Not able to Parse a Json File



I want to load a GeoJson File that is uploaded on server

var promise = ('https://api.myjson.com/bins/31e3j');
that.map.data.loadGeoJson(promise
);

This condition works fine
But I want to Load this GeoJson File locally so I have assigned the Json Code instead a the Server Link to a Variable on which I am neither getting any error but unable to get the O/P as well

var promise = jQuery.parseJSON ('{ "type": "FeatureCollection","crs":{"type": "name","properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84"}},"features": [{"type": "Feature", "properties": {"id": 1},"geometry": {"type": "Polygon", "coordinates": [ [  [  -83.52936044652942, 40.30230752849768], [ -83.52924865349425,  40.30230753872012], [ -83.52924666169983, 40.3021800251207 ], [ -83.52935848418728, 40.302181900418084 ], [ -83.52936044652942, 40.30230752849768]]]}}, ]}');


that.map.data.loadGeoJson(promise);

Asked: February 25, 2016 by administrator
Posted under: programming
805 Views

1 Answers


postanswer