Maps Route

Introduction

This extension module will add route functions to the Maps module. It also does a lot of caching to avoid problems with the limits of the API

You can use it as tags, so you can work with the route data, or you can put it directly as a polyline on the map.

Documentation versions

Installation

Prerequisites

Make sure your system meets the minimum requirements:

Installation Instructions

Update instructions

Important notes

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

On a local environment, like *.dev *.local *.localhost *.test the license will be valid for the testing and building new sites.

Direction/Route Tag

Return multi-part directions for a series of waypoints. Directions for several modes of transportation are available.

The tag

{exp:maps_services:direction}

Tag parameters

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

address:from

A from address name, can also a name like 'reichenbach im vogtland or amsterdam or america'.

address:from="" [REQUIRED] if latlng:from is empty

latlng:from

latitude longitude coordinates

latlng:from="" [REQUIRED] if address:from is empty

address:to

A to address name, can also a name like 'reichenbach im vogtland or amsterdam or america'.

address:to="" [REQUIRED] if latlng:to is empty

latlng:to

latitude longitude coordinates

latlng:to="" [REQUIRED] if address:to is empty

address:waypoints

Stops between the from and to point. addresses seperated with a pipline '|'

address:stops="" [OPTIONAL] if latlng:stops is empty

latlng:waypoints

Stops between the from and to point. latitude longitude coordinates seperated with a pipline '|'

latlng:stops="" [OPTIONAL] if address:stops is empty

optimize_waypoints

By default the waypoints are in order how you request it. To have a better and optimized route, you can enable this param so it gives you a better route.

optimize_waypoints="no" [OPTIONAL]

travel_mode

set the travel mode.
values: driving walking walking

travel_mode="driving" [OPTIONAL]

avoid

values: tolls highways ferries
You can use multiple options seperated with a pipline (|)

avoid="tolls" [OPTIONAL]

lang

Set the language based on the language code

lang="en" [OPTIONAL]

Tag variables

Below are the Tag variables. (note the prefix directions:)

direction:distance:text

The distance

{direction:distance}

direction:duration

The duration/time

{direction:duration:text}

direction:start_location

The start location

{direction:start_location}

direction:end_location

The end location

{direction:end_location}

direction:steps

The steps pair tag hold all the steps to on the route

{direction:steps}...{/direction:steps}

direction:steps:distance

The distance

{direction:steps}
    {direction:steps:distance}
{/direction:steps}

direction:steps:duration

The duration/time

{direction:steps}
    {direction:steps:duration}
{/direction:steps}

direction:steps:location

The location where the action should take

{direction:steps}   
    {direction:steps:location}
{/direction:steps}

direction:steps:instruction

Formatted HTML instructions of the step

{direction:steps}   
    {direction:steps:instruction}
{/direction:steps}

direction:steps:travel_mode

The travel mode

{direction:steps}
    {direction:steps:travel_mode}
{/direction:steps}

Map tag

With this tag you can add a route directly to a map. You can use it just like the {map:add_marker} tag, just put in inside the {exp:maps:map}...{/exp:maps:map} tag

The tag

{maps:add_route}

Tag parameters

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

address:from

A from address name, can also a name like 'reichenbach im vogtland or amsterdam or america'.

address:from="" [REQUIRED] if latlng:from is empty

latlng:from

latitude longitude coordinates

latlng:from="" [REQUIRED] if address:from is empty

address:to

A to address name, can also a name like 'reichenbach im vogtland or amsterdam or america'.

address:to="" [REQUIRED] if latlng:to is empty

latlng:to

latitude longitude coordinates

latlng:to="" [REQUIRED] if address:to is empty

address:waypoints

stops between the from and to point. addresses seperated with a pipline '|'

address:stops="" [OPTIONAL] if latlng:stops is empty

latlng:waypoints

stops between the from and to point. latitude longitude coordinates seperated with a pipline '|'

latlng:stops="" [OPTIONAL] if address:stops is empty

travel_mode

set the travel mode.
values: driving transit walking

travel_mode="driving" [OPTIONAL]

stroke:color

set the stroke color.

stroke:color="#131540" [OPTIONAL]

stroke:opacity

set the stroke opacity.

stroke:opacity="0.6" [OPTIONAL]

stroke:weight

set the stroke weight.

stroke:weight="6" [OPTIONAL]

Fit tag

To fit the routes on the map, the route module add the following tag to the {exp:maps:map}

fit_map:routes

Fit the map based on the routes

{exp:maps:map
    fit_map:routes="no" [OPTIONAL]    
}

Changelog

2.0.0 (16-06-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.0 (19-12-2018)

1.0.0 (10-10-2018)