Skip to content

Latest commit

 

History

History
41 lines (31 loc) · 976 Bytes

README.md

File metadata and controls

41 lines (31 loc) · 976 Bytes

THIS IS A FORKED BRANCH FROM THE ORIGINAL MAPBOX

This branch will have everything what the mapbox has but extended to show some shapes within the markers like in the image below:

image

USAGE

Just add the shape and shapeColor properties for each of your marker and you are ready to rock.

For example:

{
  type: 'Feature',
  properties: {
    shape: 'triangle', 
    shapeColor: '#fff',
    color: '#ddd' // Color of the circle
  },
  geometry: {
    type: 'Point',
    coordinates: []
}

Available shapes are: circle, diamond, triangle, square, star, invTriangle

Also important that the color of the circle is read from the properties like this (otherwise the shapes will not work):

map.addLayer({
  id: "layerId",
  type: "circle",
  source: "layerSource",
  paint: {
      'circle-color': ['get', 'color']
  },
});