Skip to content

Commit d811422

Browse files
authored
Merge pull request allenhwkim#674 from alitto/issue-670
Fix for issue allenhwkim#670 "Custom markers disappear on second load"
2 parents 071b72c + 202fadb commit d811422

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

directives/custom-marker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@
6969
position && (this.position = position); /* jshint ignore:line */
7070

7171
if (this.getProjection() && typeof this.position.lng == 'function') {
72-
var posPixel = this.getProjection().fromLatLngToDivPixel(this.position);
7372
var _this = this;
7473
var setPosition = function() {
74+
var posPixel = _this.getProjection().fromLatLngToDivPixel(_this.position);
7575
var x = Math.round(posPixel.x - (_this.el.offsetWidth/2));
7676
var y = Math.round(posPixel.y - _this.el.offsetHeight - 10); // 10px for anchor
7777
_this.el.style.left = x + "px";

0 commit comments

Comments
 (0)