×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 29
  1. #1
    Registered User
    Join Date
    Jul 2013
    Posts
    21

    HERE Maps on WP8 route between two points

    I'm developing an app for WP8 and I was wondering… How can I show walking directions between two points with HERE Maps. I don't want to use the user's current location, I just want a specified place as the start point and another specified place as the finish point. I have a button on a xaml page and I want HERE maps along with those directions to launch when the user taps that button.

    According to the code below I would like to know what needs to be changed in order to meet what I want above?

    All help would be appreciated.

    Many thanks

    Code:
    DirectionsRouteDestinationTask routeTo = new DirectionsRouteDestinationTask();
    routeTo.Destination = new GeoCoordinate(60.35, 24.60);
    routeTo.Mode = RouteMode.Car;
    routeTo.Show();

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2013
    Location
    Dublin, Ireland
    Posts
    574

    Re: HERE Maps on WP8 route between two points

    Is an 'origin' parameter available like with the Uri scheme?

    http://developer.nokia.com/Resources...irections.html

  3. #3
    Registered User
    Join Date
    Jul 2013
    Posts
    21

    Re: HERE Maps on WP8 route between two points

    What do you mean by that?

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,752

    Re: HERE Maps on WP8 route between two points

    Quote Originally Posted by m.findlay93 View Post
    What do you mean by that?
    He means what is shown on the linked page
    Quote Originally Posted by page
    Example use case:
    directions://v2.0/route/destination/?latlon=52.53,13.41
    directions://v2.0/route/destination/?latlon=52.53,13.41&origin.latlon=52.53,13.41&mode=car
    the second example contains coordinates for origin (origin.latlon). You have not shown setting anything similar in your code snippet.
    As I absolutely do not know this API, I searched for DirectionsRouteDestinationTask from your code and found the documentation on http://developer.nokia.com/Resources...estinationTask.
    Mysteriously it contains the very same example snippet what you have posted. Now if you happen to look 5 centimeters above, you will see an optional parameter which exists, just not used in the example. It is called Origin, and its type is the very same GeoCoordinate as the one used for Destination. You may want to consider setting it to something.

  5. #5
    Registered User
    Join Date
    Jul 2013
    Posts
    21

    Re: HERE Maps on WP8 route between two points

    I'd prefer to use the HERE launcher, how can I implement code for HERE launchers with the xaml/vb of my project + what components are required?
    Last edited by m.findlay93; 2013-12-30 at 19:38. Reason: More specific need

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,752

    Re: HERE Maps on WP8 route between two points

    I am not sure what we are talking about now. The important part in my post was the Origin, and my expectation is that it could be used as
    Code:
    DirectionsRouteDestinationTask routeTo = new DirectionsRouteDestinationTask();
    routeTo.Destination = new GeoCoordinate(60.35, 24.60);
    routeTo.Origin = new GeoCoordinate(123.45, 67.42);
    routeTo.Mode = RouteMode.Car;
    routeTo.Show();

  7. #7
    Registered User
    Join Date
    Jul 2013
    Posts
    21

    Re: HERE Maps on WP8 route between two points

    OK cool, thanks. Is there any chance that these directions can be made to work offline?

  8. #8
    Nokia Developer Champion
    Join Date
    Feb 2013
    Location
    Dublin, Ireland
    Posts
    574

    Re: HERE Maps on WP8 route between two points

    Quote Originally Posted by m.findlay93 View Post
    OK cool, thanks. Is there any chance that these directions can be made to work offline?
    HERE Maps and HERE Drive should work offline, so if your app redirects them to either, it should work. I haven't tested that before, so you should try it first.

  9. #9
    Registered User
    Join Date
    Jul 2013
    Posts
    21

    Re: HERE Maps on WP8 route between two points

    OK thanks. I now need to add a specify an ApplicationID and AuthenticationToken in my code but MSDN don't say where in my project it needs to go.

  10. #10
    Registered User
    Join Date
    Jul 2013
    Posts
    21

    Re: HERE Maps on WP8 route between two points

    OK but where do I put my Application ID and Token?

  11. #11
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,169

    Re: HERE Maps on WP8 route between two points


  12. #12
    Registered User
    Join Date
    Jul 2013
    Posts
    21

    Re: HERE Maps on WP8 route between two points

    There is no information on that page regarding where the code needs to go

  13. #13
    Nokia Developer Champion
    Join Date
    Feb 2013
    Location
    Dublin, Ireland
    Posts
    574

    Re: HERE Maps on WP8 route between two points

    Quote Originally Posted by m.findlay93 View Post
    There is no information on that page regarding where the code needs to go
    YES there is. Please read the entire page.

  14. #14
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,169

    Re: HERE Maps on WP8 route between two points

    its indeed rather near the bottom of the page.

  15. #15
    Registered User
    Join Date
    Jul 2013
    Posts
    21

    Re: HERE Maps on WP8 route between two points

    I am not using a Map Control in my project, I'm using the HERE launcher.

    Imports Coding4Fun.Toolkit.Controls
    Imports Nokia.Phone.HereLaunchers
    Imports System.Device.Location

    Partial Public Class Regent_s_Park
    Inherits PhoneApplicationPage

    Public Sub New()
    InitializeComponent()
    End Sub

    Private Sub DirectionsRPtoGPSButton_Click(sender As Object, e As Input.GestureEventArgs)
    Dim result As IAsyncResult = Microsoft.Xna.Framework.GamerServices.Guide.BeginShowMessageBox("Regent's Park to Great Portland Street", "Walking directions will open in HERE Maps. If you are using 3G or 4G then you may incur data charges.", New String() {"ok", "cancel"}, 0, Microsoft.Xna.Framework.GamerServices.MessageBoxIcon.Alert, Nothing, _
    Nothing)

    result.AsyncWaitHandle.WaitOne()

    Dim choice As System.Nullable(Of Integer) = Microsoft.Xna.Framework.GamerServices.Guide.EndShowMessageBox(result)
    If choice.HasValue Then
    'user clicks the first button
    If choice.Value = 0 Then
    Dim routeTo As New DirectionsRouteDestinationTask()
    routeTo.Destination = New GeoCoordinate(60.35, 24.6)
    routeTo.Origin = New GeoCoordinate(123.45, 67.42)
    routeTo.Mode = RouteMode.Pedestrian
    routeTo.Show()
    End If
    End If
    End Sub
    End Class
    Last edited by m.findlay93; 2014-01-03 at 20:03.

Similar Threads

  1. how to create a route between two geo locations in html5 here maps
    By amjad_hunzai in forum [Archived] MH5: Nokia Maps Framework for mobile HTML5
    Replies: 1
    Last Post: 2013-06-16, 16:12
  2. Navigation route coordinates from Nokia Maps or Ovi Maps
    By selimsolmaz in forum Mobile Java Tools & SDKs
    Replies: 2
    Last Post: 2010-03-04, 10:02
  3. Replies: 3
    Last Post: 2010-03-03, 10:25
  4. route and record route on 3rd edition
    By jcaradec in forum Symbian Networking & Messaging (Closed)
    Replies: 3
    Last Post: 2007-04-16, 19:07
  5. Record-Route and Route at SIP
    By mhappenhofer in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2005-11-30, 09:22

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×