Note that there are some explanatory texts on larger screens.

plurals
  1. POiPad Mapkit - Change title of "Current Location"
    text
    copied!<p>In map view, i'm showing current user location. On click on the pin its showing "Current Location". I want to change it to "My Current Location". How can I change it. Also I want to change the current user location pin color in a timer. Some thing like every one second it should change its color between green, purple and red. Possible to do it? </p> <p>I'm using map kit's show default location and then manipulating the annotation pin color as below:</p> <pre><code>- (MKAnnotationView *)mapView:(MKMapView *)map viewForAnnotation:(id &lt;MKAnnotation&gt;)annotation{ static NSString *AnnotationViewID = @"annotationViewID"; SolarAnnotationView* annotationView = (SolarAnnotationView*)[map dequeueReusableAnnotationViewWithIdentifier:AnnotationViewID]; if(annotationView == nil) { if([self CLLocationCoordinate2DEquals:mapView.userLocation.location.coordinate withSecondCoordinate:[annotation coordinate]]) //Show current location with green pin { annotationView = [[SolarAnnotationView alloc] initWithAnnotation:annotation]; annotationView.delegate = self; [annotationView setPinColor:MKPinAnnotationColorGreen]; } else { annotationView = [[SolarAnnotationView alloc] initWithAnnotation:annotation]; annotationView.delegate = self; } } return annotationView; </code></pre> <p>}</p> <pre><code>- (BOOL) CLLocationCoordinate2DEquals:(const CLLocationCoordinate2D)lhs withSecondCoordinate:(const CLLocationCoordinate2D) rhs{ const CLLocationDegrees DELTA = 0.001; return fabs(lhs.latitude - rhs.latitude) &lt;= DELTA &amp;&amp; fabs(lhs.longitude - rhs.longitude) &lt;= DELTA; </code></pre> <p>}</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload