While you can use TileJSON to automatically
configure our maps, it’s just a shortcut to adding a normal layer to a mapping
API. It’s simple to use MapBox tiles without using any
code from MapBox - so it’s also easy to try out different tile providers to
find the one that best fits your usage and budget. Leaflet is a great place to start in making the jump from Google because it’s
very similar to the Google Maps API.
Creating a basic map with Google Maps:
and in Leaflet:
Markers and overlays in Leaflet
Unlike Modest Maps, the nano-sized framework
we use for MapBox Hosting’s embed functionality, Leaflet
supports an array of markers and polygon overlays very similar to Google Maps. There
are custom icons, and you can
bring in your GeoJSON for polygon
Adding a marker in the Google Maps API looks like:
And in Leaflet it isn’t much different:
Try out Leaflet
If you’re looking to experiment with alternatives to Google Maps, Leaflet’s a
great way to go. It gives you flexibility between tile providers, a rich feature set,
and unlike the Google Maps API it’s BSD-licensed open source code. For help working with Leaflet and MapBox, just ask us on the MapBox support site.
MapBox for fast, reliable custom map tile hosting
In addition to your data markers and polygons rendered through Leaflet, you can add in layers of map tiles for a custom base map, or additional features like restaurants, transit stops, or neighborhood boundaries. Try using TileMill to style your own data or pull in extracts from OpenStreetMap. When you’re ready to share your maps, check out MapBox plans starting at just $5 a month. MapBox includes server-side compositing so your maps will be fast even as you add more layers and work well on mobiles.