Mapzen basemap styles include custom icons to display points of interest on a map, ranging from airports to zoos. These can be used interchangeably between the different basemaps or in a custom Tangram map of your own.
The library has expanded to a several hundred icons. Most, but not all icons, are available in 4 or more styles.
There are no rights restrictions on the icons. The examples below are for Tangram but you are free to use the icons in your favorite mapping library or application. The original Illustrator vector artwork is also available.
Icons can be added to a Tangram map using the sprites property of the mapzen_icon_library
draw style.
Import the Refill basemap style (which includes the Mapzen icon library) and draw user-provided points on the map using the library's zoo icon.
import:
- https://mapzen.com/carto/refill-style/9/refill-style.zip
sources:
my-source:
type: GeoJSON
url: https://example.com/filename.geojson
layers:
my-layer:
data:
source: my-source
draw:
mapzen_icon_library:
sprite: zoo
Data-driven styling is supported when your data includes a kind
property with values matched to the icon names in the table. Data is evaluated on a per-feature basis so you'll end up with a variety of icons shown on the map.
import:
- https://mapzen.com/carto/refill-style/9/refill-style.zip
sources:
my-source:
type: GeoJSON
url: https://example.com/filename.geojson
layers:
my-layer:
data:
source: my-source
draw:
mapzen_icon_library: {}
Sprites can be defined with a Javascript function that allows remapping property values to the named icons in the library.
import:
- https://mapzen.com/carto/refill-style/9/refill-style.zip
sources:
my-source:
type: GeoJSON
url: https://example.com/filename.geojson
layers:
my-layer:
data:
source: my-source
draw:
mapzen_icon_library:
sprite: |
function() {
var class = feature.class;
var kind = class == 'my_airport' ? 'airport' :
class == 'my_hospital' ? 'hospital' :
class == 'my_zoo' ? 'zoo' :
'generic';
return kind;
}
You can use the icons in the Mapzen icon library independent of Mapzen basemap styles by importing just the icon bundle into a Tangram scene.
https://mapzen.com/carto/bubble-wrap-style/8/themes/bubble-wrap-icons.zip
https://mapzen.com/carto/cinnabar-style/8/themes/cinnabar-icons.zip
https://mapzen.com/carto/refill-style/9/themes/refill-icons.zip
https://mapzen.com/carto/tron-style/5/themes/tron-icons.zip
https://mapzen.com/carto/walkabout-style/6/themes/walkabout-icons.zip
https://mapzen.com/carto/sdk-default-style/1/themes/sdk-default-icons.zip
For example:
import:
- https://mapzen.com/carto/refill-style/9/themes/refill-icons.zip
sources:
my-source:
type: GeoJSON
url: https://example.com/filename.geojson
layers:
my-layer:
data:
source: my-source
draw:
mapzen_icon_library:
sprite: zoo
The Mapzen Icon Library is available for use in your favorite mapping or graphics software as individual sprite images.
Currently only only png
format at 2x
resolution is supported.
https://mapzen.com/carto/bubble-wrap-style/8/icons/{resolution}/{sprite}.{format}
https://mapzen.com/carto/cinnabar-style/8/icons/{resolution}/{sprite}.{format}
https://mapzen.com/carto/refill-style/9/icons/{resolution}/{sprite}.{format}
https://mapzen.com/carto/tron-style/5/icons/{resolution}/{sprite}.{format}
https://mapzen.com/carto/walkabout-style/6/icons/{resolution}/{sprite}.{format}
https://mapzen.com/carto/sdk-default-style/1/icons/{resolution}/{sprite}.{format}
For example:
Load the adit
sprite in the Bubble Wrap style at 2x
in png
format:
https://mapzen.com/carto/bubble-wrap-style/8/icons/2x/adit.png
You can customize the icon colors by changing the global color of colorized-icons in styles. Assign the color in the global u_tint. If you would like to color the badge fill area, assign the color in the draw layer. See below:
import:
- https://mapzen.com/carto/refill-style/9/themes/refill-icons.zip
sources:
my-source:
type: GeoJSON
url: https://example.com/filename.geojson
styles:
colorized-icons:
shaders:
uniforms:
# color the icon here
u_tint: [0.925,0.090,0.094]
layers:
my-layer:
data:
source: my-source
draw:
mapzen_icon_library:
# color the badge fill area here
color: [0.724,1.000,0.893]
sprite: zoo
You could even use the Bubble Wrap icons on Refill!
import:
- https://mapzen.com/carto/refill-style/9/refill-style.zip
- https://mapzen.com/carto/bubble-wrap-style/8/themes/bubble-wrap-icons.zip
Sprite names generally match the kind
values from the Mapzen vector tiles points of interest (pois) layer.
Some exceptions:
- Populated places that are displayed as point features (capitals, cities, and towns for instance) use the
capital
ortownspot
icons, respectively. - Icons for sports pitches and religious places of worship are based on
kind_detail
. - Road shields are generally sourced from the
network
values in the roads layer - User experience assets are prefixed with
ux-
.
The following Mapzen basemap styles support the mapzen_icon_library
style defaults and named icon assets:
- Bubble Wrap:
8.0.0
and later - Cinnabar:
8.0.0
and later - Refill:
9.0.0
and later - Tron:
5.0.0
and later - Walkabout:
6.0.0
and later
Earlier versions of Mapzen basemap styles did not support all icons in the table above or the style defaults.