0

In Mapbox studio classic, you just click where you want a new "marker" and it creates one. I want to do the same thing in the new mapbox studio but that feature doesn't seem to exist. Please note, I do not have a dataset to upload, I need to create a dataset through Mapbox Studio.

If anybody has any insight for me that would be super!

Shan Robertson
  • 2,742
  • 3
  • 25
  • 43

1 Answers1

0

You can add your data to Mapbox Studio along with this custom svg marker. I styled it similar to the old Leaflet L.marker: https://github.com/Ccantey/icons/blob/master/svgs/placeMarker-Blue-Shadow.svg

Then in the layout properties you can set "marker-symbol"/"icon-image" to "myMarker-Blue-Shadow":

map.addSource("pointclick", {
    "type": "geojson",
    "data": {
        "type": "Feature",
        "geometry": {
            "type": "Point",
            "coordinates": [e.lngLat.lng, e.lngLat.lat]
        },
        "properties": {
            "title": "mouseclick",
            "marker-symbol": "myMarker-Blue-Shadow"
        }
    }
});

map.addLayer({
    "id": "pointclick",
    type: 'symbol',
    source: 'pointclick',
    "layout": {
        "icon-image": "{marker-symbol}",
        "icon-size":1,
        "icon-offset": [0, -13]
    },
    "paint": {}
});
CCantey
  • 306
  • 1
  • 14