diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 2cba72bddf..1871571dde 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,13 @@ +2014-01-09 Miguel de Dios + + * include/functions.php: added function "https_is_running". + + * include/functions_gis.php, operation/gis_maps/render_view.php, + operation/gis_maps/public_console.php, godmode/setup/gis_step_2.php: + fixed the urls for google maps when it is running in https mode. + + Fixes: #2403 + 2014-01-09 Junichi Satoh * godmode/servers/plugin.php: Fixed that unexpected strings are set diff --git a/pandora_console/godmode/setup/gis_step_2.php b/pandora_console/godmode/setup/gis_step_2.php index fe34c7d1b9..8e52572653 100755 --- a/pandora_console/godmode/setup/gis_step_2.php +++ b/pandora_console/godmode/setup/gis_step_2.php @@ -37,7 +37,7 @@ switch ($action) { case 'create_connection_map': // Header ui_print_page_header (__('Create new map connection'), "", false, "gis_setup_map_connection", true); - + $mapConnection_name = ''; $mapConnection_group = ''; $mapConnection_numLevelsZoom = '19'; @@ -343,7 +343,7 @@ function changeSetManualPosition(stCenter, stGISDefault) { function changePoints(e) { var lonlat = map.getLonLatFromViewPortPx(e.xy); lonlat.transform(map.getProjectionObject(), map.displayProjection); //transform the lonlat in object proyection to "standar proyection" - + if (setCenter) { //Change the fields center_latitude = $('input[name=center_latitude]').val(lonlat.lat); @@ -357,7 +357,7 @@ function changePoints(e) { centerPoint.move(lonlat.transform(map.displayProjection, map.getProjectionObject())); } } - + if (setGISDefaultPosition) { //Change the fields center_latitude = $('input[name=default_latitude]').val(lonlat.lat); @@ -378,7 +378,7 @@ function changePoints(e) { * fields. And make two points, center and default. */ function refreshMapView() { - switch ($('#sel_type :selected').val()) { + switch ($('#sel_type :selected').val()) { case 'Gmap': //TODO: Validate there is a key, and use it gmap_key = $('input[name=gmap_key]').val(); @@ -387,13 +387,13 @@ function refreshMapView() { script.src = 'http://www.google.com/jsapi?key='+gmap_key+'&callback=loadGoogleMap'; //script.src = 'http://www.google.com/jsapi?key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhT2yXp_ZAY8_ufC3CFXhHIE1NvwkxTS6gjckBmeABOGXIUiOiZObZESPg&callback=loadGoogleMap'; document.getElementsByTagName("head")[0].appendChild(script); - + //TODO: paint the gif clock for waiting the request. break; default: refreshMapViewSecondStep(); break; - } + } } @@ -402,50 +402,50 @@ function refreshMapView() { * fields. And make two points, center and default. */ function refreshMapViewSecondStep() { - //Clear the previous map. - map = null; - $("#map").html(''); - //Clear the points. - centerPoint = null; - GISDefaultPositionPoint = null; - - //Change the text to button. - $("input[name=button_refresh]").val(''); - - //Obtain data of map of fields. - inital_zoom = $('input[name=initial_zoom]').val(); - num_levels_zoom =$('input[name=num_levels_zoom]').val(); - center_latitude = $('input[name=center_latitude]').val(); - center_longitude = $('input[name=center_longitude]').val(); - center_altitude = $('input[name=center_altitude]').val(); - - var objBaseLayers = Array(); - objBaseLayers[0] = {}; - objBaseLayers[0]['type'] = $('select[name=sel_type] :selected').val(); - objBaseLayers[0]['name'] = $('input[name=name]').val(); - objBaseLayers[0]['url'] = $('input[name=url]').val(); - // type Gmap - objBaseLayers[0]['gmap_type'] = $('select[name=gmap_type] option:selected').val(); - objBaseLayers[0]['gmap_key'] = $('input[name=gmap_key]').val(); - // type Static Image - 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'); - - js_printMap('map', inital_zoom, center_latitude, center_longitude, objBaseLayers, arrayControls); - - layer = js_makeLayer('temp_layer', true, null); - - centerPoint = js_addPointExtent('temp_layer', '', $('input[name=center_longitude]').val(), $('input[name=center_latitude]').val(), 'images/gis_map/icons/circle.pink.png', 11, 11, 'center', ''); - GISDefaultPositionPoint = js_addPointExtent('temp_layer', '', $('input[name=default_longitude]').val(), $('input[name=default_latitude]').val(), 'images/gis_map/icons/cross.pink.png', 11, 11, 'default', ''); - - js_activateEvents(changePoints); + //Clear the previous map. + map = null; + $("#map").html(''); + //Clear the points. + centerPoint = null; + GISDefaultPositionPoint = null; + + //Change the text to button. + $("input[name=button_refresh]").val(''); + + //Obtain data of map of fields. + inital_zoom = $('input[name=initial_zoom]').val(); + num_levels_zoom =$('input[name=num_levels_zoom]').val(); + center_latitude = $('input[name=center_latitude]').val(); + center_longitude = $('input[name=center_longitude]').val(); + center_altitude = $('input[name=center_altitude]').val(); + + var objBaseLayers = Array(); + objBaseLayers[0] = {}; + objBaseLayers[0]['type'] = $('select[name=sel_type] :selected').val(); + objBaseLayers[0]['name'] = $('input[name=name]').val(); + objBaseLayers[0]['url'] = $('input[name=url]').val(); + // type Gmap + objBaseLayers[0]['gmap_type'] = $('select[name=gmap_type] option:selected').val(); + objBaseLayers[0]['gmap_key'] = $('input[name=gmap_key]').val(); + // type Static Image + 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'); + + js_printMap('map', inital_zoom, center_latitude, center_longitude, objBaseLayers, arrayControls); + + layer = js_makeLayer('temp_layer', true, null); + + centerPoint = js_addPointExtent('temp_layer', '', $('input[name=center_longitude]').val(), $('input[name=center_latitude]').val(), 'images/gis_map/icons/circle.pink.png', 11, 11, 'center', ''); + GISDefaultPositionPoint = js_addPointExtent('temp_layer', '', $('input[name=default_longitude]').val(), $('input[name=default_latitude]').val(), 'images/gis_map/icons/cross.pink.png', 11, 11, 'default', ''); + + js_activateEvents(changePoints); } function validateGmapsParamtres () { diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 4179fbaf73..173347e685 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -68,6 +68,17 @@ require_once('functions_io.php'); // } //} +function https_is_running() { + if (isset ($_SERVER['HTTPS']) + && ($_SERVER['HTTPS'] === true + || $_SERVER['HTTPS'] == 'on')) { + + return true; + } + + return false; +} + /** * Cleans an object or an array and casts all values as integers * diff --git a/pandora_console/include/functions_gis.php b/pandora_console/include/functions_gis.php index 83a42ac211..8b844dc5cf 100644 --- a/pandora_console/include/functions_gis.php +++ b/pandora_console/include/functions_gis.php @@ -1001,9 +1001,16 @@ function gis_get_agent_map($agent_id, $heigth, $width, $show_history = false, $c } if ($gmap_layer === true) { - ?> - - + + + + + + + +