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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:12:36+00:00 2026-06-15T04:12:36+00:00

Is there a specific time in the page’s lifecycle that the Map.SetView() function should

  • 0

Is there a specific time in the page’s lifecycle that the Map.SetView() function should be called? In our app we use this on various map objects and it seems to work randomly, sometimes perfectly and sometimes with no effect but also no exception.

example code:

RouteMap.SetView(LocationRectangle.CreateBoundingRectangle(DirectionCoordinates));

Where RouteMap is the mapping component and DirectionCoordinates contains the start/end coordinates for the map.

I can see that the bounding box is being created properly, but the map’s positioning is not always being affected even loading the same data. If I add a break point it does seem to work, so I was assuming it had something to do with the map loading, but adding the SetView() functionality to the Loaded event has the same issue. We currently process the map information in the page Loaded event.

Update

I’ve been testing more and added events to what I could, I know for a fact that the MapLoaded event is being called before SetView. After SetView is called, it is working sometimes and not others. Neither ViewChanging or ViewChanged events are called.

  • 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-06-15T04:12:37+00:00Added an answer on June 15, 2026 at 4:12 am

    This is obviously not the best solution, but there must be something that is not quite finished loading when the Loaded event is called that is preventing this from finishing.

    I added a 100ms sleep to the Map_Loaded event and it has solved the problem I was having.

    System.Threading.Thread.Sleep(500);
    

    update

    100ms isn’t working for some people, you may want to play around with the numbers, 200, 500 etc. It’s still a very short delay on the map’s load time. I have contacted Microsoft about this and they have told me that they are looking into the issue and we will hopefully have some sort of response from them shortly.

    update and edit

    Use the following code instead to prevent UI hanging:

    await Task.Delay(250);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way to trigger mysql functions automatic on specific time? on mysql
Is there a specific Xcode compiler flag that gets set when compiling for iPad?
I like to know is there any specific reason that there is no public
I have a webpage that has 3 file inputs. There are specific fields on
There's one specific feature that I wish was in the .NET framework, but isn't.
Should there be any specific order in which I should write the following for
Is there a specific design practice for MVC type sites that need to have
Some time ago there was a field called targeting in the Post API Reference
I want to display a message to first time visitors of a specific page
I have a specific Adobe CQ5 (5.5) content template that authors will use to

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.