Openlayers POI layer example

Hello,

for some years I used the sample from the wiki https://wiki.openstreetmap.org/wiki/Openlayers_POI_layer_example to display up to 5 markers on a map. Now I determined that this doesn’t work any more - no idea since when.

Firefox 69: Full map is shown, but no markers.
Internet Explorer: Nothing except the +/- buttons in the upper left corner and the copyright link in the lower right corner.
Microsoft Edge: Same as the Internet Explorer, plus pink background, and a “x” at every tile and marker (but no map and no marker).

I tested this also with the original code from the wiki. On different PC with different internet access points. All are Windows 10 1903 64 Bit.

Is this because of some new security features? Is there a solution available?

Regards,

JanEsx

Hardly anyone uses OpenLayers anymore, most modern stuff will use Leaflet. Therefore I’m afraid the relevant webpage has long since bitrotted away.

If you look in the web console you’ll see the problem “Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at file:///C:/Temp/textfile.txt. (Reason: CORS request not http)”.

As SK53 suggests, I’d suggest looking at the Leaflet examples: https://leafletjs.com/examples.html .

Hello SK53 and SomeoneELse,

many thanks for the explanation and the link to leaflet. I will give it a try.

I added the openlayers years ago to my project. I use it not very often and so I saw first last weekend that it doesn’t work any more.