Wax has been deprecated.

Wax is no longer maintained. See the Mapbox.js page for full documentation and examples.

Mapbox Wax now supports ESRI’s JavaScript API 2.8, allowing you to easily use tiles from your Mapbox account in your ESRI projects and use super-fast interactive overlays.

Open Source Integration

You can download Wax v6.0.0-beta5 and see demos & docs of the interaction control and connector now.

Wax already supported many APIs: Leaflet, Modest Maps, OpenLayers, and Google Maps API v3. In most cases, the very basic integration code is minimal - Leaflet’s connector, for instance, is only 11 lines long.

Containing the variation between APIs makes it possible to have more consistent code. Here are the APIs for all of the available toolkits:

// Modest Maps
map.addLayer(new wax.mm.connector(tilejson))
// Leaflet
map.addLayer(new wax.leaf.connector(tilejson))
// Google Maps
map.mapTypes.set('mapbox', new wax.g.connector(tilejson));
// OpenLayers
map.addLayer(new wax.esri.connector(tilejson));

If you don’t want to use Wax in your project, just check out the source code of the connector and use it as a guide - it’s open source.

In order to make this spread maintainable, Wax v6 has a high level of abstraction that allows the new ESRI interaction control to be 50 lines of concise code - containing application logic in the shared library.

Using the ESRI JavaScript API

The ESRI API is most similar to OpenLayers in that it devotes much of its complexity to dealing with projections and coordinate systems, and treats much of the web component as an implementation detail. This has some negative ramifications in that Wax needs to rely on a private API in order to provide interactivity - the API doesn’t document access to tile elements.

ESRI’s JavaScript API is actually available for download by those who have ESRI accounts. Despite taking advantage of a great deal of open source code in the Dojo toolkit, ESRI’s code is explicitly copywritten and labeled as TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL. This is unfortunate in an ecosystem of open and understandable code.

Being able to mix tools is what enables people to create powerful stories through maps. Wax is one of the many tools that can be built from the Mapbox API and the open standards we’ve been pushing like TileJSON and UTFGrid. Recently NPMap from the National Park Service and slashmaps from Seabourne Consulting have demonstrated other ways to use the toolkit and integrate maps into websites.

Integrating with ESRI and Google Maps open up new possibilities for Mapbox users, and we hope this bridges web and GIS worlds, getting the best of both.