Skip to content

Map ​

The main tag of Maps: it renders the map. Add markers, shapes and more with the {maps:add_*} tags inside it.

A map with a marker

The tag ​

{exp:reinos_maps:map}

Tag parameters ​

Below are the Tag Parameters. Those parameters can be used in the tag described above.

Every parameter can also be written as a tag pair inside the map tag, e.g. {overlay:html}<b>Our store</b>{/overlay:html}. That is handy for a value with quotes or more lines; double quotes in it become single quotes.

tiles ​

Use a tile that is enabled in the CP. Use more than one, separated with a pipe |, to enable the tile selector as seen in the screenshots below. See Providers and Tiles for all tile names.

Tile selector closed

Tile selector open

Default is openstreetmap. A tile that is not enabled is left out and logged; when no tile is left, the map uses openstreetmap (when that tile is enabled, otherwise no map is shown).

tiles="openstreetmap"
tiles="openstreetmap|google_maps_roadmap|google_maps_hybrid"

tile_control_position ​

The position of the tile selector (one of the map corners). Possible values are topleft, topright (default), bottomleft or bottomright

tile_control_position="topright"

dragging:disable ​

(from v4.3.0)

Disable dragging on all devices. Possible values are yes or no

dragging:disable="no"

dragging:disable_mobile ​

(from v4.3.0)

Disable dragging on mobile devices. Possible values are yes or no

dragging:disable_mobile="no"

fullscreen_control ​

Enable the fullscreen control. This adds a button to map that will set the map to fullscreen upon click. Possible values are yes or no

fullscreen_control="no"

google_maps:style ​

When you use a Google Maps tile, you can also style the map. See https://developers.google.com/maps/documentation/javascript/styling

Because the style is JSON, you can also use a style from Snazzy Maps https://snazzymaps.com/

Because the JSON has quotes, it is better to use the tag pair instead of the parameter. A style that is not valid JSON (or a plain Javascript object as below) is ignored and logged.

{google_maps:style}
    [
        {elementType: 'geometry', stylers: [{color: '#242f3e'}]},
        {elementType: 'labels.text.stroke', stylers: [{color: '#242f3e'}]},
        {elementType: 'labels.text.fill', stylers: [{color: '#746855'}]},
        {
          featureType: 'administrative.locality',
          elementType: 'labels.text.fill',
          stylers: [{color: '#d59563'}]
        },
        {
          featureType: 'poi',
          elementType: 'labels.text.fill',
          stylers: [{color: '#d59563'}]
        },
        {
          featureType: 'poi.park',
          elementType: 'geometry',
          stylers: [{color: '#263c3f'}]
        },
        {
          featureType: 'poi.park',
          elementType: 'labels.text.fill',
          stylers: [{color: '#6b9a76'}]
        },
        {
          featureType: 'road',
          elementType: 'geometry',
          stylers: [{color: '#38414e'}]
        },
        {
          featureType: 'road',
          elementType: 'geometry.stroke',
          stylers: [{color: '#212a37'}]
        },
        {
          featureType: 'road',
          elementType: 'labels.text.fill',
          stylers: [{color: '#9ca5b3'}]
        },
        {
          featureType: 'road.highway',
          elementType: 'geometry',
          stylers: [{color: '#746855'}]
        },
        {
          featureType: 'road.highway',
          elementType: 'geometry.stroke',
          stylers: [{color: '#1f2835'}]
        },
        {
          featureType: 'road.highway',
          elementType: 'labels.text.fill',
          stylers: [{color: '#f3d19c'}]
        },
        {
          featureType: 'transit',
          elementType: 'geometry',
          stylers: [{color: '#2f3948'}]
        },
        {
          featureType: 'transit.station',
          elementType: 'labels.text.fill',
          stylers: [{color: '#d59563'}]
        },
        {
          featureType: 'water',
          elementType: 'geometry',
          stylers: [{color: '#17263c'}]
        },
        {
          featureType: 'water',
          elementType: 'labels.text.fill',
          stylers: [{color: '#515c6d'}]
        },
        {
          featureType: 'water',
          elementType: 'labels.text.stroke',
          stylers: [{color: '#17263c'}]
        }
      ]
{/google_maps:style} [OPTIONAL]

google_maps:streetview ​

Add Google Street View to your map.

Note: this needs a Google Maps tile.

google_maps:streetview="yes" [OPTIONAL]

center:address ​

Center the map on an address. It goes before center:latlng.

center:address=""

center:latlng ​

Center the map on a latlng, e.g. 52.0907,5.1214. Without a center (and without fit_map:*) the map shows a default location (34.5133,-94.1629).

center:latlng=""

zoom ​

the zoom level. Default 15

zoom="15" [OPTIONAL]

zoom:max ​

the max zoom level.

zoom:max="19" [OPTIONAL]

zoom:min ​

the min zoom level. Without it the min zoom of the tile is used; zoom:min="0" allows zooming out all the way (before v5.0.0 0 was ignored).

