function measureDisCompleted(measureEventArgs) {
var distance = measureEventArgs.result.distance.toFixed(2),
str = '';
if (distance != -1) {
str = "距离:" + distance + "千米";
} else {
}
if (map.getLayerIndex(labelLayer) == -1) {
map.addLayers([labelLayer]);
}
map.setLayerIndex(labelLayer, map.getNumLayers() - 1);
var label = new SuperMap.Geometry.GeoText(lonx, laty, str);
var labelFeature = new SuperMap.Feature.Vector(label);
labelFeatureList.push(labelFeature);
labelLayer.addFeatures(labelFeature);
}
仅供参考