All examples By author By category About

tkayne23

External geojson; addLayer to default Mapbox Streets

Built with blockbuilder.org

External file is a geojson from geojson.xyz A simple, open source website, CDN, and CLI utility for the fast access of GeoJSON data for web mapping examples and experiments - Natural Earth Data (Public Domain).

Add a new layer below labels Using the second argument of addLayer, you can be more precise

// This is the important part of this example: the addLayer
// method takes 2 arguments: the layer as an object, and a string
// representing another layer's name. if the other layer
// exists in the stylesheet already, the new layer will be positioned
// right before that layer in the stack, making it possible to put
// 'overlays' anywhere in the layer stack.