[OpenLayers-Users] OpenLayers.Layer.OSM - Problems with definedresolutions

Arnd Wippermann arnd.wippermann at web.de
Wed Dec 4 10:26:10 PST 2013


Hi Jacob,
 
there shouldn't be any problem:
 
http://gis.ibbeck.de/ginfo/apps/OLExamples/OLdev/OSM_restrictedZoomLevels.as
p
 
The coordinates are as one would expect.
 
Arnd
 

  _____  

Von: Jacob Mendt [mailto:jacobmendt at googlemail.com] 
Gesendet: Mittwoch, 4. Dezember 2013 17:33
An: arnd.wippermann at web.de
Cc: openlayers-users at lists.osgeo.org
Betreff: AW: [OpenLayers-Users] OpenLayers.Layer.OSM - Problems with
definedresolutions



Thanks Arnd, 

 

this fixed my problem with the unexpected new center point when often change
zoom levels. But I still don't understand the coordinate behavior. For a
city called Dresden, I would expected coordinates
1535690.0862089/6633228.960051 (Lon/Lat) for EPSG:900913. But this isn't the
case with this Mapnik setup. I still got -9250546.4411336/13333779.701537
(Lon/Lat) also after fixing the serverResolution property. Does anybody know
what I do or think wrong?


Kind regards, 


Jacob

 

 

Von: Arnd Wippermann [mailto:arnd.wippermann at web.de] 
Gesendet: Freitag, 29. November 2013 19:31
An: 'Jacob Mendt'
Cc: openlayers-users at lists.osgeo.org
Betreff: AW: [OpenLayers-Users] OpenLayers.Layer.OSM - Problems with
definedresolutions

 

Hi,

 

in your serverResolutions array is one entry absent : 4891.9698095703125

 

it should be:

...,9783.939619140625, 4891.9698095703125, 2445.9849047851562,...

 

add the resolution and your problem should be solved.

 

Arnd

  _____  

Von: openlayers-users-bounces at lists.osgeo.org
[mailto:openlayers-users-bounces at lists.osgeo.org] Im Auftrag von Jacob Mendt
Gesendet: Freitag, 29. November 2013 09:19
An:  <mailto:users at openlayers.org> users at openlayers.org
Betreff: [OpenLayers-Users] OpenLayers.Layer.OSM - Problems with
definedresolutions

Hello OpenLayers-Community,

 

at first i wanna thank you guys for the great work you are doing with
OpenLayers. It is a great piece of software and I really enjoy using it.
Right now I am faced with a problem regarding the  OpenLayers.Layer.OSM
object. I want to restrict the possible zoom levels of this layer and of the
map. So far this is possible by using the resolution and serverResolution
properties on the layer level. (I know it is also possible via the "zoomend"
event, but a definition over the possible resolutions looks for me the
cleanest way) But with that solution I run in two different kinds of
problems (both problems can be monitor by deploy the html file which is
attachted to this mail).


The first problem is that I got a strange coordinate behavior. Like you can
see in the attached html file, the lonlat-coordinates
(-9208448.7478114,13344939.50767) center me on the federal state of Saxony /
Germany. Normally I would expected this for the coordinates
(1481769,6634478). So what is OpenLayers doing here?

 

The second strange problem I encountered with the zoom behavior. When I
often zoom in and out, sometimes with the zoom out the map chooses a new
center point.  The new center point normally lies in the neighborhood of the
originally center point, but it is still a new center point. 


Maybe somebody also faced this kind of problem? It is a bug or it is
expected behavior? I am using OpenLayers 2.13.1.


Kind regards,


Jacob

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20131204/62e309fb/attachment.html>


More information about the Users mailing list