Select to view content in your preferred language

Accessing the esri js api over https

1362
3
08-02-2010 06:30 AM
KevinGooss
Regular Contributor
I am building a website that will be SSL-secured as https.
I want to be able to pull in the esri js api as https.
I can change the link to get the api by adding the s to http and it works fine - the initial call for the api comes over the wire as https.
However, the api itself makes subsequent calls for content that are not https. How can I get around this issue without having to host the entire api myself?
0 Kudos
3 Replies
timothysimons
Emerging Contributor
hey i am also the same setup as yours? anyone who can bring light to this question?????

TIA
0 Kudos
timothysimons
Emerging Contributor
Hi KG22,

Have you found anything realted to this issue?

TIA

I am building a website that will be SSL-secured as https.
I want to be able to pull in the esri js api as https.
I can change the link to get the api by adding the s to http and it works fine - the initial call for the api comes over the wire as https.
However, the api itself makes subsequent calls for content that are not https. How can I get around this issue without having to host the entire api myself?
0 Kudos
RebeccaMaaser
New Contributor
Here's info we got from ESRI when we asked about this:

A potential workaround is to update the tile urls after the layer is loaded and replace http with https, here's a code snippet that shows this.

function init() {
    var map = new esri.Map("map");
        
    //Creates the Virtual Earth layer to add to the map
    veTileLayer = new esri.virtualearth.VETiledLayer({
    bingMapsKey: '', //set to your key
    mapStyle: esri.virtualearth.VETiledLayer.MAP_STYLE_AERIAL
    });
    dojo.connect(veTileLayer, "onLoad", function(){
    veTileLayer.tileServers = dojo.map(veTileLayer.tileServers, function(tileServer) {
    return tileServer.replace("http:","https:");
    });
    map.addLayer(veTileLayer);
    });
}
0 Kudos