mirror of
https://github.com/claradex/nativegallery.git
synced 2024-11-15 03:31:10 +03:00
add Российская Империя label
This commit is contained in:
parent
3fccf21052
commit
5cc7646577
2 changed files with 49 additions and 43 deletions
|
@ -190,6 +190,7 @@ $user = new User(Auth::userid());
|
||||||
<option value="79">Протекторат Богемии и Моравии</option>
|
<option value="79">Протекторат Богемии и Моравии</option>
|
||||||
<option value="102">РСФСР</option>
|
<option value="102">РСФСР</option>
|
||||||
<option value="1">Россия</option>
|
<option value="1">Россия</option>
|
||||||
|
<option value="ex_1">Российская Империя</option>
|
||||||
<option value="40">Румыния</option>
|
<option value="40">Румыния</option>
|
||||||
<option value="77">Румынская Народная Республика</option>
|
<option value="77">Румынская Народная Республика</option>
|
||||||
<option value="10">СССР</option>
|
<option value="10">СССР</option>
|
||||||
|
|
|
@ -3,57 +3,62 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Leaflet 3D Map Example</title>
|
<title>Template Creator</title>
|
||||||
<!-- Подключение Leaflet CSS и JS -->
|
<link href="https://stackpath.bootstrapcdn.com/bootstrap/5.1.3/css/bootstrap.min.css" rel="stylesheet">
|
||||||
<link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css" />
|
|
||||||
<script src="https://unpkg.com/leaflet/dist/leaflet.js"></script>
|
|
||||||
|
|
||||||
<!-- Подключение плагина Leaflet-Geoman -->
|
|
||||||
<link rel="stylesheet" href="https://unpkg.com/leaflet-geoman-free/dist/leaflet-geoman.css">
|
|
||||||
<script src="https://unpkg.com/leaflet-geoman-free/dist/leaflet-geoman.min.js"></script>
|
|
||||||
|
|
||||||
<!-- Подключение плагина Leaflet-3d-model -->
|
|
||||||
<script src="https://unpkg.com/leaflet-3d-model/dist/leaflet-3d-model.min.js"></script>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
#map {
|
|
||||||
height: 500px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="map"></div>
|
<div class="container mt-5">
|
||||||
|
<h1 class="mb-4">Создание шаблона</h1>
|
||||||
|
<div id="template-form">
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="key-name" class="form-label">Ключ</label>
|
||||||
|
<input type="text" class="form-control" id="key-name">
|
||||||
|
</div>
|
||||||
|
<button id="add-key" class="btn btn-primary">Добавить ключ</button>
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
<h2 class="mt-4">Шаблоны</h2>
|
||||||
|
<ul id="template-list" class="list-group"></ul>
|
||||||
|
<button id="save-templates" class="btn btn-success mt-4">Сохранить шаблоны</button>
|
||||||
|
<pre id="json-output" class="mt-4"></pre>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
var map = L.map('map').setView([51.505, -0.09], 13);
|
$(document).ready(function () {
|
||||||
|
const template = {};
|
||||||
|
|
||||||
// Добавление основного слоя карты
|
$('#add-key').on('click', function () {
|
||||||
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
const key = $('#key-name').val();
|
||||||
maxZoom: 19,
|
|
||||||
}).addTo(map);
|
|
||||||
|
|
||||||
// Инициализация плагина Leaflet-Geoman
|
if (key) {
|
||||||
map.pm.addControls({
|
template[key] = '';
|
||||||
position: 'topleft',
|
addKeyToTemplateList(key);
|
||||||
drawCircle: false,
|
$('#key-name').val('');
|
||||||
drawCircleMarker: false,
|
}
|
||||||
drawRectangle: false,
|
});
|
||||||
drawCircleMarker: false,
|
|
||||||
drawPolygon: false,
|
$('#save-templates').on('click', function () {
|
||||||
drawPolyline: false,
|
const json = JSON.stringify(template, null, 2);
|
||||||
drawMarker: false,
|
$('#json-output').text(json);
|
||||||
|
saveTemplates(json);
|
||||||
|
});
|
||||||
|
|
||||||
|
function addKeyToTemplateList(key) {
|
||||||
|
const templateList = $('#template-list');
|
||||||
|
const listItem = `<li class="list-group-item">${key}</li>`;
|
||||||
|
templateList.append(listItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
function saveTemplates(json) {
|
||||||
|
$.post('save_templates.php', { data: json }, function (response) {
|
||||||
|
alert('Шаблоны сохранены!');
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
// Добавление 3D модели на карту
|
|
||||||
var model = new L.Model3D({
|
|
||||||
position: [51.505, -0.09],
|
|
||||||
rotation: [0, 0, 0],
|
|
||||||
scale: 0.1,
|
|
||||||
path: 'path/to/your/3d-model.obj',
|
|
||||||
format: 'obj'
|
|
||||||
});
|
|
||||||
|
|
||||||
map.addLayer(model);
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in a new issue