您好,您具体可以参考https://iclient.supermap.io/examples/openlayers/editor.html#02_editFeatures
pointFeature = new ol.Feature(new ol.geom.Point(point));
pointFeature.setStyle(new ol.style.Style({
image: new ol.style.Circle({
fill: new ol.style.Fill({
color: [255, 0, 0, 0.5]
}),
stroke: new ol.style.Stroke({
color: 'red',
width: 2
}),
radius: 8
})
}));
pointFeature.setProperties({POP: 1, CAPITAL: 'test'});
map.forEachFeatureAtPixel(e.pixel, function (feature) {
if (feature.getProperties().CAPITAL) {
map.getTargetElement().style.cursor = 'pointer';
var contentHTML = feature.getProperties().CAPITAL;
content.innerHTML = contentHTML;
overlay.setPosition(feature.getGeometry().getCoordinates());
map.addOverlay(overlay);
select = true
}
}