Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@maplibre/maplibre-gl-style-spec

Package Overview
Dependencies
Maintainers
3
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@maplibre/maplibre-gl-style-spec

a specification for maplibre styles

  • 22.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created

What is @maplibre/maplibre-gl-style-spec?

@maplibre/maplibre-gl-style-spec is a package that provides a specification for defining styles for MapLibre GL maps. It allows developers to create, validate, and manipulate map styles in a structured and standardized way.

What are @maplibre/maplibre-gl-style-spec's main functionalities?

Style Validation

This feature allows you to validate a MapLibre GL style object against the style specification. The code sample demonstrates how to validate a style and check for any errors.

const { validate } = require('@maplibre/maplibre-gl-style-spec');

const style = {
  "version": 8,
  "sources": {},
  "layers": []
};

const errors = validate(style);
if (errors.length) {
  console.error('Style validation errors:', errors);
} else {
  console.log('Style is valid!');
}

Style Parsing

This feature allows you to parse a MapLibre GL style object. The code sample shows how to parse a style and log the parsed result.

const { parse } = require('@maplibre/maplibre-gl-style-spec');

const style = {
  "version": 8,
  "sources": {},
  "layers": []
};

const parsedStyle = parse(style);
console.log('Parsed style:', parsedStyle);

Style Generation

This feature allows you to generate a MapLibre GL style object. The code sample demonstrates how to generate a style from a given configuration.

const { generate } = require('@maplibre/maplibre-gl-style-spec');

const style = generate({
  version: 8,
  sources: {},
  layers: []
});
console.log('Generated style:', style);

Other packages similar to @maplibre/maplibre-gl-style-spec

Keywords

FAQs

Package last updated on 28 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc