I am having troubles using SimpleSchema to define a location object and fill in gMaps event data (event.latLng , or event.latLng.lat() )
Also I want to use MongoDbs near function to search the data.
I do it with the following code:
Places = new SimpleSchema({
ālocā : {
type: [Number],
decimal: true,
index: ā2dsphereā,
optional: false,
label : āLong/Lat Coordsā,
minCount: 2,
maxCount: 2
}
);
Dont forget to create an 2dsphere index in your MongoDb collection.
event.latLng is what I get from the mapClickEvent (gmaps v3).
My meteor does not even compile when I do something like loc. (no extension allowed). So I must pass a complete object and in the correct order (long/lat for mongo).