zoom:min="3" [OPTIONAL]

fit_map:markers ​

Fit the map based on the markers. When everything to fit is one point (e.g. one marker), the map is centered on it and keeps its zoom (or fit_map:force_zoom) instead of zooming in all the way (from v5.0.0).

fit_map:markers="no" [OPTIONAL]

fit_map:circles ​

Fit the map based on the circles, with their radius (before v5.0.0 only their centers)

fit_map:circles="no" [OPTIONAL]

fit_map:rectangles ​

Fit the map based on the rectangles

fit_map:rectangles="no" [OPTIONAL]

fit_map:polylines ​

Fit the map based on the polylines. Routes and GPX tracks are polylines too, so they count as well.

fit_map:polylines="no" [OPTIONAL]

fit_map:polygons ​

Fit the map based on the polygons

fit_map:polygons="no" [OPTIONAL]

fit_map:geojson ​

Fit the map based on the geojson data, every geometry type counts, also every part of a MultiPolygon and a GeometryCollection (before v5.0.0 parts could be missed and a GeometryCollection broke the GeoJSON layer)

fit_map:geojson="no" [OPTIONAL]

fit_map:routes ​

Fit the map based on the routes only. A route is a polyline on the map, so fit_map:polylines counts the routes as well (before v5.0.0 this did the same as fit_map:polylines).

fit_map:routes="no" [OPTIONAL]

fit_map:force_zoom_out ​

Zoom out on the bound level that has been set. The value must be between 1 and 10.

For example, your auto zoom is 10 and you are using fit_map:force_zoom_out="3". Your new zoom level become 7.

It goes before fit_map:force_zoom when both are set.

fit_map:force_zoom_out="1" [OPTIONAL]

fit_map:force_zoom ​

Force zoom. This will override the auto zoom level.

fit_map:force_zoom="10" [OPTIONAL]

You can combine multiple fit_map calls e.g. fit_map:circles="yes" fit_map:polygons="yes"

filter ​

(from v5.0.0) A legend on the map with the categories of the markers and shapes (the category param of add_marker, add_polyline, add_polygon, add_circle and add_rectangle): a checkbox per category with its icon or color and the number of layers, and All. A layer is shown when one of its categories is checked; a layer without a category is always shown. The legend is only shown when a layer has a category. With marker_cluster:enabled="yes" the hidden markers leave their clusters. The icon per category comes from {maps:category}.

filter="yes" [OPTIONAL]
{exp:reinos_maps:map filter="yes" filter:title="Show" fit_map:markers="yes"}
    {exp:channel:entries channel="places"}
        {maps:add_marker latlng="{location}" category="{categories backspace='1'}{category_name}|{/categories}"}
    {/exp:channel:entries}
{/exp:reinos_maps:map}

filter:position ​

The corner of the legend: topleft, topright (default), bottomleft or bottomright (from v5.0.0)

filter:position="topright" [OPTIONAL]

filter:title ​

A title above the legend, e.g. Show (from v5.0.0)

filter:title="" [OPTIONAL]

filter:all ​

The text of the checkbox that shows or hides all categories (default All) (from v5.0.0)

filter:all="All" [OPTIONAL]

A search field in the legend (needs filter="yes"): it shows the markers and shapes with the text in their title or tooltip (and in a checked category). Works without categories as well (from v5.0.0)

filter:search="yes" [OPTIONAL]

filter:search:placeholder ​

The text in the empty search field, also its label for a screen reader (default Search) (from v5.0.0)

filter:search:placeholder="Search" [OPTIONAL]

With {maps:add_entries} the EE categories of the entries are the categories of the legend: add entry_id="{entry_id}" to {maps:entry}:

{exp:reinos_maps:map filter="yes" filter:search="yes" fit_map:markers="yes"}
    {maps:add_entries}
        {exp:channel:entries channel="stores" dynamic="no"}
            {maps:entry latlng="{store_location:markers_latlngs}" title="{title:attr_safe}" entry_id="{entry_id}"}
        {/exp:channel:entries}
    {/maps:add_entries}
{/exp:reinos_maps:map}

marker_cluster:enabled ​

Enable clustering for the markers.

marker_cluster:enabled="no" [OPTIONAL]

Markers in clusters

marker_cluster:show_coverage_on_hover ​

When you mouse over a cluster it shows the bounds of its markers.

marker_cluster:show_coverage_on_hover="yes" [OPTIONAL]

marker_cluster:zoom_to_bounds_on_click ​

When you click a cluster we zoom to its bounds.

marker_cluster:zoom_to_bounds_on_click="yes" [OPTIONAL]

marker_cluster:spiderfy_on_max_zoom ​

When you click a cluster at the bottom zoom level we spiderfy it so you can see all of its markers.

marker_cluster:spiderfy_on_max_zoom="yes" [OPTIONAL]

marker_cluster:remove_outside_visible_bounds ​

Clusters and markers too far from the viewport are removed from the map for performance.

