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

Huub Fleuren huub.fleuren at geodan.nl
Fri Sep 7 20:07:03 EDT 2007


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



More information about the Users mailing list