Bing Maps v7 Dynamic Tile Layer Source URI

Answered Bing Maps v7 Dynamic Tile Layer Source URI

  • Thursday, February 23, 2012 11:57 PM
     
     

    I've got a bing maps v7 app, and I'm making use of a tile layer to show traffic data.

    Is there a way to provide a callback instead of a static string for the tile URL?

    I need to modify the URL more than just the quadkey, and pass in different parameters based on the current zoom level and time of day.

All Replies

  • Friday, February 24, 2012 1:18 AM
     
     Answered

    Looks like there is an undocumented solution.

    instead of passing a string for the URL, you can pass in a callback method that takes a tileId as an object.

    That tileId object has x,y, and levelOfDetail, which can be used to reconstruct a quadkey, or get the lat/lng depending on your API needs.

    Standard boilerplate warnings apply :)