TMSFNCOpenLayers - The maps have completely disappeared!!!

Maps stopped showing. Instead of them, there is only a white area. They have disappeared both in all existing finished and several months running Android applications, but also in Windows, and they also do not appear in the Delphi 11 development environment.
What could happen?

2 Likes

Interestingly, apps written in TMSFMXWebOSMaps work normally (until Android 10)

1 Like

My windows not work too !

1 Like

The outage occurred yesterday (24/08/2022) in the afternoon on all devices.
It won't even initialize.
Console writes: Access to restricted URI denied.

Hi,

The links used in the OpenLayers implementation are no longer valid. We are looking for a permanent solution. As a workaround, please upload the files to your own server from the attached zip file and use these links instead with the OnCustomizeHeadLinks event

procedure TForm1.TMSFNCOpenLayers1CustomizeHeadLinks(Sender: TObject;
  AList: TTMSFNCMapsLinksList);
begin
  AList.Clear;
  AList.Add(TTMSFNCMapsLink.CreateLink('https://myserver.com/fncmaps/ol/6.1.1/ol.css', 'text/css', 'stylesheet'));
  AList.Add(TTMSFNCMapsLink.CreateScript('https://myserver.com/fncmaps/ol/6.1.1/ol.js', 'text/javascript'));
end;

v6.1.1-dist.zip (913.5 KB)

Alternatively, you can also use this

procedure TForm1.TMSFNCOpenLayers1CustomizeHeadLinks(Sender: TObject;
  AList: TTMSFNCMapsLinksList);
begin
  AList.Clear;
  AList.Add(TTMSFNCMapsLink.CreateLink('https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.15.1/css/ol.css', 'text/css', 'stylesheet'));
  AList.Add(TTMSFNCMapsLink.CreateScript('https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.15.1/build/ol.js', 'text/javascript'));
end;
1 Like

Thank you for the very quick temporary solution. Going through gh and so far so good...

1 Like

One could surely also download these files (ol.css and ol.js) and install them with the application, preventing problems like this in future?


appDir := IncludeTrailingPathDelimiter(ExtractFilePath(Application.ExeName))
AList.Add(TTMSFNCMapsLink.CreateLink('file://' + appDir + '\ol.css', 'text/css', 'stylesheet'));
AList.Add(TTMSFNCMapsLink.CreateScript('file://' + appDir + '\ol.js', 'text/javascript'));

Of course, this also works with local files. It's unclear if this will work on mobile operating systems, and in TMS WEB Core this will not work.