Update Stamen map tiles to use Stadia hosting

Created on 11 October 2023, about 1 year ago
Updated 11 June 2024, 6 months ago

Problem/Motivation

When one of the Stamen options is selected as the map style, some map tiles now show a warning (right on top of the map): "These basemap tiles will no longer be available as of October 31, 2023. The site administrator can upgrade to the new map at stamen.com/faq." See attached screenshot.

Proposed resolution

Update URLs as described in Stadia's documentation.

Remaining tasks

Add information on the form page that Stamen and Stadia maps requires registering an account.

Emphasize that Domain-based authentication is the recommended method:

Stamen maps from Stadia use Domain-based authentication, so you need to register an account and add your local domain. Add *.ddev.site for DDEV, *.lndo.site for Lando, and so on. Development from 127.0.0.1 or localhost will "just work".

Testing without Stadia account, at 127.0.0.1

You can test the MR without registering an account and a domain, by using the alternative DDEV 127.0.0.1 URL:

$ ddev describe | grep "Host: 127.0.0.1:"
โ”‚ Host: 127.0.0.1:32769,32770 โ”‚ docroot:'web'      โ”‚
โ”‚ Host: 127.0.0.1:32768       โ”‚ User/Pass: 'db/db' โ”‚

In the example above, it's https://127.0.0.1:32769, which you need to adjust to you local port number.

๐Ÿ“Œ Task
Status

Fixed

Version

