Skip to content

Commit

Permalink
Merge pull request #14 from Jhays10/master
Browse files Browse the repository at this point in the history
fix; mapquest geocode pound sign
  • Loading branch information
wavded committed Jul 14, 2015
2 parents 1ac5e33 + 22747a2 commit a41c5fe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions wheredat.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
var API_KEY = param('key')

if (service === "mapquest") {
document.write('<script src="'+location.protocol+'//www.mapquestapi.com/sdk/leaflet/v1.0/mq-map.js?key='+ API_KEY +'"><\/script>');
document.write('<script src="'+location.protocol+'//www.mapquestapi.com/sdk/leaflet/v1.0/mq-geocoding.js?key='+ API_KEY +'"><\/script>')
document.write('<script src="'+location.protocol+'//www.mapquestapi.com/sdk/leaflet/v1.s/mq-map.js?key='+ API_KEY +'"><\/script>');
document.write('<script src="'+location.protocol+'//www.mapquestapi.com/sdk/leaflet/v1.s/mq-geocoding.js?key='+ API_KEY +'"><\/script>')

isMapQuest = true
} else {
Expand All @@ -34,6 +34,7 @@
geocode: function (address, country, city) {
if (!isMapQuest) jsonp('?countryCode='+(country || 'US')+'&q='+address)
else {
address = address.replace(new RegExp('#', 'g'), 'no.')
if (!country || !city) MQ.geocode().search(address).on('success', function(e) { window._wheredat_res(e.result.best) })
else MQ.geocode().search({ country: country, street: address, city: city }).on('success', function (e) { window._wheredat_res(e.result.best) })
}
Expand Down

0 comments on commit a41c5fe

Please sign in to comment.