I am trying to store the lat, lng in my model. I have defined my model as
attributes: {
point: {type: 'json'}
}
And i am passing the coordinates simply as [x ,y]. But it is storing the point as NULL. So please, if anyone knows how to deal with it, please help me. I have no idea how to do this.
I tried to do something similar to this using the more funky field types but found that breaking it down to primitive types worked better.
module.exports = {
attributes: {
speed: {
type: 'string'
},
heading: {
type: 'string'
},
altitude: {
type: 'string'
},
altitudeAccuracy: {
type: 'string'
},
longitude: {
type: 'float',
required: true
},
latitude: {
type: 'float',
required: true
},
accuracy: {
type: 'string'
}
}
};
here is the complete object for storing geo data.