sg

Pazartesi, Aralık 05, 2005

Re: Limiting Zoom Level


The simplest way is to install a zoom event handler.

Off the top of my head, something like

GEvent.addListener(map,'zoom',function (fromZoom,toZoom) {
if (toZoom > 5) {
map.setZoomLevel(5); // clip zoom level to 5
}
});

Add this code just after the map.centerAndZoom() or whatever that you
use to set the initial view.

Be aware that limiting the zoom level makes it very difficult to
position the view to another part of the earth.

Do you really need to do this? The user will notice quite quickly that
there is no information (markers?) outside a localized area, but if
they want to simply browse the globe, they can.

For myself, I'd react to a zoom ceiling like I would to a straight
jacket - very badly.

0 Comments:

Yorum Gönder

<< Home


Komik Videolar   islam  şarkı sözleri  yemek tarifleri  gelibolu  huzur   sağlık