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.1 (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;

//Route with intermediate stops (addresses or "lat,lng"), in the shortest order
EdgeGoogleMapViewer.MapOptimizeWaypoints := True;
EdgeGoogleMapViewer.RouteByAddresses(['Piazza del Duomo, Milano', '45.6983, 9.6773']);

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 ​

Version 2.2.0 (not yet released)

  • Added waypoints to the routes (issue #11): MapWaypoints property (one address or "lat,lng" per line), new overloads RouteByLocations(array of TLatLng) and RouteByAddresses(array of string), up to 25 waypoints
  • Added MapOptimizeWaypoints property: Google reorders the waypoints to get the shortest route
  • Added OnRouteError event: a route request failed (e.g. address not found, no route available); before, the error was silent
  • RouteByAddresses: the addresses are geocoded by the Google DirectionsService in the same request
  • Demo: waypoints and "Optimize order" in the Routing panel
  • Added "Test..." to the component editor (also double click on the component): the map with the settings of the component, working inside the IDE, with a button that generates random points (and a route through them). WebView2Loader.dll is searched in the output folder of the active project, in the folder of the library, or can be selected once
  • Added Assign: copies the map settings of another TEdgeGoogleMapViewer
  • Setup: WebView2Loader.dll (Win32 and Win64) is installed in Demo\GoogleMaps\Bin

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