TAdvWebBrowser / WebView2 and local file resources

I'm currently trying to migrate some former TWebBrowser/IE-based embedded website-display (namely google maps) to the new TAdvWebBrowser-component, but struggle with accessing local files.

With TWebBrowser we were generating some custom markers on the fly for the google map, and used some JavaScript to tell google maps: "place this file:///... marker at geoposition (x,y)". That doesn't work with TAdvWebBrowser. It looks like access to local files is disabled for security reasons, because displaying standard markers from some http:///... address works.

I found some info on relevant settings for the Edge-WebView2-component that's used by TAdvWebBrowser here:
Accessing local files via WebView2 · Issue #642 · MicrosoftEdge/WebView2Feedback · GitHub
... but I've not found any way to tell TAdvWebBrowser which settings I'd like to use.

How can I achieve this? Google Maps is soon shutting down IE support, so I need to migrate to some current technology ...

Thanks for any tips!

There are 3 options:

  1. Use TMS FNC Maps with LocalFileAccess = True
  2. Use AdvWebBrowser1.LoadFile, which then loads HTML file that renders the map. Then you should be able to access local files.
  3. Use base64 encoded string representation of the marker icons.

thanks for the quick reply! I'm gonna check out option 2 first, as that seems to be the least effort for now.

Option 2 seems to work! Thank you!

1 Like

Thanks for confirming!

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.