One of the things that I tried to add to my website, last summer was a map that showed what countries I had visited. I was never able to come up with a solution that I really liked but this week’s little experiment might fit the need. You might remember from our previous Mapbox post that we were able to mark the four square blocks that contain UWM’s campus. If we can do a simple shape, why not a complex one? Let’s start with the state of Wisconsin.
See the Pen
Playing with Mapbox – Where is Wisconsin on a map by Joe Steinbring (@steinbring)
on CodePen.
For the UWM example, I drew it myself but for things like states, there is plenty of example data out there. You will notice that as the shapes get more complex, the size of the data increases. Next, let’s look at an example of the entire United States.
Where is the United States on a map:
See the Pen
Playing with Mapbox – Where is the United States on a map by Joe Steinbring (@steinbring)
on CodePen.
This example is much more complex because of the size of the area and the complexity of the borders. Like our state example, there is plenty of example data out there, though.
From here, it is a reasonably simple task to mark multiple countries on the map. Let’s take a look at what countries I have visited so far.
Map of countries Joe has visited:
See the Pen
Playing with Mapbox – Countries Joe has been to by Joe Steinbring (@steinbring)
on CodePen.
So, where can we go from here? I think that the next logical step is to use different colored shading and maybe some sort of legend. That is going to need to wait for a future post, though.
Have a question, comment, etc? Feel free to drop a comment, below.
[ Cover photo by Thomas Kinto on Unsplash ]