'."\n"; echo ''."\n"; echo '
'; global $vc_public_view; $vc_public_view = true; // This starts the page head. In the call back function, // things from $page['head'] array will be processed into the head ob_start ('ui_process_page_head'); require_once('include/functions_gis.php'); require_once($config['homedir'] . "/include/functions_agents.php"); ui_require_javascript_file('openlayers.pandora'); $config["remote_addr"] = $_SERVER['REMOTE_ADDR']; $hash = get_parameter ('hash'); $idMap = (int) get_parameter ('map_id'); $config["id_user"] = get_parameter ('id_user'); $myhash = md5($config["dbpass"] . $idMap . $config["id_user"]); // Check input hash if ( $myhash != $hash) { exit; } $show_history = get_parameter ('show_history', 'n'); $map = db_get_row ('tgis_map', 'id_tgis_map', $idMap); $confMap = gis_get_map_conf($idMap); // Default open map (used to overwrite unlicensed google map view) $confMapDefault = get_good_con(); $confMapUrlDefault = json_decode($confMapDefault['conection_data'], true); $num_baselayer=0; // Initialy there is no Gmap base layer. $gmap_layer = false; if ($confMap !== false) { foreach ($confMap as $mapC) { $baselayers[$num_baselayer]['typeBaseLayer'] = $mapC['connection_type']; $baselayers[$num_baselayer]['name'] = $mapC['conection_name']; $baselayers[$num_baselayer]['num_zoom_levels'] = $mapC['num_zoom_levels']; $decodeJSON = json_decode($mapC['conection_data'], true); switch ($mapC['connection_type']) { case 'OSM': $baselayers[$num_baselayer]['url'] = $decodeJSON['url']; break; case 'Gmap': if (!isset($decodeJSON['gmap_key']) || empty($decodeJSON['gmap_key'])) { // If there is not gmap_key, show the default view $baselayers[$num_baselayer]['url'] = $confMapUrlDefault['url']; $baselayers[$num_baselayer]['typeBaseLayer'] = 'OSM'; } else { $baselayers[$num_baselayer]['gmap_type'] = $decodeJSON['gmap_type']; $baselayers[$num_baselayer]['gmap_key'] = $decodeJSON['gmap_key']; $gmap_key = $decodeJSON['gmap_key']; // Once a Gmap base layer is found we mark it to import the API $gmap_layer = true; } 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; } $num_baselayer++; if ($mapC['default_map_connection'] == 1) { $numZoomLevels = $mapC['num_zoom_levels']; } } } if ($gmap_layer === true) { if (https_is_running()) { ?> '; echo "