From 01f6df9e9feabbc84c0d1d6b5590f79fe8f99961 Mon Sep 17 00:00:00 2001 From: themohooks <81331307+themohooks@users.noreply.github.com> Date: Sat, 6 Jul 2024 08:05:10 +0300 Subject: [PATCH] Upload: add geotags! --- app/Controllers/Api/Images/Upload.php | 6 + static/css/map.css | 48 +++++ static/js/core_lk.js | 2 - views/components/LoadHead.php | 1 + views/pages/Profile/UploadPhoto.php | 241 +++++++++++++++++++++++++- views/pages/t.php | 59 +++++++ 6 files changed, 352 insertions(+), 5 deletions(-) create mode 100644 static/css/map.css diff --git a/app/Controllers/Api/Images/Upload.php b/app/Controllers/Api/Images/Upload.php index 0b3615b..a9bb69c 100644 --- a/app/Controllers/Api/Images/Upload.php +++ b/app/Controllers/Api/Images/Upload.php @@ -40,12 +40,18 @@ class Upload ) ); } + if (isset($_POST['nomap'])) { + $_POST['lat'] = null; + $_POST['lng'] = null; + } if ($upload->getType() !== null) { $content = Json::return( array( 'type' => 'none', 'copyright' => $_POST['license'], 'comment' => $_POST['descr'], + 'lat' => $_POST['lat'], + 'lng' => $_POST['lng'] ) ); self::$photourl = $upload->getSrc(); diff --git a/static/css/map.css b/static/css/map.css new file mode 100644 index 0000000..f3d17e7 --- /dev/null +++ b/static/css/map.css @@ -0,0 +1,48 @@ +.leaflet-div-icon { + background: #fff; + border: 1px solid #666; +} +.leaflet-center { + margin-left: 55px; +} +.leaflet-control-geosearch, .leaflet-control-geosearch ul { + background: none repeat scroll 0 0 rgba(0, 0, 0, 0.25); + margin: 4px 0 0; + padding: 2px; + height: auto; + border-radius: 4px; +} +.leaflet-control-geosearch-msg ul { + list-style: none; + display: none; + height: auto; + background: none; + padding: 0; +} +.leaflet-control-geosearch ul li { + background: none repeat scroll 0 0 rgba(255, 255, 255, 0.75); + margin: 0; + padding: 0 4px; +} +.leaflet-container .leaflet-control-geosearch input { + width: 240px; + height: 21px; + padding: 0; + text-indent: 4px; + background: #fff; + border: none; + border-radius: 2px; + box-shadow: none; +} +.leaflet-control-layers-list { + text-align:left; +} +.multimark { + background:url('/img/m/multimark.png') no-repeat; + font-family:PT Sans Narrow,sans-serif; + font-size:18px; + color:#fff; + font-weight:bold; + padding-top:11px; + text-align:center; +} diff --git a/static/js/core_lk.js b/static/js/core_lk.js index c7d3ed2..7fabb83 100644 --- a/static/js/core_lk.js +++ b/static/js/core_lk.js @@ -198,8 +198,6 @@ $(document).ready(function() $('#conn_veh').on('change', 'input:checkbox, input:text', modify); - // Предотвращение случайного закрытия формы - window.onbeforeunload = function() { if (modified) return false; } }); diff --git a/views/components/LoadHead.php b/views/components/LoadHead.php index 95894bb..ca418b7 100644 --- a/views/components/LoadHead.php +++ b/views/components/LoadHead.php @@ -11,6 +11,7 @@ + diff --git a/views/pages/Profile/UploadPhoto.php b/views/pages/Profile/UploadPhoto.php index 1f28b0c..e6aa4ee 100644 --- a/views/pages/Profile/UploadPhoto.php +++ b/views/pages/Profile/UploadPhoto.php @@ -9,7 +9,7 @@ $user = new User(Auth::userid()); - + @@ -18,6 +18,23 @@ $user = new User(Auth::userid()); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + + + + + + + + + +

Предложить фото на публикацию

Ваш текущий индекс загрузки: i('uploadindex')?>

@@ -281,8 +298,11 @@ $user = new User(Auth::userid()); Шаг 1. Выберите фотографию для загрузки и укажите дату съёмки:
+ @@ -593,13 +613,228 @@ $user = new User(Auth::userid());
Шаг 3. Отметьте точку, с которой вы делали кадр, на карте:
+ + + +
Точка съёмки: +
+
+
+ + +
+ + +
+
+
+
Шаг 3. Выберите опции загрузки:Шаг 4. Выберите опции загрузки:
Лицензия: