コード例 #1
0
function urlArgsToParam($checkMobile, $urlbase)
{
    echo "<script type=\"text/javascript\">\n";
    echo "var params={\n";
    echo "urlbase : '" . $urlbase . "',\n";
    echo "id : " . (isValidId('id') ? $_GET['id'] : "null") . ",\n";
    echo "type : " . (isValidType('type') ? "'" . $_GET['type'] . "'" : "null") . ",\n";
    echo "lat : ";
    if (isValidCoordinate('lat')) {
        echo $_GET['lat'] . ",\n";
    } else {
        $latlon = getLatLon('id', isset($type) ? $type : "");
        if ($latlon) {
            echo $latlon[1] . ",\n";
        } else {
            echo "null,\n";
        }
    }
    echo "lon : ";
    if (isValidCoordinate('lon')) {
        echo $_GET['lon'] . ",\n";
    } else {
        $latlon = getLatLon('id', isset($type) ? $type : "");
        if ($latlon) {
            echo $latlon[0] . ",\n";
        } else {
            echo "null,\n";
        }
    }
    echo "zoom : " . (isValidZoom('zoom') ? $_GET['zoom'] : "null") . ",\n";
    echo "offset : " . (isValidOffset('offset') ? $_GET['offset'] : "null") . ",\n";
    echo "searchquery : " . (isset($_GET['q']) ? json_encode($_GET['q']) : "''") . ",\n";
    echo "lang : '" . $lang . "',\n";
    echo "ref : " . (isset($_GET['ref']) ? json_encode($_GET['ref']) : "null") . ",\n";
    echo "name : " . (isset($_GET['name']) ? json_encode($_GET['name']) : "null") . ",\n";
    echo "line : " . (isset($_GET['line']) ? json_encode($_GET['line']) : "null") . ",\n";
    echo "operator : " . (isset($_GET['operator']) ? json_encode($_GET['operator']) : "null") . ",\n";
    if ($checkMobile) {
        echo "mobile : " . (isset($_GET['mobile']) ? $_GET['mobile'] != '0' && $_GET['mobile'] != 'false' ? "true" : "false" : "null") . ",\n";
    }
    echo "style : " . (isset($_GET['style']) ? json_encode($_GET['style']) : "null") . "\n";
    echo "};\n";
    echo "</script>\n";
}
コード例 #2
0
ファイル: index.php プロジェクト: HH882015/OpenRailwayMap
echo "lat : ";
if (isValidCoordinate($_GET['lat'])) {
    echo $_GET['lat'] . ",\n";
} else {
    $latlon = getLatLon($_GET['id'], $type);
    if ($latlon) {
        echo $latlon[1] . ",\n";
    } else {
        echo "null,\n";
    }
}
echo "lon : ";
if (isValidCoordinate($_GET['lon'])) {
    echo $_GET['lon'] . ",\n";
} else {
    $latlon = getLatLon($_GET['id'], $type);
    if ($latlon) {
        echo $latlon[0] . ",\n";
    } else {
        echo "null,\n";
    }
}
echo "zoom : " . (isValidZoom($_GET['zoom']) ? $_GET['zoom'] : "null") . ",\n";
echo "offset : " . (isValidOffset($_GET['offset']) ? $_GET['offset'] : "null") . ",\n";
echo "searchquery : " . (isset($_GET['q']) ? json_encode($_GET['q']) : "''") . ",\n";
echo "lang : '" . $lang . "',\n";
echo "ref : " . (isset($_GET['ref']) ? json_encode($_GET['ref']) : "null") . ",\n";
echo "name : " . (isset($_GET['name']) ? json_encode($_GET['name']) : "null") . ",\n";
echo "position : " . (isValidPosition($_GET['position']) ? json_encode($_GET['position']) : "null") . ",\n";
echo "line : " . (isset($_GET['line']) ? json_encode($_GET['line']) : "null") . ",\n";
echo "operator : " . (isset($_GET['operator']) ? json_encode($_GET['operator']) : "null") . ",\n";
コード例 #3
0
ファイル: embed.php プロジェクト: duizendnegen/OpenRailwayMap
echo "lat : ";
if (isValidCoordinate('lat')) {
    echo $_GET['lat'] . ",\n";
} else {
    $latlon = getLatLon('id', isset($type) ? $type : "");
    if ($latlon) {
        echo $latlon[1] . ",\n";
    } else {
        echo "null,\n";
    }
}
echo "lon : ";
if (isValidCoordinate('lon')) {
    echo $_GET['lon'] . ",\n";
} else {
    $latlon = getLatLon('id', isset($type) ? $type : "");
    if ($latlon) {
        echo $latlon[0] . ",\n";
    } else {
        echo "null,\n";
    }
}
echo "zoom : " . (isValidZoom('zoom') ? $_GET['zoom'] : "null") . ",\n";
echo "offset : " . (isValidOffset('offset') ? $_GET['offset'] : "null") . ",\n";
echo "searchquery : " . (isset($_GET['q']) ? json_encode($_GET['q']) : "''") . ",\n";
echo "lang : '" . $lang . "',\n";
echo "ref : " . (isset($_GET['ref']) ? json_encode($_GET['ref']) : "null") . ",\n";
echo "name : " . (isset($_GET['name']) ? json_encode($_GET['name']) : "null") . ",\n";
echo "line : " . (isset($_GET['line']) ? json_encode($_GET['line']) : "null") . ",\n";
echo "operator : " . (isset($_GET['operator']) ? json_encode($_GET['operator']) : "null") . ",\n";
echo "style : " . (isset($_GET['style']) ? json_encode($_GET['style']) : "null") . "\n";
コード例 #4
0
ファイル: functions.php プロジェクト: rahool/maplocator
function getLayerExtent($table,$layertype,$list="") {
  //echo $layertype;
  if('RASTER' != $layertype and $layertype !='' ){
  	// echo 'here'. $layertype;
    if ($list == null || $list == "") {
      $query = 'SELECT astext(extent('.AUTO_DBCOL_PREFIX.'topology)) as extent from "%s"' ;
      $query_args = $table;
    } else{
      $query = 'SELECT astext(extent('.AUTO_DBCOL_PREFIX.'topology)) as extent from "%s" where '.AUTO_DBCOL_PREFIX.'id IN(%s)' ;
      $query_args = array($table, $list);
    }
    $result_db = db_query($query, $query_args);
    $extent = '';
    if(!$result_db) {
      $extent = "Error fetching extent. Please try after sometime.";
    } else {
      while ($user_data = db_fetch_object($result_db)) {
        $extent = $user_data->extent;
      }
      if (strpos($extent, 'POINT') === false){
        $extent = str_replace('POLYGON((','',$extent);
        $extent = str_replace('))','',$extent);
        $arr = explode(",",$extent);
        $extent = $arr[0].",". $arr[2];
        $extent = str_replace(' ',',',$extent);
      } else {
        $extent = str_replace('POINT(','',$extent);
        $extent = str_replace(')','',$extent);
        $extent = $extent.",". $extent;
        $extent = str_replace(' ',',',$extent);
      }
    }
  } else {
     //read metadata and get the upper right and lower left corner
    $char_pos=strpos($upper_right,'d'); //this will be used if .metadata file is for raster layers
     $filename = "metadata/".$table.".metadata";
     if(file_exists($filename)){
       $fcontents = file($filename);
       $len = count($fcontents);

       $upper_right = $fcontents[$len-3];
       $lower_left = $fcontents[$len-4];
       $index1 = strpos($upper_right,'(');
       $index2 = strpos($upper_right,')');

       $upper_right = substr($upper_right,$index1+1,$index2-$index1-1);
       $index1 = strpos($lower_left,'(');
       $index2 = strpos($lower_left,')');
       $lower_left = substr($lower_left,$index1+1,$index2-$index1-1);

       $right_top = split(",",$upper_right);
       $left_bottom = split(",",$lower_left);

       if($char_pos === true) { //if long and lat points are in degrees (for vector layers)

	 $right_top_lon=getLatLon($right_top[0]);
	 $right_top_lat=getLatLon($right_top[1]);

	 $left_bottom_lon=getLatLon($left_bottom[0]);
	 $left_bottom_lat=getLatLon($left_bottom[1]);
	 $extent = $left_bottom_lon.",".$left_bottom_lat.",".$right_top_lon.",".$right_top_lat;
       }
       else {   //for raster layers

	 $extent=$left_bottom[0].",".$left_bottom[1].",".$right_top[0].",".$right_top[1];
       }
    } else {
       $extent = '';
     }
  }
  return $extent;
}
コード例 #5
0
ファイル: small.php プロジェクト: dieterdreist/OpenLinkMap
		<meta name="revisit-after" content="after 90 days" />
		<meta name="date" content="2010-01-01" />
		<meta name="page-topic" content="<?php 
