[RESOLVED]How to Capture the coordinates and store them in the database or for now in an xml file

Here i am capturing the coordinates of the polygon end points and displaying the longitude and latitude of the specific points.

But i am not able to store the End points value to a XML File.

Please give suggestion.. 

somk

Here i am capturing

Any sample code of what you meant by "here"?

My Sample Code: 

google.maps.event.addListener(drawingManager, ‘polygoncomplete’, function (polygon) {
debugger;
polygon.getPath().forEach(function (elem, index) {
document.getElementById(‘info’).innerHTML += "[" + index + "] " + elem.toUrlValue() + "<br>";
//console.log(elem.lat());
//console.log(elem.lng());
});
});

using this JS function i am getting the value of endpoints of polygon, but my question is after that how can i store the values to XML file.

See this example: http://jsfiddle.net/rvsMH/1/ 

After a polygon is completed it assigns all coordinates to a textbox below map. All what you need is a corresponding code that will get that textbox in the code behind and save in required format (e.g. xml).

Yes, i am getting the value.but how i can store that value to XML file ?

All what you need is a corresponding code that will get that textbox in the code behind and save in required format (e.g. xml).

What it is the exact issue with that? You do not know how to capture Save button click in the code behind?

Thank you for your valuable answer.

Now i am saving the data into a XML file. But again i have to search, if i am selected another polygon area.

There i have to check if that point is in the previously selected polygon or not, how?

somk

i have to search, if i am selected another polygon area

Not sure what you mean by this but if you need to check if point is already in xml or not – you need to search.

For example using linq to xml

XElement root = XElement.Load("TestConfig.xml");
int count =
    (from el in root.Elements("Item")
    where (string)el.Element("Point") == "123456"
    select el).Count();
if (count > 0)
// point exists

http://msdn.microsoft.com/de-de/library/bb387053.aspx

http://www.dotnetperls.com/xelement 

Leave a Reply