Skip to content

Maps Fieldtype Tag ​

To show your created map, you can put your custom field tag inside a {exp:channel:entries} loop. This will show your map that you created from within the CP.

{your_custom_field}

To modify the map (like the map style or anything else) you can use the power of the Maps module. Simply extend your tag with some params from the {exp:reinos_maps:map} method

{your_custom_field width="100%"}

Please make sure you add the {exp:reinos_maps:html_header} and {exp:reinos_maps:html_footer} to your template to include the necessary files

In the examples below your_custom_field is the short name of your Maps field.

Tag params ​

The following tags from the Maps module are supported

  • tiles
  • tile_control_position
  • google_maps:style
  • center:address
  • center:latlng
  • zoom
  • zoom:max
  • marker_cluster:enabled
  • marker_cluster:show_coverage_on_hover
  • marker_cluster:zoom_to_bounds_on_click
  • marker_cluster:spiderfy_on_max_zoom
  • marker_cluster:remove_outside_visible_bounds
  • div_class
  • width
  • height
  • overlay:html
  • overlay:position
  • focus_current_location
  • scroll_wheel
  • zoom_control
  • zoom_control_position
  • scale_control

[marker|circle|rectangle|polygon|polyline]:popup:offset ​

Set the offset per feature for the popup

{your_field marker:popup:offset="-10,-100"}
{your_field circle:popup:offset="-10,-100"}
{your_field rectangle:popup:offset="-10,-100"}
{your_field polygon:popup:offset="-10,-100"}
{your_field polyline:popup:offset="-10,-100"}

Params you don't set are filled in automatically with the values you set for the map in the entry: the tiles, the zoom level, the center and an enabled scroll wheel, zoom control and scale control. The max zoom level, the control positions and the overlay from the entry are not used; set them with the params above.

Tag pair ​

You can also use the field as a tag pair. Everything between the tags is placed inside the {exp:reinos_maps:map} tag, so you can add your own markers or other features from the Maps module to the map of the entry.

{your_custom_field width="100%"}
    {maps:add_marker address="Amsterdam"}
{/your_custom_field}

Has check ​

Check if the map has markers, routes, circles, rectangles, polygons or polylines with the type param. The tag returns 1 when the map has at least one of them, and nothing when it hasn't. routes checks the markers.

{your_custom_field:has type="markers"}

Markers latlngs ​

Returns the latitude, longitude of all markers, separated by a pipeline | (e.g. 52.37,4.89|52.09,5.12).

{your_custom_field:markers_latlngs}

Prefix ​

All tag pairs below accept a prefix param (Available from v3.6.0). With prefix="marker" the variables become {marker:lat}, {marker:lng} etc. Without the param the variables have no prefix, except for the Map Fieldtype tag.

Markers Fieldtype tag ​

Read markers data from the fieldtype and show it in your template. You can use the following tags to show the markers data:

Example ​

{your_custom_field:markers prefix=""}
	{lat}
	{lng}
	{tooltip}
	{icon}
	{content}
	{count}
	{abs_count}
	{total_results}
{/your_custom_field:markers}

{!-- With prefix --}
{your_custom_field:markers prefix="marker"}
	{marker:lat}
	{marker:lng}
	{marker:tooltip}
	{marker:icon}
	{marker:content}
	{marker:count}
	{marker:abs_count}
	{marker:total_results}
{/your_custom_field:markers}

Polyline Fieldtype tag ​

Read Polyline data from the fieldtype and show it in your template. You can use the following tags to show the polyline data:

Example ​

{your_custom_field:polylines prefix=""}
	{stroke_color}
	{stroke_opacity}
	{stroke_weight}
	{tooltip}
	{path}
		{lat}, {lng}
	{/path}
{/your_custom_field:polylines}

Polygon Fieldtype tag ​

Read Polygon data from the fieldtype and show it in your template. You can use the following tags to show the polygon data:

Example ​

{your_custom_field:polygons prefix=""}
	{stroke_color}
	{stroke_opacity}
	{stroke_weight}
	{fill_color}
	{fill_opacity}
	{tooltip}
	{path}
		{lat}, {lng}
	{/path}
{/your_custom_field:polygons}

Circles Fieldtype tag ​

Read Circle data from the fieldtype and show it in your template. You can use the following tags to show the circle data:

Example ​

{your_custom_field:circles prefix=""}
	{stroke_color}
	{stroke_opacity}
	{stroke_weight}
	{fill_color}
	{fill_opacity}
	{tooltip}
	{lat}
	{lng}
	{radius}
{/your_custom_field:circles}

Rectangle Fieldtype tag ​

Read Rectangle data from the fieldtype and show it in your template. You can use the following tags to show the rectangle data. The {latlngs} pair returns the two corners (north-east and south-west) of the rectangle.

Example ​

{your_custom_field:rectangles prefix=""}
	{stroke_color}
	{stroke_opacity}
	{stroke_weight}
	{fill_color}
	{fill_opacity}
	{tooltip}
	{latlngs}
		{lat}, {lng}
	{/latlngs}
{/your_custom_field:rectangles}

Routes Fieldtype tag ​

Read Route data from the fieldtype and show it in your template. The route is based on the markers: the first marker is the from, the last marker is the to and the markers in between are the stops.

Example ​

{your_custom_field:routes prefix=""}
	{from}
		{from:lat}
		{from:lng}
		{from:title}
		{from:icon}
		{from:content}
	{/from}

	{stops}
		{stops:lat}
		{stops:lng}
		{stops:title}
		{stops:icon}
		{stops:content}
	{/stops}

	{to}
		{to:lat}
		{to:lng}
		{to:title}
		{to:icon}
		{to:content}
	{/to}
{/your_custom_field:routes}

Map Fieldtype tag ​

Read Map data from the fieldtype and show it in your template. You can use the following tags to show the map data.

Without a prefix param the variables of this tag are prefixed with marker: (e.g. {marker:zoom}), so add prefix="" to use them without a prefix.

Example ​

{your_custom_field:map prefix=""}
	{tiles}
	{zoom}
	{max_zoom}
	{scroll_wheel}
	{zoom_control}
	{zoom_control_position}
	{scale_control}
	{scale_control_position}
	{overlay_html}
	{overlay_position}
	{center}
{/your_custom_field:map}

{tiles} and {center} (latitude and longitude) are separated by a pipeline |.