Search Results

Search found 2 results on 1 pages for 'makinitez21'.

Page 1/1 | 1 

  • Uncenter MkMapView

    - by Makinitez21
    I am trying to "uncenter" the map view and remove all annotations. the reason for this is that the mapView will be used by different view controllers to display different annotations and locations. What's happening now is that i am using the "remove annotations" method and i removes them, but the map stays centered on the spot and thus when the new annotations come in, it does not move. Is there a way to reset the region and if so, what value do i reset it to. I tried nil, zero and some calculated value but "core animation" says they are all invalid. how do i get that to zoom out and back in on my new annotations? here is some code -(void)recenterMap { NSArray *coordinates = [_mapView valueForKeyPath:@"annotations.coordinate"]; CLLocationCoordinate2D maxCoord = {-90.0f, -180.0f}; CLLocationCoordinate2D minCoord = {90.0f, 180.0f}; //NSLog(@"%@", [coordinates description]); for (NSValue *value in coordinates) { CLLocationCoordinate2D coord = {0.0f, 0.0f}; [value getValue: &coord]; if(coord.longitude > maxCoord.longitude) { maxCoord.longitude = coord.longitude; } if(coord.latitude > maxCoord.latitude){ maxCoord.latitude = coord.latitude; } if(coord.longitude < minCoord.longitude){ minCoord.longitude = coord.longitude; } if(coord.latitude < minCoord.latitude){ minCoord.latitude = coord.latitude; } } MKCoordinateRegion region = {{0.0f, 0.0f}, {0.0f, 0.0f}}; region.center.longitude = (minCoord.longitude + maxCoord.longitude) / 2.0; region.center.latitude = (minCoord.latitude + maxCoord.latitude) / 2.0; region.span.longitudeDelta = maxCoord.longitude - minCoord.longitude; region.span.latitudeDelta = maxCoord.latitude - minCoord.latitude; [_mapView setRegion: region animated: YES]; } Thats the recenter methos i'm using - (MKAnnotationView *)mapView: (MKMapView *)mapView viewForAnnotation: (id <MKAnnotation>)annotation{ MKAnnotationView *view = nil; if(annotation != mapView.userLocation){ Annotation *schoolAnn = (Annotation*)annotation; view = [self.mapView dequeueReusableAnnotationViewWithIdentifier:@"schoolLoc"]; if(nil == view){ view = [[[MKPinAnnotationView alloc] initWithAnnotation:schoolAnn reuseIdentifier:@"schoolLoc"]autorelease]; } [(MKPinAnnotationView *)view setAnimatesDrop:YES]; [view setCanShowCallout:YES]; } else { [self recenterMap]; } return view; } This "else" piece waits until the blue marble drops in then recenters the map. The problem i have with that part is that when i go back to the previous View Controller i remove all annotations, so when i come back in the User location (for some reason) does not pop back in. How do i get this to pop back in? thanks in advance guys

    Read the article

  • HTML, PHP No data in drop down box

    - by Makinitez21
    Hey, I am trying to figure out why a website's drop down box will not show any options. The data file for this drop down box comes from a microsoft access .mde file. The file is present and after the last update was working fine. Some changes happened to the site, i.e. text got added along with some photos. Im not saying this was when the drop down box went bad, but when it was discovered these were the only changes made. The data file seems fine as it is worked with everyday. Can anyone point me in the right direction as to where to begin looking for the bug? For a better idea of what I am talking about, check out the Site http://yogaalliance.org/teacher_search.cfm and try selecting a country. Thank you in advance

    Read the article

1