16

Click here to load reader

TMS Google Mapping Components

Embed Size (px)

Citation preview

Page 1: TMS Google Mapping Components

Bruno [email protected]

Stay in touch

http://www.facebook.com/tmssoftware

@tmssoftwarenews @BrunoFierens

Using Google Maps in Delphi VCL and FMX apps

Page 2: TMS Google Mapping Components

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

Page 3: TMS Google Mapping Components

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/

Page 4: TMS Google Mapping Components

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

Page 5: TMS Google Mapping Components

Map options

• Map types: default, terrain, satellite, hybrid

• Traffic

• Streetview

• Language

• Controls: zoom, map type, streetview

Page 6: TMS Google Mapping Components

Demo

Page 7: TMS Google Mapping Components

Positioning

• Map position:

- WebGMaps.MapPanTo(),

- WebGMaps.MapPanBy(X,Y)

- WebGMaps.MapZoomTo(bounds)

• Markers

- WebGMaps.Markers.Add()

Page 8: TMS Google Mapping Components

Demo

Page 9: TMS Google Mapping Components

Geocoding, reversegeocoding

• Translation of address to longitude & latitude and vice versa

• Via TWebGMapsGeocoding, TWebGMapsReversegeocoding component

• In VCL helper component: TWebGMapsLookupEdit

Page 10: TMS Google Mapping Components

Demo

Page 11: TMS Google Mapping Components

Directions

• Calculating routes from point A to B

• Optionally add waypoints

• WebGMaps.RenderDirections()

• WebGMaps.GetDirections()

• WebGMaps.Directions result collection

• WebGMaps.FillDirectionList()

Page 12: TMS Google Mapping Components

Demo

Page 13: TMS Google Mapping Components

GPX, GEOJson

• Import and export GPX files

WebGMaps.LoadGPSRoute();

WebGMaps.SavePathToGPSRoute();

• Import GEOJson files (http://geojson.org/)

WebGMaps.LoadGeoJsonPolyLine();

WebGMaps.LoadGeoJsonPolygon();

Page 14: TMS Google Mapping Components

Demo

Page 15: TMS Google Mapping Components

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

Page 16: TMS Google Mapping Components

Q&A