echo $appname;
?>
" />
		<meta name="robots" content="index,follow" />
		<link rel="shortcut icon" href="img/favicon.ico" type="image/vnd.microsoft.icon" />
		<link rel="icon" href="img/favicon.ico" type="image/vnd.microsoft.icon" />
		<meta http-equiv="content-script-type" content="text/javascript" />
		<meta http-equiv="content-style-type" content="text/css" />
		<link rel="stylesheet" type="text/css" href="css/small.css" />
		<script type="text/javascript" src="js/OpenLayers.js"></script>
		<?php 
// params
$latlon = getLatLon($_GET['id'], $_GET['type']);
echo "<script type=\"text/javascript\">\n";
echo "var params={\n";
echo "id : " . (isValidId($_GET['id']) ? $_GET['id'] : "null") . ",\n";
echo "type : " . (isValidType($_GET['type']) ? "'" . $_GET['type'] . "'" : "null") . ",\n";
echo "ext : " . (isset($_GET['ext']) && $_GET['ext'] == 1 ? "true" : "false") . ",\n";
echo "lat : ";
if (isValidCoordinate($_GET['lat'])) {
    echo $_GET['lat'] . ",\n";
} else {
    if ($latlon) {
        echo $latlon[1] . ",\n";
    } else {
        echo "null,\n";
    }
}
コード例 #6
0
This is free software, and you are welcome to redistribute it under certain conditions.
See http://wiki.openstreetmap.org/wiki/OpenLinkMap for details.
*/
require_once "functions.php";
// include translation file
includeLocale($_GET['lang']);
$format = $_GET['format'];
$id = $_GET['id'];
$type = $_GET['type'];
$lat = $_GET['lat'];
$lon = $_GET['lon'];
$callback = $_GET['callback'];
date_default_timezone_set('UTC');
// request latlon if not given
if (!$lat || !$lon) {
    $latlon = getLatLon($id, $type);
    $lat = $latlon[0];
    $lon = $latlon[1];
}
// get the most important langs of the user
$langs = getLangs();
if ($_GET['lang']) {
    $langs[0] = $_GET['lang'];
}
// connnecting to database
$connection = connectToDatabase("nextobjects");
// if there is no connection
if (!$connection) {
    exit;
}
$next['busstops'] = array(_("Busstops"), getNearObjectsForId($connection, $lat, $lon, array(array("highway", "bus_stop"), array("highway", "bus_station")), 2000));