Skip to content

Instantly share code, notes, and snippets.

@teomanofficial
Created November 24, 2023 21:29
OpenLayers Nasıl Kullanılır ?
fetch('/data.json')
.then(res => res.json())
.then(geojson => {
const reader = new GeoJSON({ featureProjection: 'EPSG:3857' });
const features = reader.readFeatures(geojson);
const vectorSource = new VectorSource({ features });
map.addLayer(new VectorLayer({ source: vectorSource }))
})
.catch((e) => {
alert('hata Oluştu!');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment