Part 1: Mapbox Studio
- Create an account with Mapbox if you don't already have one.
- Log in to your Mapbox account.
- Once logged in, go to the Studio page (link in the top right).
- Under Styles, click New style and pick a style to start from.
- Edit your style. Use some zoom-independent styling and zoom-dependent styling. Look into filtering data in some layers.
- Publish your style.
Part 2: Mapbox tiles in Leaflet
- Open a Leaflet map you have made in the past, either for in-class work or an assignment.
- In your Mapbox account, under Styles, click the button to the right of Edit for one of your styles. Then click Share & use.
- On the next page, to the right under Use style in other apps, select CartoDB and copy the resulting URL in the box under it.
- Back in your Leaflet map, replace the URL for the
L.tileLayer
with the URL you just copied.
- When you're done you should have a map with Mapbox tiles as in this jsbin.
Part 3: Mapbox tiles in CartoDB
- Open a CartoDB map you have made in the past.
- Find and click the Change basemap button in the lower left.
- Click the + next to Yours.
- Under XYZ (not Mapbox), paste the same URL you used in the previous section.
- Your CartoDB map should now be using your Mapbox style.
Part 4: Adding data to Mapbox Studio
- Pick a relatively large dataset you would like to add to your Mapbox style. Consider MapPLUTO for one of the boroughs if you don't have anything in mind.
- In your Mapbox account, go to Tilesets and upload the data as a new tileset. If it is a shapefile leave it zipped.
- Edit your style.
- Click New layer and select the data you uploaded as the tileset next to Source.
- Consider adding filters if appropriate.
- Click Create layer.
- Style the layer as you would any other layer.
- Publish the resulting style.