Polygon Editing

Hi,

In the demo of Vega http://cesiumjs.org/demos/vega.html they have a polygon editing tool that could be very useful for the project I am currently working on. Is there open source project I could look at that has this capability?

Thanks!
Matt

Hi,

I need a similar functionality so I started to put a bit of code together to have a 2D shape editor. I am making this project OS. You can find it @https://github.com/leforthomas/DrawHelperCesium

It’s only a few days of work, so it’s not exactly feature packed ;-). Only 2D Polygon, Extent and Circle for now. No tablet support, etc…

You can see the code live @ http://pad.geocento.com/DrawHelper/

The way the demo works: start drawing shapes using the buttons in the window. Hover above the shapes to highlight them. Click to edit them. When editing some markers are added to change the shapes. Use them :wink: The server is very slow BTW.

I have a few issues:

  • can’t seem to be able to get the billboards on top of the shapes, even when using raiseToTop (actually the reason I came to this group in the first place)

  • some issues with the polygons drawing and editing

Like I said it’s a very first stab. If you want to take it onboard from where it is you are very welcome to grab the code. If you want to contribute, even better. If you any suggestion or requests please let me know. I have my own agenda for this, ie a web application possibly making use of Cesium, so no garantee I will implement them.

I need to do some other work right now but next iteration will add line and ellipse and some more controls to the editing of the shapes + some more UI feedback as well. And hopefully current bug fixed as well.

1 Like

Thomas,

This is a nice start here, thanks for sharing. When you think this is stable, please consider sharing it as a Cesium plugin: http://cesiumjs.org/2014/01/16/Introducing-Cesium-Plugins/

Patrick

Hi Patrick,

Thanks. Will do ASAP, most likely next week.

Nice work, this is exactly what i was looking for.

Thanks!

I’ve spent some time today and updated the DrawHelperwith some more features, if you are interested. Still available @ http://pad.geocento.com/DrawHelper/

I have a problem with polylines though. Polygons seem to be drawn following the earth curvature, along great circles, which is nice but not the polylines. If you draw a large polyline with the tool, ie spanning half the globe, you quickly see that the lines are “straight” and if you spin the globe they are even going “through the earth”. I am probably missing a parameter in there?

Nice progress! Looks like it is coming along quickly. Looking forward to the plugin.

To curve the polylines, see Hannah’s reply in this thread:

https://groups.google.com/forum/#!searchin/cesium-dev/Polylines$20curving$20with$20the$20shape$20of$20the$20earth%7Csort:relevance%7Cspell:true/cesium-dev/dMcJG0hgbKY/T18HopAB5n4J

Patrick

Hello, I made a little function to draw and update a circle and a polygon with only the mouse.
Your helper had an other approach but had same goals.
I can't find your plug in and I'd like to contribute to it if it possible
Best regards

Sure. The GitHub repository is at https://github.com/leforthomas/cesium-drawhelper

Thomas,

Thanks for posting this on github. When you are ready, please open a pull request to cesium-plugins-list and we’ll add this to the list of plugins.

Thanks,

Patrick

Patrick, I thought I did already. Will check again later tonight.

Please do, I don’t see any pull requests.

Patrick