Start drawing from existing geometry

13 views
Skip to first unread message

matteo.velludi...@gmail.com

unread,
Mar 20, 2018, 7:27:18 AM3/20/18
to OpenLayers Dev
Hi,

I'm Matteo a gis developer.
I have another problem for your attention.

I need to start drawing a feature from existing coordinates.

Imagine that i have some starting coordinates coming from a form called previousCoord

What a tried is the following:
geometryFunction = (coordinates, geometry) => {
  let geom
= geometry;
 
if (!geom) {
    geom
= this.createOLGeometry({type: geomType, coordinates: previousCoord});
 
}
  geom
.setCoordinates(previousCoord.concat(coordinates));
 
return geom;
};


What happen is that when the user clicks on the map the previousCoord are effectively drawn, but they are not drawn from the very start.
It is necessary the click event to trigger the first time the geometryFunction. is there a workaround for this?


I've seen that there is private method startDrawing_  that could (haven't tried it yet) be useful in may case (but it is private) any chance can this become public?

Can you give me any suggestion on how to achieve what i've asked you?

Cheers,
Matteo

matteo.velludi...@gmail.com

unread,
May 17, 2018, 9:19:57 AM5/17/18
to OpenLayers Dev
Hi, no news about this?
Reply all
Reply to author
Forward
0 new messages