Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GeoPint is not implemented #1604

Closed
saoron opened this issue May 8, 2018 · 7 comments
Closed

GeoPint is not implemented #1604

saoron opened this issue May 8, 2018 · 7 comments

Comments

@saoron
Copy link

saoron commented May 8, 2018

Version info

Angular: 5.2.x

Firebase: ^4.8.2

AngularFire: 5.0.0-rc.7

Description

AngularFire doesn't have GeoPoint interface

Expected behavior

import { AngularFirestore, AngularFirestoreCollection } from 'angularfire2/firestore';

...

constructor(private db: AngularFirestore) {
    let point = new db.firestore.GeoPoint(32.5522, 34.556656)
}

Actual behavior

TypeError: Cannot read property 'GeoPoint' of undefined

More info

Firebase JS reference:
https://firebase.google.com/docs/reference/js/firebase.firestore.GeoPoint

@jamesdaniels
Copy link
Member

For the types, you should import from firebase.

import * as firebase from 'firebase/app'
...
let point = new firebase.firestore.GeoPoint(32.5522, 34.556656)

@ahmed-eg
Copy link

ahmed-eg commented May 26, 2018

The jamesdaniels solution didn't work with me, any suggestions what might be the problem?

I'm getting error
TypeError: Cannot read property 'GeoPoint' of undefined

I'm using:
"angularfire2": "^5.0.0-rc.8.0",
"firebase": "^5.0.2",

@jamesdaniels
Copy link
Member

This is different in 5.0 now, you should do:

import { firestore } from 'firebase/firestore';
...
new firestore.GeoPoint ...

@inorganik
Copy link

You are correct, GeoPint is not implemented. 🍻

@manunoly
Copy link

I use this to make the GeoPoint work
import { firestore } from 'firebase';

let point = new firestore.GeoPoint(32.5522, 34.556656);

@jimmykane
Copy link

Hi what is the recommended way to import these classes?

There are different answers here.

@jimmykane
Copy link

Hi @jamesdaniels I am confused.

What is the correct way to import?

import { firestore } from 'firebase/firestore';
...
new firestore.GeoPoint ...

does not work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants