Hello ,
I am planning to track the location of the users and show in the marker.
For that I am planning to store the location data inside the user collection like below
{ "_id" : "yjDLZSnduspNrN65x", "createdAt" : ISODate("2015-12-04T09:03:12.940Z"), "services" : { "password" : { "bcrypt" : "$2a$10$U0oCTalo./JZb2LwtAAjhe1aIaElRQEL6Pbx.hoCz8wdI0GBOR3Ga" }, "resume" : { "loginTokens" : [ { "when" : ISODate("2015-12-04T10:15:32.534Z"), "hashedToken" : "kFS3/feRsYCDU1V2noyjn/zdAbKMgZTs+9Dbbt+yiIM=" }, { "when" : ISODate("2015-12-04T11:12:06.923Z"), "hashedToken" : "XVh+QSh0rUG2NEtEUULz+S1PD9UFLparkFWNIzHDTZY=" } ] } }, "emails" : [ { "address" : "dinesh3@complitech.net", "verified" : false } ], "profile" : { "firstName" : "dinesh3", "lastName" : "dinesh3", "location" : { "latitude" : 22.4, "longitude" : 71.87 } } }
As I am using the Angular google maps plugin which accepts the data in the form of
$scope.markers = [{ latitude: 40.1451, longitude: -99.6680 id: '12411asdgashgah1241' }, { latitude: 40.1451, longitude: -99.6680 id: '12411asdgashgah1241' }]
I used following publish pattern for that but still I have to remove the profile wrapper with help of underscore library to get only lat,long.
Meteor.publish(âlocationsâ, function(users) {
return Meteor.users.find( {âQuery According to zoom levelâ},{âservicesâ:0,âemailsâ:0,âcreatedAtâ:0} );
});
Now Question is ,
â> Is there any way to create kind of publish-subscribe that has only those parameters that i wants?
â> If I zoom out to the last level where whole map will be visible , then all the users will be seen in the map , and that will creates issues in performance on client side as well as server side. I have used marker clusters in client side, Is there any way to set the maker clustering from the server side as well , If yes how can I ?