properties - mapbox layer fill-color based on TEXT property -
is possible set fill-color stops, based on text property rather numeric value
e.g fill based on province name
my input dataset has property/column called prov_id , contains 2 letter id each state/province
so aiming toward in lines of: 'stops': [['gp', 'yellow']]
the code not render fill-colors when when implemented shown below, have replaced prov_id in code below primary key property [numeric] test, , works fine
i guess question if fill-color stops limited numeric properties only?
map.addlayer({ 'id': 'countieslayer', 'type': 'fill', /*define type of layer fill, line, point, fill-extrusion, background, raster, circle*/ 'source': 'mysrcname', 'source-layer': '3_fields-83vr21', 'layout': { 'visibility': 'visible' }, /*there many options styling - simple style*/ 'paint': { 'fill-color': { 'property': 'prov_id', 'stops': [['gp', 'yellow']] }, 'fill-outline-color': 'white' } });
Comments
Post a Comment