Actions

Widget

Difference between revisions of "Map"

From Dragon Eye Atlas

Line 7: Line 7:
* bounds - optional bounds array, replaces lon,lat,zoom
* 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
* show, filter = show must be one of "realm", "culture", "religion" or "province" and filter must be the (short) name of the entity to highlight
* info - set to true to show the information overlay/popup
* info - set to "hover" or "click" to show the information overlay/popup


=== Examples ===
=== Examples ===
Line 57: Line 57:


   var biome = "";
   var biome = "";
   map.on('click', 'biomes', function(e) {
   map.on('<!--{$info|escape:'html'}-->', 'biomes', function(e) {
       if (e.features.length > 0) {
       if (e.features.length > 0) {
         biome = e.features[0].properties.biome;
         biome = e.features[0].properties.biome;
Line 63: Line 63:
   });
   });


   map.on('click', 'overlay', function(e) {
   map.on('<!--{$info|escape:'html'}-->', 'overlay', function(e) {
       var Realm = "(none)";
       var Realm = "(none)";
       var Province = "(none)";
       var Province = "(none)";

Revision as of 08:37, 12 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
  • info - set to "hover" or "click" to show the information overlay/popup

Examples

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