background preloader

MapBox

Facebook Twitter

CartoCSS. The following is a list of properties provided in CartoCSS that you can apply to map elements. All elements image-filters functions Default Value: none (no filters) A list of image filters. comp-op clear src dst src-over dst-over src-in dst-in src-out dst-out src-atop dst-atop xor plus minus multiply screen overlay darken lighten color-dodge color-burn hard-light soft-light difference exclusion contrast invert invert-rgb grain-merge grain-extract hue saturation color value Default Value: src-over (add the current layer on top of other layers) Composite operation. Opacity float Default Value: 1 (no separate buffer will be used and no alpha will be applied to the style after rendering) An alpha value for the style (which means an alpha applied to all features in separate buffer and then composited back to main buffer) map background-color color Default Value: none (transparent) Map Background color background-image uri srs string buffer-size float base string font-directory uri polygon line markers shield.

Examples. MapBox Home. MapBox JS. The Mapbox.js documentation is organized by methods. Each method is shown with potential arguments in a table. Objects returned by constructors are documented by just their object type. For instance, L.mapbox.markerLayer documents a function that returns a layer for markers. The methods on that object are then documented as markerLayer.setFilter, markerLayer.getGeoJSON, and so on. To use this API, you'll need to understand basic Javascript and mapping concepts.

If you'd like to learn Javascript, start with an interactive course or book. To learn more about maps, we've provided a helpful article explaining how web maps work. Asynchronous calls and the `ready` event Mapbox.js is asynchronous - when you create a layer like L.mapbox.tileLayer('examples.map-i86nkdio'), the layer doesn't immediately know which tiles to load and its attribution information.

For most things you'll write, this isn't a problem, since Mapbox.js does a good job of handling these on-the-fly updates. TileMill. Reference. TileMill is a tool for cartographers to quickly and easily design maps for the web using custom data. It is built on the powerful open-source map rendering library Mapnik - the same software OpenStreetMap and MapQuest use to make some of their maps. TileMill is not intended to be a general-purpose cartography tool, but rather focuses on streamlining and simplifying a narrow set of use cases.

For anyone coming from a GIS or cartography background, the biggest assumption TileMill makes is the final projection - TileMill maps are always projected to “Web Mercator”. As the name suggests, this projection is popular with web mapping applications, thus maps created with TileMill can be displayed using Leaflet, the map APIs from Google and Apple, and many other projects. TileMill can export directly to a Mapbox account, or to your computer using the SQLite-based MBTiles file format, which allows for easy transfer or use in offline-capable applications.

Tutorials. If you've found yourself on this page, we're assuming you've Before you begin, you will need a shapefile (a set of four files with the extensions: .shp, .dbf, ,shx, and .prj) that contains the data that you want to map. TileMill supports a number of the most commonly used geospatial formats, you can read more about the types of supported layers here. There are a number of resources to obtain shapefile data for the area or issue you want to map. You may also have generated your own data in shapefile format and want to map it alongside other data. If you need to do additional manipulation or edit your shapefile, you can use free open-source software like QuantumGIS to work with shapefiles. For practice, we’ll add a tectonic plates boundary shapefile downloaded from the Institute for Geophysics at University of Texas. Start TileMill and click on the Add project button.