简体   繁体   中英

How to display Current Location and Nearby Places in windows phone application 8.1 using bing maps

I am trying to develop a windows phone 8.1 application.(not silverlight). I need to locate my current location and also nearest location. (ie geographic points of interest within a given proximity (eg 10km) filtered by category, such as "restaurants","petrol bunks","hotels" etc.)

With the help of BingMapsTask we can do it in silverlight applications. So coming to wp8.1 I tried using launch uri. But I cannot get the current location and nearby selected category with this uri

await Windows.System.Launcher.LaunchUriAsync(new Uri("bingmaps:?lvl=10&where=restaurants", UriKind.Absolute));

How to get the current nearby list of places

First get the current Position using "GetGeopositionAsync" function. Then try it using the coordinates that you received.

Example for the URI: "bingmaps:?cp=40.726966~-74.006076&lvl=10&where=New%20York"

Also note that the GetGeopositionAsync function would take time so "await" it till you get the result. Use try-catch to check if phone GPS/location is turned ON or not.

Upvote if this works

Cheers

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