none
Bug Report - TileOption zIndex working not accordingly RRS feed

  • Question

  • Hello,

    I am currently working with multiple TileLayers and the zIndex order is misbehaving.

    You can use this link here

    http://www.bing.com/api/maps/sdk/mapcontrol/isdk#tileLayerPublicXYZoom+JS

    Replace the code for this: (just placed zIndex = 1) 

    var map = new Microsoft.Maps.Map(document.getElementById('myMap'), {
        credentials: 'Your Bing Maps Key',
        center: new Microsoft.Maps.Location(40.750220, -99.476964),
        zoom: 4
    });
    // weather radar tiles from Iowa Environmental Mesonet of Iowa State University
    var weatherTileSource = new Microsoft.Maps.TileSource({
        uriConstructor: 'http://mesonet.agron.iastate.edu/cache/tile.py/1.0.0/nexrad-n0q-900913/{zoom}/{x}/{y}.png'
    });
    var weatherTileLayer = new Microsoft.Maps.TileLayer({
        mercator: weatherTileSource,
        zIndex: 1
    });
    map.layers.insert(weatherTileLayer);

    In this case the tileLayer simply its not visible. 

    But if you for example put the zIndex = 101. The tile is rendered in Road mode, but if you change it to aerial its not visible any more. But back again to road and its visible.

    update: from 1-99 doesnt work, from 100-999 it works only in aerial and from 1000++ works apparently well(?)

    Best regards
    João Mourão





    • Edited by JMRMourao Thursday, November 10, 2016 5:24 PM
    Thursday, November 10, 2016 11:48 AM

Answers

  • zIndexing is working as designed. It is a bit different in Bing Maps V8 compared to previous versions of Bing Maps as the map is made up of several canvases and there are ranges of zIndexes for each canvas type. This allows you to position tile layers at any level above or below other map data which wasn't possible in the past. Additionally, a lot of the data is rendered on a single HTML canvas. There is no concept of zIndexes inside of canvases, but for usability the Bing Maps control adds a virtual zIndexing framework, but needs to provide ranges for different types of data. We are working on some documentation around the zIndexing. Bing Maps uses vector labels and some elements are rendered below the label layer and others above it. Here is some rough details the zIndexes of most of the layers in the map:

    Base map canvas (zIndexes for all data below the map labels):    

    • road/aerial/ordnance survey imagery: 1000
    • traffic flow: 3000
    • streetside coverage (light blue areas): 8000
    • directions routes: 9100
    • custom tile layer: 10000
    • Polygons, polylines: 10000       
    • Layer/Entity Collection: 10000 and incrementing by 1 onwards
    • Heatmap Layer, Data Binning Layer, Contour Layer, custom overlay (when beneathLabels=true), stacked in the order they are inserted: auto

    Animated Tile Layers (rendered on a separate canvas for performance between the base canvas and label layer): auto

    LabLabel Canvas (zIndexes at and above the label layer):

    • Pushpins, Clustering layer are rendered in the label canvas.
    • Custom overlay (when beneathLabels=false): auto
    • Traffic legend: 0
    • Drawing canvas used by drawing tools: 2
    • Navigation bars, zoom buttons: 1001


    [Blog] [twitter] [LinkedIn]



    • Proposed as answer by Ricky_Brundritt Thursday, November 10, 2016 8:05 PM
    • Marked as answer by JMRMourao Friday, November 11, 2016 10:05 AM
    • Edited by Ricky_Brundritt Friday, November 11, 2016 6:46 PM
    Thursday, November 10, 2016 8:05 PM
  • I have written some documentation around zIndexing in Bing Maps V8 and have added it to MSDN: https://msdn.microsoft.com/en-us/library/mt791033.aspx

    [Blog] [twitter] [LinkedIn]


    Saturday, November 12, 2016 3:14 AM

All replies

  • zIndexing is working as designed. It is a bit different in Bing Maps V8 compared to previous versions of Bing Maps as the map is made up of several canvases and there are ranges of zIndexes for each canvas type. This allows you to position tile layers at any level above or below other map data which wasn't possible in the past. Additionally, a lot of the data is rendered on a single HTML canvas. There is no concept of zIndexes inside of canvases, but for usability the Bing Maps control adds a virtual zIndexing framework, but needs to provide ranges for different types of data. We are working on some documentation around the zIndexing. Bing Maps uses vector labels and some elements are rendered below the label layer and others above it. Here is some rough details the zIndexes of most of the layers in the map:

    Base map canvas (zIndexes for all data below the map labels):    

    • road/aerial/ordnance survey imagery: 1000
    • traffic flow: 3000
    • streetside coverage (light blue areas): 8000
    • directions routes: 9100
    • custom tile layer: 10000
    • Polygons, polylines: 10000       
    • Layer/Entity Collection: 10000 and incrementing by 1 onwards
    • Heatmap Layer, Data Binning Layer, Contour Layer, custom overlay (when beneathLabels=true), stacked in the order they are inserted: auto

    Animated Tile Layers (rendered on a separate canvas for performance between the base canvas and label layer): auto

    LabLabel Canvas (zIndexes at and above the label layer):

    • Pushpins, Clustering layer are rendered in the label canvas.
    • Custom overlay (when beneathLabels=false): auto
    • Traffic legend: 0
    • Drawing canvas used by drawing tools: 2
    • Navigation bars, zoom buttons: 1001


    [Blog] [twitter] [LinkedIn]



    • Proposed as answer by Ricky_Brundritt Thursday, November 10, 2016 8:05 PM
    • Marked as answer by JMRMourao Friday, November 11, 2016 10:05 AM
    • Edited by Ricky_Brundritt Friday, November 11, 2016 6:46 PM
    Thursday, November 10, 2016 8:05 PM
  • except from this post, where could i have checked this info?(or i couldnt? )

    https://msdn.microsoft.com/en-us/library/mt712686.aspx

    i think the info should be placed in this link just in case :) 


    Friday, November 11, 2016 10:16 AM
  • ZIndex is an option in a few different parts of the API. We will likely write an article on how zIndexing works and then link all the zIndex option documents to this article.

    [Blog] [twitter] [LinkedIn]

    Friday, November 11, 2016 5:57 PM
  • I have written some documentation around zIndexing in Bing Maps V8 and have added it to MSDN: https://msdn.microsoft.com/en-us/library/mt791033.aspx

    [Blog] [twitter] [LinkedIn]


    Saturday, November 12, 2016 3:14 AM