geofire

How to set Geofire in node.js

人走茶凉 提交于 2019-12-06 04:29:39
I'm a newbie in NodeJS as well in Geofire. So, I want to know wheter is possible to set Geofire in NodeJS or not. I've tried to do the following: ... var geofire = require('geofire') var firebase = require('firebase'); var db = new firebase.database(); var ref = db.ref('path/to/repo'); geofire = new Geofire(ref) ; // THIS DOESN'T WORK. I couldn't set geofire object properly. How could I do it in the right way? Guitz I think you need to respect the case in your first line : var GeoFire = require('geofire'); then var firebaseRef = firebase.database().ref(); // Create a GeoFire index var ref =

How to retrieve posts that are within 0.5 kms of my reach?

心已入冬 提交于 2019-12-05 17:57:44
I am saving the coordinates of the post posted by the users. I'm generating a push id and then using it to save both the data of the post and the geofire coordinates. I want to show only those posts which are within 0.5 kms radius of them. I am using GeoFire library for the same but I'm unable to achieve the task. Here's how I'm generating the push id: itemID = databaseReferenceRequests.push().getKey(); Here's how I'm using it to save geofire coordinates as well as the data of the posts: geoFire.setLocation(itemID, new GeoLocation(Double.parseDouble(currentLat.getText().toString()), Double

Query Location by Radius with GeoFire

依然范特西╮ 提交于 2019-12-04 20:02:23
I know this is a basic question, but I’m having a lot of trouble with it nonetheless. I have a Firebase database storing community events. Each event node has a geo location node (created with GeoFire) called eventPlace (see screenshot below). Using GeoFire (and javascript), how would I query the entire database and get all events within a certain location/radius? Is this possible, given the way the data is stored? Or do I need to move all the location nodes to a common node (eventPlaces??) and query that single parent node? Note that I am not seeking real-time data. These locations are stored

Retrieving Keys From GeoFire within Radius in Swift

不问归期 提交于 2019-12-04 14:29:10
I have the following Firebase Database JSON data structure: { "Post List" : { "-KUlvg8mCEGfY5ZSKCou" : { "addedByUser" : "7llQbPdy2NV7aO337h7ap0qLOhC3", "content" : "Post1", "cost" : "$450", "duration" : "Daily", "latitude" : "25.0879721592719", "longitude" : "55.1487715855458", "number" : "01234567890", "timestamp" : "Posted on: Sun 23 Oct" } }, "Post Locations" : { "-KUlvg8mCEGfY5ZSKCou" : { ".priority" : "thrnwznh58", "g" : "thrnwznh58", "l" : [ 25.0879721592719, 55.1487715855458 ] } }, "User Locations" : { "7llQbPdy2NV7aO337h7ap0qLOhC3" : { ".priority" : "thrnwypqu9", "g" : "thrnwypqu9",

I have inserted location using geofire in firebase

三世轮回 提交于 2019-12-04 06:19:47
问题 I have inserted location using geofire in firebase from one of the activity in android studio now I want to retrieve all the location in single google map activity with marker. I have created map activity, but I don't know how to retrieve the location from the firebase . Please help I am stuck in this. With some source code. Here is my code for sending location to firebase GeoFire geoFire = new GeoFire(databaseReference.child("Location").child(user.getUid())); geoFire.setLocation("location",

How to remove a GeoFire handle for the following observe in Swift?

半城伤御伤魂 提交于 2019-12-04 02:35:22
问题 This is a question for Swift, Firebase and Geofire. I would like to know how to remove a GeoFire handle for the following observer in Swift. locationsEnd!.query(at: location, withRadius: 16.0).observe(GFEventType.init(rawValue: 0)!, with: {(key, location) in The following works fine (in viewDidDisappear): locationsEnd?.firebaseRef.removeAllObservers() However with handle it does not: var locationHandle: UInt = 0 override func viewDidDisappear(_ animated: Bool) { super.viewDidDisappear

GeoFire Swift 3 - Saving and Updating Coordinates

橙三吉。 提交于 2019-12-03 06:25:39
问题 I'm trying to store coordinates into Firebase Database using GeoFire. I'm unsure how to update the new coordinates as they will be changed/updated every second. With the childByAutoId , it is generating a new unique ID for each Bike. How do I reference this unique Bike ID? For instance, the user would be called by FIRAuth.auth()?.currentUser?.uid . Is this possible? let geofireRef = FIRDatabase.database().reference().child("Bike").childByAutoId() let geoFire = GeoFire(firebaseRef: geofireRef)

Retrieving Location Data with Radius using Firebase & GeoFire

柔情痞子 提交于 2019-12-03 06:06:52
问题 I am trying to use GeoFire to retrieve and according to radius (for example, everything in 10km distance). To remain clear, I am saving the details and location separately in the database, so details' id is same with locations' id. While saving the data, I use: var details = ["a":"a", "b":"b", etc] let checkpointRef = eventRef.childByAutoId() checkpointRef.setValue(details) let checkpointId = checkpointRef.key let geofireRef = ref.childByAppendingPath("checkpointLocations") let geoFire =

GeoFire Swift 3 - Saving and Updating Coordinates

≯℡__Kan透↙ 提交于 2019-12-02 19:52:28
I'm trying to store coordinates into Firebase Database using GeoFire. I'm unsure how to update the new coordinates as they will be changed/updated every second. With the childByAutoId , it is generating a new unique ID for each Bike. How do I reference this unique Bike ID? For instance, the user would be called by FIRAuth.auth()?.currentUser?.uid . Is this possible? let geofireRef = FIRDatabase.database().reference().child("Bike").childByAutoId() let geoFire = GeoFire(firebaseRef: geofireRef) var data = geoFire?.setLocation(CLLocation(latitude: userIncrementLat, longitude: userIncrementLong),

When do I know GeoFire is finished loading as it is Event based trigger

懵懂的女人 提交于 2019-12-02 18:56:27
问题 So I used GeoFire and AngularFire for populate my ng-repeat item lists. There is an ionic pull to refresh list. So user pull it and get the current updated location and refresh the list (recall the GeoFire to re-populate the list). $scope.doRefresh = function() { if ($scope.doneLoading) { $scope.useCurrentLocation().then(function() { $scope.userCurrentLocation = { lat: geoLocation.getGeolocation().lat, lng: geoLocation.getGeolocation().lng } angular.forEach($scope.tasks, function(child) {