Visualisation: Directions
Show route directions between two points with some waypoints on the way. The first record returned by the query is taken as the starting point, and the last record is used as the end point for the journey.
Google Maps allows a maximum of 8 waypoints in addition to the origin and destination.
The Directions Panel is an ordinary APEX region with the following contents:
<div id="directionspanel"></div>
The JavaScript Initialization Code on the plugin is:
this.options.directionsPanel = "directionspanel";
If the "Optimize Waypoints" plugin attribute is switched on, the map would reorder the intermediate waypoints to minimize the route cost.
A dynamic action on the region responds to the "directions" event with this javascript:
$s("P11_DISTANCE",this.data.distance);
$s("P11_DURATION",this.data.duration);
$s("P11_LEGS",this.data.legs);