Select to view content in your preferred language

VEGeocoder using HTTPS?

1302
6
07-24-2013 05:35 AM
DerekWicks1
Deactivated User
Is it possible to access the Bing VEGeocoder using HTTPS? My web and GIS servers both use HTTPS but the VEGeocoder uses HTTP, even though the Bing basemaps use HTTPS? Any help is appreciated.
0 Kudos
6 Replies
GordonBooth
Deactivated User
Did you figure this out? I'm having a similar issue.
0 Kudos
VinayBansal
Frequent Contributor
0 Kudos
JohnGravois
Deactivated User
i've logged a defect with regard to this problem.  [NIM094284: Bing address locator always uses HTTP]

in the meantime, you could use a technique similar to what is described in the forum thread Vinay linked to to manually update the url for the request in your code.

esriRequest.setRequestPreCallback(myCallbackFunction);

...

function myCallbackFunction(ioArgs) {         
    if (ioArgs.url == "http://serverapi.arcgisonline.com/veadaptor/production/services/geocode/geocode") {
        ioArgs.url = "https://serverapi.arcgisonline.com/veadaptor/production/services/geocode/geocode";
    }
    // don't forget to return ioArgs.
    return ioArgs;
}


sorry for the inconvenience!
0 Kudos
GordonBooth
Deactivated User
I'll give it go. THANKS!
0 Kudos
JohnGravois
Deactivated User
as an alternative, you could also dig into the object after its been instantiated and modify the relevant internal property to workaround the problem.

var locator = new VEGeocoder({bingMapsKey: 'yourkeyhere'});
locator._url.path = locator._url.path.replace("http", "https");
0 Kudos
GordonBooth
Deactivated User
Thanks John - this option is much better and works perfectly.
0 Kudos