Extension:Maps/Customizing maps

From semantic-mediawiki.org
< Extension "Maps"
Extension "Maps"Extension:Maps/Customizing maps
Maps extension
Overview
Installation and Configuration
Usage
Displaying maps
Customizing maps
Displaying GeoJSON
Geocoding
Converting coordinates
SMW integration
Storing coordinates
Aggregating onto a map
On this page


Maps shown with the #display_map parser function can be customized using various parameters. For instance you can change the height of the map using the height parameter. Example:

{{#display_map:Berlin|height=200px}}
Loading map...

There are "common parameters" that are available always, and there are parameters that are only available for specific mapping services. For instance the fusiontables parameter is only supported when using Google Maps.

Common parameters[edit]

  • All data display parameters
  • service: The mapping service to use. Can be leaflet, googlemaps or openlayers. Defaults to leaflet, which can be changed in your wikis configuration.
  • width: Width of the map in pixels or another supported unit. Supported units are px, ex, em and %. Also allows "auto". Default is "auto", which can be changed in your wikis configuration.
  • height: Height of the map in pixels or another supported unit. Supported units are px, ex, em and %. Default is "350", which can be changed in your wikis configuration.
  • center: On which location the map should center. This can be a coordinate or human readable location. Defaults to the locations you provided, if any.
  • title: Default title to show in popups
  • label: Default label to show in popups
  • icon: Default icon to use for markers
  • maxzoom: Whole number indicating what the maximum zoom level is
  • minzoom: Whole number indicating what the minimum zoom level is.
  • copycoords: If the coordinates of markers should be copyable. Can be yes and no (default).
  • static: If the map should be a static image instead of dynamic and interactive. Can be yes and no (default).

Leaflet specific parameters[edit]

Parameter Type Default Description
zoom whole number no The zoom level for the map. For maps with markers this will default to the most zoomed in level that still shows all markers.
defzoom whole number 14 Allows setting the default zoom level of the map.
layers list of texts OpenStreetMap The layers that will be available in the layer selector. The first layer will be shown when the map loads.
overlaylayers list of texts empty The overlay layers that will be shown when the map loads.
resizable yes/no no Makes the map resizable by dragging at its lower right corner.
enablefullscreen yes/no no Enable fullscreen button
scrollwheelzoom yes/no yes Indicates if mouse scrolling should be enabled or not.
markercluster yes/no no Allows merging of multiple nearby markers into one marker
clustermaxzoom whole number 20 The maximum zoom level where clusters may exist.
clusterzoomonclick yes/no yes Whether the default behaviour of clicking on a cluster is to zoom into it.
clustermaxradius whole number 80 The maximum radius that a cluster will cover.
clusterspiderfy yes/no yes When you click a cluster at the bottom zoom level we spiderfy it so you can see all of its markers.
geojson ⧼validator-type-jsonfile⧽ empty URL of a GeoJSON file

Google Maps specific parameters[edit]

Parameter Type Default Description
zoom whole number 14 The zoom level for the map. For maps with markers this will default to the most zoomed in level that still shows all markers.
type text roadmap The map type to initially show.
types list of texts roadmap, satellite, hybrid, terrain The map types that will be available via the type control.
layers list of texts empty Special layers to load onto the map.
controls list of texts pan, zoom, type, scale, streetview The controls to place on the map.
zoomstyle text default The style of the zoom control.
typestyle text default The style of the type control.
autoinfowindows yes/no no Automatically open all info windows after the page has loaded.
resizable yes/no no Makes the map resizable by dragging at its lower right corner.
kmlrezoom yes/no no Rezoom the map after the KML layers have been loaded.
poi yes/no yes Show points of interest.
markercluster yes/no no Allows merging of multiple nearby markers into one marker
clustergridsize whole number 60 The grid size of a cluster in pixels.
clustermaxzoom whole number 20 The maximum zoom level where clusters may exist.
clusterzoomonclick yes/no yes Whether the default behaviour of clicking on a cluster is to zoom into it.
clusteraveragecenter yes/no yes Whether the center of each cluster should be the average of all markers in the cluster.
clusterminsize whole number 2 The minimum number of markers to be in a cluster before the markers are hidden and a count is shown.
tilt whole number 0 Tilt for the Map when using Google Maps.
imageoverlays List of image overlays empty Allows adding an image to be shown on the specified location on the map.
kml list of texts empty KML files to load onto the map.
gkml list of texts empty KML files hosted by Google to load onto the map.
fusiontables list of texts empty IDs of Google Fusion Tables which should be loaded onto the map.
searchmarkers text empty Allows to search for specific markers via a field embedded into the map.
enablefullscreen yes/no no Enable fullscreen button
scrollwheelzoom yes/no no Indicates if mouse scrolling should be enabled or not.

OpenLayers specific parameters[edit]

Parameter Type Default Description
zoom whole number 13 The zoom level for the map. For maps with markers this will default to the most zoomed in level that still shows all markers.
controls list of texts layerswitcher, mouseposition, autopanzoom, scaleline, navigation The controls to place on the map.
layers list of texts osm-mapnik, osm-cyclemap The layers that will be available in the layer selector. The first layer will be shown when the map loads.
resizable yes/no no Makes the map resizable by dragging at its lower right corner.
overlays text empty Overlay layers that will be available in the layer selector. These layers will be displayed on top of a normal layer, kind of like a marker.
searchmarkers text empty Allows to search for specific markers via a field embedded into the map.
kml list of texts empty KML files to load onto the map.