Click here to Skip to main content
15,887,890 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
Hello Everyone !
I have to a Windows 8.1 store project and I must use bingmap or other maps for this project( I tried Bing Map). When I click on the map I want to take location(Latidude , Longtitude) of the this point.

How can I do? If help me, I will be very happy.

Thanks for answers.. :)
Posted
Updated 20-May-15 1:29am
v2

Try this
Add a tapped event to the Bing Map like
HTML
xmlns:Maps="using:Bing.Maps"
<maps:map credentials="{StaticResource BingCredentials}" tapped="MapTapped" xmlns:maps="#unknown" /> 

The Tapped is like this
C#
private void MapTapped(object sender, TappedRoutedEventArgs e)
{
    var pos = e.GetPosition(map);
    Location location;
    map.TryPixelToLocation(pos, out location);
    var latitude= location.Latitude;
    var longitude= location.Longitude;
}


Ref:

https://diptimayapatra.wordpress.com/2012/11/29/custom-pushpin-in-bing-map-for-windows-store-app-xaml/[^]

Using Bing Maps for Windows 8 Metro Apps - C# / JavaScript[^]
 
Share this answer
 
Naz_Firdouse Thank you so much your answer. This is solution for me.
 
Share this answer
 
Hello Naz_Firdouse . My problem is simular first problem. I need same of the above code for silverlight for windows phone 8.1 app.
 
Share this answer
 
v4
Comments
Deepu S Nair 7-Jun-15 7:13am    
Don't post your comment as solution.If you want to respond to the answer use the "Have a Question or Comment?" link next to it. This will notify the member.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900