Bing Ajax Control over HTTPS or HTTP Secure SSL

image

Today we updated some code in our Contact Details module for DotNetNuke.

The module makes it easy to add your contact details to a page in DNN.

There is a map control function that uses Bing Maps that can be seen in the demo here: http://www.interactivewebs.com/contactdetails/Demo.aspx

We have updated the module today to support the use of SSL or https connections to the page that contains the module.

How we did this

So here are the two ways to add the Bing Ajax control to your page in HTTP or HTTPS:

HTTP:

<script src=”http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.3” type="text/javascript"></script>

HTTPS:

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

Now on the HTTPS version notice I changed the URL to start with HTTPS, this is what pulls from the secure site over at the good Bing folks. Also notice I added the “s” parameter and set it to 1, default is 0, this tells the Bing API to get the image tiles for the map from HTTPS.

Why? you ask.

Well it seems that the API determines what protocol to use for JavaScript and other parts from the document.location.protocol, however when it comes to the map tiles it looks to a global setting that is set based on the parameter being passed.

2 thoughts on “Bing Ajax Control over HTTPS or HTTP Secure SSL”

  1. Application programming interface is source code based specification intended to be used as an interface by software components.

Leave a Reply