Вырезал захардкоженный слой с ортофотопланом

This commit is contained in:
zakhy 2025-05-14 10:40:57 +07:00
parent a2f4e39423
commit 488d6355b6
6 changed files with 13 additions and 99 deletions

View File

@ -420,25 +420,6 @@
mapCore.addLayer(gtoLayer, 'dynamic');
const scanLayer = new ol.layer.Tile({
source: new ol.source.XYZ({
url: `/media/map/orth/tiles/{z}/{x}/{y}.png?seed=${Math.random() * 1000}`,
}),
extent: ol.proj.transformExtent(
[
parseFloat('{{ orth_minLon }}'),
parseFloat('{{ orth_minLat }}'),
parseFloat('{{ orth_maxLon }}'),
parseFloat('{{ orth_maxLat }}')
],
'EPSG:4326', // Исходная проекция
'EPSG:3857' // Целевая проекция
)
});
scanLayer.set('title', 'Ортофотоплан')
scanLayer.set('name', 'orto')
mapCore.addLayer(scanLayer)
const mineBorderLayer = new ol.layer.Vector({
source: new ol.source.Vector({
url: '/{{ prgr }}',

View File

@ -345,7 +345,6 @@
let translateInteraction = {}
let extentInteraction = {}
let i = 0
const scanLayerExists = Boolean(parseInt('{{ scan_layer_enable }}'))
let vectorSource = {}
let vectorLayer = {}
let group = {}
@ -356,26 +355,6 @@
}),
]
if (scanLayerExists) {
scanLayer = new ol.layer.Tile({
source: new ol.source.XYZ({
url: `/media/map/orth/tiles/{z}/{x}/{y}.png?seed=${Math.random() * 1000}`,
}),
extent: ol.proj.transformExtent(
[
parseFloat('{{ orth_minLon }}'),
parseFloat('{{ orth_minLat }}'),
parseFloat('{{ orth_maxLon }}'),
parseFloat('{{ orth_maxLat }}')
],
'EPSG:4326', // Исходная проекция
'EPSG:3857' // Целевая проекция
)
});
scanLayer.set('name', 'Ортофотоплан')
layers.push(scanLayer)
}
function getCoordsByFeature(feature, resoluiton) {
const coords = feature.getGeometry().getCoordinates()
const coordsIn4326 = ol.proj.transform(coords, 'EPSG:3857', 'EPSG:4326');

View File

@ -136,25 +136,6 @@
mapCore.addLayer(workerLayer, 'dynamic');
mapCore.addLayer(seismicLayer, 'dynamic');
const scanLayer = new ol.layer.Tile({
source: new ol.source.XYZ({
url: `/media/map/orth/tiles/{z}/{x}/{y}.png?seed=${Math.random() * 1000}`,
}),
extent: ol.proj.transformExtent(
[
parseFloat('{{ orth_minLon }}'),
parseFloat('{{ orth_minLat }}'),
parseFloat('{{ orth_maxLon }}'),
parseFloat('{{ orth_maxLat }}')
],
'EPSG:4326', // Исходная проекция
'EPSG:3857' // Целевая проекция
)
});
scanLayer.set('title', 'Ортофотоплан')
scanLayer.set('name', 'orto')
mapCore.addLayer(scanLayer)
const mineBorderLayer = new ol.layer.Vector({
source: new ol.source.Vector({
url: '/{{ prgr }}',

View File

@ -49,7 +49,7 @@
</section>
<section class="content">
<form autocomplete="off" method="post" enctype="multipart/form-data" class="form-horizontal">
<form autocomplete="off" method="post" enctype="multipart/form-data" class="form-horizontal" id="form">
{% csrf_token %}
<div class="container-fluid">
<div class="row">
@ -153,7 +153,7 @@
</div>
</div>
<div class="card-footer">
<button id="btnok" type="submit" class="btn bg-gradient-primary">Сохранить</button>
<button id="saveButton" type="submit" class="btn bg-gradient-primary">Сохранить</button>
<a href="/management/" type="button" class="btn btn-default float-right">Отмена</a>
</div>
<!-- /.card -->
@ -168,6 +168,17 @@
</section>
{% endblock %}
{% block script_footer %}
<script>
document.getElementById("saveButton").addEventListener("click", (event) => {
$("#saveButtonIcon").hide()
event.target.insertAdjacentHTML('afterbegin', `
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
`);
event.target.disabled = true
document.getElementById("form").submit()
})
</script>
<script>
const inputArr = document.querySelectorAll('.custom-file')
for (let div of inputArr) {

View File

@ -122,25 +122,6 @@
mapCore.addLayer(workerLayer, 'dynamic');
const scanLayer = new ol.layer.Tile({
source: new ol.source.XYZ({
url: `/media/map/orth/tiles/{z}/{x}/{y}.png?seed=${Math.random() * 1000}`,
}),
extent: ol.proj.transformExtent(
[
parseFloat('{{ orth_minLon }}'),
parseFloat('{{ orth_minLat }}'),
parseFloat('{{ orth_maxLon }}'),
parseFloat('{{ orth_maxLat }}')
],
'EPSG:4326', // Исходная проекция
'EPSG:3857' // Целевая проекция
)
});
scanLayer.set('title', 'Ортофотоплан')
scanLayer.set('name', 'orto')
mapCore.addLayer(scanLayer)
const mineBorderLayer = new ol.layer.Vector({
source: new ol.source.Vector({
url: '/{{ prgr }}',

View File

@ -122,25 +122,6 @@
mapCore.addLayer(workerLayer, 'dynamic');
const scanLayer = new ol.layer.Tile({
source: new ol.source.XYZ({
url: `/media/map/orth/tiles/{z}/{x}/{y}.png?seed=${Math.random() * 1000}`,
}),
extent: ol.proj.transformExtent(
[
parseFloat('{{ orth_minLon }}'),
parseFloat('{{ orth_minLat }}'),
parseFloat('{{ orth_maxLon }}'),
parseFloat('{{ orth_maxLat }}')
],
'EPSG:4326', // Исходная проекция
'EPSG:3857' // Целевая проекция
)
});
scanLayer.set('title', 'Ортофотоплан')
scanLayer.set('name', 'orto')
mapCore.addLayer(scanLayer)
const mineBorderLayer = new ol.layer.Vector({
source: new ol.source.Vector({
url: '/{{ prgr }}',