move marker extensions to Marker.js

This commit is contained in:
Vladimir Agafonkin 2016-09-27 17:59:05 +03:00
parent 7ec434e505
commit e3545bc9b9
4 changed files with 10 additions and 22 deletions

View File

@ -71,8 +71,7 @@ var deps = {
src: [
'layer/DivOverlay.js',
'layer/Popup.js',
'layer/Layer.Popup.js',
'layer/marker/Marker.Popup.js'
'layer/Layer.Popup.js'
],
deps: ['Marker'],
desc: 'Used to display the map popup (used mostly for binding HTML data to markers and paths on click).'
@ -81,8 +80,7 @@ var deps = {
Tooltip: {
src: [
'layer/Tooltip.js',
'layer/Layer.Tooltip.js',
'layer/marker/Marker.Tooltip.js'
'layer/Layer.Tooltip.js'
],
deps: ['Popup', 'Marker'],
desc: 'Used to display the map tooltip (used mostly for binding short descriptions to markers and paths on mouseover).'

View File

@ -1,9 +0,0 @@
/*
* Popup extension to L.Marker, adding popup-related methods.
*/
L.Marker.include({
_getPopupAnchor: function () {
return this.options.icon.options.popupAnchor || [0, 0];
}
});

View File

@ -1,9 +0,0 @@
/*
* Tooltip extension to L.Marker, adding tooltip-related methods.
*/
L.Marker.include({
_getTooltipAnchor: function () {
return this.options.icon.options.tooltipAnchor || [0, 0];
}
});

View File

@ -320,6 +320,14 @@ L.Marker = L.Layer.extend({
_resetZIndex: function () {
this._updateZIndex(0);
},
_getPopupAnchor: function () {
return this.options.icon.options.popupAnchor || [0, 0];
},
_getTooltipAnchor: function () {
return this.options.icon.options.tooltipAnchor || [0, 0];
}
});