I imported GeoJSON to my map, but my browser shows me the following error message:
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
(clickable)
This is my script :
< !doctype html >
< html lang = "en" >
< head >
< link rel = 'stylesheet'
href = 'css/ol.css' >
< style > #map {
height: 100 % ;
width: 100 % ;
} < /style>
<title>OpenLayers 3 example</title >
< script src = "build/ol.js"
type = "text/javascript" > < /script>
</head >
< body >
< h1 > My Map < /h1>
<div id="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.Vector({
title: 'added Layer',
source: new ol.source.GeoJSON({
projection: 'EPSG:4326',
url: 'gjson/test.geojson'
})
})
],
view: new ol.View({
center: [0, 0],
zoom: 2
})
}); < /script>
</body >
< /html>
Where I made an error? I don't know how to resolve this problem.

< head >instead of<head>?