How to use the ol-mapbox-style.apply function in ol-mapbox-style

To help you get started, we’ve selected a few ol-mapbox-style examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github maputnik / editor / src / components / map / OpenLayersMap.jsx View on Github external
updateStyle(newMapStyle) {
    if(!this.map) return;
    apply(this.map, newMapStyle);
  }
github openlayers / workshop / src / en / examples / vectortile / bright.js View on Github external
import 'ol/ol.css';
import {apply} from 'ol-mapbox-style';

const map = apply('map-container', './data/bright.json');
github openlayers / ol-mapbox-style / example / tilejson.js View on Github external
import 'ol/ol.css';
import {apply} from 'ol-mapbox-style';

apply('map', 'data/tilejson.json');
github openlayers / ol-mapbox-style / example / geojson.js View on Github external
import 'ol/ol.css';
import {apply} from 'ol-mapbox-style';

apply('map', 'data/geojson.json');
github openlayers / ol-mapbox-style / example / tilejson-vectortile.js View on Github external
import 'ol/ol.css';
import {apply} from 'ol-mapbox-style';

apply('map', ' https://demo.tegola.io/styles/hot-osm.json');
github openlayers / ol-mapbox-style / example / geojson-inline.js View on Github external
import 'ol/ol.css';
import {apply} from 'ol-mapbox-style';

apply('map', 'data/geojson-inline.json');
github openlayers / workshop / src / en / examples / vectortile / interact.js View on Github external
import 'ol/ol.css';
import {apply} from 'ol-mapbox-style';
//! [import-layer]
import VectorLayer from 'ol/layer/Vector';
import VectorSource from 'ol/source/Vector';
import {Style, Stroke} from 'ol/style';
//! [import-layer]
//! [import-interaction]
import {Feature} from 'ol';
import {fromExtent} from 'ol/geom/Polygon';
//! [import-interaction]

const map = apply('map-container', './data/bright.json');
//! [layer]
const source = new VectorSource();
new VectorLayer({
  map: map,
  source: source,
  style: new Style({
    stroke: new Stroke({
      color: 'red',
      width: 4
    })
  })
});
//! [layer]
//! [interaction]
map.on('pointermove', function(event) {
  source.clear();

ol-mapbox-style

Create OpenLayers maps from Mapbox Style objects

BSD-2-Clause
Latest version published 6 days ago

Package Health Score

86 / 100
Full package analysis