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

ol-mapbox-style

Package Overview
Dependencies
Maintainers
4
Versions
171
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ol-mapbox-style

Create OpenLayers maps from Mapbox Style objects

  • 12.4.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
170K
increased by6.71%
Maintainers
4
Weekly downloads
 
Created

What is ol-mapbox-style?

The ol-mapbox-style package allows you to use Mapbox Style objects with OpenLayers. It provides functionality to apply Mapbox styles to OpenLayers maps, making it easier to integrate Mapbox's rich styling capabilities with the OpenLayers mapping library.

What are ol-mapbox-style's main functionalities?

Apply Mapbox Style to OpenLayers Map

This feature allows you to apply a Mapbox style to an OpenLayers map. The code sample demonstrates how to use the `apply` function to load a Mapbox style from a URL and apply it to a map element with the ID 'map'.

const olms = require('ol-mapbox-style');
olms.apply('map', 'https://api.mapbox.com/styles/v1/mapbox/streets-v11?access_token=YOUR_MAPBOX_ACCESS_TOKEN');

Apply Mapbox Style to OpenLayers Layer

This feature allows you to apply a Mapbox style to a specific OpenLayers layer. The code sample demonstrates how to use the `applyStyle` function to load a Mapbox style from a URL and apply it to a vector layer.

const olms = require('ol-mapbox-style');
const layer = new ol.layer.Vector();
olms.applyStyle(layer, 'https://api.mapbox.com/styles/v1/mapbox/streets-v11?access_token=YOUR_MAPBOX_ACCESS_TOKEN');

Apply Mapbox Style from JSON

This feature allows you to apply a Mapbox style from a JSON object directly to an OpenLayers map. The code sample demonstrates how to use the `apply` function with a JSON style object instead of a URL.

const olms = require('ol-mapbox-style');
const styleJson = { /* JSON style object */ };
olms.apply('map', styleJson);

Other packages similar to ol-mapbox-style

Keywords

FAQs

Package last updated on 12 Dec 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