GoogleMapsRoutePlanner

Category: Widgets
Subcategory: Display widgets

Overview

Add a route planner based on Google Maps webservices on your webpage to quickly get the best route including multiple waypoints and travelmodes.

Documentation

Demo url

Description

Add a route planner based on Google Maps services on your webpage to quickly get the best route including multiple waypoints and travelmodes.

Features and limitations

  • Multiple travel modes are supported. 
  • Add multiple waypoints. Not available for TRANSIT travel mode.
  • Supports both address or latitude / longitude pair as starting address. When both are filled, lat/long is used and address from will be updated.
  • At least arrival time or departure time should be filled. When both are filled, arrival date will only be used and departure date will be updated.- Possibility to add preferences to avoid highways / tolls / ferries.

Dependencies 

  • API key needed, see below

Configuration

Place the GoogleMapsRoutePlanner in a Dataview. The Dataview entity should be a Route entity which the widget will use for it's route calculation.

The Route entity should have the following attributes:

  • AddressFrom (String)
  • LatitudeFrom (Decimal)
  • LongitudeFrom (Decimal)
  • AddressTo (String)
  • ArrivalTime (DateTime)
  • DepartureTime (DateTime)
  • AvoidHighways (Boolean)
  • AvoidFerries (Boolean)
  • AvoidTolls (Boolean)
  • Duration (Integer)
  • Distance (Integer)
  • TravelMode (Enum)

The TravelMode enumeration should hold as Keys the following values: TRANSIT, WALKING, DRIVING, BICYCLING.

Map those attributes in the DataSource tab pane of the widget. 

Waypoints

If you want to make use of WayPoints then also add a String attribute in your route entity, called something likeWaypointsStringArray (String, 2000 characters). In this attribute a user can add multiple waypoints when travelling from AddressFrom to AddressTo. Separate each address by a pipeline '|'. See also printscreen added.

Google Maps API's 

The widget makes use of two Google Maps API's: 

  1. Directions API for looking up the route
  2. Distance Matrix API for looking up distance and duration.

For the API's to correctly work an API key is necessary. See: https://developers.google.com/maps/documentation/directions/ 

 

 

Releases

Version: 1.1.0
Framework Version: 8.2.2
Release Notes: - Upgraded to Mendix 8.2.2. - Removed Resize function content. - Cleaned up code slightly.
Version: 1.0.0
Framework Version: 6.10.10
Release Notes: Add a route planner based on Google Maps services on your webpage to quickly get the best route including multiple waypoints and travelmodes.