Does Bing Maps 7 support KML?

Looks like the answer is no. I'm saying this based on looking at their SDK docs and this thread: Looking for KML or GeoRSS Example in Bing Maps Ajax Control v7.

If KML support is crucial, you could use Esri's ArcGIS API for JavaScript as it has support for publicly accessible KML layers. Full disclosure: I work at Esri on the JavaScript API team.


As mentioned above, GeoRSS and KML are not supported. However, someone has written a GeoRSS interpreter for Bing Maps v7. And since KML files and GeoRSS files are both XML, so you can easily convert between the two using XSL. Some hunting shows that many people have talked about it, but I can't find any actual XSL file that does it. I did, however, find one the did the opposite, converting GeoRSS to KML, which should give you a good idea of where to start if you wrote your own.

If you only need to do this once, you could use to following two website to convert KML to GeoRSS via CSV:

  1. A KML to CSV converter using XSL.
  2. A CSV to GeoRSS webapp

And a final option is simply to write your own KML interpreter, in the same way someone wrote their own GeoRSS interpreter, per @Derek.


Bing Maps 7.0 does not include a KML converter. But because it uses JavaScript objects to display data on the map (see Bing API), you can manually parse the kml and convert it to the respective objects.

In this code example, I use JavaScript to convert KML polygon data to new Microsoft.Maps.Polygon objects. I would then use the code below to add the polygons to my Bing map.

// Initialize the Map.
var map = new Microsoft.Maps.Map(document.getElementById("mapDiv"), {credentials:"Bing Maps Key"});

// Insert your own code to get your KML string here.

// Parse the kml into Microsoft.Maps.Polygon objects and add them to the map.
var polygons = bingKmlParser.parsePolygons(kmlString);
map.entities.push(polygons);

Tags:

Bing Maps

Kml