Created
November 24, 2023 21:29
-
-
Save teomanofficial/4dd63dfae01a6d6a8ad044f3b03880bf to your computer and use it in GitHub Desktop.
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.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