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.
- API key needed, see below
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.
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:
- Directions API for looking up the route
- 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/