Actions

Widget

Difference between revisions of "Map"

From Dragon Eye Atlas

Line 63: Line 63:
   });
   });


   var info = "<table>";
   var biome = "";
   map.on('mousemove', 'biomes', function(e) {
   map.on('mousemove', 'biomes', function(e) {
       if (e.features.length > 0) {
       if (e.features.length > 0) {
         $("#mapinfo-biome").html(e.features[0].properties.biome);
         $("#mapinfo-biome").html(e.features[0].properties.biome);
         info = info + "<tr><td>Biome:</td><td>"+e.features[0].properties.biome+"</td></tr>";
         biome = e.features[0].properties.biome;
       }
       }
   });
   });
Line 77: Line 77:


   map.on('mousemove', 'overlay', function(e) {
   map.on('mousemove', 'overlay', function(e) {
      var info = "<table><tr><td>Biome:</td><td>"+biome+"</td></tr>";
       e.features.forEach(function(feature) {
       e.features.forEach(function(feature) {
         switch (feature.properties.class) {
         switch (feature.properties.class) {

Revision as of 17:18, 11 October 2019

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: 50%, 400px)
  • bounds - optional bounds array, replaces lon,lat,zoom
  • show, filter = show must be one of "realm", "culture", "religion" or "province" and filter must be the (short) name of the entity to highlight

Examples

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