1

I would like to ask how to show routes on my map using WinRT ComponentOne map. I am no able to show map and connect the points together by lines but lines are not following the routes.

enter image description here

It shows only a straight line between points. Does anybody have an idea how to solve this issue? Or if there is any other option how to solve this in Windows 8.1 app, I would appreciate it.

Thanks

AbdiasM
  • 613
  • 4
  • 15
  • You've mentioned - "I am no able to show map and connect the points together by lines". Are you able to show the lines or not able to show the lines on the map? – AbdiasM Oct 19 '15 at 04:51

2 Answers2

1

Since Component One use Bing maps it would be easier for you use their REST API.

First you need to get Bing maps key here: https://www.bingmapsportal.com On reference page https://msdn.microsoft.com/en-us/library/ff701717.aspx get corresponding query URL to your problem. On this page are also details to other optional parameters. And then simply use WebRequest to call this URL and in reply you will get response from Bing maps api.

WebRequest wc = HttpWebRequest.Create(uri);
try {
   using (HttpWebResponse response = await wc.GetResponseAsync() as HttpWebResponse){
      DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(BingMapsRESTService.Common.JSON.Response));
      return ser.ReadObject(response.GetResponseStream()) as BingMapsRESTService.Common.JSON.Response;
   }
}
catch(Exception ex){
   return null;
}

For more information about this responce see https://msdn.microsoft.com/en-us/library/mt270292.aspx.

Vodáček
  • 254
  • 3
  • 12
0

You can draw a route on C1Map by using the C1VectorPolyline class and adding points to its Points collection. You can find a tutorial for this at the following documentation link : http://helpcentral.componentone.com/nethelp/mapswinrt/Marking%20a%20Route%20with%20a%20C1VectorPolyline.html

AbdiasM
  • 613
  • 4
  • 15
  • that is true but how can I get points of the route which i am going to take? is there any service that I am able to use? For example from point x to y via (points getted from service)? – Jan Holešínský Oct 21 '15 at 15:24