iPhone 版 Mapkit 上的多个注释

发布于 2024-09-25 12:23:57 字数 73 浏览 3 评论 0原文

有谁知道如何使用数据库在地图上显示多个位置?

我试图在数据库的帮助下在谷歌地图上删除多个图钉,但只能删除最后一个图钉

Does anyone know how to display more than one location on a map Using Database?

I am trying to drop Multiple Pins on google Map with the help of database but just able to drop last pin

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

三人与歌 2024-10-02 12:23:57
Below is the function which i m using to fill array with the help of Database


RecipieAppDelegate *appDelegate = (RecipieAppDelegate *)[[UIApplication sharedApplication] delegate];
    [appDelegate getallrecords];
    self.namesArray=appDelegate.rs;
    ///filling array with database
        for (int i=0; i<namesArray.count; i++) {
        Food *product = (Food *)[self.namesArray objectAtIndex:i];
        NSLog(@"%d",i);
        appDelegate.mylatitude=product.Latitude;
        appDelegate.mylongitude=product.Longitude;
     /// this function is use to call the class which is use to drop pin on map 
     BridgeAnnotation *BridgePin = [[BridgeAnnotation alloc] init];
     [self.mapAnnotations insertObject:BridgePin atIndex:kBridgeAnnotationIndex];
     [BridgePin release];

    }


/////CLASS BRIDGE ANNOTATION   below is the function getting cordinate from above function n droping pin    
    - (CLLocationCoordinate2D)coordinate;
    {
        RecipieAppDelegate *appDelegate = (RecipieAppDelegate *)[[UIApplication sharedApplication] delegate];
        Food *product;
        CLLocationCoordinate2D theCoordinate;
    //  theCoordinate.latitude = 37.810000;
    //  theCoordinate.longitude = -122.477989;
        theCoordinate.latitude = [appDelegate.mylatitude doubleValue];
        NSLog(@"%f",    theCoordinate.latitude);
        theCoordinate.longitude = [appDelegate.mylongitude doubleValue];
        NSLog(@"%f",    theCoordinate.longitude);
        return theCoordinate; 
    }

好吧,我在数组上完美运行循环 5 次,但它将最后一个值传递给第二个函数

等待您回复

Below is the function which i m using to fill array with the help of Database


RecipieAppDelegate *appDelegate = (RecipieAppDelegate *)[[UIApplication sharedApplication] delegate];
    [appDelegate getallrecords];
    self.namesArray=appDelegate.rs;
    ///filling array with database
        for (int i=0; i<namesArray.count; i++) {
        Food *product = (Food *)[self.namesArray objectAtIndex:i];
        NSLog(@"%d",i);
        appDelegate.mylatitude=product.Latitude;
        appDelegate.mylongitude=product.Longitude;
     /// this function is use to call the class which is use to drop pin on map 
     BridgeAnnotation *BridgePin = [[BridgeAnnotation alloc] init];
     [self.mapAnnotations insertObject:BridgePin atIndex:kBridgeAnnotationIndex];
     [BridgePin release];

    }


/////CLASS BRIDGE ANNOTATION   below is the function getting cordinate from above function n droping pin    
    - (CLLocationCoordinate2D)coordinate;
    {
        RecipieAppDelegate *appDelegate = (RecipieAppDelegate *)[[UIApplication sharedApplication] delegate];
        Food *product;
        CLLocationCoordinate2D theCoordinate;
    //  theCoordinate.latitude = 37.810000;
    //  theCoordinate.longitude = -122.477989;
        theCoordinate.latitude = [appDelegate.mylatitude doubleValue];
        NSLog(@"%f",    theCoordinate.latitude);
        theCoordinate.longitude = [appDelegate.mylongitude doubleValue];
        NSLog(@"%f",    theCoordinate.longitude);
        return theCoordinate; 
    }

well I run loop perfectly on array 5 times but its pass the last value to second function

awaiting for you reply

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文