New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Indicating polygon vertices with small circles #3165
Comments
You could this by setting a geometry function returning a MultiPoint geometry with all vertices on the style. See also this example: http://openlayers.org/en/master/examples/earthquake-clusters.html But please ask questions on the mailing list or StackOverflow. |
@tsauerwein do you know how to display both the polygon and its vertices? |
@elemoine You have two styles, one for the polygon and one for the points. And the style for the points has a custom geometry function:
|
Neat, wouldn’t this deserve an example? |
@tsauerwein, I see. Thanks for the answer. |
agree with @tonio that this would make a nice example |
Thank you for posting the answer to this - I tested the geometry function and it works perfectly. As for asking on StackOverflow first, I did - and I just added your response there. EDIT: Apparently you did too, at the same time - one minute after me :-) I removed my own response, and accepted yours - thanks again. |
Great work, I think this is part of examples section in OpenLayers page. Could someone help me select these created circles. I need to allow certain functionality only to these circles on the corners of a Polygon.. |
If I want to change the current click vertice`s style, like change it`s color, how can I do? Because I want to remove this vertice by modify.removePoint(). (For better user experience). |
I am using OpenLayers 3 and have more or less implemented everything in my requirements list, except one thing: I am asked to somehow make the polygon rendering indicate the polygon's vertices with small circles.
This helps the users avoid creating accidental overlaps (or slivers) in the polygons they draw, when a neighboring polygon's edge appears to be a straight line, but in fact it's almost a straight line, and has a vertex right along its middle. Here's an example - look at the right edge of Polygon A below:
In plain words, the desired polygon outline is not just a line - it is a line "adorned" with small circles in all the places where there is a vertex.
How can I do that in OL3? I searched in the ol.style.Style docs (that is, the style I pass via
setStyle
to theol.layer.Vector
containing my polygons), but didn't find anything relevant.The text was updated successfully, but these errors were encountered: