none
V8 Bing Maps Base Tile Calls Not Firing Causing Delay For PushPins and Painting of Map RRS feed

  • Question

  • Hi, I am having an issue with adding pins to the map using the V8 control.  I am retrieving the pin data in an async ajax call which uses a spatial query from the map to query data.  The call can be very fast when zoomed in but can take a little longer obviously when a larger area is passed in.  My problem seems to be that whenever the ajax call takes more than about 2-3 seconds getting a decent amount of data the map is pausing and taking a long time to paint.  The pause occurs waiting on base tiles to be called from urls like t2.ssl.ak.dynamic.tiles.virtualearthUS I changed the ajax call to always return quickly and verified that doing that does not cause the calls to the tiles to pause.  I also changed the way success function to always come back under a second to stop the pause of the calls but when this happens the canvas doesnt paint the correct pins because the data is not back yet.  Is there a correct way to trigger a refresh of the base map tiles through the api so that this pause does not happen.  I have seen it pause for 3 seconds all the way up to like 15 seconds.  I dont want to change the ajax call from async and a settimeout wont really work because the performance is fine at lower zoom levels.  Thanks for any help.
    Friday, February 17, 2017 12:48 AM

Answers

  • Stupid on my part, i was adding deprecated pushpin options, eg, zIndex, height, width but doing this never caused an error it just made it perform horribly.  It would be ok adding pushpins under like 2k but when I was getting upward of 4K to say 20K it was really bad.
    Wednesday, February 22, 2017 3:25 AM

All replies

  • How are you retrieving and adding your data to the map. Sounds like something in this process is blocking the thread. You ajax call isn't being made synchronously is it? How many calls to your data do you see in the network traffic, if there a lot it may be using up all the http requests that are available causing the loading of map tiles to wait.

    [Blog] [twitter] [LinkedIn]

    Friday, February 17, 2017 3:45 AM
  • Hi and thanks for the response.  The ajax call is not being made synchronously definitely being made async.  To add the pins to the map I am making the ajax call, parsing the data and creating pins, clustering the pins using the clustering js file from V7 with some tweaks ,adding to a layer and inserting to layers collection of the map.  I have tried using the new clustering library / layer instead of just a regular layer and old js file with the same exact results.  I have even tried just adding directly to map.entities, same result.  There is only one http request from the ajax call.  I have tried creating the layer and adding it to the map before even making a call for the pin data, then adding to the layer, same issue.  I tried changing it so that I create the layer with the data and add it to the map, same issue.  Tried adding the layer first, removing the layer from layers collection, populating layer and adding it still no luck.   If you have any ideas its greatly appreciated.
    Friday, February 17, 2017 6:15 PM
  • It looks to me from just a quick profile in IE that it is running super long in the dynamic scripts from bing url's https://www.bingcom/rms, not sure if you have any idea what might cause that.  I dont think its network related since when I add small amounts of pins to the map layer there is no problem.
    Friday, February 17, 2017 9:32 PM
  • I'll pass this on to the dev team to take a look at.

    [Blog] [twitter] [LinkedIn]

    Saturday, February 18, 2017 3:03 AM
  • Great thanks very much.  One last thing is I thought maybe I should just do one add to the layer instead of doing and add to the layer while in the loop to create the pins so I instead just pushed each pin to an array and then just did one add to the layer with the array of pins, but that had no change either.  Thanks again.
    Saturday, February 18, 2017 3:47 AM
  • Hi, i figured out what was going on with this issue, its all set.  Thanks again for offering up your assistance.
    Tuesday, February 21, 2017 4:10 AM
  • Out of curiosity, what was the solution. Would be good to know incase someone reports a similar issue.

    [Blog] [twitter] [LinkedIn]

    Tuesday, February 21, 2017 4:07 PM
  • Stupid on my part, i was adding deprecated pushpin options, eg, zIndex, height, width but doing this never caused an error it just made it perform horribly.  It would be ok adding pushpins under like 2k but when I was getting upward of 4K to say 20K it was really bad.
    Wednesday, February 22, 2017 3:25 AM