I am creating a windows phone application which uses map control in it. I want to calculate the driving distance between two geo coordinates in windows phone? can any help on this please
You need to work through this example in MSDN Magazine http://msdn.microsoft.com/en-us/magazine/hh148148.aspx
It explains how to do the routing and get the distance property in the results.
Related
My app currently uses Location Services. During debugging, I retrieve my current location using GetLastKnownLocationAsync: myposition.Latitude is 40.758896 while myposition.Latitude is -73.985130.
My SQL Database has a list of Walmart stores, and there's a Walmart with Latitude & Longitude of 40.660992 & -73.7267629.
How can I calculate the driving distance between my set of coordinates and Walmart's coordinates? It would be something like Google Maps' Driving Directions or Waze.
I understand that I can use this SO link to calculate the distance between two sets of point, but I assume apps like Google Maps or Waze consider the actual driving distance between two sets of points. The link above would be great if there were a straight street between two points. Obviously, that's not the case.
I have used Xamarin.Essential library to find the distance between two point
You can use something like this
var location = new Location(21.705723, 72.998199);
var otherLocation = new Location(22.3142, 73.1752);
double distance = location.CalculateDistance(otherLocation,DistanceUnits.Kilometers);
Is it possible to get the image based on an address using the API? I have seen that it is possible to get them via latitude, longitude (which I do have) direction and camera angle (which I do not have).
I made some research and found posts from several years ago, which stated it would not be possible - but technology evolves and I wanted to know if anyone has an idea how to get an image based on the address.
Theoretically Google would be able to do that; they know where the images has been taken and can calculate the direction to the address.
It actually is possible,
the nearest streetview panorama can be found via the API, and the heading to the actual position can be calculated.
As in this article:
Google Maps Api StreetView PanoramaOptions Point of View Setting from Lon Lat
As we know, we can calculate the distance between two fingers in Windows Phone 7 using the toolkit's gesteuresevices. It would be like this:
ManipulationStartedEventArgs.GetPosition(UIElment, fingerIndex);
Is there a similar method in Windows Phone to achieve this without toolkit?
So, you want actual distance between user's fingers in real world, i.e. in centimeters? It should be easy: you need to know distance in pixels, then you need to know physical size of one pixel, and then you multiply.
Now, to get the physical size of one pixel, you'd need to know the phone's screen size. You'd need to know the phone model for that, which you can get by DeviceStatus class. Then you'd need a database of phone's screen sizes, which you'll need to build yourself. For Nokia phones, you could check official website (here's an example). So, for Lumia 920 size of one pixel is 0,07578125 x 0,075520833 mm.
Next, you'd need to get the multitouch event. For that, you'd use ManipulatienStarted, ManipulationDelta, and ManiputalionComplete events. See this MSDN article for more info.
Hope I understood you correct and this will work for you. If you need more info or explanations, just let me know in comments.
i dont think so that you can use gesture services without toolkit....
there is a toolkit available for this
Microsoft.Phone.Controls.Toolkit
this will work fine for you....
Which coordinatesystem Windows Phone 7-device is using? If I fetch latitude and longitude with WP 7, are they equivalent to WGS84 and Mercator coordinates?
There are two parts here.. if you use built in GPS and ask for coordinates, they give you GeoPosition which exposes Latitude / Longitude etc
Bing Maps used with WP7 uses Mercator tile system
http://msdn.microsoft.com/en-us/library/bb259689.aspx
If you search msdn you will find various samples. Here's one that I modified a while back
http://invokeit.wordpress.com/2012/06/30/bing-mapcontrol-offline-tiles-solution-wpdev-wp7dev/ it contains many helpers.
In my app I am getting the latitude , longitude co-ordinates of places using GeocodeService now I want to get distance between these places.
I've tried GetDistanceTo method to get the distance two location co-ordinates but it gives me stright distance.
How can I calculate driving distance between two locations?
thanks in advance
To calculate the driving distance you'll have to use the Bing Routes API (or Google, but I assume you're using Bing Maps).
There's an example of using the api to find a driving route between two places here: http://msdn.microsoft.com/en-us/library/gg636957.aspx
The general call is:
http://dev.virtualearth.net/REST/V1/Routes/Driving?o=xml&wp.0=location1&wp.1=location2&avoid=minimizeTolls&key=BingMapsKey
You'll have to register for a Bing Maps API key, and then replace location1 and location2 with the locations you like.
The distance should be returned in travelDistance in the json or xml