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 6839557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:43:58+00:00 2026-05-26T23:43:58+00:00

How to simulate my position in my app like GPS does? I want to

  • 0

How to simulate my position in my app like GPS does?
I want to do this from Additional Tools -> Location

Example to use on your emulator:

private void button2_Click(object sender, RoutedEventArgs e)
{
   BingMapsDirectionsTask bingMapsDirectionsTask = new BingMapsDirectionsTask();

   // You can specify a label and a geocoordinate for the end point.
   // GeoCoordinate spaceNeedleLocation = new GeoCoordinate(47.6204,-122.3493);
   // LabeledMapLocation spaceNeedleLML = new LabeledMapLocation("Space Needle", spaceNeedleLocation);

   // If you set the geocoordinate parameter to null, the label parameter is used as a search term.
   LabeledMapLocation spaceNeedleLML = new LabeledMapLocation("Space Needle", null);


   bingMapsDirectionsTask.End = spaceNeedleLML;

   // If bingMapsDirectionsTask.Start is not set, the user's current location is used as the start point.

   bingMapsDirectionsTask.Show();
}
  • 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-26T23:43:59+00:00Added an answer on May 26, 2026 at 11:43 pm

    You need a GeoCoordinateWatcher to listen for GPS positions. Later, when getting the first position, you initialize the LabeledMapLocation with the coordinates given by the event arguments and start the map task.

    Example:

    (First, add System.Device to your project`s references.)

    GeoCoordinateWatcher watcher;
    
    // this receives the current GPS position (or the simulated one in the emulator)
    private void HandleGeoPositionChanged(object sender, GeoPositionChangedEventArgs<GeoCoordinate> e)
    {
        // we only need one coordinate - stop watching
        watcher.Stop();
    
        // initialize task and location
        BingMapsDirectionsTask bingMapsDirectionsTask = new BingMapsDirectionsTask();
        GeoCoordinate spaceNeedleLocation = new GeoCoordinate(e.Position.Location.Latitude, e.Position.Location.Longitude);
        LabeledMapLocation spaceNeedleLML = new LabeledMapLocation("Space Needle", spaceNeedleLocation);
        bingMapsDirectionsTask.End = spaceNeedleLML;
    
        // If bingMapsDirectionsTask.Start is not set, the user's current location is used as the start point.
    
        bingMapsDirectionsTask.Show();
    }
    
    // this starts watching for GPS coordinates, the Bing task will be invoked later
    // when we receive our first coordinate
    private void button1_Click(object sender, RoutedEventArgs e)
    {
        // prepare for coordinate watching
        watcher = new GeoCoordinateWatcher(GeoPositionAccuracy.Default) { MovementThreshold = 10 };
        // register for position changes
        watcher.PositionChanged += HandleGeoPositionChanged;
        // start watching
        watcher.Start();
    }
    

    And in the emulator you can click around on the Bing map to change your current position as you like.

    You should also register for watcher.StatusChanged. This event tells you for example when GPS becomes unavailable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a link like this: <a href=www.example.com> I would like to simulate the
To simulate enums in PHP I like to use class constants. e.g. class FRUIT
I'm trying to simulate the user location animation in MapKit (where-by the user's position
I have this example here to illustrate the situation: http://jsfiddle.net/nubrF/40/ If you hold your
I'm trying to simulate waiting in a java swing application, so it's basically like
In this program I simulate the gravity. All works but when there is no
I have used this code manually to simulate a mouse click by system through
I want to implement a collapsible menu. I plan to use table component to
I am trying to simulate shaking by changing the position of img tags within
In vb2005 how do you simulate a web browser's file download using Net.HttpListener? This

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.