SSL Support for Virtual Earth is here

If you've ever placed a Virtual Earth map or Google map on an HTTPS page then you're probably familiar with the mixed content message that appears when the page loads:

While there are workarounds for this in the browser settings, the solution isn't really scalable. The good news it that Virtual Earth 6 now offers support for SSL pages. All that we have to do is update the script reference like so:

<script type="text/javascript" 
  src="https://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6&s=1">
</script> 

Notice how the source path now begins with https and the version is set to 6. Also, there is the additional parameter at the end, s=1; that flags the request accordingly.

If you're using ASP.NET AJAX and have a ScriptManager on the page, then your reference can look something like this:

<asp:ScriptManager ID="ScriptManager1" runat="server">
  <Scripts>
    <asp:ScriptReference Path="https://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6&s=1" />
  </Scripts>
</asp:ScriptManager>

This seems like a subtle change, but both Google and Virtual Earth have lacked this type of support for years. For anyone building enterprise applications that require HTTPS, this is something we've been asking and waiting for, for quite some time.

Published Friday, November 23, 2007 12:34 PM by davidbarkol
Filed under: ,

Comments

# re: SSL Support for Virtual Earth is here

Saturday, November 24, 2007 7:16 AM by Garbin

And I've been waiting for it too. Thanks for the info!

# re: SSL Support for Virtual Earth is here

Thursday, July 30, 2009 2:33 PM by Josh

Have you tried to implement the SSL feature?  I still get prompted in regards to the Secure / Unsecure data but when I hit "Yes" (IE8) it loads the map correctly.

When I look at the page source, it references the dev.virtualearch.net twice.  Once secured, the other not.

I know it's the virtual earth control because I removed the control (not the links) on the page and I'm not prompted anymore.

# re: SSL Support for Virtual Earth is here

Saturday, October 3, 2009 7:07 AM by nintendo ds r4

Thanx for the information. I was looking for something like this. I had the same issue with google MAp. now i got it why that haapens. keep posting. You rock.

# re: SSL Support for Virtual Earth is here

Monday, January 11, 2010 4:15 AM by Fran

Thanx for the information.

# re: SSL Support for Virtual Earth is here

Monday, January 18, 2010 5:55 PM by Margaret

I embedded the map and all I get is that the content is blocked due to a non valid security certificate.

# re: SSL Support for Virtual Earth is here

Tuesday, February 16, 2010 12:11 PM by Francisco

Thanx for the information.

# re: SSL Support for Virtual Earth is here

Tuesday, April 27, 2010 5:43 PM by Reparar ordenadores

Have you tried to implement the SSL feature?  I still get prompted in regards to the Secure / Unsecure data but when I hit "Yes" (IE8) it loads the map correctly.

When I look at the page source, it references the dev.virtualearch.net twice.  Once secured, the other not.

I know it's the virtual earth control because I removed the control (not the links) on the page and I'm not prompted anymore.

# re: SSL Support for Virtual Earth is here

Friday, June 4, 2010 10:07 AM by Medyum

I embedded the map and all I get is that the content is blocked due to a non valid security certificate.

# re: SSL Support for Virtual Earth is here

Tuesday, February 8, 2011 5:21 AM by Jay

wow, I was about to mail my client that this is not happening! Thanks david

# re: SSL Support for Virtual Earth is here

Friday, February 11, 2011 4:27 PM by medyum

When I look at the page source, it references the dev.virtualearch.net twice.  Once secured, the other not.

I know it's the virtual earth control because I removed the control (not the links) on the page and I'm not prompted anymore.

# re: SSL Support for Virtual Earth is here

Tuesday, July 19, 2011 8:29 AM by medyum

thanks for admin wonderfull blog and information ..everthing so great.

# re: SSL Support for Virtual Earth is here

Thursday, August 11, 2011 3:07 PM by Varin

s=1 was the key. I was missing it in the script reference. Thanks for sharing.