File "selectionManagement.js"

Full path: /www/map/mapserver-extensions/pmapper-4.2.0/plugins/selectionManagement/selectionManagement.js
File size: 2.45 KiB (2508 bytes)
MIME-type: text/plain
Charset: utf-8

Download   Open   Back

/******************************************************************************
 *
 * Purpose: selectionManagement
 * Author:  Vincent Mathis, SIRAP
 *
 ******************************************************************************
 *
 * Copyright (c) 2009 SIRAP
 *
 * This is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version. See the COPYING file.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with p.mapper; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 ******************************************************************************/

$.extend(PM.Plugin, 
{
	selectionManagement: 
	{
		/**
		 * remove selection
		 */
		delSelection: function() {
			var urlreq = PM_PLUGIN_LOCATION + "/selectionManagement/x_selectionManagement.phtml";
			var params = SID;
			params += "&operation=remove_select";

			$.ajax({
				url: urlreq,
				dataType: "json",
				type: "POST",
				data: params,
				success: function(response) {
					PM.Map.clearInfo();
				},	
				error: function(response) {
					alert("Echec de la suppression");
				}
			});
			
			// hide selection 
			if ($('#pmQueryContainer').length > 0) {
	            $('#pmQueryContainer .jqmClose').click();
	        }
		},
		
		/**
		 * reload selection
		 */
		reloadSelection: function() {
			var urlreq = PM_PLUGIN_LOCATION + "/selectionManagement/x_selectionManagement.phtml";
			var params = SID;
			params += "&operation=reload_select";

			$.ajax({
				url: urlreq,
				dataType: "json",
				type: "POST",
				data: params,
				success: function(response) {
					// select the objects
					PM.Query.writeQResult(response.queryResult, "dynwin");
				},		
				error: function(response) {
					alert(_p("selectionManagement_reloadError"));
				}
			});
		},
		
		/**
		 * Reload application
		 */
		reloadMap: function(remove) {
			var mapurl = PM_XAJAX_LOCATION + 'x_load.phtml?'+SID+'&zoom_type=zoompoint';
			if (remove) {
				PM.extentSelectedFeatures = null;
			}
			PM.Map.updateMap(mapurl);
		}
	}
});

PHP File Manager