I am working with the code that contains the TrackEnded event and I now have another question. When I'm drawing a polygon initially, I click on the points one at a time and then when I'm finished, I double-click and that completes my shape and the TrackEnded event is raised.
But when I'm editing the polygon, after I have finished changing the polygon to be what I want, what do I have to do to say that I'm done editing the shape? If I double-click, it zooms in. I added a button to set the Track Mode to none, but that doesn't do the trick. What do I have to do to tell it that the track has ended so it will raise the Track Ended event? Should I raise the event myself?
I have a sort of related question that I feel I should know the answer to, but haven’t figured this out yet. I’m not exactly sure how to use the edit overlay. I’m obviously using it for creating shapes, but I don’t feel like I fully understand it. After I create a polygon using Track Shapes, I move the created shape to a different layer that’s part of the StaticOverlay. Can I edit the shape on that layer? Do I have to move the shape back to the edit layer on the Edit Overlay?
(On a different post, someone asked about books or websites for training. I have been able to do an impressive amount quickly with your software, but some detailed background information and explanations of some concepts would be hugely beneficial. If there were a venue for getting that information, I would love to hear it. A training session/conference-like meeting would be way cool!)
TrackEnd will not be raised when you edit the shape. For example, after adding a new vertex to the shape, the system has no idea whether we will add another vertex or it has already been completed, so we need to let the system know ourselves. We might add an EditEnd event though that would be raised everytime we finished doing one editing (like add one vertex). This is not finally decided and I suggest you to keep an eye on developer’s blog where David will public the new editing APIs to get user’s feedback, he might do it today or tomorrow and please feel free to let us know your suggestions then.
There are 2 kinds of Edit in Desktop Edition. One is to Edit a feature visually on the map, the other is the “real” edit to change the feature in the data source. EditOverlay is only for the visually editing, it records the features you drew but didn’t change anything, if you want to update those features to a shape file for example, you need to do the second “editing” to commit the changes to the data source. You need to call featureSouce.BeginTransaction(), update the features and then CommitTransaction().
We planned to make a manual and I think we will start working on it very soon. We have a Webinar every now and then where you can directly ask questions to our developers. About a training meeting, that’s interesting. I will report it to the developers and see if we can arrange one. By the way, for any problems, you can always ask on the forum also. :-)
After adding the new map component, I notice that my SnapToZoomLevel = False is being ignored as my map snaps to zoom level. Also, my MinimumScale is ignored. If I set SnapToZoomLevel = false and set MinimumScale to 100, the changes save but are not used. This was working before the new component. Any help is appreciated.
We will send the temporary package to you today or tomorrow by email. We will send it to the account you registered and please contact support@thinkgeo.comif you have any issues.
Thanks,
Ben
Ben, Can you also send me the temporary package? I need the event too.
We couldn’t recreate this issue with the same component we sent you. Can you let me know more about that problem? Could you provide us a simple sample?
Also, while on the subject of track shape I noticed the Circle and Ellipse track shapes are still only Polygon Shapes? I would like the ability to drag a circle track shape and be able to detail its radius and circumference very similar to what the EllipseShape type seems to be able to do. How can I get from the PolygonShape to the EllipseShape?
As we are using OGC WKB to store the shapes internally and OGC doesn’t support Ellipse and Circle but polygon, I’m afraid we can only get a polygon out from the internal features. There is no way to directly convert a polygon into an ellipse, one way to work it around though is to get the boundingbox of the return polygon and create a new ellipse based on its center point and length/height, there is some extra calculation here but you can get the ellipse accurately.
I need the Area, Circumference and Radius of the circle.
The Area and Perimeter are available which can roughly be used as the the circumference I would imagine, right?
For getting the radius, can I take the bounding box of the circle track shape and divide its Width property by 2 to effectively get the radius? Or is this a highly unreliable means? The numbers seem to work out for me, but your opinion would be welcome in case I am missing something.
Whenever passing an ellipse into the internal features, it will generate a polygon with 384 (96* 4) points (by default) to simulate that ellipse. It’s not 100% identical but you can tell it’s very accurate. As a result, I think you agree that the perimeter can be used as the circumference and divide the bounding box‘s width by 2 is not a bad idea to get the radius.
Excellent. That is functionally all I need. There is a certain level of tolerance expected for us in the accuracy of these numbers anyways as we often deal with feet level numbers. I just wanted to make sure I was going about it in a way that made sense.