Giter VIP home page Giter VIP logo

Comments (9)

kingtross88 avatar kingtross88 commented on May 30, 2024 2

still working on getting this done. I did an update on my react native and now my project won't build. I'll get this sorted out today and let you know.

Thank you!

from geofirestore-js.

MvRemmerden avatar MvRemmerden commented on May 30, 2024

Looks like you forgot the .latitude in your first argument.

For everything else, we would need to see more of your code.

from geofirestore-js.

kingtross88 avatar kingtross88 commented on May 30, 2024

I'm sorry I wrote it out wrong. I should've just pasted from my code rather than type it over. I'm still getting the same error.
I'm running the getCurrentPosition function in componentDidMount.

getCurrentPosition(){
navigator.geolocation.getCurrentPosition((position) => {
region = {
latitude: position.coords.latitude,
longitude: position.coords.longitude,
latitudeDelta: 0.00922,
longitudeDelta: 0.00421,
error: null,
}
this.setState({
region,
});
},
(error) => this.setState({ error: error.message }),
{ enableHighAccuracy: true, timeout: 20000, maximumAge: 1000 },

);

}

then I run the following code in another function.
var ref = firebase.firestore().collection('myCollection');
const geoFirestore = new GeoFirestore(this.ref);
const geoQuery = geoFirestore.query({
center: new firebase.firestore.GeoPoint(this.state.region.latitude, this.state.region.longitude),
radius: 10.5
});

from geofirestore-js.

MvRemmerden avatar MvRemmerden commented on May 30, 2024

Which version of firebase and geofirestore are you using?

from geofirestore-js.

kingtross88 avatar kingtross88 commented on May 30, 2024

geofirestore "version": "2.0.2"
firebase "version": "4.13.1"

from geofirestore-js.

MvRemmerden avatar MvRemmerden commented on May 30, 2024

Try to update firebase to any version above 5.0.0, they changed docChanges into a method at that release, so it might be possible that the geofirestore code tries to access a variable that now is a function.

from geofirestore-js.

MichaelSolati avatar MichaelSolati commented on May 30, 2024

@MvRemmerden is absolutely correct, geofirestore is designed for firebase version5.x.x. Try that and you should be all set.

from geofirestore-js.

MichaelSolati avatar MichaelSolati commented on May 30, 2024

@kingtross88 let me know if updating your firebase did the trick for you. If we don't hear back I'll be closing this in a day or so.

from geofirestore-js.

kingtross88 avatar kingtross88 commented on May 30, 2024

updated firebase and did a node update. closing this out

from geofirestore-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.