On 12/01/2010 06:08, i-boy wrote:
> Hi all !
>
> When I use Add POI tool, it remains until I start a new session (close the
> brower), so I try to clear POIs data when still remain in the current
> session.
>
> I had changed in pm.map.js (and the compress file pm_cjs.js too)
>
>
> reloadMap: function(remove) {
> ...
> PM.extentSelectedFeatures = null;
> // new line
> unset($_SESSION['url_points']);
> ...
>
> but it returned an error.
'reloadMap' is a JavaScript function,
the call
unset($_SESSION['url_points']);
is PHP code... mixing both will not work... ;-)
try using
PM.setSessionVar('url_points', 'null');
I'd recommend that you do not change this in the Javascript files
directly but that you add it in a *.js file under your config directory,
like
$.extend(PM.Map,
{
/**
* Reload application
*/
reloadMap: function(remove) {
var mapurl = PM_XAJAX_LOCATION +
'x_load.php?'+SID+'&zoom_type=zoompoint';
if (remove) {
mapurl += '&resultlayer=remove';
PM.extentSelectedFeatures = null;
PM.setSessionVar('url_points', 'null');
}
this.updateMap(mapurl);
}
});
In order for this to work correctly you will also need to replace the
file 'incphp/xajax/x_setsessionvar.php' with the one from SVN trunk:
http://svn.pmapper.net/trac/browser/pmapper/trunk/pmapper/incphp/xajax/x_setsessionvar.php?format=raw
armin
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
pmapper-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pmapper-users