Skip to content

DelphiGoogleMap ​

License: ApacheLatest releaseDelphi 10.4.2+Platform: VCLMicrosoft Edge WebView2Google Maps JavaScript APIWindows 10 and 11

TEdgeGoogleMapViewer: a Delphi "WebView2" Component to View Google Map with integrated Routing and Markers Support

Actual official version 2.1.0 (VCL) ​

ComponentDescription
google-maps-128.pngTEdgeGoogleMapViewer is a Delphi wrapper on "WebView2" Component that adds many Google Maps features like Routing and Markers Support (only for VCL). You can setup attributes of the components to see the Google Maps reacts to your changes.

Installation ​

Run the Installer: it detects your Delphi versions, installs the sources, builds and installs the packages and adds the source paths.

Or install the package with DPM, the Delphi Package Manager (Delphi 10.4 to 13, Win32 and Win64), which also copies WebView2Loader.dll next to the executable of your project:

dpm install EtheaDev.DelphiGoogleMap <path of your project>.dproj

Without the installer, open Packages\<Delphi version>\DelphiGoogleMapsPackages.groupproj, build the run-time package, build and install the design-time one and add the Source folder to the Delphi source path.

If you do not use DPM, WebView2Loader.dll (32 or 64 bit) has to be in the same folder as the executable: see Demo\GoogleMaps\Bin\Win32 and Win64.

Simple to use ​

You need a Google Maps API key. Register it once, then set properties and call methods:

pascal
TEdgeGoogleMapViewer.RegisterGoogleMapsApiKey('<your Google Maps API key>');

//Goto Address Example
EdgeGoogleMapViewer.GotoAddress(MemoAddress.Lines.Text);

//Setting Map View Mode
EdgeGoogleMapViewer.MapTypeId := mtHYBRID;

//Route between two addresses, with the directions panel
EdgeGoogleMapViewer.MapShowDirectionsPanel := True;
EdgeGoogleMapViewer.MapStartAddress := 'Via Santa Cecilia 4, Carugate, Milano';
EdgeGoogleMapViewer.MapDestinationAddress := 'Via San Francesco 5, Carugate, Milano';
EdgeGoogleMapViewer.RouteByAddresses;

The demo showing a route with the directions panel

Open Demo\GoogleMaps\GoogleMapsTest.dproj to see every feature at work: markers, circles, polylines and polygons, routing, light and dark maps, map events.

Documentation ​

Full documentation, with the Quick Start, every feature explained and the walkthrough of the demo, is on the Project Site.

RELEASE NOTES ​

07 Nov 2026 - Version 2.1.0

  • Fixed CoordToText: longitudes >= 100 lost the last decimals (e.g. 151.209296 became 151.209300)
  • Fixed TextToCoord: uses invariant format settings (no uninitialized TFormatSettings fields)
  • Fixed texts passed to javascript (addresses, descriptions, labels, info windows): apostrophes, newlines, backslashes and quotes no longer break the script (e.g. "Via dell'Industria"). New class function JSQuotedStr
  • Fixed Put* methods and routing called with the map hidden: they now wait until the page and the Google Maps API are loaded (the first overlay or route was lost)
  • Fixed OnCreateWebViewCompleted, OnNavigationCompleted and OnWebMessageReceived assigned at design-time: they no longer replace the internal handlers (map never shown, OnMapClick/OnMapZoom/ComputeDistanceBetween not working)
  • Fixed PutCircle, PutPolyline and PutPolygon changing the global FormatSettings.DecimalSeparator of the application; opacities keep all the decimals
  • Fixed RouteByLocations: points on the Equator or on the Greenwich meridian are valid, an unassigned start point is no longer accepted
  • Fixed '%' in the javascript added by OnGetJavascript (e.g. "7 % 2" was truncated)
  • Fixed web messages: map events are reported as handled (no more duplicated OnWebUnhandledMessageReceived), memory leaks with non-object JSON messages and COM strings, access violation with messages that are not strings
  • Fixed exceptions raised in OnMapClick, OnMapRightClick and OnMapZoom: no longer silently swallowed
  • Fixed ComputeDistanceBetween: the 2 seconds timeout is real elapsed time (was about 30 seconds), the map is shown if needed, re-entrant calls are rejected
  • Fixed WebView2 initialization failure (e.g. missing WebView2Loader.dll): ShowMap raises the error instead of hanging the application
  • Fixed Demo compilation with Delphi 10.4 (Winapi.WebView2 unit not found)
  • Added Demo build scripts (Demo\BuildDemo.ps1, BuildAllDemos.ps1, BuildDemoD10.4/D11/D12/D13.ps1)
  • Breaking change: OnGetJavascript receives the final javascript (no %s/%d placeholders): write '%' instead of '%%'
  • Breaking change: a user OnWebMessageReceived handler is called for every message, in addition to the internal handling

All the release notes: README on GitHub

License ​

Copyright (c) 2021-2026 Ethea S.r.l.

Licensed under the Apache License, Version 2.0 (the "License"): you may not use this software except in compliance with the License. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Open source projects by Ethea S.r.l. - each one with its own license