Skip to content

Commit fb61f0f

Browse files
committed
Version 1.16.2
1 parent d7477d3 commit fb61f0f

File tree

6 files changed

+27
-15
lines changed

6 files changed

+27
-15
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ngmap",
3-
"version": "1.16.1",
3+
"version": "1.16.2",
44
"main": "./build/scripts/ng-map.js",
55
"homepage": "https://github.com/allenhwkim/angularjs-google-maps",
66
"authors": [

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,16 +233,20 @@ <h1 class="title">
233233
position && (this.position = position); /* jshint ignore:line */
234234
if (this.getProjection() && typeof this.position.lng == 'function') {
235235
var posPixel = this.getProjection().fromLatLngToDivPixel(this.position);
236-
//delayed left/top calculation. with/height are not set instantly
237236
var _this = this;
238-
var delay = _this.el.offsetWidth ? 0 : 300;
239-
$timeout(function() {
237+
var setPosition = function() {
240238
var x = Math.round(posPixel.x - (_this.el.offsetWidth/2));
241239
var y = Math.round(posPixel.y - _this.el.offsetHeight - 10); // 10px for anchor
242240
_this.el.style.left = x + "px";
243241
_this.el.style.top = y + "px";
244242
_this.el.style.visibility = "visible";
245-
}, delay);
243+
};
244+
if (_this.el.offsetWidth && _this.el.offsetHeight) {
245+
setPosition();
246+
} else {
247+
//delayed left/top calculation when width/height are not set instantly
248+
$timeout(setPosition, 300);
249+
}
246250
}
247251
};
248252
CustomMarker.prototype.setZIndex = function(zIndex) {

build/scripts/ng-map.debug.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -459,16 +459,20 @@ angular.module('ngMap').config([
459459

460460
if (this.getProjection() && typeof this.position.lng == 'function') {
461461
var posPixel = this.getProjection().fromLatLngToDivPixel(this.position);
462-
//delayed left/top calculation. with/height are not set instantly
463462
var _this = this;
464-
var delay = _this.el.offsetWidth ? 0 : 300;
465-
$timeout(function() {
463+
var setPosition = function() {
466464
var x = Math.round(posPixel.x - (_this.el.offsetWidth/2));
467465
var y = Math.round(posPixel.y - _this.el.offsetHeight - 10); // 10px for anchor
468466
_this.el.style.left = x + "px";
469467
_this.el.style.top = y + "px";
470468
_this.el.style.visibility = "visible";
471-
}, delay);
469+
};
470+
if (_this.el.offsetWidth && _this.el.offsetHeight) {
471+
setPosition();
472+
} else {
473+
//delayed left/top calculation when width/height are not set instantly
474+
$timeout(setPosition, 300);
475+
}
472476
}
473477
};
474478

build/scripts/ng-map.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -459,16 +459,20 @@ angular.module('ngMap').config([
459459

460460
if (this.getProjection() && typeof this.position.lng == 'function') {
461461
var posPixel = this.getProjection().fromLatLngToDivPixel(this.position);
462-
//delayed left/top calculation. with/height are not set instantly
463462
var _this = this;
464-
var delay = _this.el.offsetWidth ? 0 : 300;
465-
$timeout(function() {
463+
var setPosition = function() {
466464
var x = Math.round(posPixel.x - (_this.el.offsetWidth/2));
467465
var y = Math.round(posPixel.y - _this.el.offsetHeight - 10); // 10px for anchor
468466
_this.el.style.left = x + "px";
469467
_this.el.style.top = y + "px";
470468
_this.el.style.visibility = "visible";
471-
}, delay);
469+
};
470+
if (_this.el.offsetWidth && _this.el.offsetHeight) {
471+
setPosition();
472+
} else {
473+
//delayed left/top calculation when width/height are not set instantly
474+
$timeout(setPosition, 300);
475+
}
472476
}
473477
};
474478

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.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ngmap",
3-
"version": "1.16.1",
3+
"version": "1.16.2",
44
"main": "build/scripts/ng-map.js",
55
"dependencies": {},
66
"engines": {

0 commit comments

Comments
 (0)