You are viewing an older version of Mapbox.js. Check out v3.1.0 for the latest.

Global Switches

Global switches are created for rare cases and generally make Leaflet to not detect a particular browser feature even if it's there. You need to set the switch as a global variable to true before including Leaflet on the page, like this:

<script>L_PREFER_CANVAS = true;</script>
<script src="leaflet.js"></script>
Switch Description
L_PREFER_CANVAS Forces Leaflet to use the Canvas back-end (if available) for vector layers instead of SVG. This can increase performance considerably in some cases (e.g. many thousands of circle markers on the map).
L_NO_TOUCH Forces Leaflet to not use touch events even if it detects them.
L_DISABLE_3D Forces Leaflet to not use hardware-accelerated CSS 3D transforms for positioning (which may cause glitches in some rare environments) even if they're supported.