Merge branch 'master' into release-v1.3.0

This commit is contained in:
Andrew 2018-01-10 15:47:53 +01:00
commit 7686816a95
2 changed files with 11 additions and 3 deletions

View File

@ -51,9 +51,12 @@ export var Icon = Class.extend({
* will be aligned so that this point is at the marker's geographical location. Centered * 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. * 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. * 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 * @option shadowUrl: String = null
* The URL to the icon shadow image. If not specified, no shadow image will be created. * 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. * 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) { initialize: function (options) {
setOptions(this, options); setOptions(this, options);
}, },

View File

@ -349,11 +349,11 @@ export var Marker = Layer.extend({
}, },
_getPopupAnchor: function () { _getPopupAnchor: function () {
return this.options.icon.options.popupAnchor || [0, 0]; return this.options.icon.options.popupAnchor;
}, },
_getTooltipAnchor: function () { _getTooltipAnchor: function () {
return this.options.icon.options.tooltipAnchor || [0, 0]; return this.options.icon.options.tooltipAnchor;
} }
}); });