Skip to content

Commit abf7b86

Browse files
committed
v1.16.1
1 parent 8b419e2 commit abf7b86

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

build/docs/source/ngmap.custom-marker.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,13 +235,14 @@ <h1 class="title">
235235
var posPixel = this.getProjection().fromLatLngToDivPixel(this.position);
236236
//delayed left/top calculation. with/height are not set instantly
237237
var _this = this;
238+
var delay = _this.el.offsetWidth ? 0 : 300;
238239
$timeout(function() {
239240
var x = Math.round(posPixel.x - (_this.el.offsetWidth/2));
240241
var y = Math.round(posPixel.y - _this.el.offsetHeight - 10); // 10px for anchor
241242
_this.el.style.left = x + "px";
242243
_this.el.style.top = y + "px";
243244
_this.el.style.visibility = "visible";
244-
}, 300);
245+
}, delay);
245246
}
246247
};
247248
CustomMarker.prototype.setZIndex = function(zIndex) {

build/scripts/ng-map.debug.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,17 +456,19 @@ angular.module('ngMap').config([
456456

457457
CustomMarker.prototype.setPosition = function(position) {
458458
position && (this.position = position); /* jshint ignore:line */
459+
459460
if (this.getProjection() && typeof this.position.lng == 'function') {
460461
var posPixel = this.getProjection().fromLatLngToDivPixel(this.position);
461462
//delayed left/top calculation. with/height are not set instantly
462463
var _this = this;
464+
var delay = _this.el.offsetWidth ? 0 : 300;
463465
$timeout(function() {
464466
var x = Math.round(posPixel.x - (_this.el.offsetWidth/2));
465467
var y = Math.round(posPixel.y - _this.el.offsetHeight - 10); // 10px for anchor
466468
_this.el.style.left = x + "px";
467469
_this.el.style.top = y + "px";
468470
_this.el.style.visibility = "visible";
469-
}, 300);
471+
}, delay);
470472
}
471473
};
472474

build/scripts/ng-map.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,17 +456,19 @@ angular.module('ngMap').config([
456456

457457
CustomMarker.prototype.setPosition = function(position) {
458458
position && (this.position = position); /* jshint ignore:line */
459+
459460
if (this.getProjection() && typeof this.position.lng == 'function') {
460461
var posPixel = this.getProjection().fromLatLngToDivPixel(this.position);
461462
//delayed left/top calculation. with/height are not set instantly
462463
var _this = this;
464+
var delay = _this.el.offsetWidth ? 0 : 300;
463465
$timeout(function() {
464466
var x = Math.round(posPixel.x - (_this.el.offsetWidth/2));
465467
var y = Math.round(posPixel.y - _this.el.offsetHeight - 10); // 10px for anchor
466468
_this.el.style.left = x + "px";
467469
_this.el.style.top = y + "px";
468470
_this.el.style.visibility = "visible";
469-
}, 300);
471+
}, delay);
470472
}
471473
};
472474

build/scripts/ng-map.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)