简体   繁体   中英

Cloudboost - Geopoint Query Event

Fantastic tool, I've been fighting with GeoFire for the past while and decided to try a new platform, so easy to get started.

I have a small problem however, I've written a query that picks up messages that are within a radius which works great on load, I am now however trying to make that an event. On page load the query works perfectly, this bit of code seems to not be applying my query and just appending the data. What am I doing wrong?

    var query1 = new CB.CloudQuery('Data');

    //third parameter is the radius to check in meters.
    query1.near("messageLocation", loc, 1000);

    CB.CloudObject.on('Data', 'created', query1, function(value){
        var myUIMessage = '<li class="media"><div class="media-body"><div class="media"><a class="pull-left" href="#"><img class="media-object img-circle " src="assets/img/user.png" /></a><div class="media-body">' + value.document.Message + '<br /><small class="text-muted">' + value.document.userID + ' | ' + value.document.createdAt + '</small><hr /></div></div></div></li>';

        $("#messageList").prepend(myUIMessage);
    });

GeoLocation queries with Realtime are not supported yet. I have created an issue for this on GitHub and we should be adding support for that in a week from now.

Thank you for your feedback.

https://github.com/CloudBoost/cloudboost/issues/122

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM