openlayers / ol2

OpenLayers v2 - deprecated!
Other
1.48k stars 771 forks source link

Dev.openlayers.org is gone #1540

Closed pzacheo closed 2 years ago

pzacheo commented 2 years ago

Hello, I have an integration with OpenLayers working for many years now. As the API code examples we were using dev.openlayers.org/OpenLayers.js Now the whole site is gone.

My question is do you plan to reopen that site? Why are the files taken down? My code no longer works properly, for example some maps (like Google Maps) no longer work.

ahocevar commented 2 years ago

That site has been down for a long time, and we're not planning to put it up again. ol2 has been deprecated for 7 years now. If possible, upgrade your application to the latest version (see https://openlayers.org/).

The url you've been accessing pointed to the built js of an unreleased version of ol2. The built js of the last released version of ol2 is here:

The code is in this repository. If you want to build the latest unreleased version yourself, follow these steps:

git clone git@github.com/openlayers/ol2.git
cd ol2/build
python2 build.py full

Then you will find OpenLayers.js in the build/ directory, and you can take style.css from the theme/default/ directory.

pzacheo commented 2 years ago

Strangely enough the site was done a couple of days ago. It's still accessible on Google index which shows my point. Anyway, I'm using the 2.13.1 API now and I still have the same problem.

Google Maps are not being shown. There is a dropdown radio button where I can select the maps. Only OpenStreet Maps work now. Google Maps layers are all black.

Can you provide any help? Am I missing something? A couple of days ago it was working flawlessly.

ahocevar commented 2 years ago

I can confirm that I'm seeing an orphaned snapshot of dev.openlayers.org in the Google cache, from a couple of days ago. I was not aware that site was still up, because we told the OSGeo foundation, who was hosting that site, a long time ago that there is nothing on it that is still needed (i.e. no assets that were part of an official OpenLayers API).

Regarding the Google layer: I was able to get the Google layer to show in a local version of the https://github.com/openlayers/ol2/blob/master/examples/google.html example, but greyed out and with a warning.

Here is a build of OpenLayers.js from the latest commit in the default branch: OpenLayers.js.zip

Maybe you're luckier with that file, because I think it is closer to what you've been using.

Other than that, I can only recommend removing the Google layer, upgrading to a recent version of OpenLayers, or using an alternative mapping library. You can also check out https://www.osgeo.org/service-providers/ to find professional support, if you need help upgrading your application.

pzacheo commented 2 years ago

Thank you so much for your support. In fact everything was working fine before deletion. After deletion of the dev site I had to find the OpenLayers.js and theme and "img" folder in order for it to work again. I've linked it to my site, then it started working.

I've tried with the version you sent me and I still have the same problem with Google Maps (i.e. black map). I've tried with the example you provided me in my server and still the same.

This is the code I'm using:

    super.writeJSIncludes(out, reqState, new String[] {
        JavaScriptTools.qualifyJSFileRef("http://maps.google.com/maps/api/js?v=3&sensor=false"),
        JavaScriptTools.qualifyJSFileRef("maps/jsmap.js"),
        "https://www.cartrackgps.com/OpenLayers.js",
        JavaScriptTools.qualifyJSFileRef("maps/OpenLayers.js")            
    });

Maybe I'm missing some file, as I've seen that there is a "lib" folder. I've uploaded the lib folder but still it doesn't work.

What is strange to me is that before the deletion of the site GoogleMaps worked. Now I cannot seem to make it work.

Thank you very much for your support.

pzacheo commented 2 years ago

I think I missed something, now it's working perfectly with the file you provided. I cannot thank you enough and will take you into account for the future sponsorship.

ahocevar commented 2 years ago

Thanks for the kind words, @pzacheo. Glad to help.

pzacheo commented 2 years ago

There is a small detail I just found out that on the mobile Apps one cannot drag the map or zoom in/out using gestures. I've been told by another developer that this problem resides on the OpenLayers.js unable to detect touch events. They told me I should request a new version of the file including support for mobile. Sorry to bother you again.

ahocevar commented 2 years ago

The file I provided is a full build, and it comes with mobile support out of the box. To make the map navigation work on mobile devices, you'd have to set up the html so it does not zoom upon user gestures, like in the official examples. Add this to the <head>:

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">

But that should be no different than with the build you previously used.

pzacheo commented 2 years ago

Thank you for your support again. On desktop it is working perfectly. But on mobile (Android App) it's not working as before. So that it won't zoom in or out using gestures, and I cannot drag the map around.

Everything else works, like clicking on the map layers and clicking on the "+" and "-" zoom symbols. Maybe I'm missing openlayersmobile.js ?

ahocevar commented 2 years ago

Here you go:

OpenLayers.mobile.js.zip