Click here to load reader
Upload
embarcadero-technologies
View
212
Download
2
Embed Size (px)
Citation preview
Bruno [email protected]
Stay in touch
http://www.facebook.com/tmssoftware
@tmssoftwarenews @BrunoFierens
Using Google Maps in Delphi VCL and FMX apps
Using Google Maps in Delphi apps
• Introduction: Google Maps in Delphi apps
• Architecture in a nutshell
• Map options
• Positioning, markers
• Geocoding, reverse geocoding
• Directions
• GPX, GEOJson
Introduction: Google Maps in Delphi apps
• Programmatic control of Google Maps via Delphi code
• Wide range of geographical related functions
• Available for - VCL apps for Windows - FMX apps for Windows, macOS, Android, iOS - IntraWeb apps for web
• Easy to use Delphi classes, properties, methods. No Javascript required
• Free liberal use of Google Maps, some use is payinghttps://console.developers.google.com/
Architecture in a nutshell
WebBrowser control based
• Navigate to https://maps.google.com
• Injection of Javascript to interact with map via Google Maps Javascript API
• Use WebBrowser interface to expose Javascript browser events as Delphi events
• Additional use of Google geocoding / Reverse geocoding APIs
Map options
• Map types: default, terrain, satellite, hybrid
• Traffic
• Streetview
• Language
• Controls: zoom, map type, streetview
Demo
Positioning
• Map position:
- WebGMaps.MapPanTo(),
- WebGMaps.MapPanBy(X,Y)
- WebGMaps.MapZoomTo(bounds)
• Markers
- WebGMaps.Markers.Add()
Demo
Geocoding, reversegeocoding
• Translation of address to longitude & latitude and vice versa
• Via TWebGMapsGeocoding, TWebGMapsReversegeocoding component
• In VCL helper component: TWebGMapsLookupEdit
Demo
Directions
• Calculating routes from point A to B
• Optionally add waypoints
• WebGMaps.RenderDirections()
• WebGMaps.GetDirections()
• WebGMaps.Directions result collection
• WebGMaps.FillDirectionList()
Demo
GPX, GEOJson
• Import and export GPX files
WebGMaps.LoadGPSRoute();
WebGMaps.SavePathToGPSRoute();
• Import GEOJson files (http://geojson.org/)
WebGMaps.LoadGeoJsonPolyLine();
WebGMaps.LoadGeoJsonPolygon();
Demo
Interesting links
• TMS VCL WebGMapshttp://www.tmssoftware.com/site/webgmaps.asp
• TMS FMX WebGMapshttp://www.tmssoftware.com/site/tmsfmxwebgmaps.asp
• TMS IntraWeb WebGMapshttp://www.tmssoftware.com/site/iwwebgmaps.asp
• More videoshttps://www.youtube.com/user/tmssoftwareTV
Q&A