Style templates
A list of template and designer styles to share for accuracy across projects.
Usage
import { getTemplates } from '@mapbox/style-templates';
const templates = getTemplates('production');
console.log(templates);
Contributing
Add any new entry to templates.json
.
Styles are grouped in template
or designer
arrays and each entry
should be formatted in the following way:
{
/* Required fields */
"title": "Title of the style",
"description": "Description of the style. Keep it pithy",
"id": {
"production": "A valid style url (i.e mapbox://styles/mapbox/streets-v9)",
"staging": "A valid style url from staging"
},
"center": {
"lng": -122.4241,
"lat": 37.78,
"zoom": 9
},
/* Required fields for designer styles */
"author": "Name of author",
"color": "as valid hex (i.e #333)"
}
Verify how your style will look from the static API by running the test site:
npm install && npm start
Open http://localhost:9966/ and thumbnails for each
entry should be generated from the staging environment. To verify styles render
correctly in production, replace npm start
with:
npm run start-production
Releasing
$ npm version {major|minor|patch}
$ git push --follow-tags
$ mbx npm publish