|
@@ -229,10 +229,9 @@ export class TMapMngr {
|
|
|
} catch (err) {
|
|
|
console.error(err);
|
|
|
}
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
if (_mapMngr.onMouseClickFunc != null) {
|
|
|
- _mapMngr.onMouseClickFunc(-1, -1, -1, -1, -1,-1, -1);
|
|
|
+ _mapMngr.onMouseClickFunc(-1, -1, -1, -1, -1, -1, -1);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
@@ -253,12 +252,10 @@ export class TMapMngr {
|
|
|
let xy = [];
|
|
|
if (lyrType <= LayerType.VMSI) {
|
|
|
xy = e.coordinate; //coord[0];
|
|
|
- }
|
|
|
- else if (coord) {
|
|
|
+ } else if (coord) {
|
|
|
xy[0] = coord[0];
|
|
|
xy[1] = coord[1];
|
|
|
- }
|
|
|
- else if (obj.coordinates) {
|
|
|
+ } else if (obj.coordinates) {
|
|
|
xy[0] = obj.coordinates[0];
|
|
|
xy[1] = obj.coordinates[1];
|
|
|
}
|
|
@@ -281,8 +278,7 @@ export class TMapMngr {
|
|
|
console.error(err);
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
if (_mapMngr.onMouseClickFunc != null) {
|
|
|
_mapMngr.onMouseClickFunc(-1, -1, -1, -1, -1, e.pixel[0], e.pixel[1]);
|
|
|
}
|
|
@@ -290,8 +286,17 @@ export class TMapMngr {
|
|
|
});
|
|
|
|
|
|
this.map.on("pointermove", this.onMouseMove);
|
|
|
+ this.map.getViewport().addEventListener("mouseout", this.onMapMouseOut);
|
|
|
} // constructor
|
|
|
|
|
|
+ onMapMouseOut( e ) {
|
|
|
+ _mapMngr.tooltip.style.display = "none";
|
|
|
+ if (_mapMngr.selLink != null && _mapMngr.selLinkStyle != null) {
|
|
|
+ _mapMngr.selLink.setStyle(_mapMngr.selLinkStyle);
|
|
|
+ _mapMngr.selLink = null;
|
|
|
+ _mapMngr.selLinkStyle = null;
|
|
|
+ }
|
|
|
+ }
|
|
|
onMouseMove(e) {
|
|
|
_mapMngr.tooltip.style.display = "none";
|
|
|
if (e.dragging) {
|
|
@@ -303,7 +308,7 @@ export class TMapMngr {
|
|
|
}
|
|
|
_mapMngr.map.getTarget().style.cursor = "";
|
|
|
|
|
|
- if (_mapMngr.selLink) {
|
|
|
+ if (_mapMngr.selLink != null && _mapMngr.selLinkStyle != null) {
|
|
|
_mapMngr.selLink.setStyle(_mapMngr.selLinkStyle);
|
|
|
_mapMngr.selLink = null;
|
|
|
_mapMngr.selLinkStyle = null;
|
|
@@ -358,11 +363,11 @@ export class TMapMngr {
|
|
|
iwContent += '<div export class="head"><span export class="title">' + road + '</span><span export class="traffic">' + info + "</span></div>";
|
|
|
iwContent += '<div export class="cont">';
|
|
|
iwContent += "<dl><dt>" + path + "</dt>";
|
|
|
- let sectLength = '-';
|
|
|
+ let sectLength = "-";
|
|
|
if (refObj.SECT_LNGT) {
|
|
|
sectLength = refObj.SECT_LNGT.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
|
}
|
|
|
- let sped = '-';
|
|
|
+ let sped = "-";
|
|
|
if (refObj.sped) {
|
|
|
sped = refObj.sped.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
|
}
|
|
@@ -374,12 +379,12 @@ export class TMapMngr {
|
|
|
const lyrName = "[" + lyrInfo.lyrName + "]";
|
|
|
const COMM = obj.COMM;
|
|
|
let path = obj.NAME;
|
|
|
- if (lyrName === '[교차로카메라]') {
|
|
|
- const direction = ['북', '동', '남', '서', '북동', '남동', '북서', '남서'];
|
|
|
- if (obj.drct_dvsn_cd >= 0) path = obj.NAME + " (" + direction[obj.drct_dvsn_cd - 1] + ")"
|
|
|
+ if (lyrName === "[교차로카메라]") {
|
|
|
+ const direction = ["북", "동", "남", "서", "북동", "남동", "북서", "남서"];
|
|
|
+ if (obj.drct_dvsn_cd >= 0) path = obj.NAME + " (" + direction[obj.drct_dvsn_cd - 1] + ")";
|
|
|
}
|
|
|
if (path === null || path === undefined || path === "") {
|
|
|
- path = '-';
|
|
|
+ path = "-";
|
|
|
}
|
|
|
let grade = 1;
|
|
|
let info = "";
|
|
@@ -410,17 +415,17 @@ export class TMapMngr {
|
|
|
iwContent += '<div export class="cont">';
|
|
|
iwContent += "<dl><dt>" + path + "</dt>";
|
|
|
if (obj.NMBR) {
|
|
|
- iwContent += "<dd>NO : " + obj.NMBR
|
|
|
+ iwContent += "<dd>NO : " + obj.NMBR;
|
|
|
}
|
|
|
if (obj.ID) {
|
|
|
iwContent += "<br/> ID : " + obj.ID + "</dd>";
|
|
|
}
|
|
|
- if (lyrName === '[교차로카메라]') {
|
|
|
- let traff = '-';
|
|
|
+ if (lyrName === "[교차로카메라]") {
|
|
|
+ let traff = "-";
|
|
|
if (obj.info1) {
|
|
|
traff = obj.info1.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
|
}
|
|
|
- iwContent += "<dd>교통량 : " + traff + " 대</dd>"
|
|
|
+ iwContent += "<dd>교통량 : " + traff + " 대</dd>";
|
|
|
}
|
|
|
iwContent += "</dl></div>";
|
|
|
}
|
|
@@ -525,7 +530,16 @@ export class TMapMngr {
|
|
|
iwContent += '<div export class="head"><span export class="title">' + nmbr + '</span><span export class="traffic">' + info + "</span></div>";
|
|
|
iwContent += '<div export class="cont">';
|
|
|
iwContent += "<dl><dt>" + path + "</dt>";
|
|
|
- iwContent += "<dd>등록시각: " + getParseDateTime(REG_DT) + "<br/>시작시각: " + getParseDateTime(STR_DT) + "<br/>종료시각: " + getParseDateTime(END_DT) + "<br/>발생장소: " + INCLOC + "</dd>";
|
|
|
+ iwContent +=
|
|
|
+ "<dd>등록시각: " +
|
|
|
+ getParseDateTime(REG_DT) +
|
|
|
+ "<br/>시작시각: " +
|
|
|
+ getParseDateTime(STR_DT) +
|
|
|
+ "<br/>종료시각: " +
|
|
|
+ getParseDateTime(END_DT) +
|
|
|
+ "<br/>발생장소: " +
|
|
|
+ INCLOC +
|
|
|
+ "</dd>";
|
|
|
iwContent += "</dl></div>";
|
|
|
}
|
|
|
}
|
|
@@ -678,14 +692,14 @@ export class TMapMngr {
|
|
|
EditLinkColor[2] = "#FFAA00";
|
|
|
EditLinkColor[3] = "#FF0000";
|
|
|
}
|
|
|
- setTrafficGradDesc( jsonData ) {
|
|
|
+ setTrafficGradDesc(jsonData) {
|
|
|
if (jsonData && jsonData.length > 0) {
|
|
|
- jsonData.map((item)=>{
|
|
|
+ jsonData.map((item) => {
|
|
|
if (item.cmmn_cd) {
|
|
|
- let idx = item.cmmn_cd.substring(item.cmmn_cd.length-1, item.cmmn_cd.length);
|
|
|
+ let idx = item.cmmn_cd.substring(item.cmmn_cd.length - 1, item.cmmn_cd.length);
|
|
|
TrafficGradeDesc[idx] = item.cmmn_cd_kor_nm;
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
setEditMode(ALyrIdx, AIsEdit) {
|
|
@@ -874,8 +888,8 @@ export class TMapMngr {
|
|
|
|
|
|
getInfo() {
|
|
|
return {
|
|
|
- zoom : _mapMngr.currZoom,
|
|
|
- center : _mapMngr.centerPos,
|
|
|
+ zoom: _mapMngr.currZoom,
|
|
|
+ center: _mapMngr.centerPos,
|
|
|
};
|
|
|
}
|
|
|
// 레이어 객체 선택
|
|
@@ -1152,22 +1166,22 @@ export class TMapMngr {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // 지도영역 다시 그리기(화면이 리사이즈 될 경우 등)
|
|
|
- updateSize() {
|
|
|
- if (this.resizeMapUpdateTimer) {
|
|
|
- clearTimeout(this.resizeMapUpdateTimer);
|
|
|
+ // 지도영역 다시 그리기(화면이 리사이즈 될 경우 등)
|
|
|
+ updateSize() {
|
|
|
+ if (this.resizeMapUpdateTimer) {
|
|
|
+ clearTimeout(this.resizeMapUpdateTimer);
|
|
|
+ }
|
|
|
+ this.resizeMapUpdateTimer = setTimeout(() => {
|
|
|
+ this.map.updateSize();
|
|
|
+ // let layerArr = this.config.baseMapLyr.satellite.getLayers().getArray();
|
|
|
+ // layerArr.forEach((layer) => layer.redraw());
|
|
|
+ // this.config.baseMapLyr.satellite.layers.forEach((lyr) => lyr.redraw());
|
|
|
+ // this.config.baseMapLyr.normal.layers.forEach((lyr) => lyr.redraw());
|
|
|
+ // this.config.baseMapLyr.satellite.redraw();
|
|
|
+ // this.config.baseMapLyr.normal.redraw();
|
|
|
+ }, 450);
|
|
|
}
|
|
|
- this.resizeMapUpdateTimer = setTimeout(() => {
|
|
|
- this.map.updateSize();
|
|
|
- // let layerArr = this.config.baseMapLyr.satellite.getLayers().getArray();
|
|
|
- // layerArr.forEach((layer) => layer.redraw());
|
|
|
- // this.config.baseMapLyr.satellite.layers.forEach((lyr) => lyr.redraw());
|
|
|
- // this.config.baseMapLyr.normal.layers.forEach((lyr) => lyr.redraw());
|
|
|
- // this.config.baseMapLyr.satellite.redraw();
|
|
|
- // this.config.baseMapLyr.normal.redraw();
|
|
|
- }, 450);
|
|
|
-}
|
|
|
-// 지도화면 refresh
|
|
|
+ // 지도화면 refresh
|
|
|
refreshMap() {
|
|
|
if (this.editMode) {
|
|
|
// 편집 모드
|
|
@@ -1455,7 +1469,7 @@ export class TMapMngr {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-function getParseDateTime(param){
|
|
|
+function getParseDateTime(param) {
|
|
|
if (param.length <= 14) {
|
|
|
let str = "";
|
|
|
str += param.substring(0, 4);
|
|
@@ -1470,8 +1484,7 @@ function getParseDateTime(param){
|
|
|
str += ":";
|
|
|
str += param.substring(12, 14);
|
|
|
return str;
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
return param;
|
|
|
}
|
|
|
}
|