如何在Bing Maps v8中指定切片图层的zIndex以覆盖城镇名称?

时间:2017-06-15 09:03:29

标签: z-index bing-maps

以下代码是从Bing Maps V8 interactive SDK复制的。仅添加zIndex

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: 10001
});
map.layers.insert(weatherTileLayer);

是否可以通过天气平铺图层位于显示城镇和州名称的图层上来调整zIndex

1 个答案:

答案 0 :(得分:1)

默认情况下,Bing Maps使用矢量标签,这些标签在除了图钉之外的所有内容上呈现。您可以通过在加载时添加以下地图选项来禁用此功能并在基本地图图块(图块图层下方)中呈现标签:liteMode: true

您可以在此处找到有关矢量标签的更多信息:https://msdn.microsoft.com/en-us/library/mt750538.aspx