marker_cluster:remove_outside_visible_bounds="yes" [OPTIONAL]

div_class ​

An extra CLASS name for the map div. The div always has the classes reinos_map reinos_maps reinos_map_[map_id] reinos_maps_[map_id] and the ID reinos_map_[map_id]

div_class="" [OPTIONAL]

width ​

the width of the map. Default 700px

width="700px" [OPTIONAL]

height ​

the height of the map. Default 400px

height="400px" [OPTIONAL]

overlay:html ​

Show a overlay on the map Overlay

overlay:html="<p><b>Maps Overlay</b></p>This is a Google Like overlay<p><p>Just like the Iframe</p>"  [OPTIONAL]

overlay:position ​

Set the position of the overlay.
values: left (default) right

overlay:position="left" [OPTIONAL]

focus_current_location ​

Focus on the users current location. (SSL is needed)

focus_current_location="no" [OPTIONAL]

scroll_wheel ​

possible to scroll the map with the scrollwheel.

scroll_wheel="yes" [OPTIONAL]

zoom_control ​

place the zoom control on the map.

zoom_control="yes" [OPTIONAL]

zoom_control_position ​

Set the position for the control. Possible values are topleft, topright, bottomleft or bottomright

zoom_control_position="topleft" [OPTIONAL]

scale_control ​

place the scale control on the map.

scale_control="yes" [OPTIONAL]

scale_control_position ​

Set the position for the scale control. Possible values are topleft, topright, bottomleft or bottomright

scale_control_position="bottomleft" [OPTIONAL]

gesture_handling ​

Prevents users from getting trapped on the map when scrolling a long page: zoom with Ctrl/⌘ + scroll, and move the map with two fingers on a touch screen. Default no (from v5.0.0, before it was documented as yes but did nothing).

gesture_handling="yes" [OPTIONAL]

lazy ​

Create the map only when it scrolls into view (or is 200px from it), so a page with maps lower on the page loads faster and doesn't load tiles that nobody sees. Default no. (from v5.0.0)

Until the map is created, Javascript API calls for it wait and run when it is created, so a call that returns something (e.g. getMarkers) returns nothing before that.

lazy="yes" [OPTIONAL]

Show a placeholder until the visitor allows the map: no, click, ee or ee:<consent request>. The default is the Consent setting in the CP. Write your own placeholder with the {maps:consent} tag pair inside the map tag. See Consent (GDPR). (from v5.0.0)

consent="click" [OPTIONAL]
consent:remember="yes" [OPTIONAL]
consent:text="This map is loaded from [provider]. ..." [OPTIONAL]
consent:button="Load map" [OPTIONAL]

The name of the map for screen readers, the name of a cluster, the link to skip the map and a list of the markers as text alternative. See Accessibility. (from v5.0.0)

aria:label="Map of our stores" [OPTIONAL]
list="yes" [OPTIONAL]

theme ​

The theme of the map: light (default), dark or auto (dark when the visitor uses dark mode, prefers-color-scheme). (from v5.0.0)

The dark theme makes the popups, tooltips, buttons, the tile switcher, the attribution and the overlay dark. A tile of the tiles param that has a dark variant is replaced by that variant, when the variant is enabled in the CP:

TileDark variant
carto_positron, carto_voyagercarto_dark_matter
carto_positron_nolabels, carto_voyager_nolabelscarto_dark_matter_nolabels
stadia_alidade_smooth, stadia_osm_brightstadia_alidade_smooth_dark
mapbox_streets, mapbox_lightmapbox_dark
thunderforest_transportthunderforest_transport_dark
stamen_toner_litestamen_toner
pmtiles, pmtiles_lightpmtiles_dark
pmtiles_whitepmtiles_black

Google Maps tiles get a dark style, unless you set your own with google_maps:style. Tiles without a dark variant (e.g. openstreetmap) stay as they are, use e.g. tiles="carto_positron" for a map that looks good in both themes.

theme="dark" [OPTIONAL]

weather ​

Add a weather layer, e.g. rain, snow or wind. The weather layers need an API key from OpenWeatherMap in the Weather API setting in the CP.

Each layer is [layer_name]:[opacity]:[legend], where opacity defaults to 0.5 and legend (yes/no) to no. Separate multiple layers with a comma, spaces around them are fine. The layer names are case sensitive: an unknown layer is skipped with an error in the browser console, the rest of the map is still shown (before v5.0.0 a space or an unknown layer stopped the rest of the map).

Layers: clouds cloudsClassic precipitation precipitationClassic rain rainClassic snow pressure pressureContour temperature wind

weather="[[layer_name]:[opacity]:[legend]]," [OPTIONAL]
weather="rain:0.5:no" [OPTIONAL]

Tag Variables ​

Below are the Tag Variables. These variables can be used in the tag described above.

map_id ​

The number of the current map on the page (1 for the first map). The ID of the map div is reinos_map_{map_id}.

{exp:reinos_maps:map}
   {map_id}
{/exp:reinos_maps:map}