如何获取蓝色圆圈的坐标

时间:2019-04-01 13:39:10

标签: openlayers-5

我使用openlayers在地图上绘制,修改和对齐LineString。

当我移动鼠标时,一个小的蓝色圆圈被捕捉到特征(LineString)上。 我可以得到鼠标指针的坐标。 如何获得蓝色小圆圈的坐标?

import { Draw, Modify, DragAndDrop, Snap } from 'ol/interaction';
const map = new Map({target: 'map-container',
view: new View({ center: fromLonLat([6.4014458656311, 52.2779654296947]), zoom: 17 }),
layers: [new Tile({ source: new OSM() })]
});

var snap = new Snap({ source: source, edge: false });

map.addInteraction(draw);
map.addInteraction(modify);
map.addInteraction(snap);

// Get coordinate of mousepointer.
map.on('pointermove', function (e) {
if (e.dragging) return;

console.log(`e.coor=${e.coordinate}`);
}

0 个答案:

没有答案