Skip to content

Commit

Permalink
Merge branch 'master' into release-v1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cherniavskii committed Jan 10, 2018
2 parents 16f1c48 + 9796e11 commit 7686816
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 9 additions & 1 deletion src/layer/marker/Icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,12 @@ export var Icon = Class.extend({
* will be aligned so that this point is at the marker's geographical location. Centered
* by default if size is specified, also can be set in CSS with negative margins.
*
* @option popupAnchor: Point = null
* @option popupAnchor: Point = [0, 0]
* The coordinates of the point from which popups will "open", relative to the icon anchor.
*
* @option tooltipAnchor: Point = [0, 0]
* The coordinates of the point from which tooltips will "open", relative to the icon anchor.
*
* @option shadowUrl: String = null
* The URL to the icon shadow image. If not specified, no shadow image will be created.
*
Expand All @@ -70,6 +73,11 @@ export var Icon = Class.extend({
* A custom class name to assign to both icon and shadow images. Empty by default.
*/

options: {
popupAnchor: [0, 0],
tooltipAnchor: [0, 0],
},

initialize: function (options) {
setOptions(this, options);
},
Expand Down
4 changes: 2 additions & 2 deletions src/layer/marker/Marker.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,11 +349,11 @@ export var Marker = Layer.extend({
},

_getPopupAnchor: function () {
return this.options.icon.options.popupAnchor || [0, 0];
return this.options.icon.options.popupAnchor;
},

_getTooltipAnchor: function () {
return this.options.icon.options.tooltipAnchor || [0, 0];
return this.options.icon.options.tooltipAnchor;
}
});

Expand Down

0 comments on commit 7686816

Please sign in to comment.