DivOverlay.js (Leaflet-1.8.0) | : | DivOverlay.js (Leaflet-1.9.0) | ||
---|---|---|---|---|
skipping to change at line 36 | skipping to change at line 36 | |||
// @option offset: Point = Point(0, 0) | // @option offset: Point = Point(0, 0) | |||
// The offset of the overlay position. | // The offset of the overlay position. | |||
offset: [0, 0], | offset: [0, 0], | |||
// @option className: String = '' | // @option className: String = '' | |||
// A custom CSS class name to assign to the overlay. | // A custom CSS class name to assign to the overlay. | |||
className: '', | className: '', | |||
// @option pane: String = undefined | // @option pane: String = undefined | |||
// `Map pane` where the overlay will be added. | // `Map pane` where the overlay will be added. | |||
pane: undefined | pane: undefined, | |||
// @option content: String|HTMLElement|Function = '' | ||||
// Sets the HTML content of the overlay while initializing. If a | ||||
function is passed the source layer will be | ||||
// passed to the function. The function should return a `String` | ||||
or `HTMLElement` to be used in the overlay. | ||||
content: '' | ||||
}, | }, | |||
initialize: function (options, source) { | initialize: function (options, source) { | |||
Util.setOptions(this, options); | if (options && (options instanceof L.LatLng || Util.isArray(optio | |||
ns))) { | ||||
this._source = source; | this._latlng = toLatLng(options); | |||
Util.setOptions(this, source); | ||||
} else { | ||||
Util.setOptions(this, options); | ||||
this._source = source; | ||||
} | ||||
if (this.options.content) { | ||||
this._content = this.options.content; | ||||
} | ||||
}, | }, | |||
// @method openOn(map: Map): this | // @method openOn(map: Map): this | |||
// Adds the overlay to the map. | // Adds the overlay to the map. | |||
// Alternative to `map.openPopup(popup)`/`.openTooltip(tooltip)`. | // Alternative to `map.openPopup(popup)`/`.openTooltip(tooltip)`. | |||
openOn: function (map) { | openOn: function (map) { | |||
map = arguments.length ? map : this._source._map; // experimental , not the part of public api | map = arguments.length ? map : this._source._map; // experimental , not the part of public api | |||
if (!map.hasLayer(this)) { | if (!map.hasLayer(this)) { | |||
map.addLayer(this); | map.addLayer(this); | |||
} | } | |||
End of changes. 2 change blocks. | ||||
4 lines changed or deleted | 19 lines changed or added |