Maps Fieldtype

Introduction

The official FieldType extension for the Maps module. Simply modify your Map from within your entry.

title

Documentation versions

Installation

Prerequisites

Make sure your system meets the minimum requirements:

Installation Instructions

Update instructions

version 3.x

This version is a major update that can only be installed on top of version 2.x or higher. See https://addons.reinos.nl/news/maps-suite-3

License

For every paid addon you need to validate your license in order to activate the module.

On a local environment, like *.dev *.local *.localhost *.test the license is valid for testing and building a new or existing sites. For every other domain, you need to have a valid license.

Process of validating

Once installed, you will asked to enter your license key. When you entered a valid license you can hit the "Save license" button. This will start validating your license and will redirect you to addons.reinos.nl to login into your account. You can also register a new account in this process.

Control panel overview

Once logged in, you are asked to use your current account or to login with another one.

Control panel overview

Using the current logged in account, the server will check all info related to your license and once valid, it will redirect you back to your site where you see either a success message or an error message.

Control panel overview

License field

This module is using a license field to check if the license for the module is valid or not. On addons.reinos.nl you can check your license and add your valid domains.

Control panel overview

In the Module CP you can enter then your license Control panel overview

When you enter a wrong license, the module will not work and it shows you an warning Control panel overview

Invalid license

Sometimes it happens that the license system says you have an invalid license. When this happens, make sure you have entered your domain url in your account, next to your license on addons.reinos.nl.

If this will not fix your license problem, please contact us on https://addons.reinos.nl/support

Migration tool

See https://addons.reinos.nl/maps-migration

The Maps Field

Once Maps Fieldtype is installed, you can add a Maps field to the Publish page.

Publish page overview

When the custom field is created, you can see the Maps Fieldtype in action on the publish field

title

From here you can start adding markers (circles, polylines etc...), customize markers (circles, polylines etc...), search addresses and customize the map settings.

Editing Maps setting

To modify the settings for the Map, you can click in the bottom on the 'map settings' button.

title

Search an address

To search an address, you can click on the search icon at the bottom in the toolbar. After clicking on the icon an input field will be on top of the map where you can search an address.

The icon in the toolbar title

The input form with a result title

Reset the map

To simply reset the map to the original state, click on the reset icon in the toolbar.

title

Removing/editing markers (and others)

To remove the marker, you can right-click on a marker on another item that will show a context menu.

title

Field 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

Tag params

The following tags from the Maps module are supported

