gis 편집
This commit is contained in:
@@ -742,10 +742,13 @@ GisOlLayer.prototype = {
|
||||
const extent = this.combineExtents(geometries.map(g => g?.getExtent()));
|
||||
|
||||
let map = GisApp.Module.core.map;
|
||||
const targetZoom = 16;
|
||||
const currentZoom = Number(map.getView().getZoom());
|
||||
const maxZoom = Number.isFinite(currentZoom) && currentZoom > targetZoom ? currentZoom : targetZoom;
|
||||
map.getView().fit(extent, {
|
||||
duration: 300,
|
||||
padding: [50, 50, 50, 50],
|
||||
maxZoom: 16
|
||||
maxZoom: maxZoom
|
||||
});
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -132,13 +132,15 @@ GisOlSelect.prototype = {
|
||||
const selectedLayer = e.target?.getLayer(feature) || feature.getLayer?.();
|
||||
const clckZoom = Number(selectedLayer?.get('clckZoom'));
|
||||
const targetZoom = Number.isFinite(clckZoom) && clckZoom > 0 ? clckZoom : 16;
|
||||
const currentZoom = Number(map.getView().getZoom());
|
||||
const maxZoom = Number.isFinite(currentZoom) && currentZoom > targetZoom ? currentZoom : targetZoom;
|
||||
const geometry = feature.getGeometry();
|
||||
if (geometry) {
|
||||
const extent = geometry.getExtent();
|
||||
map.getView().fit(extent, {
|
||||
duration: 300,
|
||||
padding: [50, 50, 50, 50],
|
||||
maxZoom: targetZoom
|
||||
maxZoom: maxZoom
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,12 +343,13 @@ GisOlStyle.prototype = {
|
||||
//레이어 스타일 반환
|
||||
getLayerStyle: function (layer, options) {
|
||||
let gobjTy = layer.get('gobjTy');
|
||||
if (!gobjTy) return;
|
||||
if (!gobjTy || typeof this[gobjTy] !== 'function') return;
|
||||
let style = this[gobjTy](layer, options);
|
||||
return style;
|
||||
},
|
||||
getLayerStyleFunction: function (layer, options) {
|
||||
let gobjTy = layer.get('gobjTy');
|
||||
if (!gobjTy || typeof this[gobjTy] !== 'function') return;
|
||||
let styleFunction = function (feature, resolution) {
|
||||
return this[gobjTy](layer, options, feature, resolution);
|
||||
}.bind(this);
|
||||
|
||||
Reference in New Issue
Block a user