Условная отрисовка orto
This commit is contained in:
parent
cab4abe467
commit
b9a1cb484f
@ -45,7 +45,7 @@
|
||||
<div class="input-group d-flex flex-column">
|
||||
<label for="id_layer_file_input" class="file-upload-label">Выберите файл с
|
||||
расширением
|
||||
.kml, .json, .dxf </label>
|
||||
.kml, .json, .dxf</label>
|
||||
<span>Сейчас выбран: <span id="file_path"
|
||||
style="cursor: auto; color: var(--primary);"></span></span>
|
||||
<input type="file" name="layer_file_input"
|
||||
@ -123,33 +123,37 @@
|
||||
let translateInteraction = {}
|
||||
console.log(centerLat)
|
||||
let i = 0
|
||||
scanLayer = new ol.layer.Tile({
|
||||
source: new ol.source.XYZ({
|
||||
url: '/media/map/orth/tiles/{z}/{x}/{y}.png',
|
||||
const scanLayerExists = Boolean(parseInt('{{ scan_layer_enable }}'))
|
||||
|
||||
layers = [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.OSM()
|
||||
}),
|
||||
extent: ol.proj.transformExtent(
|
||||
[
|
||||
parseFloat('87.889212480'),
|
||||
parseFloat('53.633875446'),
|
||||
parseFloat('87.965792495'),
|
||||
parseFloat('53.713365769')
|
||||
],
|
||||
'EPSG:4326', // Исходная проекция
|
||||
'EPSG:3857' // Целевая проекция
|
||||
)
|
||||
});
|
||||
]
|
||||
if (scanLayerExists) {
|
||||
scanLayer = new ol.layer.Tile({
|
||||
source: new ol.source.XYZ({
|
||||
url: '/media/map/orth/tiles/{z}/{x}/{y}.png',
|
||||
}),
|
||||
extent: ol.proj.transformExtent(
|
||||
[
|
||||
parseFloat('87.889212480'),
|
||||
parseFloat('53.633875446'),
|
||||
parseFloat('87.965792495'),
|
||||
parseFloat('53.713365769')
|
||||
],
|
||||
'EPSG:4326', // Исходная проекция
|
||||
'EPSG:3857' // Целевая проекция
|
||||
)
|
||||
});
|
||||
scanLayer.set('name', 'Ортофотоплан')
|
||||
layers.push(scanLayer)
|
||||
}
|
||||
|
||||
|
||||
scanLayer.set('name', 'Ортофотоплан')
|
||||
|
||||
const map = new ol.Map({
|
||||
target: 'map',
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.OSM()
|
||||
}),
|
||||
scanLayer
|
||||
],
|
||||
layers: layers,
|
||||
view: new ol.View({
|
||||
center: ol.proj.fromLonLat([centerLon, centerLat]), // Центр карты
|
||||
zoom: 12,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user