[OpenLayers-Users] RE: Automatic smooth zoom
Michael
mdm at yachtpc.com
Sat Jul 9 11:00:31 EDT 2011
Maybe you need a time delay. It may be happening way too fast.
On 7/8/2011 3:50 PM, jhpoosthoek wrote:
> I'm trying to create a function which uses a for loop to incrementally zoom
> in:
>
> function zooming(oldcrds, oldzm, newcrds, newzm)
> {
> j = newzm - oldzm;
> xinc = (newcrds[0] - oldcrds[0]) / j;
> yinc = (newcrds[1] - oldcrds[1]) / j;
> for (i=1;i<=j;i++)
> {
> newx = oldcrds[0] + i * xinc;
> newy = oldcrds[0] + i * yinc;
> map.panTo(new OpenLayers.LonLat(newx, newy));
> map.setCenter(new OpenLayers.LonLat(newx, newy), oldzm + i);
> }
> }
>
> But this doesn't work, the map goes directly to newcrds and newzm. Any idea
> how to get this working? Would love to use the jQuery easing plugin for this
> (and more increments if the layer allows fractionalZoom)
>
> --
> View this message in context: http://osgeo-org.1803224.n2.nabble.com/Automatic-smooth-zoom-tp6563855p6564387.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
More information about the Users
mailing list