I have downloaded OpenLayers v6.3.1 libraries and successfully displayed a simple map on my local server, and now I'm trying to load a GeoJSON file as a new vector layer into this map.
But for some reason it's not loading.
Here is what it shows in Chrome :
And here is the code.
<!doctype html>
<html lang="en">
<head>
<link rel="stylesheet" href="css_cyclo_temp.css">
<link rel="stylesheet" href="libraries/ol.css">
<title>TestMap</title>
</head>
<body>
<script type="text/javascript" src="libraries/ol.js"></script>
<div id="map" class="map"></div>
<script type="text/javascript">
var map = new ol.Map({
target: 'map',
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
}),
new ol.layer.VectorImage ({
visible: true,
source: new ol.source.Vector ({
//projection : 'EPSG:3857',
url: "kml/test.geojson",
format: new ol.format.GeoJSON()
}),
})
],
view: new ol.View({
center: ol.proj.fromLonLat([4.8374852,45.7568633]),
zoom: 12
})
});
</script>
</body>
</html>