Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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 open layers" 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 Open Layers 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?

Thank you,

-Vadim

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

share|improve this question

2 Answers 2

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/

share|improve this answer
    
Thanks, but we're sooner to move to OL than to Bing v7. The move to v7 was too costly and it still doesn't support KML out of the box. However I've not seen any information about v6 deprecation, so at this point we don't want to stir the pot if everything else is working just fine. –  Vadim Jun 18 '12 at 18:36
up vote 0 down vote accepted

So here's how we ended up solving it. Partially mentioned in the original question.

  1. Created a small Open Layers build that only included KML parsing and WKT output (+ any necessary files) via the already included python build script
  2. Loaded KML via server-side proxy with Open Layers and converted KML Format to WKT
  3. Used WKT to VE Shape library - http://pietschsoft.com/post/2009/04/04/Virtual-Earth-Shapes-%28VEShape%29-to-WKT-%28Well-Known-Text%29-and-Back-using-JavaScript
  4. Copied the style from the OpenLayers feature to the VE Shape [line color, width, shading and IMG if it's an icon]
  5. And just added to the map

Ended up working very very nice. There are still a few things that are not processed once in a while but overall a final solution to Bing Maps v6 being stubborn about not supporting KML under SSL.

We will not be sharing the source, but I've basically outlined all the steps necessary to get it done and none of them are very difficult on their own.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.