지도 레이어 추가

This commit is contained in:
yschoi
2025-07-07 16:58:53 +09:00
parent cbb41bb200
commit b7f345fdf7
4 changed files with 54 additions and 28 deletions
@@ -31,8 +31,6 @@ const GisApp = {};
//레이어 정보
GisApp.layerInfos = [];
//기본정보
//GisApp.GEOSERVER_URL = 'http://rsone.iptime.org:10010/geoserver/hasudo/ows';
//GisApp.GEOSERVER_WMS_URL = 'http://rsone.iptime.org:10010/geoserver/hasudo/wms';
GisApp.GEOSERVER_URL = '/geoserver/hasudo/ows';
GisApp.SN_GEOSERVER_URL = '/sewerage-service/api/v1/map/geometry';
GisApp.GEOSERVER_WMS_URL = '/geoserver/hasudo/wms';
@@ -56,7 +54,6 @@ GisApp.OPENSTREET_URL = '//tile.openstreetmap.org/{z}/{x}/{y}.png';
GisApp.BASE_MAP_TYPES = [];
GisApp.FROM_PROJ = 'EPSG:4326';
// GisApp.TO_PROJ = 'EPSG:3857';
GisApp.TO_PROJ = 'EPSG:5179'; //ngii 좌표계
GisApp.TO_DATA_PROJ = 'EPSG:4326';
GisApp.CONTEXT_LAYER_PATH = '/images/map/layericon/';
@@ -77,19 +77,6 @@ GisOlLayer.prototype = {
let lyrTyNm = options.lyrTyNm;
let typename = this.storageNm + lyrTyNm;
if(options.lyrTyNm == "om_dt_untrt_swg_rain" //중점우수토실
|| options.lyrTyNm == "om_wqlt_station" //관측소
|| options.lyrTyNm == "tb_wr_bdst_ruse_fclt" //재이용시설
|| options.lyrTyNm == "tb_wr_rnwtr_utztn_fclt" //빗물이용시설
|| options.lyrTyNm == "tb_wr_rswtr_fclt" //중수도시설
|| options.lyrTyNm == "tb_wr_htdfl_fclt" //온배수시설
|| options.lyrTyNm == "tb_wr_tmpr_dmd_co" //잠재수요처
)
{
url = GisApp.SN_GEOSERVER_URL;
typename = lyrTyNm;
}
const params = {};
params['TYPENAME'] = typename;
params['SERVICE'] = 'WFS';
@@ -97,16 +84,23 @@ GisOlLayer.prototype = {
params['REQUEST'] = 'GetFeature';
params['SRS'] = toProj;
params['OUTPUTFORMAT'] = 'application/json';
if (options?.flterSql && options?.flterSql?.trim() !== 'null') {
params['CQL_FILTER'] = options?.flterSql;
}
const strParams = new URLSearchParams(params).toString();
let source = new VectorSource({
format: new GeoJSON(),
url: function (extent) {
const [minX, minY, maxX, maxY] = extent;
const bboxFilter = `BBOX(geom, ${minX}, ${minY}, ${maxX}, ${maxY}, '${toProj}')`;
const filter = options?.flterSql && options.flterSql && options.flterSql.trim() !== ''
? `(${options.flterSql}) AND ${bboxFilter}`
: bboxFilter;
params['CQL_FILTER'] = filter;
const strParams = new URLSearchParams(params).toString();
return url + '?' + strParams;
},
strategy: all,
strategy: bbox,
});
return source;
},
@@ -212,7 +206,7 @@ GisOlLayer.prototype = {
return null;
}
let vectorSource = new VectorSource({
strategy: all,
strategy: bbox,
});
if (feature) {
if (Object.prototype.toString.call(feature).slice(8, -1).indexOf('Object') > -1) {