Please consider sharing the widgets you created on this site for others to use.

 Actions

Custom map

From MediaWiki Widgets

Custom map widget
Description:Allows you to create a custom slippy map from a single image file using the OpenLayers API.
Author:Acnetj
Provider:Transitunlimited.org
Code:Widget:Custom map
Status:active
Security:unknown
Inv-Icon tools.svg.png

To copy this widget to your wiki, cut and paste the entire source of the Custom map widget code page into a page called Widget:Custom 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 allows you to create a custom slippy map from a single image file to your wiki page. It uses the OpenLayers API to create the map.

To insert this widget, use the following code:

{{#widget:Custom map
|zoomlevels=
|layername=
|file=
|filewidth=
|fileheight=
|ifile=
|ifilewidth=
|ifileheight=
|width=
|height=
}}

Parameters

  • zoomlevels - Available zoom levels for the custom map
  • layername - Name for the layer
  • file - path to the image file (needs to be a relative or absolute file path)
  • filewidth - Width of the file (does not need to be exact width of the image. If you change them, you will either enlarge or reduce the image for the default)
  • fileheight - Height of the file (does not need to be exact height of the image. If you change them, you will either enlarge or reduce the image for the default)
  • ifile - optional path to the image file for iPhone/iPod Touch/iPad users (needs to be a relative or absolute file path)
  • ifilewidth - Width of the file
  • ifileheight - Height of the file
  • width - Width of the map window
  • height - Height of the map window

Because Apple mobile products may not be able to display large PNG and GIF based images (OK for smaller images), the ifile parameters allow you to specify an alternate file (like in JPEG format, in which the image quality won't be as good) for Apple devices. If no ifile parameters are specified, the Apple devices will display the main file if they can display them.

Sample result

Comments

blog comments powered by Disqus