openlayers 3 - get point from ol.geom.MultiPolygon -
i trying add marker @ center or anywhere of feature (ol.geom.multipolygon) , cannot point (x,y) !!!
var coordinates= feature.getgeometry().getcoordinates();
/** marker data */ var iconfeature = new ol.feature({ geometry: new ol.geom.point([coordinates[0][0][0], coordinates[0][0][1]]), /** if works: geometry: new ol.geom.point([8420.360601958382, 12492.263314383097]), */ name: 'null island', population: 4000, rainfall: 500 }); thank;s again !
try:
feature.getgeometry().getinteriorpoints().getpoint(0)
Comments
Post a Comment