Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Powered by Esri' missing in map attribution #133

Closed
ItaiEinhorn opened this issue Jul 5, 2022 · 12 comments
Closed

'Powered by Esri' missing in map attribution #133

ItaiEinhorn opened this issue Jul 5, 2022 · 12 comments
Assignees

Comments

@ItaiEinhorn
Copy link

Describe the bug

Other Esri leaflet map layers support the 'Powered by Esri' attribution
onAdd: function (map) { // include 'Powered by Esri' in map attribution setEsriAttribution(map); ...
Vector layers does not support this behavior

Requesting to add the 'setEsriAttribution' call to the 'onAdd' function in the vector layers

Reproduction

Tiled map layer:
image.
Vector Layer:
image

Logs

No response

System Info

Leaflet version: `v1.7.1`. 
Esri Leaflet version: `v3.0.7`.
Esri Leaflet Vector version: `v3.1.2`.

Additional Information

No response

@gavinr
Copy link
Contributor

gavinr commented Jul 6, 2022

Hi, thank you for the question.

Can you please post a sample code that shows the issue not showing "powered by Esri"? I see it showing here:
https://developers.arcgis.com/esri-leaflet/samples/showing-a-basemap/

image

@ItaiEinhorn
Copy link
Author

@gavinr Thanks for the response
I took the source code from the same page in your screenshot, the only change:

L.esri.Vector.vectorBasemapLayer("3e1a00aeae81496587988075fe529f71", {
        url: 'https://basemaps.arcgis.com/arcgis/rest/services/OpenStreetMap_v2/VectorTileServer',
        apikey: apiKey
      }).addTo(map);

This map doesn't show the 'Powered by Esri'

image

@gavinr
Copy link
Contributor

gavinr commented Jul 6, 2022

Are you able to use this?

L.esri.Vector.vectorBasemapLayer("OSM:Standard", {
  apikey: apiKey
}).addTo(map);

That way includes the "Powered by Esri".

@ItaiEinhorn
Copy link
Author

@gavinr Unfortunately i can't, In my use case the basemaps are fetched dynamically from the user's gallery

@gavinr
Copy link
Contributor

gavinr commented Jul 7, 2022

In that case, you can pass the attribution parameter, like this:

L.esri.Vector.vectorBasemapLayer("3e1a00aeae81496587988075fe529f71", {
      apiKey: apiKey,
      attribution: 'Powered by <a href="https://esri.com">Esri</a>'
}).addTo(map);

@ItaiEinhorn
Copy link
Author

@gavinr That's a nice workaround,
However, this way we'll lose the current attribution. I was expecting from esri-leaflet-vector library to add the 'Powered by Esri' the same way it does with named basemaps, am i missing something?

@gavinr

This comment was marked as outdated.

@gavinr gavinr self-assigned this Jul 11, 2022
@ItaiEinhorn
Copy link
Author

@gavinr Why is this different from other layers? for example: RasterLayer has the 'setEsriAttribution' call in the 'onAdd' event (same with other layers in that library) but for VectorBasemapLayer it calls 'setEsriAttribution' only on '_setupAttribution' callback only if id isn't 32 characters.
This is inconsistent and confusing behavior.
If you don't necessarily add 'Powered by Esri' in esri-leaflet-vector then we should have the same behavior in other types of base map layers

@gavinr
Copy link
Contributor

gavinr commented Jul 12, 2022

Thanks for the input @ItaiEinhorn. I think you're right - every standard Esri Leaflet layer type adds "Powered by Esri" except for this layer in this very specific case (demo). Given that, I agree with you that this layer should be consistent and add "Powered by Esri" in all use cases.

PRs to update this are welcome!

@shawnmgoulet
Copy link
Contributor

I've submitted a PR referenced above (#135) that seeks to resolve this issue. @ItaiEinhorn @gavinr

@ItaiEinhorn
Copy link
Author

@gavinr @shawnmgoulet Thank you guys,

Any idea when a new version will be published?

@gavinr
Copy link
Contributor

gavinr commented Aug 12, 2022

The fix for this (#135) was released in v3.1.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants