[GIS] How to parse and display KML on Bing maps under SSL

bing-mapskml

This may seem like a simple question at first, but let me explain. We have several mapping solutions, however one is strictly Bing maps (v6) based. "Use OpenLayers" will not be a possible solution for this question.

Our product runs behind a login and SSL and we use the HTTPS hosted version of Bing Maps. However… Bing maps under SSL does NOT support adding a KML file. It does under HTTP. The way it works is a URL is passed in, then the MS Server downloads the file, parses into Bing shapes sends back to client and the client renders it. This is all automated by just adding the KML URL. However this is not supported under SSL. There's a 3-year old post on MS forums about this already. Also, running Bing maps on HTTP on our page will not work as it generates the wonderful "mixed content" warning and is generally not good practice. So that's not a solution either.

So I've been thinking about consuming the KML file through our own server-side proxy (since URL is from a different domain) and parsing it manually into Bing-friendly shapes.

Any ideas about parsing KML and displaying on Bing maps? Essentially what OpenLayers (OL) does already, but it's all in an OL format. Is it possible to reuse some of that KML code? Or do you know of another library that would allow us to parse KML and display on Bing maps v6?

Here's a link to the MS Forum discussion where they basically acknowledge the problem under SSL

Best Answer

With Bing Maps API v6 it seems to be a bug that has not be update or investigated.

Though I note your not looking for alternatives but it would make sense to upgrade to Bing Maps v7 - Bing Maps v6 will be depreciated at some point in the future.

If you would be willing to update to V7 of Bing Maps API then you can use the GeoRSS support with SSL. using https://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0&s=1

http://rbrundritt.wordpress.com/2010/12/10/georss-support-for-bing-maps-v7-ajax-control/