/* 距离测量 */
import Draw from 'ol/interaction/Draw';
import {MeasureParameters} from '@supermap/iclient-common/iServer/MeasureParameters';
draw = new Draw({
source: source,
type: "LineString"
});
draw.on('drawstart', function (evt) {
feature = evt.feature;
});
draw.on('drawend', function () {
var distanceMeasureParam = new MeasureParameters(feature.getGeometry());
new ol.supermap.MeasureService(url,
{measureMode: ""}).measureDistance(distanceMeasureParam, function (serviceResult) {
debugger
alert(serviceResult.result.distance);
});
});
map.addInteraction(draw);
第一个断点走过之后,没有进第二个,现在就是基于vue的 MeasureService 函数没找到! 有依赖地址请回复下谢谢~