Merge branch 'master' into release-v1.3.0

carto
Andrew 7 years ago
commit 7686816a95

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

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

Loading…
Cancel
Save