none
Tile Layer Incomplete? RRS feed

  • Question

  • I have a tracking software built on Bing maps 7 that I am migrating to Bing maps 8. I am trying to implement a tile layer for weather patterns using NOAA web services. I can call the services and display them on the map just fine. However, There is no "clear method" on the tile layer like the normal layer class. Is this something that has yet to be implemented? As it is right now, I see no way at all to remove a tile layer once it is added to the map. Not even map.removeAt[index]  will remove a tile layer. They can only be hidden. Please let me know if this is something that will be implemented in version 8. Thank you.

    Tuesday, May 10, 2016 2:55 PM

Answers

  • The dev team hasn't had a chance to look into this bug yet, however I did notice some work being done on the layers property which looked related. Doing some testing in the experimental branch of the SDK it appears that this issue is fixed there. you can remove a layer by using map.layers.remove([your tile layer]);

    To test against the experimental branch add "&branch=experimental" to the map script URL reference.


    [Blog] [twitter] [LinkedIn]

    Monday, May 16, 2016 10:06 PM

All replies

  • Only about 2/3rds of the API is documented so far.

    When you add a TileLayer to the map you use map.layers.insert([your tile layer]); The map.layers class has a remove function that you can use to remove a TileLayer from the map. Simply do map.layers.remove([your tile layer]);


    [Blog] [twitter] [LinkedIn]

    Tuesday, May 10, 2016 3:54 PM
  • Hello,

    I just tested and confirmed. This does not work for tile layers. This causes an error: JavaScript runtime error: Unable to get property '0' of undefined or null reference. the tile layer is not a null reference. I called remove just after inserting the layer and I tested after setting an interval to call remove. Still no dice. I am going to assume that this has yet to be implemented. As of right now there is still no way to remove a tile layer. The code causing the error: (insert works properly, remove fails with error)

    map.layers.insert(tilelayer);

    map.layers.remove(tilelayer);


    What's up.

    Tuesday, May 10, 2016 4:06 PM
  • I'm able to reproduce that issue. I'll have the dev team look into this. Thanks for reporting.

    [Blog] [twitter] [LinkedIn]

    Tuesday, May 10, 2016 7:43 PM
  • No Problem. Thank you.

    What's up.

    Tuesday, May 10, 2016 9:16 PM
  • Any news on this topic?

    What's up.

    Thursday, May 12, 2016 9:26 PM
  • The dev team hasn't had a chance to look into this bug yet, however I did notice some work being done on the layers property which looked related. Doing some testing in the experimental branch of the SDK it appears that this issue is fixed there. you can remove a layer by using map.layers.remove([your tile layer]);

    To test against the experimental branch add "&branch=experimental" to the map script URL reference.


    [Blog] [twitter] [LinkedIn]

    Monday, May 16, 2016 10:06 PM