Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6668809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:04:51+00:00 2026-05-26T03:04:51+00:00

in my app for WP7(mango) I need to navigate the user from one point

  • 0

in my app for WP7(mango) I need to navigate the user from one point to another. I know there is the Map control that lets you draw staff on it, but how do you ask it to draw the path for you? (based on the specified destination & user’s current location – but that keeps changing so how do you update the route if he goes of the way?)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T03:04:52+00:00Added an answer on May 26, 2026 at 3:04 am

    To update the map with the users current location, use the GeoCoordinateWatcher and update the position of a databound Pushpin as it changes. Remember to set the minimum distance to something low, like 5 meters.

    A pushpin like the one on bing maps, can be created with this XAML template:

    <maps:Pushpin Background="{StaticResource PushpinLocationBrush}"
                  Location="{Binding MyLocation}">
        <maps:Pushpin.Template>
            <ControlTemplate>
                <Grid>
                    <Rectangle Width="15"
                               Height="15"
                               Margin="0"
                               Fill="Black">
                        <Rectangle.Projection>
                            <PlaneProjection CenterOfRotationX="0"
                                             LocalOffsetX="-2"
                                             LocalOffsetY="5"
                                             RotationZ="45" />
                        </Rectangle.Projection>
                    </Rectangle>
                    <Ellipse Width="7"
                             Height="7"
                             Margin="0"
                             HorizontalAlignment="Center"
                             VerticalAlignment="Center"
                             Fill="Orange"
                             RenderTransformOrigin="0.339,0.232"
                             StrokeThickness="0" />
                </Grid>
            </ControlTemplate>
        </maps:Pushpin.Template>
    </maps:Pushpin>
    

    Getting the GeoCoordinate of a address can be done with Bing Maps. You can read more about Bing Services here: http://msdn.microsoft.com/en-us/library/cc980922.aspx — the one you need is the GeoCodeService

    Drawing a path is rather complicated, specially if you want it to follow the roads. For this, you need the Bing Maps Route Service.

    Add the service to Visual Studio, with RouteServiceReference as name, and then you can utilize following code to get the path fragments, and add them to your map. The XAML below reflects the controls I add the fragments to:

    List<GeoCoordinate> locations = new List<GeoCoordinate>();
    
    RouteServiceClient routeService = new RouteServiceClient("BasicHttpBinding_IRouteService");
    
    routeService.CalculateRouteCompleted += (sender, e) =>
    {
        var points = e.Result.Result.RoutePath.Points;
        var coordinates = points.Select(x => new GeoCoordinate(x.Latitude, x.Longitude));
    
        var routeColor = Colors.Blue;
        var routeBrush = new SolidColorBrush(routeColor);
    
        var routeLine = new MapPolyline()
        {
            Locations = new LocationCollection(),
            Stroke = routeBrush,
            Opacity = 0.65,
            StrokeThickness = 5.0,
        };
    
        foreach (var location in points)
        {
            routeLine.Locations.Add(new GeoCoordinate(location.Latitude, location.Longitude));
        }
    
        RouteLayer.Children.Add(routeLine);
    };
    
    RouteBingMap.SetView(LocationRect.CreateLocationRect(locations));
    
    routeService.CalculateRouteAsync(new RouteRequest()
    {
        Credentials = new Credentials()
        {
            ApplicationId = "YOURBINGMAPSKEYHERE"
        },
        Options = new RouteOptions()
        {
            RoutePathType = RoutePathType.Points
        },
        Waypoints = new ObservableCollection<Waypoint>(
            locations.Select(x => new Waypoint()
            {
                Location = x.Location
            }))
    });
    

    Related XAML:

    <maps:Map x:Name="RouteBingMap"
              AnimationLevel="None"
              CopyrightVisibility="Collapsed"
              CredentialsProvider="YOURBINGMAPSKEYHERE"
              LogoVisibility="Collapsed"
              ZoomBarVisibility="Collapsed"
              ZoomLevel="12">
        <maps:MapLayer x:Name="RouteLayer" />
    </maps:Map>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have WP7 app that uses the MVVM pattern. When the user goes from
I need to perform facebook post into the user wall from wp7 (but without
I have a Mango WP7.5 app that uses a local SqlCe database. I would
I'm creating (yet another) ruler app for wp7. I know the res. is always
I am trying to make a WP7 app that would Tweet short messages user
I made an App on WP7 that uses the textbox for the user to
I'm working on a WP7 mango App that makes use of Linq2SQL for data
My wp7 app crashes when I come back from a task such as Map,
I have a WP7 app (Silverlight) that has a page with a textbox that
I am developing WP7 app. I met some unexpected behavior. I use PerformanceProgressBar from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.