Sunday 25 October 2015

openlayers 2 - Unable to see whole world map by decreasing panzoom bar?


I am seeing one weird thing in Openlayers today. I am unable to see whole map by using panzoombar, previously i used to.




OpenLayers Example









this is the code, panzoombar is showing all the levels, but it stopped at last above two levels and not coming down.



Answer



i think this is all about div size. openlayers automatically makes its minimum zoom level to fit it to whole world map... and this does not seem as a problem.



it makes people that "you can see the whole world at this zoom level and i dont want you to see blank images with decreasing the level of zoom."


when width and height is 100% or 600px,400px:


it makes automatically min zoom level to : 3


openlayers


when width: 200px and height: 400px :


it makes automatically min zoom level to : 1


enter image description here


you can test it with changing the div width and height...


i hope it helps you...


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...