mirror of
https://github.com/WerySkok/nativegallery.git
synced 2024-11-15 03:31:19 +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="102">РСФСР</option>
|
||||
<option value="1">Россия</option>
|
||||
<option value="ex_1">Российская Империя</option>
|
||||
<option value="40">Румыния</option>
|
||||
<option value="77">Румынская Народная Республика</option>
|
||||
<option value="10">СССР</option>
|
||||
|
|
|
@ -3,57 +3,62 @@
|
|||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Leaflet 3D Map Example</title>
|
||||
<!-- Подключение Leaflet CSS и JS -->
|
||||
<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>
|
||||
<title>Template Creator</title>
|
||||
<link href="https://stackpath.bootstrapcdn.com/bootstrap/5.1.3/css/bootstrap.min.css" rel="stylesheet">
|
||||
</head>
|
||||
<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>
|
||||
var map = L.map('map').setView([51.505, -0.09], 13);
|
||||
$(document).ready(function () {
|
||||
const template = {};
|
||||
|
||||
// Добавление основного слоя карты
|
||||
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
||||
maxZoom: 19,
|
||||
}).addTo(map);
|
||||
$('#add-key').on('click', function () {
|
||||
const key = $('#key-name').val();
|
||||
|
||||
// Инициализация плагина Leaflet-Geoman
|
||||
map.pm.addControls({
|
||||
position: 'topleft',
|
||||
drawCircle: false,
|
||||
drawCircleMarker: false,
|
||||
drawRectangle: false,
|
||||
drawCircleMarker: false,
|
||||
drawPolygon: false,
|
||||
drawPolyline: false,
|
||||
drawMarker: false,
|
||||
if (key) {
|
||||
template[key] = '';
|
||||
addKeyToTemplateList(key);
|
||||
$('#key-name').val('');
|
||||
}
|
||||
});
|
||||
|
||||
$('#save-templates').on('click', function () {
|
||||
const json = JSON.stringify(template, null, 2);
|
||||
$('#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>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in a new issue