Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm using GeoExt with OpenLayers and trying to save the extent of the map. while exploring the page, users can be able to save the extent and restore via their browsers.

Here is the point that I'm stuck:

how can I catch mousewheel's actions to save the extent of the map and keep it in cookies?

any ideas?

share|improve this question
    
Which question(s) are you asking: how to capture map extent change events, or how to use cookies? There should be plenty of examples and info online for both. –  Anthony -GISCOE- Dec 19 '11 at 13:45
    
Actually examples about cookies, yes there are plenty of them. But I don't know how to catch the extent after the mousewheel rolls. –  vestanbul Dec 19 '11 at 14:39
add comment

1 Answer

I've found a solution for my problem.

thanks to Alexandre Dubê :

map.events.on({"moveend": function(e) { 
     alert("map moveend"); 
}, "zoomend": function(e) { 
     alert("map zoomend"); 
}, scope: map}); 

So whenever the zoom or extend of my map changes, I will be able to save the extend information...

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.