Control.Attribution.js (Leaflet-1.8.0) | : | Control.Attribution.js (Leaflet-1.9.0) | ||
---|---|---|---|---|
import {Control} from './Control'; | import {Control} from './Control'; | |||
import {Map} from '../map/Map'; | import {Map} from '../map/Map'; | |||
import * as Util from '../core/Util'; | import * as Util from '../core/Util'; | |||
import * as DomEvent from '../dom/DomEvent'; | import * as DomEvent from '../dom/DomEvent'; | |||
import * as DomUtil from '../dom/DomUtil'; | import * as DomUtil from '../dom/DomUtil'; | |||
import Browser from '../core/Browser'; | import Browser from '../core/Browser'; | |||
var ukrainianFlag = '<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500 " d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>'; | var ukrainianFlag = '<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fi ll="#E0BC00" d="M0 7h12v1H0z"/></svg>'; | |||
/* | /* | |||
* @class Control.Attribution | * @class Control.Attribution | |||
* @aka L.Control.Attribution | * @aka L.Control.Attribution | |||
* @inherits Control | * @inherits Control | |||
* | * | |||
* The attribution control allows you to display attribution data in a small tex t box on a map. It is put on the map by default unless you set its [`attribution Control` option](#map-attributioncontrol) to `false`, and it fetches attribution texts from layers with the [`getAttribution` method](#layer-getattribution) aut omatically. Extends Control. | * The attribution control allows you to display attribution data in a small tex t box on a map. It is put on the map by default unless you set its [`attribution Control` option](#map-attributioncontrol) to `false`, and it fetches attribution texts from layers with the [`getAttribution` method](#layer-getattribution) aut omatically. Extends Control. | |||
*/ | */ | |||
export var Attribution = Control.extend({ | export var Attribution = Control.extend({ | |||
skipping to change at line 77 | skipping to change at line 77 | |||
// @method setPrefix(prefix: String|false): this | // @method setPrefix(prefix: String|false): this | |||
// The HTML text shown before the attributions. Pass `false` to disable. | // The HTML text shown before the attributions. Pass `false` to disable. | |||
setPrefix: function (prefix) { | setPrefix: function (prefix) { | |||
this.options.prefix = prefix; | this.options.prefix = prefix; | |||
this._update(); | this._update(); | |||
return this; | return this; | |||
}, | }, | |||
// @method addAttribution(text: String): this | // @method addAttribution(text: String): this | |||
// Adds an attribution text (e.g. `'Vector data © Mapbox'`). | // Adds an attribution text (e.g. `'© OpenStreetMap contributors'`). | |||
addAttribution: function (text) { | addAttribution: function (text) { | |||
if (!text) { return this; } | if (!text) { return this; } | |||
if (!this._attributions[text]) { | if (!this._attributions[text]) { | |||
this._attributions[text] = 0; | this._attributions[text] = 0; | |||
} | } | |||
this._attributions[text]++; | this._attributions[text]++; | |||
this._update(); | this._update(); | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added |