Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
MapView.PlanRoute
Plans a route.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
MapView | 9.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes, on macOS | ✅ Yes |
MBS( "MapView.PlanRoute"; MapView; SourceAddress; DestinationAddress; Mode { ; TransportType; StartIdentifier; EndIdentifier; StartColor; EndColor } ) More
Parameters
Parameter | Description | Example | Flags |
---|---|---|---|
MapView | The map view reference number. | $$MapView | |
SourceAddress | The address where to start. | "Köln" | |
DestinationAddress | The address where to end. | "München" | |
Mode | Various options. Add 1 to show route on map. Add 2 to show alternative routes on the map. Add 4 to show start of route with a pin. Add 8 to show end of route with a pin. Add 16 to zoom map to show whole of the router. Add 32 to return result as JSON. Add 64 to include poly lines in JSON. |
1+4+8+16 | |
TransportType | The type of transportation to use. Value can be a combination of 1 for car, 2 for walk. Default is by car. |
1 | Optional |
StartIdentifier | Available in MBS FileMaker Plugin 9.3 or newer. The identifier for the pin to use with script trigger. If empty, the plugin assigns a number automatically. |
Optional | |
EndIdentifier | Available in MBS FileMaker Plugin 9.3 or newer. The identifier for the pin to use with script trigger. If empty, the plugin assigns a number automatically. |
Optional | |
StartColor | Available in MBS FileMaker Plugin 9.3 or newer. The color to use. Can be a color name or hex notation like in HTML. |
"#FF0000" | Optional |
EndColor | Available in MBS FileMaker Plugin 9.3 or newer. The color to use. Can be a color name or hex notation like in HTML. |
"#FF0000" | Optional |
Result
Returns result or error.
Description
Plans a route.The plugin will lookup coordinates for the given addresses and request a route calculation.
Then we may add show routes and optionally return JSON with results.
You can call this method several times to show multiple routes together.
Examples
Plan a route and store JSON:
Set Variable [ $r ; Value: MBS("MapView.PlanRoute"; $$MapView; "Köln"; "München"; 1+2+4+8+16+32; 1+2+4) ]
Set Field [ MapView::Route ; $r ]
Plan route with coordinates:
MBS("MapView.PlanRoute"; $$MapView;
"50.938056N 6.956944E"; // Cologne, Germany
"48.137222N 11.575556E"; // Munich, Germany
1+4+8+16; 1)
Release notes
- Version 14.4
- Improved MapView.PlanRoute function to use less memory.
- Version 9.3
- Added identifier and color parameters for MapView.AddPin, MapView.AddPinWithAddress, MapView.PlanRoute and MapView.ShowAddress functions.
- Version 9.2
- Added MapView.FormatDistance, MapView.ParseDistance and MapView.PlanRoute functions.
Example Databases
Blog Entries
- MBS FileMaker Plugin, version 14.4pr1
- MBS Plugin Advent calendar: 20 - MapView
- Was gibt es neues bei MBS Version 9.2
- MBS FileMaker Plugin, version 9.3pr2
- More on MapViews in FileMaker
- MBS FileMaker Plugin, version 9.2pr1
- Adding route planing for MapView in FileMaker
FileMaker Magazin
This function is free to use.
Created 17th March 2019, last changed 22nd March 2023