Skip to content

Commit 8d76ce3

Browse files
committed
- (Bug Fix) Fixed an issue causing a JS error when attempting to set an icon on a marker before the api property has been set
1 parent 2ab9029 commit 8d76ce3

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

resources/js/plugin.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,8 @@ var GoogleMaps = {
416416
this.map.addMarker(this, this.fitBounds);
417417

418418
this.createInfoWindow();
419+
420+
this.setIcon(this.icon);
419421
}
420422
else if(this.address) {
421423
this.geocoder.geocode({address: this.address}, function(results, status) {
@@ -432,11 +434,11 @@ var GoogleMaps = {
432434
t.map.addMarker(t, t.fitBounds);
433435

434436
t.createInfoWindow();
437+
438+
t.setIcon(t.icon);
435439
}
436440
});
437441
}
438-
439-
this.setIcon(this.icon);
440442
},
441443

442444
shouldCluster: function() {

0 commit comments

Comments
 (0)