I have discovered one of the primary pitfalls of relying on YouTube tutorials- good software changes fast and finding tutorials for the newest version of a thing can be challenging. I have spent the better part of two weeks trying to get my map to work. It isn’t a complex map, and the individual elements were not especially challenging to figure out.
I created a simplified style for my map tiles in Mapbox without any major issues. I took care to consider which elements I needed and which I didn’t. I went with a map that is water-centric, with cities and land masses more subtly colored and minimally detailed, while lakes and rivers are in a vivid blue. I wanted to emphasize that this is a map of water insecurity, even if it is primarily about water insecurity in urban areas, which may be relatively far removed from the water source.
It was when I tried to use those Mapbox tiles with Leaflet to make an interactive map that the problems started. All of the tutorials I could find were a couple of years old, and in that time, Mapbox developed its own interactive map building software and no longer had clear documentation regarding how to use a custom style tile with Leaflet and Leaflet no longer includes Mapbox in its tutorials. After trying for two weeks to cobble the code together based on the elements I thought were needed, it became clear that I was missing something. My map preview remained stubbornly blank. I am embarrassed to admit that it took me until this point before it occurred to me to look back at the code from the map we created for our rapid development challenge last semester.
I needed less than half of the code I thought I did.
From there it was relatively smooth sailing. I had no trouble getting the pop-ups in place for Flint and Milwaukee, and I even figured out how to create the boxes that appear when you mouse over the pop-ups. Now to build the pages for the exhibits and figure out how to link to them from those boxes! I deliberately tackled what I thought would be the hardest piece first, so hopefully things move a little more quickly from here.