Notice
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
Tags
- cross-origin
- 오픈레이어스
- 텍스트채우기
- jupyterlab
- R kernel
- 최적Zoom
- map
- javascript lpad
- Deckgl ToolTip
- openlayers
- 다중팝업
- deckgl
- openlayers Popup
- 다중툴팁
- fitBounds
- javascript rpad
- Deckgl Tooltip fixed position
- docker
- JupyterHub
- openlayers crossorigin
- ToolTip
- 주피터허브
- crossorigin
- jupyterhub admin
- 지도
- 멀티툴팁
- WebMercatorViewport
- openlayers tooltip
- multiplePopup
- getZoom
Archives
- Today
- Total
Map 개발자의 길
DeckGL 거리측정 기능 개발 본문
1. DeckGl 거리측정 개발
- Deckgl Hover evt , Click evt 를 이용한 기능 구현

2. 코드
let preDisTanceLongLat = [];
new Deck({
id: 'map'
canvas: 'map'
layers: [baseMap] // 배경지도
onHover: function(e) {
const distancePointlayer = new ScatterplotLayer({
id: 'distancePath-movePoint',
data: [e.coordinate],
opacity: 0.8,
stroked: true,
filled: true,
txGrupKey: 'distance',
radiusScale: 2,
getPosition: d => {
return d;
},
getRadius: 2,
getFillColor: d => [255, 255, 255, 0],
getLineColor: d => [255, 255, 255]
});
if (preDisTanceLongLat.length > 0) {
var oData = [{
prelonglat: preDisTanceLongLat[tpreDisTanceLongLat.length - 1],
nextLonLat: e.coordinate
}];
const distanceLinelayer = new PathLayer({
id: 'distanceLinelayer_dash',
data: oData,
getWidth: 2,
pickable: false,
widthScale: 3,
widthMinPixels: 2,
widthMaxPixels: 2,
getPath: d => {
return d.geom.geometry.coordinates
},
getColor: d => [255, 172, 0],
getDashArray: [3, 2],
dashJustified: false,
extensions: [new PathStyleExtension({
dash: true
})],
});
}
},
onClick: function(e, mouseInfo) {
let longlat = e.coordinate //현재 마우스 위치
preDisTanceLongLat.push(longlat);
}
})
반응형
'DeckGL' 카테고리의 다른 글
geoFeatures의 bbox의 최적 Zoom 구하기 (0) | 2022.05.11 |
---|---|
DeckGL TextLayer 한글 깨짐/미표출 (2) | 2022.03.28 |
DeckGL Map 기울기(pitch) 적용시 깨짐 현상 (0) | 2021.06.09 |
DeckGL Layer On/Off (0) | 2020.11.16 |
DeckGL PointLayer draw (0) | 2020.02.25 |