Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 05-18-2010, 11:43 AM   #1 (permalink)
Registered Member
 
Join Date: May 2010
Posts: 31
kyledecot is on a distinguished road
Default User's Current Location

I'm plotting a bunch of points on a map then doing:

Code:
[mapview setShowsUserLocation:YES];
The problem is that it displays the users location as a pin instead of the blue pulsating dot that it usually displays. Any ideas on how to fix this? I've included a screenshot of my app below.

kyledecot is offline   Reply With Quote
Old 05-18-2010, 06:02 PM   #2 (permalink)
Kislay
 
Join Date: May 2010
Location: Bangalore
Posts: 19
kislay is on a distinguished road
Send a message via Skype™ to kislay
Default

- (MKAnnotationView *) mapViewMKMapView *)mapView viewForAnnotationid <MKAnnotation>) annotation{
MKPinAnnotationView *annView=[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"currentloc"];//CONSTANTS CHANGE IT
[annView setPinColor:MKPinAnnotationColorGreen];
[annView setAnimatesDrop:NO];
[annView setCanShowCallout:YES];
[annView setCalloutOffset:CGPointMake(-5, 5)];

/*****
annView.rightCalloutAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];


*****/
return [annView autorelease];
}




so if you don't want this blue button kind of thing then comment

/*****
annView.rightCalloutAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];


*****/


Then it will work fine.

Thanks
kislay is offline   Reply With Quote
Old 05-18-2010, 09:38 PM   #3 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,003
Duncan C has a spectacular aura about
Default Return nil in mapView:viewForAnnotation: if annotation = mapView.userLocation

Quote:
Originally Posted by kyledecot View Post
I'm plotting a bunch of points on a map then doing:

Code:
[mapview setShowsUserLocation:YES];
The problem is that it displays the users location as a pin instead of the blue pulsating dot that it usually displays. Any ideas on how to fix this? I've included a screenshot of my app below.


I don't understand what the other poster was trying to say.

The solution is as follows:

In your mapView:viewForAnnotation: method, add the following as the first line:

if(annotation == mapView.userLocation)
return nil;

The system will use the default view for an annotation if you return nil, and the default view for the user's location is the blue dot.
Duncan C is offline   Reply With Quote
Old 05-19-2010, 01:07 PM   #4 (permalink)
Registered Member
 
Join Date: May 2010
Posts: 31
kyledecot is on a distinguished road
Default

Quote:
Originally Posted by Duncan C View Post
I don't understand what the other poster was trying to say.

The solution is as follows:

In your mapView:viewForAnnotation: method, add the following as the first line:

if(annotation == mapView.userLocation)
return nil;

The system will use the default view for an annotation if you return nil, and the default view for the user's location is the blue dot.
Thanks for the answer. I actually figured it out before looking at your reply but at least now someone else will be able to find the answer if they come across the same problem.
kyledecot is offline   Reply With Quote
Reply

Bookmarks

Tags
location, mapkit, user

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 309
9 members and 300 guests
Abidullah, ajay123123, Fstuff, guusleijsten, HemiMG, newDev, pkIDSF, Sami Gh, Steven.C
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,648
Threads: 94,113
Posts: 402,877
Top Poster: BrianSlick (7,990)
Welcome to our newest member, brandon6031
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 07:48 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0