[OpenLayers-Users] recalculate model on every pan/zoom

Linda Rawson linda.rawson at gmail.com
Fri Sep 7 20:29:48 EDT 2007


I use


map.events.register('moveend', map, function (e) {
}

To find the coordinates after a mouse movement of either a pan or drag.

Linda


On 9/7/07, Huub Fleuren <huub.fleuren at geodan.nl> wrote:
>
> Hi List,
>
> I found a spot we're i could hook in my custom function just before a
> mapUpdate after pan or zoom operations (also PanZoomBar)
>
> In Map.js from line1057 onwards you read that there are two pan/zoom
> occasions were a map is going to fire al requests again, in other words
> before it goes thru all layers that were added to the map.
> This is the place were you might want to add some layers dynamically,
> that's what we're doing anyway
>
> just call a function there: recalculateLayers(!dragging || zoomChanged)
>
> I was wondering, but couldn't find my way, if there are events that can
> be triggered to do this.
> There is a list of events in Map.js
> why does map.events.register("zoomend") getstriggered (after update)
> why does map.events.register("dragend") nowhere get triggered
>
> I saw that i could addEvents, and trigger them  like
>            if (!dragging) { this.events.triggerEvent("movestart"); }
>
> I added "beforeupdate" to the EVENT_TYPES of Map.js
> triggered it on Map.js line 1057
> implemented the registered event in my application
>
> Did not work
>
> Regards,
> Huub
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20070907/862b6854/attachment.html


More information about the Users mailing list