• Bonjour,
    First of all thank you for this plugin.
    I have issues adding dynamically some markers to my map.

    First try : Using mapfeaturesids. I uploaded some tiles to mapbox and put the id in this attribut.

    [mapboxadv_map mapid="1"]

    This didn’t work, my markers wouldn’t be displayed on the map.

    2nd try : Using mapfeaturescode. I didn’t understand your sentence

    A GeoJSON object, from your own Javascript code.

    I just put my Javascript between <script> just before the shortcode.

    <script type="text/javascript">
    
    var test = [
      {
        "type": "Feature",
        "geometry": {
          "type": "Point",
          "coordinates": [2.35,48.85]
        },
        "properties": {
          "icon": {
             // icon properties ...
          }
        }
      }
    ];
    </script>
    [mapboxadv_map mapid="1" mapfeaturescode="test"]

    This didn’t work either.

    3e try : Same as 2nd but putting the whole JSON Object in the attribute entirely.

    [mapboxadv_map mapid="1" mapfeaturescode="{\"type\": \"FeatureCollection\",\"features\": [{\"type\": \"Feature\",\"geometry\": {\"type\":\"Point\",\"coordinates\":[2.35,48.85] }, \"properties\":{}}]}"]

    Here the ] closes the shortcode at the wrong end.

    Sorry for this long post, and thank for your help.

The topic ‘Information needed to dynamically add markers’ is closed to new replies.