Skip to content

Instantly share code, notes, and snippets.

@teomanofficial
Created November 24, 2023 22:11
Show Gist options
  • Save teomanofficial/7435cfcbf9c428b9a2c589937c0c4d19 to your computer and use it in GitHub Desktop.
Save teomanofficial/7435cfcbf9c428b9a2c589937c0c4d19 to your computer and use it in GitHub Desktop.
OpenLayers Nasıl Kullanılır ?
fetch('/data.kml')
.then(res => res.text())
.then(geojson => {
const reader = new KML({ showPointNames: false });
const features = reader.readFeatures(geojson, { featureProjection: 'EPSG:3857' });
const vectorSource = new VectorSource({ features });
map.addLayer(new VectorLayer({ source: vectorSource as any }))
})
.catch(() => {
alert('hata Oluştu!');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment