Actions

Widget

Map: Difference between revisions

From Dragon Eye Atlas

No edit summary
No edit summary
Line 24: Line 24:
<div id='map' style='width: <!--{$width|escape:'html'|default:'50%'}-->; height: <!--{$height|escape:'html'|default:'400px'}-->; float:right; margin: 0.5em 0 1em 0.5em; border: 1px solid black'></div>
<div id='map' style='width: <!--{$width|escape:'html'|default:'50%'}-->; height: <!--{$height|escape:'html'|default:'400px'}-->; float:right; margin: 0.5em 0 1em 0.5em; border: 1px solid black'></div>
<table style="width: <!--{$width|escape:'html'|default:'50%'}-->; float:right; text-overflow:ellipsis; vertical-align:top;"><tr>
<table style="width: <!--{$width|escape:'html'|default:'50%'}-->; float:right; text-overflow:ellipsis; vertical-align:top;"><tr>
<td style="width: 20%">Biome:<br/><span id="mapinfo-biome"></span></td>
<td style="width: 28%">Biome:<br/><span id="mapinfo-biome"></span></td>
<td style="width: 20%">Realm:<br/><span id="mapinfo-realm"></span></td>
<td style="width: 18%">Realm:<br/><span id="mapinfo-realm"></span></td>
<td style="width: 20%">Province:<br/><span id="mapinfo-province"></span></td>
<td style="width: 18%">Province:<br/><span id="mapinfo-province"></span></td>
<td style="width: 20%">Culture:<br/><span id="mapinfo-culture"></span></td>
<td style="width: 18%">Culture:<br/><span id="mapinfo-culture"></span></td>
<td style="width: 20%">Religion:<br/><span id="mapinfo-religion"></span></td>
<td style="width: 18%">Religion:<br/><span id="mapinfo-religion"></span></td>
</tr></table>
</tr></table>
<script>
<script>
Line 44: Line 44:
<!--{/if}-->
<!--{/if}-->
var map = new mapboxgl.Map(options);
var map = new mapboxgl.Map(options);
map.addControl(new mapboxgl.FullscreenControl());
map.addControl(new mapboxgl.NavigationControl());
map.addControl(new mapboxgl.NavigationControl());
map.addControl(new mapboxgl.ScaleControl());
map.addControl(new mapboxgl.ScaleControl());

Revision as of 16:55, 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}}