简体   繁体   中英

How to process XML from Google Maps API on Windows Phone 8.1

I am trying to get information from Google Maps API so I follow this:

https://maps.googleapis.com/maps/api/place/nearbysearch/xml?location=41.3253483,69.2051768&radius=500&key={myKey}

and then I get the following XML:

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<PlaceSearchResponse>
<status>OK</status>
<result>
<name>Shaykhontohur District</name>
<vicinity>Shaykhontohur District</vicinity>
<type>sublocality_level_1</type>
<type>sublocality</type>
<type>political</type>
<geometry>
<location>
<lat>41.3275402</lat>
<lng>69.2102725</lng>
</location>
<viewport>
<southwest>
<lat>41.2991213</lat>
<lng>69.1613431</lng>
</southwest>
<northeast>
<lat>41.3501339</lat>
<lng>69.2748874</lng>
</northeast>
</viewport>
</geometry>
<icon>
http://maps.gstatic.com/mapfiles/place_api/icons/geocode-71.png
</icon>
<reference>
CqQBmQAAAFEa195SQc5wO9h3-BK6YlKQMMG117UFFBm0smiJIOLZgTxB62g7rRR0Cn0jr0rRMSCaV87k1ymXn4tuvFmtvvEs7dA3xLS3BFbSL-Rw0Ob44mjKJODw_mlLBI6yqqYSPwcwUgXD2u2Yz8_6Otl5Fakh4Z5YDLkc2siddMxrbbsUyY_aQjPp4p9BdtnfR_B0PhET8eD3LF9o-ZTNaZKrASEK5UHwJfPkh5zZptPuuFl-caFHIJLYYHohtktEtFktxRVkEG-_e7
</reference>
<id>efa8ef0e4d5d148dbfa746555d1b9a415809c560</id>
<place_id>ChIJs9G_ZI2LrjgRXuS05EiJGyY</place_id>
<scope>GOOGLE</scope>
</result>
</PlaceSearchResponse>

So, how do I get the the information I need? *Name *Lat *Lng

I can't seem to enable XDocument nor XCD on Windows Phone. It is all missing.

Will I be able to get my result as a LIST?

IMHO, LINQ to XML will easily solve your problem. Check here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM