[OpenLayers-Users] How to detect map changes

Grégory COLLIN gcollin at v3d.fr
Wed Apr 17 02:47:23 PDT 2013


Le Wed, 17 Apr 2013 05:49:15 +0200,
杨华杰 <yhjhoo at gmail.com> a écrit :

> I want to alert my user if they close the window without save the
> changes.
> 
> 
> Is it possible to detect the changes? And how?
> 
> Welcome any tips
> 
> Regards,
> Hua Jie

Hi Hua,

You can use the javascript event beforeunload to alert your user.
I used mine, like this :

$(window).bind('beforeunload',function(e){}

Regards,

Greg


More information about the Users mailing list