Kemal Ekren Kemal Ekren - 1 year ago 83
ASP.NET (C#) Question

Get City Name from Reverse Geocoding with latitude and longitude,32.901470&sensor=false

In this xml url, I couldn't get data from area which is explained in the below.

<long_name>Altınevler Mahallesi</long_name>

I'm using c#. Could you help me with this?

This is the code I tried to get the data from xml

XmlDocument xdoc = new XmlDocument();

XmlNodeList xNodelst = xdoc.DocumentElement.SelectNodes("entry");

foreach (XmlNode xNode in xNodelst)
label1.Text += "read";

Answer Source

I solved my question if anyone wants know be my guess. Solution indicated in the below.

Thank you

XmlDocument xDoc = new XmlDocument();
        xDoc.Load("" +coordinate+"&location_type=ROOFTOP&result_type=street_address&key=YOURAPIKEY");

        XmlNodeList xNodelst = xDoc.GetElementsByTagName("result");
        XmlNode xNode = xNodelst.Item(0);
        string adress = xNode.SelectSingleNode("formatted_address").InnerText;
        string mahalle = xNode.SelectSingleNode("address_component[3]/long_name").InnerText;
        string ilce = xNode.SelectSingleNode("address_component[4]/long_name").InnerText;
        string il = xNode.SelectSingleNode("address_component[5]/long_name").InnerText;

so you can pull anydata for google maps.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download