Hi…
How can I delete shape from map and from database with using "Delete" button. Because there is no any javascript function with name "cancelLatestFeature()" into the sample code or in thinkgeo razor vb application. Please reply as early as possible.
Thanks & regards,
SAMIR
How can I delete shape from map and from database
Hi Samir,
In the "VB HowDoISamples vs2012 Razor" project, we have a sample name "DrawEditShapes", you can find the "DrawEditShapes.vbhtml" file and the sample shows a JavaScript function Map1.cancelLatestFeature.
<img class="imgBtn" src="@Url.Content("~/Content/images/Delete.gif")" id="buttonDeleteShape" onclick="Map1.cancelLatestFeature();return false;" alt="Delete Shape" />
Any question please let me know.
Regards,
Don
hi… Don
Yes you are right there is an example for it. But, it contains only the following functions no "cancelLatestFeature()" is there. Please reply as early as possible.
Thanks & regards,
SAMIR
Hi Samir,
Here is the sample: mvcsamples.thinkgeo.com/InteractiveOverlays/DrawEditShapes/1,AllSamples
And here is the code: mvcsamples.thinkgeo.com/Resources/SourceCode/670d1346-155b-4e0a-bc0c-c744951a2cde.htm
You can see the cancelLatestFeature function is called here, the implement of it contained by our map control, so you have to call Map1.cancelLatestFeature().
Sorry maybe I misunderstand you, please let me know more detail about your question.
Regards,
Don
Hi… Don
Thanks for your reply. Actually I am working with mssql2008Layer and my data is coming from database and after creating any shape’s on map the shape’s are saved in database also. So, In your example it is working with InMemoryfeaturelayer is very good, but with mssql2008layer, I can’t edit any map or delete any map. So, if you have solution for that kindly give me that solution as early as possible. Can you please reply as early possible.
Thanks & regards,
SAMIR
Samir,
If we want to edit or delete the features from database, the first step we need to do is find out those features from database. Which means we need to pass some parameters like the edit/delete feature id/coordinate from client side and then get them from database based on those ids/coordinates at server side.
Actually, I noticed you have went further from other post on this issue at thinkgeo.com/forums/MapSuite…fault.aspx. So, I want to confirm if the issue still exists or might be we can close this post and continue on the mentioned post.
Let us know if you have any questions,
Thanks,
Johnny