Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
updateStyle(newMapStyle) {
if(!this.map) return;
apply(this.map, newMapStyle);
}
import 'ol/ol.css';
import {apply} from 'ol-mapbox-style';
const map = apply('map-container', './data/bright.json');
import 'ol/ol.css';
import {apply} from 'ol-mapbox-style';
apply('map', 'data/tilejson.json');
import 'ol/ol.css';
import {apply} from 'ol-mapbox-style';
apply('map', 'data/geojson.json');
import 'ol/ol.css';
import {apply} from 'ol-mapbox-style';
apply('map', ' https://demo.tegola.io/styles/hot-osm.json');
import 'ol/ol.css';
import {apply} from 'ol-mapbox-style';
apply('map', 'data/geojson-inline.json');
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();