2010-02-24 Pablo de la Concepción <pablo.concepcion@artica.es>

* 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).



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2413 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
Pablo de la Concepción Sanz 2010-02-24 12:01:23 +00:00
parent 7db3cb7f1c
commit bc1d03f1e7
2 changed files with 108 additions and 25 deletions

View File

@ -1,3 +1,9 @@
2010-02-24 Pablo de la Concepción <pablo.concepcion@artica.es>
* 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 <miguel.dedios@artica.es> 2010-02-24 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_gis.php: fix the refresh time in function * include/functions_gis.php: fix the refresh time in function
@ -20,8 +26,8 @@
2010-02-24 Pablo de la Concepción <pablo.concepcion@artica.es> 2010-02-24 Pablo de la Concepción <pablo.concepcion@artica.es>
* operation/gis_maps/render_view.php: Changed PanZoom * operation/gis_maps/render_view.php: Changed PanZoom to PanZoomBar in
to PanZoomBar in the map. the map.
2010-02-23 Miguel de Dios <miguel.dedios@artica.es> 2010-02-23 Miguel de Dios <miguel.dedios@artica.es>

View File

@ -97,10 +97,28 @@ switch ($action) {
$mapConnectionData = array('type' => 'OSM', $mapConnectionData = array('type' => 'OSM',
'url' => $mapConnection_OSM_url); 'url' => $mapConnection_OSM_url);
break; break;
case 'YAHOO': case 'Gmap':
$mapConnection_YAHOO_url= get_parameter('url'); $mapConnection_Gmap_url= get_parameter('url');
$mapConnectionData = array('type' => 'YAHOO', $gmap_type= get_parameter('gmap_type');
'url' => $mapConnection_YAHOO_url); $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; break;
} }
@ -141,7 +159,8 @@ $table->width = '60%';
$table->data = array(); $table->data = array();
$types[0] = __('Please select the connection type'); $types[0] = __('Please select the connection type');
$types["OSM"] = __('Open Street Maps'); $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][0] = __('Type') . ":";
$table->data[0][1] = print_select($types, 'sel_type', $mapConnection_type, "selMapConnectionType();", '', 0, true); $table->data[0][1] = print_select($types, 'sel_type', $mapConnection_type, "selMapConnectionType();", '', 0, true);
@ -150,30 +169,73 @@ print_table ($table);
$optionsConnectionTypeTable = ''; $optionsConnectionTypeTable = '';
$mapConnectionDataUrl = ''; $mapConnectionDataUrl = '';
if ($mapConnectionData != null) { if ($mapConnectionData != null) {
switch ($mapConnection_type) { switch ($mapConnection_type) {
case 'OSM': case 'OSM':
$mapConnectionDataUrl = $mapConnectionData['url']; $mapConnectionDataUrl = $mapConnectionData['url'];
break; break;
case 'YAHOO': case 'Gmap':
$gmap_type = $mapConnectionData['gmap_type'];
break;
case 'Static_Image':
$mapConnectionDataUrl = $mapConnectionData['url']; $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; break;
} }
} }
// Open Street Map Connection // Open Street Map Connection
$optionsConnectionOSMTable = '<table class="databox" border="0" cellpadding="4" cellspacing="4" width="50%">' . $optionsConnectionOSMTable = '<table class="databox" border="0" cellpadding="4" cellspacing="4" width="50%">' .
'<tr class="row_0">' . '<tr class="row_0">' .
'<td>' . __("URL") . ':</td>' . '<td>' . __("Tile Server URL") . ':</td>' .
'<td><input id="type" type="hidden" name="type" value="OSM" />' . print_input_text ('url', $mapConnectionDataUrl, '', 45, 90, true) . '</td>' . '<td><input id="type" type="hidden" name="type" value="OSM" />' . print_input_text ('url', $mapConnectionDataUrl, '', 45, 90, true) . '</td>' .
'</tr>' . '</tr>' .
'</table>'; '</table>';
// Yahoo Map Connection // Google Maps Connection
$optionsConnectionYAHOOTable = '<table class="databox" border="0" cellpadding="4" cellspacing="4" width="50%">' . $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 = '<table class="databox" border="0" cellpadding="4" cellspacing="4" width="50%">' .
'<tr class="row_0">' . '<tr class="row_0">' .
'<td>' . __("URL") . ':</td>' . '<td>' . __("Google Map Type") . ':</td>' .
'<td><input id="type" type="hidden" name="type" value="YAHOO" />' . print_input_text ('url', $mapConnectionDataUrl, '', 45, 90, true) . '</td>' . '<td><input id="type" type="hidden" name="type" value="Gmap" />'.trim(print_select($gmaps_types,'gmap_type', $gmap_type, "", '', 0, true)) . '</td>' .
'</tr>' .
'</table>';
// Image Map Connection
$optionsConnectionImageTable = '<table class="databox" border="0" cellpadding="4" cellspacing="4" width="50%">' .
'<tr class="row_0">' .
'<td>' . __("Image URL") . ':</td>' .
'<td colspan="3"><input id="type" type="hidden" name="type" value="Static_Image" />' . print_input_text ('url', $mapConnectionDataUrl, '', 45, 90, true) . '</td>' .
'</tr>' .
'<tr class="row_1">' .
'<td colspan="4"><strong>' . __("Corners of the area of the image") . ':</strong></td>' .
'</tr>' .
'<tr class="row_2">' .
'<td>' . __("Left") . ':</td>' .
'<td>'. print_input_text ('bb_left', $bb_left, '', 25, 25, true) . '</td>' .
'<td>' . __("Bottom") . ':</td>' .
'<td>'. print_input_text ('bb_bottom', $bb_bottom, '',25 , 25, true) . '</td>' .
'</tr>' .
'<tr class="row_3">' .
'<td>' . __("Right") . ':</td>' .
'<td>'. print_input_text ('bb_right', $bb_right, '', 25, 25, true) . '</td>' .
'<td>' . __("Top") . ':</td>' .
'<td>'. print_input_text ('bb_top', $bb_top, '', 25, 25, true) . '</td>' .
'</tr>' .
'<tr class="row_4">' .
'<td colspan="4"><strong>' . __("Image Size") . ':</strong></td>' .
'</tr>' .
'<tr class="row_5">' .
'<td>' . __("Width") . ':</td>' .
'<td>'. print_input_text ('image_width', $image_width, '', 25, 25, true) . '</td>' .
'<td>' . __("Height") . ':</td>' .
'<td>'. print_input_text ('image_height', $image_height, '', 25, 25, true) . '</td>' .
'</tr>' . '</tr>' .
'</table>'; '</table>';
if ($mapConnectionData != null) { if ($mapConnectionData != null) {
@ -181,8 +243,11 @@ if ($mapConnectionData != null) {
case 'OSM': case 'OSM':
$optionsConnectionTypeTable = $optionsConnectionOSMTable; $optionsConnectionTypeTable = $optionsConnectionOSMTable;
break; break;
case 'YAHOO': case 'Gmap':
$optionsConnectionTypeTable = $optionsConnectionYAHOOTable; $optionsConnectionTypeTable = $optionsConnectionGmapTable;
break;
case 'Static_Image':
$optionsConnectionTypeTable = $optionsConnectionImageTable;
break; break;
} }
} }
@ -264,7 +329,7 @@ function changePoints(e) {
center_longitude = $('input[name=center_longitude]').val(lonlat.lon); center_longitude = $('input[name=center_longitude]').val(lonlat.lon);
if (centerPoint == null) { if (centerPoint == null) {
centerPoint = js_addPointExtent('temp_layer', '<?php echo __('Center'); ?>', lonlat.lon, lonlat.lat, 'images/dot_green.png', 20, 20, 'center', ''); centerPoint = js_addPointExtent('temp_layer', '<?php echo __('Center'); ?>', lonlat.lon, lonlat.lat, 'images/dot_green.png', 11, 11, 'center', '');
} }
else { else {
//return to no-standar the proyection for to move //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); center_longitude = $('input[name=default_longitude]').val(lonlat.lon);
if (GISDefaultPositionPoint == null) { if (GISDefaultPositionPoint == null) {
GISDefaultPositionPoint = js_addPointExtent('temp_layer', '<?php echo __('Default'); ?>', lonlat.lon, lonlat.lat, 'images/dot_red.png', 20, 20, 'default', ''); GISDefaultPositionPoint = js_addPointExtent('temp_layer', '<?php echo __('Default'); ?>', lonlat.lon, lonlat.lat, 'images/dot_red.png', 11, 11, 'default', '');
} }
else { else {
//return to no-standar the proyection for to move //return to no-standar the proyection for to move
@ -322,8 +387,8 @@ function refreshMapView() {
layer = js_makeLayer('temp_layer', true, null); layer = js_makeLayer('temp_layer', true, null);
centerPoint = js_addPointExtent('temp_layer', '<?php echo __('Center'); ?>', $('input[name=center_longitude]').val(), $('input[name=center_latitude]').val(), 'images/dot_green.png', 20, 20, 'center', ''); centerPoint = js_addPointExtent('temp_layer', '<?php echo __('Center'); ?>', $('input[name=center_longitude]').val(), $('input[name=center_latitude]').val(), 'images/dot_green.png', 11, 11, 'center', '');
GISDefaultPositionPoint = js_addPointExtent('temp_layer', '<?php echo __('Default'); ?>', $('input[name=default_longitude]').val(), $('input[name=default_latitude]').val(), 'images/dot_red.png', 20, 20, 'default', ''); GISDefaultPositionPoint = js_addPointExtent('temp_layer', '<?php echo __('Default'); ?>', $('input[name=default_longitude]').val(), $('input[name=default_latitude]').val(), 'images/dot_red.png', 11, 11, 'default', '');
js_activateEvents(changePoints); js_activateEvents(changePoints);
} }
@ -332,16 +397,28 @@ function refreshMapView() {
* Dinamic write the fields in form when select a type of connection. * Dinamic write the fields in form when select a type of connection.
*/ */
function selMapConnectionType() { function selMapConnectionType() {
$('#form_map_connection_type').fadeOut("normal");
switch ($('#sel_type :selected').val()) { switch ($('#sel_type :selected').val()) {
case 'OSM': case 'OSM':
$('#form_map_connection_type').html('<?php echo $optionsConnectionOSMTable; ?>'); $('#form_map_connection_type').html('<?php echo $optionsConnectionOSMTable; ?>').hide();
break;
case 'Gmap':
/*
var script = document.createElement("script");
script.type = "text/javascript";
script.src = 'http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ';
script.src = 'http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhT2yXp_ZAY8_ufC3CFXhHIE1NvwkxTS6gjckBmeABOGXIUiOiZObZESPg';
document.body.appendChild(script);
*/
$('#form_map_connection_type').html('<?php echo $optionsConnectionGmapTable; ?>').hide();
break;
case 'Static_Image':
$('#form_map_connection_type').html('<?php echo $optionsConnectionImageTable; ?>').hide();
break; break;
case 'YAHOO':
$('#form_map_connection_type').html('<?php echo $optionsConnectionYAHOOTable; ?>');
default: default:
$('#form_map_connection_type').html(''); $('#form_map_connection_type').html('').hide();
break; break;
} }
$('#form_map_connection_type').fadeIn("normal");
} }
</script> </script>