Created
November 24, 2023 22:11
OpenLayers Nasıl Kullanılır ?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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