Example codes for Openlayers #1132
lokhandeganesh
started this conversation in
General
Replies: 1 comment 1 reply
-
import MVT from 'ol/format/MVT';
import VectorTileLayer from 'ol/layer/VectorTile';
import VectorTileSource from 'ol/source/VectorTile';
import { Map, View } from 'ol';
import { fromLonLat } from 'ol/proj';
const map = new Map({
target: 'map-container',
view: new View({
center: fromLonLat([0, 0]),
zoom: 2,
}),
});
const layer = new VectorTileLayer({
source: new VectorTileSource({
format: new MVT(),
url:
'http://localhost:3000/MixPoints/{z}/{x}/{y}',
maxZoom: 14,
}),
});
map.addLayer(layer); |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was looking through the tool documentations but, not found any example for how to use it with Openlayers library, does anybody have sample codes or examples of it?
Beta Was this translation helpful? Give feedback.
All reactions