2.1

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States jlstrecker Athens, Ohio, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @jlstrecker
  • ๐Ÿ‡ฉ๐Ÿ‡ฐDenmark ressa Copenhagen

    Thanks! It does looks like an account is required, and a fee to be paid for Commercial use "... defined as any usage by a company which is for-profit, or as part of a product that is sold or generates revenue.":

    We've set up an onboarding flow specifically for Stamen users to make the migration as easy as possible. No credit card is required to create an account, and we offer a free tier for non-commercial users.

    ... where you can then register a domain with the account:

    Domain-based authentication is the easiest form of authentication for production web apps. No additional application code is required, and you don't need to worry about anyone scraping your API keys.

    https://docs.stadiamaps.com/authentication/#domain-based-authentication

  • Assigned to ressa
  • ๐Ÿ‡ฉ๐Ÿ‡ฐDenmark ressa Copenhagen
  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • ๐Ÿ‡ฉ๐Ÿ‡ฐDenmark ressa Copenhagen

    I added all the available Stamen layers and subsets, please review.

  • ๐Ÿ‡ฉ๐Ÿ‡ฐDenmark ressa Copenhagen
  • Status changed to RTBC about 1 year ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States jlstrecker Athens, Ohio, USA

    Thanks! I looked over the code and tested with the Stamen Toner style. The tiles successfully load on both a local dev site and an AWS-hosted site. I confirmed that it's no longer requesting tiles from stamen-tiles-*.ssl.fastly.net, now only tiles.stadiamaps.com. On the public site, once I deployed the change, rebuilt caches, and registered for domain-based authentication with Stadia, the "basemap tiles will no longer be available" message no longer appeared. (On the dev site the message never appeared.)

  • ๐Ÿ‡ฉ๐Ÿ‡ฐDenmark ressa Copenhagen

    Great, thanks for a fast review, and for confirming that the patch works as expected!

  • Status changed to Needs review about 1 year ago
  • ๐Ÿ‡ฉ๐Ÿ‡ฐDenmark ressa Copenhagen

    I updated the Stamen license link, so changing status.

  • ๐Ÿ‡จ๐Ÿ‡ฟCzech Republic Petr Illek

    I tested the patch, and can see the map tiles comming from new location.
    But there are tiles randomly missing, still displaying the same message already mentioned.
    I do not have Stadia account, but if it is required, it would be good to mentioned it on the settings page in the "Map providerโ€ฆ" section.

    Personally I would remove all the target="_blank" from the code as that is mostly considered a bad practice.

  • ๐Ÿ‡ฉ๐Ÿ‡ฐDenmark ressa Copenhagen

    Thanks for a fast review! I agree very much about target="_blank" and never use it personally. But that's the format they want .... If you check for example Stamen Watercolor attribution, and I think we need to respect that.

    You're correct, Stadia requires an account, so I added info on the form about that, and updated the patch.

  • ๐Ÿ‡ฉ๐Ÿ‡ฐDenmark ressa Copenhagen
  • Status changed to RTBC about 1 year ago
  • ๐Ÿ‡จ๐Ÿ‡ฟCzech Republic Petr Illek

    Looks fine to me now.
    The target blank is annoying, but not a blocker for having this again working.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom rachel_norfolk UK

    As I try this out, Iโ€™m amused by the quote Development from 127.0.0.1 or localhost does not require setting up a domain; these requests will "just work". โ€” especially as Iโ€™m currently using DDEV running on Codespaces and my iPad to check - I have to localhostโ€ฆ

  • Status changed to Needs work about 1 year ago
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom rachel_norfolk UK

    Ah - tiny thing but itโ€™s worth updating - thereโ€™s an update to the Google terms of service link in the README that seems out of scope of the issue. Can you remove that change from the MR, set back to RTBC and Iโ€™ll merge?

    If you want to create a follow up issue for the Google terms link, thatโ€™d be great!

  • Status changed to Needs review about 1 year ago
  • ๐Ÿ‡ฉ๐Ÿ‡ฐDenmark ressa Copenhagen

    Sure, thanks!

  • ๐Ÿ‡ฉ๐Ÿ‡ฐDenmark ressa Copenhagen

    When this and the other improvements such as retina support are committed, perhaps a fresh release could be considered? The last one was Nov. 2022. I have created ๐Ÿ“Œ [Meta] Release version 2.2 Active to keep track of the issues.

  • ๐Ÿ‡ฉ๐Ÿ‡ฐDenmark ressa Copenhagen
  • ๐Ÿ‡ณ๐Ÿ‡ฑNetherlands Krilo_89

    @rachel_norfolk and @ressa, I'm missing the most important thing of the Stamen update and that's the API Key. The whole point of the switch to stadia.com, is that you need to register and retrieve an API Key to use the maps in Drupal.
    Right now it works only on localhost and I don't think we only build local websites here ;).

    The best way is to add an extra field in the backend for the API key. And 'navionics' is already doing that, so why don't do the same?

  • ๐Ÿ‡ฉ๐Ÿ‡ฐDenmark ressa Copenhagen

    Stadia recommends domain-based authentication:

    ... the easiest form of authentication for production web apps. No additional application code is required, and you don't need to worry about anyone scraping your API keys. We recommend this for most browser-based applications.

    Domain-based authentication

    I have updated the link to point to that anchor, to make this clearer. What do you think?

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly itamair

    Hi folks here ... I jumped on this "unpassant" as I don't have much time for the Leaflet More Maps module, but still I care as I can deploy new releases on this.
    I quickly tested the leaflet_more_maps-3393412 MR locally (I have a Stadia account but the API Key is not needed locally) and none of the Stadia maps work for me. Am I missing something or the MR still doesn't fix this issue properly?
    Please let me know when this is fully RTBC so that we could deploy into new release ...

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly itamair

    Oh well I can see that also @berramou is able to generate new releases of Leaflet More Maps ... (isn't it?)

  • ๐Ÿ‡ฉ๐Ÿ‡ฐDenmark ressa Copenhagen

    Thanks for looking at this @itamair. You're correct that using API Key is an option.

    But Stadia recommends using "Domain-based authentication", so If you're using DDEV, you need add a property called for example "DDEV" and *.ddev.site.

    I have expanded the info text in the form page, to make this clearer. Is it better now?

  • ๐Ÿ‡ฉ๐Ÿ‡ฐDenmark ressa Copenhagen

    Update Issue Summary, adding "Domain-based authentication" info.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom rachel_norfolk UK

    I like it. If someone can test that this is now working, describing the steps they took to test it, I'll merge it.

  • ๐Ÿ‡ฉ๐Ÿ‡ฐDenmark ressa Copenhagen

    Awesome, thanks @rachel_norfolk. I am adding a method for testing the MR without a Stadia account to the Issue Summary.

  • ๐Ÿ‡ฉ๐Ÿ‡ฐDenmark ressa Copenhagen
  • ๐Ÿ‡ฉ๐Ÿ‡ฐDenmark ressa Copenhagen

    @Petr Illek: I saw target="_blank" got removed in ๐Ÿ› Attribution links open new windows without informing user Fixed , and have also deleted them here.

    Wouldn't it be great to get this MR committed?

    • berramou โ†’ committed 88412f13 on 2.1.x
      Issue #3393412 by ressa, jlstrecker, Petr Illek: Update Stamen map tiles...
  • Status changed to Fixed 7 months ago
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance berramou
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024