diff --git a/src/layer/marker/Icon.js b/src/layer/marker/Icon.js index 22e56b72..a0dc88c6 100644 --- a/src/layer/marker/Icon.js +++ b/src/layer/marker/Icon.js @@ -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. * @@ -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); }, diff --git a/src/layer/marker/Marker.js b/src/layer/marker/Marker.js index 09c33903..b3ba5921 100644 --- a/src/layer/marker/Marker.js +++ b/src/layer/marker/Marker.js @@ -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; } });