Permalink
Browse files

Fix a marker issue that occurs when used on mulitple elements.

  • Loading branch information...
1 parent 5aaf4b8 commit 052b63c077e4d34b8e9f729cb9d4a82e97527f9c @tristandunn committed Jan 19, 2013
Showing with 4 additions and 6 deletions.
  1. +2 −3 examples/advanced.html
  2. +1 −2 jquery.auto-geocoder.js
  3. +1 −1 jquery.auto-geocoder.min.js
View
@@ -78,10 +78,9 @@
})
.on('auto-geocoder.onGeocodeFailure', function() {
log('Geocode failure. (Single Element) #location');
- })
- .autoGeocoder();
+ });
- $('#other-location').autoGeocoder();
+ $('#location, #other-location').autoGeocoder();
});
View
@@ -84,10 +84,9 @@
}],
onGeocodeResult: [function(options) {
- this.get(0).marker = new google.maps.Marker();
this.on('auto-geocoder.onGeocodeResult', function(e, results, status) {
var map = this.map,
- marker = this.marker;
+ marker = this.marker = this.marker || new google.maps.Marker();
if (status == google.maps.GeocoderStatus.OK) {
var geometry = results[0].geometry,

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit 052b63c

Please sign in to comment.