Actions

Widget

Difference between revisions of "Map"

From Dragon Eye Atlas

Line 8: Line 8:
* 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
* overlay - activate color overlay, most be one of "realm", "culture, "religion" or "province"
* overlay - activate color overlay, most be one of "realm", "culture, "religion", "province" or "zone"
* info - set to show the information overlay/popup on click
* info - set to show the information overlay/popup on click


Line 49: Line 49:
   <!--{if $show eq "zone"}-->
   <!--{if $show eq "zone"}-->
       map.setFilter('overlay', ["all", ["==", "class", "<!--{$show|escape:'html'}-->"], ["==", "name", "<!--{$filter|escape:'html'}-->"]]);
       map.setFilter('overlay', ["all", ["==", "class", "<!--{$show|escape:'html'}-->"], ["==", "name", "<!--{$filter|escape:'html'}-->"]]);
      map.setPaintProperty('overlay', 'fill-opacity', 0.2);
   <!--{else}-->
   <!--{else}-->
       map.setFilter('overlay', ["all", ["==", "class", "<!--{$show|escape:'html'}-->"], ["!=", "name", "<!--{$filter|escape:'html'}-->"]]);
       map.setFilter('overlay', ["all", ["==", "class", "<!--{$show|escape:'html'}-->"], ["!=", "name", "<!--{$filter|escape:'html'}-->"]]);

Revision as of 12:00, 23 January 2020

Map Widget

New and unified 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
  • overlay - activate color overlay, most be one of "realm", "culture, "religion", "province" or "zone"
  • info - set to show the information overlay/popup on click

Examples

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