Two weeks ago, we looked at how to embed a Mapbox map on a website. I figured that this time, we would look at how to mark a location on a map. We are going to look at two methods: dropping a pin on a map to show a location and drawing a shape to show an area on a map.
See the Pen
Playing with Mapbox – Drop a pin to show a location by Joe Steinbring (@steinbring)
on CodePen.
Drawing a shape to show an area on a map:
See the Pen
Playing with Mapbox – Marking an area on a map by Joe Steinbring (@steinbring)
on CodePen.
As you can see above, both methods look very similar two the examples from two weeks ago. The biggest challenge is to define the GeoJSON values correctly. Luckily, there are utilities out there to help with the task.
Have a question, comment, etc? Feel free to drop a comment, below.
[ Cover photo by Thomas Kinto on Unsplash ]