Старт
24
observation/config.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
$db_connection="pgsql:host=94.247.128.218;dbname=monitoring_new;";
|
||||
$db_login="postgres";
|
||||
$db_password="y7HMHi0ATxx1VC3UU5WG";
|
||||
|
||||
$Schema="main.";
|
||||
|
||||
function connectToDB()
|
||||
{
|
||||
global $db_connection,$db_login,$db_password;
|
||||
$db = null;
|
||||
try
|
||||
{
|
||||
$db = new PDO($db_connection, $db_login, $db_password);
|
||||
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
} catch (Exception $ex)
|
||||
{
|
||||
print $ex->getMessage();
|
||||
error_log($ex->getMessage());
|
||||
}
|
||||
return $db;
|
||||
}
|
||||
|
||||
|
||||
42
observation/css/ol-popup.css
Normal file
@ -0,0 +1,42 @@
|
||||
.ol-popup {
|
||||
position: absolute;
|
||||
background-color: white;
|
||||
-webkit-filter: drop-shadow(0 1px 4px rgba(0,0,0,0.2));
|
||||
filter: drop-shadow(0 1px 4px rgba(0,0,0,0.2));
|
||||
padding: 15px;
|
||||
border-radius: 10px;
|
||||
border: 1px solid #cccccc;
|
||||
bottom: 12px;
|
||||
left: -50px;
|
||||
min-width: 350px;
|
||||
}
|
||||
.ol-popup:after, .ol-popup:before {
|
||||
top: 100%;
|
||||
border: solid transparent;
|
||||
content: " ";
|
||||
height: 0;
|
||||
width: 0;
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
}
|
||||
.ol-popup:after {
|
||||
border-top-color: white;
|
||||
border-width: 10px;
|
||||
left: 48px;
|
||||
margin-left: -10px;
|
||||
}
|
||||
.ol-popup:before {
|
||||
border-top-color: #cccccc;
|
||||
border-width: 11px;
|
||||
left: 48px;
|
||||
margin-left: -11px;
|
||||
}
|
||||
.ol-popup-closer {
|
||||
text-decoration: none;
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
right: 8px;
|
||||
}
|
||||
.ol-popup-closer:after {
|
||||
content: "✖";
|
||||
}
|
||||
69
observation/get.php
Normal file
@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
// error_reporting(E_ALL | E_STRICT);
|
||||
// ini_set('display_errors','On');
|
||||
|
||||
ini_set('display_errors','Off'); //Чтоб ошибки не отправлялись клиентам
|
||||
//ini_set("error_log", "php-error.log"); //Закоментил потому что удобней смотреть в 1м месте а не лазить по всем папкам...
|
||||
date_default_timezone_set("UTC"); //Чтоб всё было по гринвичу
|
||||
|
||||
function createPath($path)
|
||||
{
|
||||
if (is_dir($path)) return true;
|
||||
$prev_path = substr($path, 0, strrpos($path, '/', -2) + 1 );
|
||||
$return = createPath($prev_path);
|
||||
return ($return && is_writable($prev_path)) ? mkdir($path) : false;
|
||||
}
|
||||
|
||||
if(isset($_REQUEST['x'])) $x=$_REQUEST['x']; else $x='';
|
||||
if(isset($_REQUEST['y'])) $y=$_REQUEST['y']; else $y='';
|
||||
if(isset($_REQUEST['z'])) $z=$_REQUEST['z']; else $z='';
|
||||
if(isset($_REQUEST['s'])) $s=$_REQUEST['s']; else $s='';
|
||||
if(isset($_REQUEST['lyrs'])) $lyrs=$_REQUEST['lyrs']; else $lyrs='m'; //Тип карты гибрид или чтото другое
|
||||
|
||||
//Проверяем есть ли файл в буфере
|
||||
if (file_exists('./google/'.$lyrs.'/'.$z.'/'.$x.'/'.$y.'.png'))
|
||||
{
|
||||
//Чтоб переписать старенькие
|
||||
$time_sec=time();
|
||||
$time_file=filemtime('./google/'.$lyrs.'/'.$z.'/'.$x.'/'.$y.'.png');
|
||||
$time=$time_sec-$time_file;
|
||||
if($time<3*30*24*60*60) //Не старше 3х месяцев
|
||||
{
|
||||
header("Content-Type: image/png");
|
||||
readfile('./google/'.$lyrs.'/'.$z.'/'.$x.'/'.$y.'.png');
|
||||
Exit();
|
||||
}
|
||||
}
|
||||
|
||||
//Request URL: http://uspdmanager.istt.kz/get.php?hl=ru-RU&lyrs=m&x=357&y=193&z=9&s=
|
||||
|
||||
//$key = "YOUR KEY HERE";
|
||||
//$url = "http://maps.google.com/maps/geo?q=".$address."&output=csv&key=".$key;
|
||||
//$url = 'http://mt2.google.com/vt/v=w2.114&hl=ru-RU&gl=cn&&x='.$x.'&y='.$y.'&z='.$z.'&s='.$s;
|
||||
$url = 'http://mt1.google.com/vt/lyrs='.$lyrs.'@199000000&hl=ru&src=app&x='.$x.'&y='.$y.'&z='.$z.'&s=Galileo';
|
||||
//$url = 'http://mt1.google.com/vt/lyrs=m@152000000&hl=ru&x='.$x.'&y='.$y.'&z='.$z.'&s=Gali';
|
||||
|
||||
|
||||
//Загружаем с помощью CURL
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_HEADER,0); //Change this to a 1 to return headers
|
||||
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER["HTTP_USER_AGENT"]);
|
||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
$data = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
|
||||
//Сохраняем файл в буфер
|
||||
if(strlen($data)>0)
|
||||
{
|
||||
createPath('./google/'.$lyrs.'/'.$z.'/'.$x);
|
||||
$fp = fopen('./google/'.$lyrs.'/'.$z.'/'.$x.'/'.$y.'.png', 'w');
|
||||
fwrite($fp, $data);
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
header("Content-Type: image/png");
|
||||
echo $data;
|
||||
|
||||
BIN
observation/google/m/10/727/328.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
observation/google/m/10/727/329.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
observation/google/m/10/727/330.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
observation/google/m/10/727/331.png
Normal file
|
After Width: | Height: | Size: 799 B |
BIN
observation/google/m/10/727/332.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
observation/google/m/10/728/328.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
observation/google/m/10/728/329.png
Normal file
|
After Width: | Height: | Size: 727 B |
BIN
observation/google/m/10/728/330.png
Normal file
|
After Width: | Height: | Size: 761 B |
BIN
observation/google/m/10/728/331.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
observation/google/m/10/728/332.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
observation/google/m/10/729/328.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
observation/google/m/10/729/329.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
observation/google/m/10/729/330.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
observation/google/m/10/729/331.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
observation/google/m/10/729/332.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
observation/google/m/10/730/328.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
observation/google/m/10/730/329.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
observation/google/m/10/730/330.png
Normal file
|
After Width: | Height: | Size: 906 B |
BIN
observation/google/m/10/730/331.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
observation/google/m/10/730/332.png
Normal file
|
After Width: | Height: | Size: 442 B |
BIN
observation/google/m/10/731/328.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
observation/google/m/10/731/329.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
observation/google/m/10/731/330.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
observation/google/m/10/731/331.png
Normal file
|
After Width: | Height: | Size: 441 B |
BIN
observation/google/m/10/731/332.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
observation/google/m/12/2916/1317.png
Normal file
|
After Width: | Height: | Size: 448 B |
BIN
observation/google/m/12/2916/1318.png
Normal file
|
After Width: | Height: | Size: 577 B |
BIN
observation/google/m/12/2916/1319.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
observation/google/m/12/2916/1320.png
Normal file
|
After Width: | Height: | Size: 517 B |
BIN
observation/google/m/12/2917/1317.png
Normal file
|
After Width: | Height: | Size: 178 B |
BIN
observation/google/m/12/2917/1318.png
Normal file
|
After Width: | Height: | Size: 178 B |
BIN
observation/google/m/12/2917/1319.png
Normal file
|
After Width: | Height: | Size: 466 B |
BIN
observation/google/m/12/2917/1320.png
Normal file
|
After Width: | Height: | Size: 921 B |
BIN
observation/google/m/12/2918/1317.png
Normal file
|
After Width: | Height: | Size: 539 B |
BIN
observation/google/m/12/2918/1318.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
observation/google/m/12/2918/1319.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
observation/google/m/12/2918/1320.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
observation/google/m/12/2919/1317.png
Normal file
|
After Width: | Height: | Size: 289 B |
BIN
observation/google/m/12/2919/1318.png
Normal file
|
After Width: | Height: | Size: 726 B |
BIN
observation/google/m/12/2919/1319.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
observation/google/m/12/2919/1320.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
observation/google/m/12/2920/1317.png
Normal file
|
After Width: | Height: | Size: 873 B |
BIN
observation/google/m/12/2920/1318.png
Normal file
|
After Width: | Height: | Size: 178 B |
BIN
observation/google/m/12/2920/1319.png
Normal file
|
After Width: | Height: | Size: 454 B |
BIN
observation/google/m/12/2920/1320.png
Normal file
|
After Width: | Height: | Size: 358 B |
BIN
observation/google/m/12/2921/1317.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
observation/google/m/12/2921/1318.png
Normal file
|
After Width: | Height: | Size: 405 B |
BIN
observation/google/m/12/2921/1319.png
Normal file
|
After Width: | Height: | Size: 208 B |
BIN
observation/google/m/12/2921/1320.png
Normal file
|
After Width: | Height: | Size: 579 B |
BIN
observation/google/m/12/2921/1500.png
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
observation/google/m/12/2921/1501.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
observation/google/m/12/2922/1500.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
observation/google/m/12/2922/1501.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
observation/google/m/13/5843/3002.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
observation/google/m/13/5844/3002.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
observation/google/m/13/5844/3003.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
observation/google/m/13/5845/3002.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
observation/google/m/14/11685/6003.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
observation/google/m/14/11685/6004.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
observation/google/m/14/11685/6005.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
observation/google/m/14/11685/6006.png
Normal file
|
After Width: | Height: | Size: 9.3 KiB |
BIN
observation/google/m/14/11685/6007.png
Normal file
|
After Width: | Height: | Size: 7.2 KiB |
BIN
observation/google/m/14/11686/6003.png
Normal file
|
After Width: | Height: | Size: 5.6 KiB |
BIN
observation/google/m/14/11686/6004.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
observation/google/m/14/11686/6005.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
observation/google/m/14/11686/6006.png
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
observation/google/m/14/11686/6007.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
observation/google/m/14/11687/6003.png
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
observation/google/m/14/11687/6004.png
Normal file
|
After Width: | Height: | Size: 9.8 KiB |
BIN
observation/google/m/14/11687/6005.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
observation/google/m/14/11687/6006.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
observation/google/m/14/11687/6007.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
observation/google/m/14/11688/6003.png
Normal file
|
After Width: | Height: | Size: 9.3 KiB |
BIN
observation/google/m/14/11688/6004.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
observation/google/m/14/11688/6005.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
observation/google/m/14/11688/6006.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
observation/google/m/14/11688/6007.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
observation/google/m/14/11689/6003.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
observation/google/m/14/11689/6004.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
observation/google/m/14/11689/6005.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
observation/google/m/14/11689/6006.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
observation/google/m/14/11689/6007.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
observation/google/m/14/11690/6003.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
observation/google/m/14/11690/6004.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
observation/google/m/14/11690/6005.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
observation/google/m/14/11690/6006.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
observation/google/m/14/11690/6007.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
observation/google/m/15/23375/12008.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
observation/google/m/15/23375/12009.png
Normal file
|
After Width: | Height: | Size: 7.0 KiB |
BIN
observation/google/m/15/23375/12010.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
observation/google/m/15/23375/12011.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
observation/google/m/15/23375/12012.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
observation/google/m/15/23376/12008.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
observation/google/m/15/23376/12009.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
observation/google/m/15/23376/12010.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
observation/google/m/15/23376/12011.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
observation/google/m/15/23376/12012.png
Normal file
|
After Width: | Height: | Size: 12 KiB |