echoes-xyz / mongoose-geojson-schema

Schema definitions for GeoJSON types for use with Mongoose JS
MIT License
79 stars 25 forks source link

Typeerror: GeoJSON is not a constructor #19

Open rahulganguly opened 7 years ago

rahulganguly commented 7 years ago

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);

muhammadfaizan commented 7 years ago

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