Blog: GIS

OpenLayers 3: Add the Bing Maps Traffic layer to your map

April 7, 2016, Software Development

The following code shows how to add the Bing Maps Traffic layer to your OpenLayers 3 map. First, we have to implement the computeQuadKey function which takes the tile coordinates and calculates a quadkey identifier which is required for the Bing API request: var computeQuadKey = function(x, y, z) { var quadKeyDigits = []; for (var i = z; i > 0; i--) { var digit = 0; var mask = 1 << (i - 1); if ((x & mask) != 0) digit++; if ((y & mask) != 0) digit = digit + 2; quadKeyDigits.push(digit); } return quadKeyDigits.join(''); }; With […] Read more...

Tags: , , , ,


  Page 1 of 1