将MKPointAnnotation保存到Firestore

时间:2019-01-16 03:34:58

标签: objective-c firebase google-cloud-firestore geopoints mkpointannotation

我有[mkmapview注释],它是MKPointAnnotation的数组

我正在尝试将ti作为数组保存到FireStore,但不接受MKPointAnnotation对象

然后我尝试将MKPointAnnotation转换为FIRGeoPoint,但是没有运气

for (MKPointAnnotation *point in annotationsArray) {
        FIRGeoPoint *FirAnnotations;
        FirAnnotations = [FirAnnotations initWithLatitude:point.coordinate.latitude longitude:point.coordinate.longitude];
        NSLog(@"FirAnnotations: %@",FirAnnotations);
    }

annotationsArray是[mkmapview注释]

始终为空

1 个答案:

答案 0 :(得分:0)

我正在尝试使用FirAnnotations指针调用init,但它为nil,我应该在那里使用FIRGeoPoint。

let that = this
window.addEventListener("beforeunload", function(event) {
    event.preventDefault();
    // problem line 
    that.$store.dispatch('CURR_TERMINAL_ACTION', that.id)
})