[OpenLayers-Users] How to detect map changes

Grégory COLLIN gcollin at v3d.fr
Mon Apr 22 00:06:56 PDT 2013


This function will be called whenever the user is trying to exit your
page.
But it's your job to accept or not to agreed his demand.
So for your change, you should flag a var if changes have not been
saved, and if it's true, then display a popup to ask what user wants to
do.

check this link : http://help.dottoro.com/ljhtbtum.php

Hope it'll help.

Regards,

Gregory collin.

 Le Sun, 21 Apr 2013 06:40:22 +0200, 杨华杰 <yhjhoo at gmail.com> a
écrit :

> I think if I use this method, it will still alert the user even there
> are no changes made by the user.
> 
> 
> Regards,
> Hua Jie
> 
> 
> On Wed, Apr 17, 2013 at 5:47 PM, Grégory COLLIN
> <gcollin at v3d.fr<mailto:gcollin at v3d.fr>> wrote: Le Wed, 17 Apr 2013
> 05:49:15 +0200, 杨华杰 <yhjhoo at gmail.com<mailto: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
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org<mailto:Users at lists.osgeo.org>
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
> 



More information about the Users mailing list