Actions

Custom zxy map

From MediaWiki Widgets

Custom zxy map widget
Description:Create slippy Leaflet.js maps using any zxy tile source.
Author:User:Oznogon
Provider:Leaflet
Code:Widget:Custom zxy map
Status:broken
Updated:August 26, 2017
If you use code on your wiki which is older than this date you may want to update since your widget may be insecure or broken.
Security:unknown
Inv-Icon tools.svg.png

To copy this widget to your wiki, cut and paste the entire source of the Custom zxy map widget code page into a page called Widget:Custom zxy map on your wiki.

If you don't have the Widget extension set up on your wiki, go to its description page on MediaWiki.org and follow the installation instructions.


This widget creates a small Leaflet.js slippy map using a custom zxy source. By default, it uses the Wikimedia maps source.

Example

{{#Widget:Custom zxy map
| tiles = https://maps.wikimedia.org/osm-intl
| lat = -10.1502
| long = 0
| zoom = 4
| attribution = <a href="https://www.mediawiki.org/wiki/Maps">Wikimedia</a>
| width = 300px
| height = 300px
| mapid = uniqueMap
}}

Parameters

mapid (optional; default mapid)
A unique identifier for the map. Required if you use the widget more than once on a page.
width (optional; default 250px)
A CSS width for the map's container div.
height (optional; default 200px)
A CSS height for the map's container div.
lat
The decimal latitude for the map's center, with positions north of the equator as negative values.
long
The decimal longitude for the map's center, with positions west of the meridian as negative values.
zoom (optional; default 6)
The map's starting zoom level, as an integer.
tiles (optional; default https://maps.wikimedia.org/osm-intl)
The tile server's base URL, with no trailing slash.
attribution
HTML string to provide attribution for the map's sources.

Comments

blog comments powered by Disqus