ProjectSidewalk / SidewalkWebpage

Project Sidewalk web page
http://projectsidewalk.org
MIT License
83 stars 24 forks source link

Upgrade Mapbox styles #2013

Closed misaugstad closed 3 years ago

misaugstad commented 4 years ago

We got an email from Mapbox this week saying that we are using Mapbox styles that are going to be deprecated soon. Looks like we won't be able to use some of the styles starting on June 1st. Not sure which of our maps are using the old versions of the styles, but we should figure that out soon!

Here is the full text of the email:

You are receiving this email because your account made requests with Mapbox Studio Classic styles in the last month.

We will be deprecating Studio Classic styles in 2020, and want to make sure you’re aware of all the benefits of upgrading to a modern Mapbox Studio style.

Upgrading unlocks:

Daily map data updates, carefully validated by Mapbox. Studio Classic styles stopped receiving regular map data updates in early 2018. Ability to customize and style your maps with Style Components in Studio Consistent styling across the full stack of modern our SDKs & Static APIs How easy is it to upgrade? The answer to this question depends on your current implementation. We’ve put together these migrations guides to help you get started:

Migrating to the modern Static Tiles API Migrating to the modern Static Images API If you are currently using a Classic style as a fallback for browsers that don’t support Mapbox GL JS, review this tutorial on how to implement with a modern Mapbox Studio style:

Use Mapbox.js as a fallback Ahead of deprecation, here are the two key dates that you should be aware of:

March 31, 2020 - you will no longer be able to upload new Studio Classic styles or modify existing Studio Classic styles via the Uploads API June 1, 2020 - you will no longer be able to make valid API requests using Studio Classic styles If you have any questions about the above dates or the migration process, please don’t hesitate to reach out to our support team.

misaugstad commented 4 years ago

@kotarohara would you potentially be able to log in to your Mapbox account and send me the metadata/stylesheets for your Mapbox Classic Styles (https://studio.mapbox.com/classic/)?

Mapbox Classic is being deprecated and I'd like to recreate the styles you made in the newer Mapbox Studio, and that would be muuuuch easier if I had access to your stylesheets!

misaugstad commented 4 years ago

Okay there are two different styles that we are using. I found default Mapbox styles that are similar to them and replaced them. They look pretty good to me, I don't see obvious/important differences. Showing an example of each style below; all the other maps use these same styles so the changes look similar.

Landing page before landing-before

Landing page after landing-after

User dashboard before user-dashboard-old

User dashboard after user-dashboard-new

jonfroehlich commented 4 years ago

Looks great!

On Thu, Mar 12, 2020 at 4:10 PM Mikey Saugstad notifications@github.com wrote:

Okay there are two different styles that we are using. I found default Mapbox styles that are similar to them and replaced them. They look pretty good to me, I don't see obvious/important differences. Showing an example of each style below; all the other maps use these same styles so the changes look similar.

Landing page before [image: landing-before] https://user-images.githubusercontent.com/6518824/76575227-c5c50580-647b-11ea-992b-9a2353410be0.png

Landing page after [image: landing-after] https://user-images.githubusercontent.com/6518824/76575230-c9f12300-647b-11ea-947b-84180ad427c9.png

User dashboard before [image: user-dashboard-old] https://user-images.githubusercontent.com/6518824/76575241-ce1d4080-647b-11ea-8ef7-3fdaf9ca8b3f.png

User dashboard after [image: user-dashboard-new] https://user-images.githubusercontent.com/6518824/76575247-d2495e00-647b-11ea-8115-580f13bb7e5b.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ProjectSidewalk/SidewalkWebpage/issues/2013#issuecomment-598471829, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAML55PQEDB2EBVQ7IPMOM3RHFTXHANCNFSM4KSW6XGA .

-- Jon Froehlich Associate Professor Paul G. Allen School of Computer Science & Engineering University of Washington http://makeabilitylab.io @jonfroehlich https://twitter.com/jonfroehlich - Twitter Help make sidewalks more accessible: http://projectsidewalk.io

misaugstad commented 4 years ago

closing via #2039

misaugstad commented 3 years ago

Okay, I had thought that I had moved to the modern mapbox styles, but it turns out that I was wrong! The documentation had sounded like they were just talking about user-created mapbox classic styles. They have since improved that documentation and it is more clear that it is referring to all mapbox classic styles, including the styles we are using for every single map. And those are supposed to be removed on November 1st, but it appears that they have been removed today! So all of our maps are missing any sort of styling (we just see a white background with our polgyons drawn on it).

Screenshot from 2020-10-13 15-06-43

This is on every map on every server, including production. So this is a very high priority.

I just did some quick testing on fixing this, and this migration code was helpful, though it doesn't get me all the way there. We just need to figure out how to add back in the max zoom parameters and such. Here is the before and after code:

Before

var choropleth = L.mapbox.map('choropleth', "mapbox.light", {
    maxZoom: 19,
    minZoom: 9,
    zoomControl: false,
    legendControl: {
        position: 'topright'
    },
    zoomSnap: 0.5
});

After

var choropleth = L.mapbox.map('choropleth').addLayer(L.mapbox.styleLayer('mapbox://styles/mapbox/light-v10'));

We can replace the "mapbox.light" with "mapbox://styles/mapbox/light-v10'" and "mapbox.streets" with "mapbox://styles/mapbox/streets-v11".