Actions

Widget

Infomap: Difference between revisions

From Dragon Eye Atlas

No edit summary
No edit summary
Line 49: Line 49:
   
   
   var coordinates = e.features[0].geometry.coordinates.slice();
   var coordinates = e.features[0].geometry.coordinates.slice();
   var description = e.features[0].properties.description;
console.log(coordinates);
   var description = e.features[0].properties.biome;
   
   
   // Ensure that if the map is zoomed out such that multiple
   // Ensure that if the map is zoomed out such that multiple
Line 61: Line 62:
   // based on the feature found.
   // based on the feature found.
   popup.setLngLat(coordinates)
   popup.setLngLat(coordinates)
       .setHTML(biome)
       .setHTML(description)
       .addTo(map);
       .addTo(map);
});
});

Revision as of 17:05, 22 September 2019

Mapbox-GL-JS Information Map Widget

Parameters

  • lon, lat, zoom - longitude, latitude and zoom for the map (defaults: 1, 30, 4)
  • width, height - dimensions of the map itself on the page, in px or % (defaults: 100%, 600px)

Examples

  • {{#widget:Mapbox|bounds=[[0, 25], [8, 31]]}}
  • {{#Widget:Mapbox|lat=31|lon=-15.5|zoom=3}}