3

I am using the OverviewMap control on my ol3-based website. Now, since I am showing a map of Greenland, I use a UTM 24N projection (EPSG:32624). When I see the overview map, however, it looks like it is using Openlayer's default projection instead of UTM 24N. Here is an example:

example

I am not using any "special" code to generate the OverviewMap control:

map.addControl(new ol.control.OverviewMap({
                collapsed: true
            }));

Any idea what I am doing wrong? Or is this maybe a bug? Could it have something to do with Geoserver (where the tiles come from)?

3

Pass the overview map a view with the correct projection to use:

view: new ol.View({ projection: projection }),

  • I have just tried, but it is still not working, the OverviewMap control requests a tile as EPSG:3857. – Qaisa Mar 31 '16 at 13:29
  • How is your projection object defined? – bartvde Mar 31 '16 at 14:03
  • var projection = new ol.proj.Projection({ code: 'EPSG:32624', units: 'm', axisOrientation: 'neu' }); – Qaisa Mar 31 '16 at 14:19
  • Try giving it an (validity) extent, I believe that is needed. – bartvde Mar 31 '16 at 14:22
  • 1
    I added the validity extent but it was still not working. Then I realized that I wasn't using the latest Openlayers version. My code was pointing at the 3.7 version that comes with Geoserver. I pointed it at the latest version and now it's working. But removing the view from the OverviewMap causes the problem again, so to sum things up the solution was adding the view with the right projection + using the latest Openlayers. Thank you! – Qaisa Mar 31 '16 at 15:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.