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
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
Below is the funtion 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