Skip to content

Commit

Permalink
export the attribution string
Browse files Browse the repository at this point in the history
for other libraries (like esri-leaflet-vector) to use
  • Loading branch information
gavinr-maps committed Dec 3, 2024
1 parent e5e146a commit c9e8818
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Util.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ export function setEsriAttribution (map) {
map.attributionControl._esriAttributionLayerCount = map.attributionControl._esriAttributionLayerCount + 1;
}

export function getEsriAttributionHtmlString () {
return POWERED_BY_ESRI_ATTRIBUTION_STRING;
}

export function removeEsriAttribution (map) {
if (!map.attributionControl) {
return;
Expand Down Expand Up @@ -353,7 +357,7 @@ export function _updateMapAttribution (evt) {
}
}

newAttributions = POWERED_BY_ESRI_ATTRIBUTION_STRING + ' | ' + newAttributions.substr(2);
newAttributions = getEsriAttributionHtmlString() + ' | ' + newAttributions.substr(2);
attributionElement.innerHTML = newAttributions;
attributionElement.style.maxWidth = calcAttributionWidth(map);

Expand All @@ -379,6 +383,7 @@ export var EsriUtil = {
extentToBounds: extentToBounds,
calcAttributionWidth: calcAttributionWidth,
setEsriAttribution: setEsriAttribution,
getEsriAttributionHtmlString: getEsriAttributionHtmlString,
removeEsriAttribution: removeEsriAttribution,
_setGeometry: _setGeometry,
_getAttributionData: _getAttributionData,
Expand Down

0 comments on commit c9e8818

Please sign in to comment.