Skip to content

Supported modules ​

The Fieldtype supports the following modules and extension

Content Elements is no longer supported from v5.0.0 (the add-on is no longer available).

Fluid ​

(available from v5.0.0)

Add the Maps field to the field types of the Fluid field. In the template the field is {content} inside its Fluid tag pair, the field tags become {content:...}. Use a prefix on the tag pairs, the popup variable {content} of a marker has the same name as the Fluid {content}.

{exp:reinos_maps:html_header}

{exp:channel:entries entry_id="1" dynamic="no"}
	{your_fluid_field}
		{your_fluid_field:your_maps_field}
			{content width="100%"}

			{content:markers prefix="marker"}
				{marker:lat}, {marker:lng} {marker:tooltip}
			{/content:markers}
		{/your_fluid_field:your_maps_field}
	{/your_fluid_field}
{/exp:channel:entries}

{exp:reinos_maps:html_footer}

Webservice ​

The Maps fieldtype supports all methods of the Entry API.

To import a new data map via the Entry API, use the following data structure. It uses the same keys as the fieldtype itself, see How it works.

array('maps_field' => array(
    'markers' => array(
        array(
            'lat' => '52.3909176',  // required
            'lng' => '6.049638',    // required
            'tooltip' => 'test',    // the tooltip of the marker (`title` works too)
            'icon' => null,         // null for the default icon, or the URL of an icon
            'content' => '<p>Popup</p>' // the popup (plain HTML, or base64: followed by the base64 encoded HTML)
        )
    ),
    'polylines' => array(),
    'polygons' => array(),
    'circles' => array(),
    'rectangles' => array(),
    'map' => array(
        'tiles' => array('openstreetmap'),
        'zoom' => 10,
        'center' => array(52.3909176, 6.049638)
    )
));

Every marker needs a numeric lat and lng. All other keys are optional: missing layer lists are added as empty lists, and without map.center the map is centered on the first marker. Tooltips and popups are cleaned with the XSS filter, like in the CP.