mongoose-geojson-schema icon indicating copy to clipboard operation
mongoose-geojson-schema copied to clipboard

Typeerror: GeoJSON is not a constructor

Open rahulganguly opened this issue 7 years ago • 1 comments

I was trying out the sample code on version 2.1.2 and I keep getting the following error Typeerror: GeoJSON is not a constructor

var test = new GeoJSON({ any: { type: "Point", point: [-113.806458, 44.847784] }, point: { type: "Point", coordinates: [12.123456, 13.134578] } });

I also tried the following

var pointData = {
point: { type: "Point", coordinates: [12.123456, 13.134578] } }; var geoLocation= new GeoJSON(pointData);

rahulganguly avatar Mar 14 '17 07:03 rahulganguly

yeah that's an issue, you can use your model name, just like any other model you'd create.

muhammadfaizan avatar Oct 21 '17 06:10 muhammadfaizan