diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index b3a8c1c0bc..18c258b723 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2010-02-24 Pablo de la Concepción + + * godmode/setup/gis_step_2.php: Modified to be able to manage also + Goolge Maps (TODO:preview and KEY management) and Static Images (TODO: + preview). + 2010-02-24 Miguel de Dios * include/functions_gis.php: fix the refresh time in function @@ -20,8 +26,8 @@ 2010-02-24 Pablo de la Concepción - * operation/gis_maps/render_view.php: Changed PanZoom - to PanZoomBar in the map. + * operation/gis_maps/render_view.php: Changed PanZoom to PanZoomBar in + the map. 2010-02-23 Miguel de Dios diff --git a/pandora_console/godmode/setup/gis_step_2.php b/pandora_console/godmode/setup/gis_step_2.php index 640f1db65c..8b6029000b 100755 --- a/pandora_console/godmode/setup/gis_step_2.php +++ b/pandora_console/godmode/setup/gis_step_2.php @@ -97,10 +97,28 @@ switch ($action) { $mapConnectionData = array('type' => 'OSM', 'url' => $mapConnection_OSM_url); break; - case 'YAHOO': - $mapConnection_YAHOO_url= get_parameter('url'); - $mapConnectionData = array('type' => 'YAHOO', - 'url' => $mapConnection_YAHOO_url); + case 'Gmap': + $mapConnection_Gmap_url= get_parameter('url'); + $gmap_type= get_parameter('gmap_type'); + $mapConnectionData = array('type' => 'Gmap', 'gmap_type' => $gmap_type); + break; + case 'Static_Image': + $mapConnection_Image_url= get_parameter('url'); + $bb_left= get_parameter('bb_left'); + $bb_right= get_parameter('bb_right'); + $bb_bottom= get_parameter('bb_bottom'); + $bb_top= get_parameter('bb_top'); + $image_height= get_parameter('image_height'); + $image_width= get_parameter('image_width'); + $mapConnectionData = array('type' => 'Static_Image', + 'url' => $mapConnection_Image_url, + 'bb_left' => $bb_left, + 'bb_right' => $bb_right, + 'bb_top' => $bb_top, + 'bb_bottom' => $bb_bottom, + 'image_width' => $image_width, + 'image_height' => $image_height + ); break; } @@ -141,7 +159,8 @@ $table->width = '60%'; $table->data = array(); $types[0] = __('Please select the connection type'); $types["OSM"] = __('Open Street Maps'); -$types["YAHOO"] = __('Yahoo Maps'); +$types["Gmap"] = __('Google Maps'); +$types["Static_Image"] = __('Static Image'); $table->data[0][0] = __('Type') . ":"; $table->data[0][1] = print_select($types, 'sel_type', $mapConnection_type, "selMapConnectionType();", '', 0, true); @@ -150,30 +169,73 @@ print_table ($table); $optionsConnectionTypeTable = ''; $mapConnectionDataUrl = ''; - if ($mapConnectionData != null) { switch ($mapConnection_type) { case 'OSM': $mapConnectionDataUrl = $mapConnectionData['url']; break; - case 'YAHOO': + case 'Gmap': + $gmap_type = $mapConnectionData['gmap_type']; + break; + case 'Static_Image': $mapConnectionDataUrl = $mapConnectionData['url']; + $bb_left= $mapConnectionData['bb_left']; + $bb_right= $mapConnectionData['bb_right']; + $bb_bottom= $mapConnectionData['bb_bottom']; + $bb_top= $mapConnectionData['bb_top']; + $image_width= $mapConnectionData['image_width']; + $image_height= $mapConnectionData['image_height']; break; } } // Open Street Map Connection $optionsConnectionOSMTable = '' . '' . - '' . + '' . '' . '' . '
' . __("URL") . ':' . __("Tile Server URL") . ':' . print_input_text ('url', $mapConnectionDataUrl, '', 45, 90, true) . '
'; -// Yahoo Map Connection -$optionsConnectionYAHOOTable = '' . +// Google Maps Connection +$gmaps_types["G_PHYSICAL_MAP"] = __('Goolge Physical'); +$gmaps_types["G_HYBRID_MAP"] = __('Goolge Hybrid'); +$gmaps_types["G_SATELITE_MAP"] = __('Goolge Satelite'); +// TODO: Add imput field for the key +$optionsConnectionGmapTable = '
' . '' . - '' . - '' . + '' . + '' . + '' . + '
' . __("URL") . ':' . print_input_text ('url', $mapConnectionDataUrl, '', 45, 90, true) . '' . __("Google Map Type") . ':'.trim(print_select($gmaps_types,'gmap_type', $gmap_type, "", '', 0, true)) . '
'; +// Image Map Connection +$optionsConnectionImageTable = '' . + '' . + '' . + '' . + '' . + '' . + '' . + '' . + '' . + '' . + '' . + '' . + '' . + '' . + '' . + '' . + '' . + '' . + '' . + '' . + '' . + '' . + '' . + '' . + '' . + '' . + '' . + '' . '' . '
' . __("Image URL") . ':' . print_input_text ('url', $mapConnectionDataUrl, '', 45, 90, true) . '
' . __("Corners of the area of the image") . ':
' . __("Left") . ':'. print_input_text ('bb_left', $bb_left, '', 25, 25, true) . '' . __("Bottom") . ':'. print_input_text ('bb_bottom', $bb_bottom, '',25 , 25, true) . '
' . __("Right") . ':'. print_input_text ('bb_right', $bb_right, '', 25, 25, true) . '' . __("Top") . ':'. print_input_text ('bb_top', $bb_top, '', 25, 25, true) . '
' . __("Image Size") . ':
' . __("Width") . ':'. print_input_text ('image_width', $image_width, '', 25, 25, true) . '' . __("Height") . ':'. print_input_text ('image_height', $image_height, '', 25, 25, true) . '
'; if ($mapConnectionData != null) { @@ -181,8 +243,11 @@ if ($mapConnectionData != null) { case 'OSM': $optionsConnectionTypeTable = $optionsConnectionOSMTable; break; - case 'YAHOO': - $optionsConnectionTypeTable = $optionsConnectionYAHOOTable; + case 'Gmap': + $optionsConnectionTypeTable = $optionsConnectionGmapTable; + break; + case 'Static_Image': + $optionsConnectionTypeTable = $optionsConnectionImageTable; break; } } @@ -264,7 +329,7 @@ function changePoints(e) { center_longitude = $('input[name=center_longitude]').val(lonlat.lon); if (centerPoint == null) { - centerPoint = js_addPointExtent('temp_layer', '', lonlat.lon, lonlat.lat, 'images/dot_green.png', 20, 20, 'center', ''); + centerPoint = js_addPointExtent('temp_layer', '', lonlat.lon, lonlat.lat, 'images/dot_green.png', 11, 11, 'center', ''); } else { //return to no-standar the proyection for to move @@ -278,7 +343,7 @@ function changePoints(e) { center_longitude = $('input[name=default_longitude]').val(lonlat.lon); if (GISDefaultPositionPoint == null) { - GISDefaultPositionPoint = js_addPointExtent('temp_layer', '', lonlat.lon, lonlat.lat, 'images/dot_red.png', 20, 20, 'default', ''); + GISDefaultPositionPoint = js_addPointExtent('temp_layer', '', lonlat.lon, lonlat.lat, 'images/dot_red.png', 11, 11, 'default', ''); } else { //return to no-standar the proyection for to move @@ -322,8 +387,8 @@ function refreshMapView() { layer = js_makeLayer('temp_layer', true, null); - centerPoint = js_addPointExtent('temp_layer', '', $('input[name=center_longitude]').val(), $('input[name=center_latitude]').val(), 'images/dot_green.png', 20, 20, 'center', ''); - GISDefaultPositionPoint = js_addPointExtent('temp_layer', '', $('input[name=default_longitude]').val(), $('input[name=default_latitude]').val(), 'images/dot_red.png', 20, 20, 'default', ''); + centerPoint = js_addPointExtent('temp_layer', '', $('input[name=center_longitude]').val(), $('input[name=center_latitude]').val(), 'images/dot_green.png', 11, 11, 'center', ''); + GISDefaultPositionPoint = js_addPointExtent('temp_layer', '', $('input[name=default_longitude]').val(), $('input[name=default_latitude]').val(), 'images/dot_red.png', 11, 11, 'default', ''); js_activateEvents(changePoints); } @@ -332,16 +397,28 @@ function refreshMapView() { * Dinamic write the fields in form when select a type of connection. */ function selMapConnectionType() { + $('#form_map_connection_type').fadeOut("normal"); switch ($('#sel_type :selected').val()) { case 'OSM': - $('#form_map_connection_type').html(''); + $('#form_map_connection_type').html('').hide(); + break; + case 'Gmap': + /* + var script = document.createElement("script"); + script.type = "text/javascript"; + script.src = 'http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ'; + script.src = 'http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhT2yXp_ZAY8_ufC3CFXhHIE1NvwkxTS6gjckBmeABOGXIUiOiZObZESPg'; + document.body.appendChild(script); + */ + $('#form_map_connection_type').html('').hide(); + break; + case 'Static_Image': + $('#form_map_connection_type').html('').hide(); break; - case 'YAHOO': - $('#form_map_connection_type').html(''); - default: - $('#form_map_connection_type').html(''); + $('#form_map_connection_type').html('').hide(); break; } + $('#form_map_connection_type').fadeIn("normal"); }