iag-geo / bootleaf

An open-source version of IAG's Bootleaf fork
https://demo.bootleaf.xyz
MIT License
89 stars 65 forks source link

attribution for displayed basemaps #7

Closed rnuske closed 5 years ago

rnuske commented 5 years ago

some basemaps, such as OSM for example, demand a certain attribution to be shown on the map. At least in the example application i couldn't see any attributions. Is there a way to configure them?

slead commented 5 years ago

If you set the attributionControl parameter to true in the config.js file, you should automatically see the attribution:

"start": {
  "attributionControl": true
}

Let me know if not and I can take a look. Thanks for fixing the typo earlier, too.

rnuske commented 5 years ago

That's great. I would recommend to turn it on by default in the sample config.js. Since the OSM Licence (ODbL) requests that an attribution containing the licence and a link to https://www.openstreetmap.org/copyright is shown. If the bootleaf user does not produce the tiles himself, he may have to display the license of the tile producer as well (usually some kind of CC-licence).

I tried to find out where the default attribution are defined, wich are shown if one just switches on the attributionControl. They seem not to be in this repo.

At least the OSM attribution needs to be mended urgently

slead commented 5 years ago

good point, I've updated the sample config to have the attribution on by default.

I didn't factor in how to add basemap attribution but I can add it. I guess the attribution should be hard-coded to the list of basemaps in app.js?

"basemaps": [
    {
      "id": "MapboxStreets",
      "type": "mapbox",
      "theme": "streets",
      "label": "Streets (MapBox)",
      "attribution": "add attribution here and ensure it's shown on the map too"
    },

Currently there's no ability to add a custom basemap within config.js, just the ability to list the basemaps from app.js that you wish to include on the map.

rnuske commented 5 years ago

Yes, i think it would be best to add an appropriate attribution where the basemaps are defined (in src/js/app.js). It's probably not easy to figure out what are necessary and what are polite parts of the attribution. In general "mentioning Leaflet" is polite I guess, but "Powered by esri" seems to be requested by esri-leaflet's Terms.

I already tried to add the attribution element to the definition of the basemaps in src/js/app.js but it seems not to be used yet.

Looking at the currently employed attribution, i guess they are from esri-leaflet. At least the OSM attribution needs love.

slead commented 5 years ago

In the latest update I've added some hard-coded attribution to the default basemaps from MapBox, OpenStreetMap and Bing.

(There's a persistent attribution US Bureau of the Census: http://www.census.gov which is presumably coming from esri-leaflet - I'll see if I can remove it when time permits)

Thanks again for the suggestion

rnuske commented 5 years ago

That's cool. Thanks for the fast reaction.

The US Bureau of the Census-part is really weird, seems to be deeply within esri-leaflet.

slead commented 5 years ago

It looks like the Table of Contents plugin that I'm using doesn't actually remove layers from the map when they're switched off, so their attribution is always shown regardless of whether they are on or off.

The "census" attribution is coming from the sample Counties layer (https://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/)

rnuske commented 5 years ago

alright that seems to be a separate issue