Select to view content in your preferred language

VEGeocoder No Longer Working

1274
7
Jump to solution
05-17-2012 06:19 AM
MarkHoover
Frequent Contributor
I've just recently discovered that code I had previously been using no longer works.  It leverages the VEGeocoder class.  Below is the offending code:

//Draw and zoom to the result when the geocoding is complete         dojo.connect(veGeocoder, "onAddressToLocationsComplete", function (geocodeResults) {             var pointMeters = esri.geometry.geographicToWebMercator(geocodeResults[0].location);             var pointSymbol = new esri.symbol.SimpleMarkerSymbol().setSize(15).setColor(new dojo.Color("blue"));             var font = new esri.symbol.Font().setSize("17pt");             var textSymbol = new esri.symbol.TextSymbol(geocodeResults[0].displayName, font, new dojo.Color("black")).setOffset(0, 8);             _that.searchMapGraphics.add(new esri.Graphic(pointMeters, pointSymbol));             _that.searchMapGraphics.add(new esri.Graphic(pointMeters, textSymbol));             map.setExtent(esri.geometry.geographicToWebMercator(geocodeResults[0].bestView));         });          var query = Ext.getCmp('searchTextField').getValue();         veGeocoder.addressToLocations(query);


The callback function never fires it seems.  There has been no change to this code from the working version.  Is anyone else experiencing this?  Is this a problem on Bing's side perchance?  Any advice would be helpful.

Thanks,
Mark
0 Kudos
1 Solution

Accepted Solutions
MarkHoover
Frequent Contributor
Ah ha, there it is.  A request is made and I get the following response:

dojo.io.script.jsonp_dojoIoScript5._jsonpCallback({"error":{"code":500,"message":"Credentials are either invalid or unspecified.","details":[]}});

Looks like a case of Key mismanagement as we had a different key for the Basemap Gallery and the Geocoder.  A bit perplexed as to why the one key suddenly started failing but at least I've uncovered why now.

Thanks!

View solution in original post

0 Kudos
7 Replies
derekswingley1
Deactivated User
Do you see a request being sent to bing to do the geocode operation?
0 Kudos
MarkHoover
Frequent Contributor
Firebug's console doesn't seem to be logging anything; should I be looking somewhere else?

Are you able to successfully use VEGeocoder in code of your own?
0 Kudos
derekswingley1
Deactivated User
What do you see in the Net tab? That's where you would see the request to do the geocode.

I haven't tested it lately but will now...I'll post back once I know more.
0 Kudos
MarkHoover
Frequent Contributor
Ah ha, there it is.  A request is made and I get the following response:

dojo.io.script.jsonp_dojoIoScript5._jsonpCallback({"error":{"code":500,"message":"Credentials are either invalid or unspecified.","details":[]}});

Looks like a case of Key mismanagement as we had a different key for the Basemap Gallery and the Geocoder.  A bit perplexed as to why the one key suddenly started failing but at least I've uncovered why now.

Thanks!
0 Kudos
derekswingley1
Deactivated User
Glad I could help...can you mark this on as answered?
0 Kudos
MarkHoover
Frequent Contributor
Certainly.  Done and done.
0 Kudos
derekswingley1
Deactivated User
Nice, thanks!
0 Kudos