Skip to content

Supported modules ​

The Fieldtype supports the following modules and extension

The field can't be used inside a Fluid field.

Content Elements ​

{exp:reinos_maps:html_header}

{exp:channel:entries entry_id="1" dynamic="no"}
	{ce_field}
		{maps_fieldtype}
		   	{value}
		{/maps_fieldtype}
	{/ce_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, you have to use the following data structure. The data is saved as is (base64 encoded JSON), so use the same keys as the fieldtype itself, see How it works.

array('maps_field' => array(
    'markers' => array(
        array(
            'lat' => '52.3909176',
            'lng' => '6.049638',
            'title' => 'test',      // required by the validation (may be null), not shown
            'tooltip' => 'test',    // the tooltip of the marker
            'icon' => null,         // required (may be null), or the URL of an icon
            'content' => 'base64:'.base64_encode('<p>Popup</p>') // the popup, or '' for none
        )
    ),
    'polylines' => array(),
    'polygons' => array(),
    'circles' => array(),
    'rectangles' => array(),
    'map' => array(
        'map_type' => 'roadmap',    // required by the validation, not used
        'tiles' => array('openstreetmap'),
        'zoom' => 10,
        'center' => array(52.3909176, 6.049638)
    )
));

The validation requires at least one marker (each with a lat/lng and the title and icon keys), the polylines and polygons keys and a map with a map_type. Also add circles, rectangles and map.center: without them the map gives a Javascript error when the entry is opened in the CP.