[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"}

There are some that filled in automatically because you set them in the entry self.

Tag Variable

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

marker:n:latlng

Show the latlng of one marker.

{your_custom_field:marker:n:latlng}

marker:latlng

Show all latlng positions with pipeline`s

{your_custom_field:marker:latlng}

marker:n:title

Show the title for one marker

{your_custom_field:marker:n:title}

marker:title

Show all titles with pipeline`s

{your_custom_field:marker:title}

marker:n:icon

Show one icon

{your_custom_field:marker:n:icon}

marker:icon

Show all icons with pipeline`s

{your_custom_field:marker:icon}

route:from

Show the from latlng for use in the route function

{your_custom_field:route:from}

route:stops

Show the stops latlng for use in the route function

{your_custom_field:route:stops}

route:to

Show the to latlng for use in the route function

{your_custom_field:route:to}

has:markers

Variable that check if there is any marker set

{maps_field_extension:has:markers}

markers

Loop over the Markers

{maps_field_extension:markers}...{/maps_field_extension:markers}

markers:lat

The lat of the marker

{maps_field_extension:markers}{lat}{/maps_field_extension:markers}

markers:lng

The lng of the marker

{maps_field_extension:markers}{lng}{/maps_field_extension:markers}

markers:title

The title of the marker

{maps_field_extension:markers}{title}{/maps_field_extension:markers}

markers:icon

The icon of the marker

{maps_field_extension:markers}{icon}{/maps_field_extension:markers}

markers:content

The content of the infowindow

{maps_field_extension:markers}{content}{/maps_field_extension:markers}

markers:count

Holds the current number, started from 1

{maps_field_extension:markers}{count}{/maps_field_extension:markers}

markers:abs_count

Holds the current number, started from 0

{maps_field_extension:markers}{abs_count}{/maps_field_extension:markers}

markers:total_results

Show the total numbers of markers

{maps_field_extension:markers}{total_results}{/maps_field_extension:markers}

polyline:n:from

Get the from latlng form the n polyline

{maps_field_extension:polyline:1:from}

polyline:n:stops

Get the stops (latlng pipline seperated) from the n polyline to convert it to the route method

{maps_field_extension:polyline:1:stops}

polyline:n:to

Get the to latlng form the n polyline

{maps_field_extension:polyline:1:to}

polyline[OPTIONAL:N]

Loop over the polyline positions, where N is the number of the polyline created.

{maps_fieldtype:polyline[OPTIONAL:1]}
    {stroke_color}
    {stroke_opacity}
    {stroke_weight}
    {path}
        {lat}, {lng}
    {/path}
{/maps_fieldtype:polyline[OPTIONAL:1]}

polygon[OPTIONAL:N]

Loop over the polygons, where N is the number of the polygon created.

{maps_fieldtype:polygon[OPTIONAL:1]}
    {stroke_color}
    {stroke_opacity}
    {stroke_weight}
    {fill_color}
    {fill_opacity}
    {path}
        {lat}, {lng}
    {/path}
{/maps_fieldtype:polygon[OPTIONAL:1]}

circle[OPTIONAL:N]

Loop over the circles, where N is the number of the circle created.

{maps_fieldtype:circle[OPTIONAL:1]}
    {stroke_color}
    {stroke_opacity}
    {stroke_weight}
    {fill_color}
    {fill_opacity}
    {lat}
    {lng}
    {radius}
{/maps_fieldtype:circle[OPTIONAL:1]}

rectangle[OPTIONAL:N]

Loop over the circles, where N is the number of the circle created.

{maps_fieldtype:rectangle[OPTIONAL:1]}
    {stroke_color}
    {stroke_opacity}
    {stroke_weight}
    {fill_color}
    {fill_opacity}
    {bounds}
        {lng}
        {lng}
    {/bounds}
{/maps_fieldtype:rectangle[OPTIONAL:1]}

map

Get all map variables

{maps_fieldtype:map}
    {map_types}
    {map_type}
    {zoom_level}
    {scroll_wheel}
    {zoom_control}
    {zoom_control_style}
    {zoom_control_position}
    {pan_control}
    {pan_control_position}
    {map_type_control}
    {map_type_control_style}
    {map_type_control_position}
    {street_view_control}
    {street_view_control_position}
    {google_overlay_html}
    {google_overlay_position}
    {center}
{/maps_fieldtype:map}

Channel Form

The Maps Fieldtype is fully compatible with Channel Form

Limit Access

You can set for different functions the access level based on the membergroup on the field setting page.

Access

Supported

The Fieldtype supports the following modules and extension

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.

array('maps_field' => array(
    'markers' => array(
        array(
            'lat' =>'52.3909176',
            'lng' =>'6.049638',
            'title' => 'test',
            'icon' => null
        )
    ),
    'map' => array(
        'map_type' => 'roadmap',
        'map_types' => array(
            'hybrid',
            'roadmap',
            'satellite',
            'terrain'
        )
    ),
    'polylines' => array(),
    'polygons' => array(),

));

Extra params bug

At the moment it is not possible to use enters in your custom field like below;

{custom_field
   param1=""
   param2=""
   param3=""
}

Instead of that you have to use it the following way;

{custom_field param1="" param2="" param3=""}

See also http://expressionengine.stackexchange.com/questions/10726/custom-field-with-params-and-enters or https://support.ellislab.com/bugs/detail/19434

Hooks

reinos_maps_fieldtype_save_data

(added in v1.0.0)

 ee()->extensions->call('reinos_maps_fieldtype_save_data', $data, $entry_id, $field_id);

FAQ

The spinner keeps loading after an upgrade

This could be happen due to the cache that has been invalid. You could fix this by clearin the cache in the Maps module.

Changelog

3.2.5 (11-10-2023)

3.2.4 (25-07-2023)

Added: show PHP error in debugging mode for the action urls

3.2.3 (24-07-2023)

3.2.2 (25-08-2022)

3.2.1 (19-01-2022)

3.2.0 (23-10-2021)

3.1.0 (08-07-2021)

3.0.7 (10-06-2021)

3.0.6 (03-06-2021)

3.0.5 (25-04-2021)

3.0.4 (26-03-2021)

3.0.3 (06-03-2021)

3.0.2 (29-12-2020)

3.0.1 (04-12-2020)

3.0.0 (02-12-2020)

Breaking changes See https://addons.reinos.nl/news/maps-suite-3

You need at least v2.0.0 or higher to upgrade to this version. Inside all v3.x.x releases, there is a v2.x.x. release. You can use this version to upgrade to the latest v2.x.x and after that upgrade you are good to go to update to v3.x.x. Remember, its just replacing files and hit the upgrade button. There is no other action required, it's that simple (but required).

2.1.4 (02-12-2020)

2.1.3 (30-10-2020)

2.1.2 (21-11-2019)

2.1.1 (13-11-2019)

2.1.0 (25-10-2019)

2.0.4 (03-09-2019)

2.0.3 (27-06-2019)

2.0.2 (08-06-2019)

2.0.1 (07-06-2019)

2.0.0 (21-05-2019)

*Note: There is a change you will have to validate the license again

\Note:** Because the module has been renamed with a prefix reinos_ there is an update path by simply add the new update to your site and install it. By installing the module, you are disabling the old module that can be deleted afterward. Also note that you have to rename the module calls and hooks with a prefix reinos_

See this article about the rename https://addons.reinos.nl/news/modules-renamed

1.1.5 (06-03-2019)

1.1.4 (05-02-2019)

1.1.3 (11-01-2019)

1.1.2 (08-01-2019)

1.1.1 (02-01-2019)

1.1.0 (19-12-2018)

1.0.2 (18-12-2018)

1.0.1 (24-11-2018)

1.0.0 (12-11-2018)