0

I am trying to incorporate a TwebBrowser into my Windows FMX application to display Leaflet Maps and openstreetmap .png tiles. The libraries for Leaflet Maps are available locally and when I view the html / javascript in Chrome or Edge, all is fine. The Map, the polygons and other markers are all displayed as they should be as per the Leaflet Maps Example. However when the url is loaded in TWebBrowser, the map is NOT displayed, but the polygons and markers display correctly. I can also call ShellExec to display the html / Java in the default PC browser. Am I missing something really basic here with TWebBrowser and FMX, or is there an issue with TWebBrowser and .png files, specifically openstreetmap.org .png files. Is there a better alternative other than going down the road of Google Maps ?

Any help would be much appreciated...

WobblyBob
  • 109
  • 1
  • 12
  • Which Delphi version are you using? In older Delphi versions `TWebBrowser` component was based on `WebView2` interface which itself is based on Internet Explorer. Also older `TwebBrowser` components by default ran in IE7 compatibility mode unless you registered your application as browser on target computer. You can read more about this in [How to have Delphi `TWebbrowser` component running in IE9 mode?](https://stackoverflow.com/a/25843958/3636228) – SilverWarior May 01 '23 at 12:46
  • @SilverWarrier - sorry for not mentioning - I am using Delphi11.3 Enterprise Edition with all updates in place . I did look into Using TMapView but seem to recall reading somewhere that that only worked with Google Mapsand associated API's. Thanks for you help so far - much appreciated - I will look at in depth a little later and keep you posted ;) – WobblyBob May 01 '23 at 21:34
  • What happens if you change the Engine of the browser to Edge? In Delphi 11.3 the TWebBrowser has a `Engine` property where you can use edge. I can load maps fine on this. – Adriaan May 02 '23 at 06:43
  • @Adrian - Hi Adrain - I have tried changing the engine and unfortunately the maps .png file refuses to show - I just get a grey background. I am going to look at Embedded Chrome for Delphi later today as alluded to by SilverWarrior and see what effect that has - many thanks. – WobblyBob May 02 '23 at 07:02

0 Answers0