diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 18c258b723..3bbf8be7f0 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,18 @@ +2010-02-24 Miguel de Dios + + * include/functions_gis.php: in function "printMap" add the posibility to + show the Static_Image base layer (WIP because it'snt show the icons), in + function "getAgentMap" pass the status in the feature. + + * include/javascript/openlayers.pandora.js: in the function "js_printMap" + add the posibility to show the Static_Image base layer (WIP). + + * operation/gis_maps/render_view.php: clean source code for the part of + baselayers and add the code for Static Image baselayer. + + * godmode/setup/gis_step_2.php: clean source code uninitialize vars, add + the preview static image var (WIP because it'snt show the icons). + 2010-02-24 Pablo de la ConcepciĆ³n * godmode/setup/gis_step_2.php: Modified to be able to manage also diff --git a/pandora_console/godmode/setup/gis_step_2.php b/pandora_console/godmode/setup/gis_step_2.php index 8b6029000b..e1239d60eb 100755 --- a/pandora_console/godmode/setup/gis_step_2.php +++ b/pandora_console/godmode/setup/gis_step_2.php @@ -169,6 +169,13 @@ print_table ($table); $optionsConnectionTypeTable = ''; $mapConnectionDataUrl = ''; +$gmap_type = ''; +$bb_left = ''; +$bb_right = ''; +$bb_bottom = ''; +$bb_top = ''; +$image_width = ''; +$image_height = ''; if ($mapConnectionData != null) { switch ($mapConnection_type) { case 'OSM': @@ -380,6 +387,14 @@ function refreshMapView() { objBaseLayers[0]['name'] = $('input[name=name]').val(); objBaseLayers[0]['url'] = $('input[name=url]').val(); + //objBaseLayers[0]['gmap_type = ''; + objBaseLayers[0]['bb_left'] = $('input[name=bb_left]').val(); + objBaseLayers[0]['bb_right'] = $('input[name=bb_right]').val(); + objBaseLayers[0]['bb_bottom'] = $('input[name=bb_bottom]').val(); + objBaseLayers[0]['bb_top'] = $('input[name=bb_top]').val(); + objBaseLayers[0]['image_width'] = $('input[name=image_width]').val(); + objBaseLayers[0]['image_height'] = $('input[name=image_height]').val(); + arrayControls = null; arrayControls = Array('Navigation', 'PanZoom', 'MousePosition'); diff --git a/pandora_console/include/functions_gis.php b/pandora_console/include/functions_gis.php index 689ca5b3f5..3be33ba90b 100644 --- a/pandora_console/include/functions_gis.php +++ b/pandora_console/include/functions_gis.php @@ -88,10 +88,25 @@ function printMap($idDiv, $iniZoom, $numLevelZooms, $latCenter, $lonCenter, $bas switch ($baselayer['typeBaseLayer']) { case 'OSM': ?> - var baseLayer = new OpenLayers.Layer.OSM("", "", {numZoomLevels: }); + var baseLayer = new OpenLayers.Layer.OSM("", + "", {numZoomLevels: }); map.addLayer(baseLayer); + var baseLayer = new OpenLayers.Layer.Image( + "", + "", + new OpenLayers.Bounds(, + , + , + ), + new OpenLayers.Size(, ), + {numZoomLevels: }); + map.addLayer(baseLayer); + @@ -744,6 +759,7 @@ function getAgentMap($agent_id, $heigth, $width, $show_history = false, $centerI makeLayer("layer_for_agent_".$agent_name); $agent_icon = get_agent_icon_map($agent_id, true); + $status = get_agent_status($agent_id); /* If show_history is true, show the path of the agent */ if ($show_history) { @@ -751,7 +767,7 @@ function getAgentMap($agent_id, $heigth, $width, $show_history = false, $centerI addPath("layer_for_agent_".$agent_name,$agent_id); } - addPoint("layer_for_agent_".$agent_name, $agent_name, $agentPositionLatitude, $agentPositionLongitude, $agent_icon, 20, 20, $agent_id, 'point_agent_info'); + addPoint("layer_for_agent_".$agent_name, $agent_name, $agentPositionLatitude, $agentPositionLongitude, $agent_icon, 20, 20, $agent_id, $status, 'point_agent_info'); if ($centerInAgent) { ?> diff --git a/pandora_console/include/javascript/openlayers.pandora.js b/pandora_console/include/javascript/openlayers.pandora.js index 91f83a92c2..c41efd8c07 100755 --- a/pandora_console/include/javascript/openlayers.pandora.js +++ b/pandora_console/include/javascript/openlayers.pandora.js @@ -81,6 +81,20 @@ function js_printMap(id_div, initial_zoom, num_levels_zoom, center_latitude, cen objBaseLayers[baselayerIndex]['url'], {numZoomLevels: num_levels_zoom}); map.addLayer(baseLayer); break; + case 'Static_Image': + console.log(objBaseLayers); + + var baseLayer = new OpenLayers.Layer.Image( + objBaseLayers[baselayerIndex]['name'], + objBaseLayers[baselayerIndex]['url'], + new OpenLayers.Bounds(objBaseLayers[baselayerIndex]['bb_left'], + objBaseLayers[baselayerIndex]['bb_bottom'], + objBaseLayers[baselayerIndex]['bb_right'], + objBaseLayers[baselayerIndex]['bb_top']), + new OpenLayers.Size(objBaseLayers[baselayerIndex]['image_width'], objBaseLayers[baselayerIndex]['image_height']), + {numZoomLevels: num_levels_zoom}); + map.addLayer(baseLayer); + break; } } } diff --git a/pandora_console/operation/gis_maps/render_view.php b/pandora_console/operation/gis_maps/render_view.php index a902137301..b9dfbe9425 100644 --- a/pandora_console/operation/gis_maps/render_view.php +++ b/pandora_console/operation/gis_maps/render_view.php @@ -35,6 +35,21 @@ if ($confMap !== false) { $baselayers[$num_baselayer]['typeBaseLayer'] = $mapC['connection_type']; $baselayers[$num_baselayer]['name'] = $mapC['conection_name']; $decodeJSON = json_decode($mapC['conection_data'], true); + + switch ($mapC['connection_type']) { + case 'OSM': + $baselayers[$num_baselayer]['url'] = $decodeJSON['url']; + break; + case 'Static_Image': + $baselayers[$num_baselayer]['url'] = $decodeJSON['url']; + $baselayers[$num_baselayer]['bb_left'] = $decodeJSON['bb_left']; + $baselayers[$num_baselayer]['bb_right'] = $decodeJSON['bb_right']; + $baselayers[$num_baselayer]['bb_bottom'] = $decodeJSON['bb_bottom']; + $baselayers[$num_baselayer]['bb_top'] = $decodeJSON['bb_top']; + $baselayers[$num_baselayer]['image_width'] = $decodeJSON['image_width']; + $baselayers[$num_baselayer]['image_height'] = $decodeJSON['image_height']; + break; + } $baselayers[$num_baselayer]['url'] = $decodeJSON['url']; $num_baselayer++; if ($mapC['default_map_connection'] == 1) {