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.

CommentFileSizeAuthor
stamen warning.png529.86 KBjlstrecker
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jlstrecker created an issue. See original summary.

ressa’s picture

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

ressa’s picture

Version: 2.1.3 » 2.1.x-dev
Assigned: jlstrecker » ressa
Category: Bug report » Task

ressa’s picture

Assigned: ressa » Unassigned
Status: Active » Needs review

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

ressa’s picture

Issue summary: View changes
jlstrecker’s picture

Status: Needs review » Reviewed & tested by the community

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.)

ressa’s picture

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

ressa’s picture

Status: Reviewed & tested by the community » Needs review

I updated the Stamen license link, so changing status.

petr illek’s picture

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.

ressa’s picture

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.

ressa’s picture

Issue summary: View changes
petr illek’s picture

Status: Needs review » Reviewed & tested by the community

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

rachel_norfolk’s picture

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…

rachel_norfolk’s picture

Status: Reviewed & tested by the community » Needs work

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!

ressa’s picture

Status: Needs work » Needs review

Sure, thanks!

ressa’s picture

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 #3410669: [Meta] Release version 2.2 to keep track of the issues.

ressa’s picture

Title: Stamen map tiles moving to Stadia hosting and will no longer be available at old URL » Update Stamen map tiles to use Stadia hosting
krilo_89’s picture

@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?

ressa’s picture

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?

itamair’s picture

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 ...

itamair’s picture

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

ressa’s picture

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

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

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

ressa’s picture

Issue summary: View changes

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

rachel_norfolk’s picture

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

ressa’s picture

Issue summary: View changes

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

ressa’s picture

Issue summary: View changes
ressa’s picture

@Petr Illek: I saw target="_blank" got removed in #3426678: Attribution links open new windows without informing user, 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...

berramou’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.