FNC Maps Issue

I'm using the GoogleMaps component which has worked well until recently. For some reason, Delphi now won't start if my TMCFNCMaps unit was open when Delphi was last closed. I can get Delphi to start if I remove the GoogleMaps component from the TMCFNCMaps unit's dfm file using Notepad. However, if I then add the TTMSFNCGoogleMaps component back to the unit's form in the IDE, it appears ok and I can close and save the unit. But then Delphi freezes if I try to open the unit again in the IDE and the only way to close Delphi is to to use the Task Manager. The only way then to re-open Delphi is to again manually remove the GoogleMaps component from the dfm file - as before. Any ideas?

Using Delphi 10.4.2 with updates, Windows 10 Pro and TMSFNCMapsSetupReg and TMSFNCCoreSetupReg V1.5.0.0. I have re-installed the FNC maps packages to no avail.

We can't reproduce this issue. We are able to save and load projects. Did you change designtime settings? Is this a new instance? Could you potentially send us the project that doesn't load so we can investigate what is going on? Alternatively, you could also create the maps instance programmatically in the constructor of the form.

As far as I know, no settings were changed and, no, it wasn't a new instance. The project is too large to send I'm afraid. It must be something in my project causing this. I'll create the maps instance programmatically if I can't resolve the issue.

Thanks for looking into it.

Please let me know if this resolves the issue, or if you can reproduce it in a simple project, you can always send it so I can inspect it here.

Thanks Pieter. Interestingly, if I add a GoogleMaps component to the form and then try to select it by clicking on it, it generates another component on the form. Each time I do this another component is added! When I try to save the form with a single (unclicked) component, I get an AV in designide 270.bpl. Looks like my ide is corrupted perhaps. Will advise if I find the cause.

Thanks for the feedback!

I copied my project to a laptop and all works ok. The crucial difference is that when adding the GoogleMaps component to a test unit on the laptop, I get the following message:

'Edge Chromium is successfully initialised'

I do not get this message when adding a GoogleMaps component to the same unit on my Desktop. I presume this is a good clue? Looks like the component can't find Edge? And what happens if a customer without Edge installs my upgrade using FNC Maps?

Hi,

The component will look for an installation, and if it doesn't work, there will be a popup appearing indicating edge is not initialized properly. There should be no crashes, the map will simply show a blank screen.

Hi Pieter,

ok, looks as though I will have to re-install 10.4.2 on my desktop - oh joy!

Thanks.

Before reinstalling, do you have another environment to test on?

If you mean a Tokyo, Seattle or Berlin IDE, no I'm afraid not. My laptop and desktop environments are very similar, so I'm guessing it's a desktop ide issue. I suppose it could be an Edge issue but Edge seems to work ok on both, and I have no idea what to check wrt this issue.

Did you install the Evergreen WebView2 Runtime on both machines?
https://developer.microsoft.com/en-us/microsoft-edge/webview2/

I hadn't, but installing it fixes the problem. Does this mean that our customers will have to install this to get FNC Maps to work? Clearly it was probably installed on my laptop but not on my Desktop.

Thanks Pieter

Yes, this is a requirement. Microsoft has made working with Microsoft Edge version installed in program files impossible so it seems. In the official docs, they mention the Evergreen runtime has to be installed. In future Windows updates, the runtime should automatically be installed along Microsoft Edge on the users PC.

Ok, thanks Pieter. I would prefer a user message and a graceful exit rather than the app freezing I see if the evergreen runtime isn't installed - if possible. Plus, of course, the geodetic polyline option promised earlier.

Thanks for your help here.

If you programmatically create the map, you can include FMX.TMSFNCWebBrowser.Win, and then check EdgeLoaded flag. You can also silent errors with EdgeSilentErrors flag. These flags allow you to detect if the browser is available and then create an instance of the map. when false, show a message to the user.

Good idea wrt to edge availability, but I was thinking about how to handle the Evergreen runtime availability. Looking at the ms doc, I guess I can install it if necessary in the app's installation program.

I don't have your FMX components, so where would I find FMX.TMSFNCWebBrowser.Win?

This is part of TMS FNC Core, so the unit is available whenever an FNC product is installed. Depending on the framework you might also use VCL.TMSFNCWebBrowser.Win

Yes, I just found it as you posted!

1 Like

A question: I'm using the GetTimeZone procedure to obtain the GMT offset times for two places on the earth's surface as follows:

TMSFNCTimeZone1.GetTimeZone(CoordRecD, DateD, '1252', mlmDefault, nil, '0', nil); //Dep time
TMSFNCTimeZone1.GetTimeZone(CoordRecA, DateA, '1252', mlmDefault, nil, '1', nil); //Arr time

Is it possible to use the TTMSFNCTimeZoneGetTimeCallback parameter to have the 2nd call depend on the completion of the 1st call?