From 43f52ba036a6ff483f133a934c132ad3a8a8a51c Mon Sep 17 00:00:00 2001 From: pabloconcepcion Date: Wed, 27 Jan 2010 19:52:53 +0000 Subject: [PATCH] =?UTF-8?q?2010-01-27=20=20Pablo=20de=20la=20Concepci?= =?UTF-8?q?=C3=B3n=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * include/functions_gis.php: Modiffied addPoint and addPointExtent to receive more parmeters so it's possible to use any kind of point. Modified comments on saveMap2 * operation/gis_maps/render_view.php: Used map_id instead if id when the parameter passed in the url is a map id. Fixed to work with the new function getMapConf. Improved "pure" view. Still some things are hardcoded and needs improvement * operation/gis_maps/ajax.php: Modified to suppor calls to get info of different kind of points. Removed hardcoded data. * operation/gis_maps/index.php: Used map_id instead if id when the parameter passed in the url is a map id. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2315 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 17 ++++++ pandora_console/include/functions_gis.php | 58 +++++++++---------- pandora_console/operation/gis_maps/ajax.php | 56 +++++++++++++++--- pandora_console/operation/gis_maps/index.php | 2 +- .../operation/gis_maps/render_view.php | 42 ++++++++++---- 5 files changed, 124 insertions(+), 51 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 582d9ab07a..a60999a1ff 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,20 @@ +2010-01-27 Pablo de la ConcepciĆ³n + + * include/functions_gis.php: Modiffied addPoint and addPointExtent to + receive more parmeters so it's possible to use any kind of point. + Modified comments on saveMap2 + + * operation/gis_maps/render_view.php: Used map_id instead if id when + the parameter passed in the url is a map id. + Fixed to work with the new function getMapConf. + Improved "pure" view. Still some things are hardcoded and needs improvement + + * operation/gis_maps/ajax.php: Modified to suppor calls to get info of + different kind of points. Removed hardcoded data. + + * operation/gis_maps/index.php: Used map_id instead if id when + the parameter passed in the url is a map id. + 2010-01-27 Miguel de Dios * include/functions_gis.php: fix a typing "print_r" in function "getMapConf" diff --git a/pandora_console/include/functions_gis.php b/pandora_console/include/functions_gis.php index e9f097c1d9..4b92e00316 100644 --- a/pandora_console/include/functions_gis.php +++ b/pandora_console/include/functions_gis.php @@ -95,23 +95,23 @@ function printMap($idDiv, $iniZoom, $numLevelZooms, $latCenter, $lonCenter, $bas layer[0].setVisibility(action); } - function addPoint(layerName, pointName, lon, lat) { + function addPoint(layerName, pointName, lon, lat, id, type_string) { var point = new OpenLayers.Geometry.Point(lon, lat) .transform(map.displayProjection, map.getProjectionObject()); var layer = map.getLayersByName(layerName); layer = layer[0]; - layer.addFeatures(new OpenLayers.Feature.Vector(point,{nombre: pointName, estado: "ok"})); + layer.addFeatures(new OpenLayers.Feature.Vector(point,{nombre: pointName, estado: "ok", id: id, type: type_string, long_lat: new OpenLayers.LonLat(lon, lat).transform(map.displayProjection, map.getProjectionObject()) })); } - function addPointExtent(layerName, pointName, lon, lat, icon, width, height) { + function addPointExtent(layerName, pointName, lon, lat, icon, width, height, id, type_string) { var point = new OpenLayers.Geometry.Point(lon, lat) .transform(map.displayProjection, map.getProjectionObject()); var layer = map.getLayersByName(layerName); layer = layer[0]; - layer.addFeatures(new OpenLayers.Feature.Vector(point,{estado: "ok"}, {fontWeight: "bolder", fontColor: "#00014F", labelYOffset: -height, graphicHeight: width, graphicWidth: height, externalGraphic: icon, label: pointName})); + layer.addFeatures(new OpenLayers.Feature.Vector(point,{estado: "ok", id: id, type: type_string, long_lat: new OpenLayers.LonLat(lon, lat).transform(map.displayProjection, map.getProjectionObject()) }, {fontWeight: "bolder", fontColor: "#00014F", labelYOffset: -height, graphicHeight: width, graphicWidth: height, externalGraphic: icon, label: pointName})); } function addPointPath(layerName, lon, lat, color, manual, id) { @@ -126,14 +126,14 @@ function printMap($idDiv, $iniZoom, $numLevelZooms, $latCenter, $lonCenter, $bas var pointRadiusManual = pointRadiusNormal - (strokeWidth / 2); if (manual) { - point = new OpenLayers.Feature.Vector(point,{estado: "ok", id: id, - lanlot: new OpenLayers.LonLat(lon, lat).transform(map.displayProjection, map.getProjectionObject())}, + point = new OpenLayers.Feature.Vector(point,{estado: "ok", id: id, type: "point_path_info", + long_lat: new OpenLayers.LonLat(lon, lat).transform(map.displayProjection, map.getProjectionObject())}, {fillColor: "#ffffff", pointRadius: pointRadiusManual, stroke: 1, strokeColor: color, strokeWidth: strokeWidth, cursor: "pointer"} ); } else { - point = new OpenLayers.Feature.Vector(point,{estado: "ok", id: id, - lanlot: new OpenLayers.LonLat(lon, lat).transform(map.displayProjection, map.getProjectionObject())}, + point = new OpenLayers.Feature.Vector(point,{estado: "ok", id: id, type: "point_path_info", + long_lat: new OpenLayers.LonLat(lon, lat).transform(map.displayProjection, map.getProjectionObject())}, {fillColor: color, pointRadius: pointRadiusNormal, cursor: "pointer"} ); } @@ -195,15 +195,14 @@ function makeLayer($name, $visible = true, $dot = null) { static $i = 0; layer.events.on({ "featureselected": function(e) { if (e.feature.geometry.CLASS_NAME == "OpenLayers.Geometry.Point") { - var feature = e.feature; var featureData = feature.data; - var lanlot = featureData.lanlot; + var long_lat = featureData.long_lat; var popup; popup = new OpenLayers.Popup.FramedCloud('cloud00', - lanlot, + long_lat, null, '
', null, @@ -213,7 +212,8 @@ function makeLayer($name, $visible = true, $dot = null) { static $i = 0; map.addPopup(popup); jQuery.ajax ({ - data: "page=operation/gis_maps/ajax&opt=point_info&id=" + featureData.id, + data: "page=operation/gis_maps/ajax&opt="+featureData.type+"&id=" + featureData.id, + //data: "page=operation/gis_maps/ajax&opt=point_path_info&id=" + featureData.id, type: "GET", dataType: 'json', url: "ajax.php", @@ -251,7 +251,7 @@ function activateSelectControl($layers=null) {