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

* godmode/setup/gis_step_2.php: Modified to get the KEY to load the Google
    Maps Javascript for the used domain. Now it stores the key, but still it
    doesn't load dinamicaly the javascript to show the preview.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2417 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
pabloconcepcion 2010-02-25 11:30:56 +00:00
parent 8594947426
commit 384270a4dd
2 changed files with 24 additions and 6 deletions

View File

@ -1,3 +1,9 @@
2010-02-25 Pablo de la Concepción <pablo.concepcion@artica.es>
* godmode/setup/gis_step_2.php: Modified to get the KEY to load the Google
Maps Javascript for the used domain. Now it stores the key, but still it
doesn't load dinamicaly the javascript to show the 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 map to show correct position the agent * include/functions_gis.php: fix map to show correct position the agent

View File

@ -100,7 +100,10 @@ switch ($action) {
case 'Gmap': case 'Gmap':
$mapConnection_Gmap_url= get_parameter('url'); $mapConnection_Gmap_url= get_parameter('url');
$gmap_type= get_parameter('gmap_type'); $gmap_type= get_parameter('gmap_type');
$mapConnectionData = array('type' => 'Gmap', 'gmap_type' => $gmap_type); $gmap_key= get_parameter('gmap_key');
$mapConnectionData = array('type' => 'Gmap',
'gmap_type' => $gmap_type,
'gmap_key' => $gmap_key);
break; break;
case 'Static_Image': case 'Static_Image':
$mapConnection_Image_url= get_parameter('url'); $mapConnection_Image_url= get_parameter('url');
@ -183,6 +186,7 @@ if ($mapConnectionData != null) {
break; break;
case 'Gmap': case 'Gmap':
$gmap_type = $mapConnectionData['gmap_type']; $gmap_type = $mapConnectionData['gmap_type'];
$gmap_key = $mapConnectionData['gmap_key'];
break; break;
case 'Static_Image': case 'Static_Image':
$mapConnectionDataUrl = $mapConnectionData['url']; $mapConnectionDataUrl = $mapConnectionData['url'];
@ -207,12 +211,18 @@ $optionsConnectionOSMTable = '<table class="databox" border="0" cellpadding="4"
$gmaps_types["G_PHYSICAL_MAP"] = __('Goolge Physical'); $gmaps_types["G_PHYSICAL_MAP"] = __('Goolge Physical');
$gmaps_types["G_HYBRID_MAP"] = __('Goolge Hybrid'); $gmaps_types["G_HYBRID_MAP"] = __('Goolge Hybrid');
$gmaps_types["G_SATELITE_MAP"] = __('Goolge Satelite'); $gmaps_types["G_SATELITE_MAP"] = __('Goolge Satelite');
// TODO: Add imput field for the key // TODO: Use label tags for the forms.
$optionsConnectionGmapTable = '<table class="databox" border="0" cellpadding="4" cellspacing="4" width="50%">' . $optionsConnectionGmapTable = '<table class="databox" border="0" cellpadding="4" cellspacing="4" width="90%">' .
'<tr class="row_0">' . '<tr class="row_0">' .
'<td>' . __("Google Map Type") . ':</td>' . '<td>' . __("Google Map Type") . ':</td>' .
'<td><input id="type" type="hidden" name="type" value="Gmap" />'.trim(print_select($gmaps_types,'gmap_type', $gmap_type, "", '', 0, 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>' . '</tr>' .
'<tr class="row_2">' .
'<td>' . __("Google Maps Key") . ':</td>' .
'</tr>' .
'<tr class="row_3">' .
'<td colspan="2">' . print_input_text ('gmap_key', $gmap_key, '', 90, 128, true) . '</td>' .
'</tr>' .
'</table>'; '</table>';
// Image Map Connection // Image Map Connection
$optionsConnectionImageTable = '<table class="databox" border="0" cellpadding="4" cellspacing="4" width="50%">' . $optionsConnectionImageTable = '<table class="databox" border="0" cellpadding="4" cellspacing="4" width="50%">' .
@ -418,12 +428,14 @@ function selMapConnectionType() {
$('#form_map_connection_type').html('<?php echo $optionsConnectionOSMTable; ?>').hide(); $('#form_map_connection_type').html('<?php echo $optionsConnectionOSMTable; ?>').hide();
break; break;
case 'Gmap': case 'Gmap':
/* /* TODO: still testing this part... still need to use the provided key
var script = document.createElement("script"); var script = document.createElement("script");
script.type = "text/javascript"; 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=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ';
script.src = 'http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhT2yXp_ZAY8_ufC3CFXhHIE1NvwkxTS6gjckBmeABOGXIUiOiZObZESPg'; //script.src = 'http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhT2yXp_ZAY8_ufC3CFXhHIE1NvwkxTS6gjckBmeABOGXIUiOiZObZESPg';
document.body.appendChild(script); //document.body.appendChild(script);
//document.getElementsByTagName("head")[0].appendChild(script);
$('head').append(script);
*/ */
$('#form_map_connection_type').html('<?php echo $optionsConnectionGmapTable; ?>').hide(); $('#form_map_connection_type').html('<?php echo $optionsConnectionGmapTable; ?>').hide();
break; break;