Actions

Widget

Difference between revisions of "Markers"

From Dragon Eye Atlas

Line 2: Line 2:
== Enable Clickable Markers ==
== Enable Clickable Markers ==
=== Parameters ===
=== Parameters ===
* layer - which layer to activate markers for
* layer - which layer to activate markers for. That layer must have "name" and "type" properties
* title - which data field to use for pop-up title
* description - which data field to use for pop-up text


</noinclude>
</noinclude>
Line 26: Line 24:
       var popup = new mapboxgl.Popup({ offset: [0, -15] })
       var popup = new mapboxgl.Popup({ offset: [0, -15] })
         .setLngLat(feature.geometry.coordinates)
         .setLngLat(feature.geometry.coordinates)
         .setHTML(feature.properties.description)
         .setHTML([[feature.properties.name]])
         .addTo(map);
         .addTo(map);
   });
   });

Revision as of 00:56, 6 October 2019

Enable Clickable Markers

Parameters

  • layer - which layer to activate markers for. That layer must have "name" and "type" properties