I am trying to save out a geoJSON file from OpenLayers 3. I have most of the code sorted but the resulting file is missing the CRS line,when I add it manually the file works just fine.
function loadXMLDoc() {var geoJSON = new ol.format.GeoJSON();var jsondata = geoJSON.writeFeatures(lyr_site.getSource().getFeatures(), {featureProjection: 'EPSG:3857'},{dataProjection: 'EPSG:3857'});var xmlhttp = new XMLHttpRequest();xmlhttp.open('POST', 'run.php', true);xmlhttp.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');xmlhttp.send(jsondata);The resulting file header looks like this:
{"type":"FeatureCollection","features":[{"type":"Feature","geometry": {"type":"Polygon","coordinates":[[[0.519087728539022,51.72285434232731],[0.5190669877274288,51.72334258224663],[0.5190633831708146,51.723622249385755],And it should look more like this (I think)
{"type": "FeatureCollection","crs": { "type": "name", "properties": { "name": "urn
gc:def:crs:EPSG::3857" } },"features": [
أكثر...
function loadXMLDoc() {var geoJSON = new ol.format.GeoJSON();var jsondata = geoJSON.writeFeatures(lyr_site.getSource().getFeatures(), {featureProjection: 'EPSG:3857'},{dataProjection: 'EPSG:3857'});var xmlhttp = new XMLHttpRequest();xmlhttp.open('POST', 'run.php', true);xmlhttp.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');xmlhttp.send(jsondata);The resulting file header looks like this:
{"type":"FeatureCollection","features":[{"type":"Feature","geometry": {"type":"Polygon","coordinates":[[[0.519087728539022,51.72285434232731],[0.5190669877274288,51.72334258224663],[0.5190633831708146,51.723622249385755],And it should look more like this (I think)
{"type": "FeatureCollection","crs": { "type": "name", "properties": { "name": "urn
أكثر...