1

I transformed (.geojson file)from EPSG 2180 to 4326 using

ogr2ogr -f "GML" -lco GEOMETRY=AS_XY -t_srs EPSG:4326 test.geojson file.geojson

I would like to add to map, but I received this error :

enter image description here

Below script: #map { height: 100%; width: 100%; } OpenLayers 3 example

My Map

  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>

  • The error comes from you GeoJSON file. Show us the content of this file pls. – oterral Feb 29 '16 at 9:42
  • speedyshare.com/vpapQ/test.geojson here is whole file – Agnieszka Feb 29 '16 at 16:01
  • Your file is not in GeoJSON format but in GML. Try to get a proper GeoJSON file. – oterral Mar 1 '16 at 8:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.