move tooltipAnchor and popupAnchor defaults from Marker to Icon

This commit is contained in:
Andrew 2018-01-10 15:03:18 +01:00 committed by Vladimir Agafonkin
parent 031ff12873
commit 5c2d3d8ebc
2 changed files with 7 additions and 2 deletions

View File

@ -73,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);
},

View File

@ -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;
}
});