Search Results

Search found 271 results on 11 pages for 'mapview'.

Page 9/11 | < Previous Page | 5 6 7 8 9 10 11  | Next Page >

  • How to display user location in mapkit?

    - by 4thSpace
    I'd like to display the blue pulsing dot for a user's location. I'm doing this: - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation{ //some other stuff here [self.mapView setShowsUserLocation:YES]; } But I eventually get -[MKUserLocation establishment]: unrecognized selector sent to instance 0x125e90 Should I be doing this some other way?

    Read the article

  • How to know when MKPinAnnotationView pin callout opens/closes

    - by JOM
    I want to update pin callout (popup) subtitle either realtime, when I receive some new info from server, or at least when callout opens. So far it looks like pin + callout are created only once at... - (MKAnnotationView *)mapView:(MKMapView *)aMapView viewForAnnotation:(id <MKAnnotation>)annotation ...and then used as-is as long as it exists regardless how many times I tap it closed/open or scroll around keeping it visible. How can I update the subtitle?

    Read the article

  • Custom Annotation not showing all

    - by funatsg
    Okay, i have a number of pins on the mapkit. These pins showing different types of attractions. (E.g Parks, Farms and etc) I want to add custom images for these different types of pin. Parks have a park image and vice versa. However, when i added in, not all the images are showing successfully. For example, in parks, it should have 5 pins, but the image only came up in 2 pins, whereas other 3 is in default red pins. But if i used colours to differentiate them. For example, [pinsetPinColor:MKPinAnnotationColorGreen]; It works! Anyone knows what is the problem? Relevant codes below. Tell me if you need more. thanks! - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation{ if ([annotation isKindOfClass:MKUserLocation.class]) { //user location view is being requested, //return nil so it uses the default which is a blue dot... return nil; } //NSLog(@"View for Annotation is called"); MKPinAnnotationView *pin=[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:nil]; pin.userInteractionEnabled=TRUE; MapEvent* event = (MapEvent*)annotation; NSLog(@"thetype: %@", event.thetype); if ([event.thetype isEqualToString:@"adv"]) { //[pin setPinColor:MKPinAnnotationColorGreen]; pin.image = [UIImage imageNamed:@"padv.png"]; } else if ([event.thetype isEqualToString:@"muse"]){ //[pin setPinColor:MKPinAnnotationColorPurple]; pin.image = [UIImage imageNamed:@"pmuse.png"]; } else if ([event.thetype isEqualToString:@"nightlife"]){ pin.image = [UIImage imageNamed:@"pnight.png"]; } else if ([event.thetype isEqualToString:@"parks"]){ pin.image = [UIImage imageNamed:@"ppark.png"]; } else if ([event.thetype isEqualToString:@"farms"]){ pin.image = [UIImage imageNamed:@"pfarm.png"]; } else { [pin setPinColor:MKPinAnnotationColorRed]; } pin.canShowCallout = YES; pin.animatesDrop = YES; UIButton *rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure]; [rightButton addTarget:self action:@selector(clickAnnotation:) forControlEvents:UIControlEventTouchUpInside]; [rightButton setTitle:event.uniqueID forState:UIControlStateNormal]; pin.rightCalloutAccessoryView = rightButton; return pin; }

    Read the article

  • iphone quartz drawing 2 lines on top of each other causes worm effect

    - by Leonard
    I'm using Quartz-2D for iPhone to display a route on a map. The route is colored according to temperature. Because some streets are colored yellow, I am using a slightly thicker black line under the route line to create a border effect, so that yellow parts of the route are spottable on yellow streets. But, even if the black line is as thick as the route line, the whole route looks like a worm (very ugly). I tought this was because I was drawing lines from waypoint to waypoint, instead using the last waypoint as the next starting waypoint. That way if there is a couple of waypoints missing, the route will still have no cuts. What do I need to do to display both lines without a worm effect? -(void) drawRect:(CGRect) rect { CSRouteAnnotation* routeAnnotation = (CSRouteAnnotation*)self.routeView.annotation; // only draw our lines if we're not int he moddie of a transition and we // acutally have some points to draw. if(!self.hidden && nil != routeAnnotation.points && routeAnnotation.points.count > 0) { CGContextRef context = UIGraphicsGetCurrentContext(); Waypoint* fromWaypoint = [[Waypoint alloc] initWithDictionary:[routeAnnotation.points objectAtIndex:0]]; Waypoint* toWaypoint; for(int idx = 1; idx < routeAnnotation.points.count; idx++) { toWaypoint = [[Waypoint alloc] initWithDictionary:[routeAnnotation.points objectAtIndex:idx]]; CLLocation* fromLocation = [fromWaypoint getLocation]; CGPoint fromPoint = [self.routeView.mapView convertCoordinate:fromLocation.coordinate toPointToView:self]; CLLocation* toLocation = [toWaypoint getLocation]; CGPoint toPoint = [self.routeView.mapView convertCoordinate:toLocation.coordinate toPointToView:self]; routeAnnotation.lineColor = [fromWaypoint.weather getTemperatureColor]; CGContextBeginPath(context); CGContextSetLineWidth(context, 3.0); CGContextSetStrokeColorWithColor(context, [UIColor blackColor].CGColor); CGContextMoveToPoint(context, fromPoint.x, fromPoint.y); CGContextAddLineToPoint(context, toPoint.x, toPoint.y); CGContextStrokePath(context); CGContextClosePath(context); CGContextBeginPath(context); CGContextSetLineWidth(context, 3.0); CGContextSetStrokeColorWithColor(context, routeAnnotation.lineColor.CGColor); CGContextMoveToPoint(context, fromPoint.x, fromPoint.y); CGContextAddLineToPoint(context, toPoint.x, toPoint.y); CGContextStrokePath(context); CGContextClosePath(context); fromWaypoint = toWaypoint; } [fromWaypoint release]; [toWaypoint release]; } } Also, I get a <Error>: CGContextClosePath: no current point. error, which I think is bullshit. Please hint me! :)

    Read the article

  • Receiving a NullPointerException when calling a cursor in Android

    - by LordSnoutimus
    I am creating an application which tracks the users location using GPS, stores the longitude and latitude in a database using a content provider then output the first long and lat to a mapview. I am able to create the cursor using this line of code: Cursor c = getContentResolver().query(GPSContentProvider.CONTENT_URI, null, null, null, null); startManagingCursor(c); However, when I make a call to move to the first row in the database or even try to close the cursor using c.close(); I receive a NullPointerException.

    Read the article

  • Can't access annotation property of subclassed uibutton - editted

    - by Tzur Gazit
    Below is my original question. I kept investigating and found out that the type of the button I allocate is of type UIButton instead of the subclassed type CustomButton. the capture below is the allocation of the button and connection to target. I break immediately after the allocation and check the button type (po rightButton at the debugger console). It's turned out tht the type is UIButton instead of CustomButton. CustomButton* rightButton = [CustomButton buttonWithType:UIButtonTypeDetailDisclosure]; [rightButton addTarget:self action:@selector(showDetails:) forControlEvents:UIControlEventTouchUpInside]; I have a mapView to which I add annotations. The pin's callout have a button (rightCalloutAccessoryView). In order to be able to display various information when the button is pushed, i've subclassed uibutton and added a class called "Annotation". @interface CustomButton : UIButton { NSIndexPath *indexPath; Annotation *mAnnotation; } @property (nonatomic, retain) NSIndexPath *indexPath; @property (nonatomic, copy) Annotation *mAnnotation; - (id) setAnnotation2:(Annotation *)annotation; @end Here is "Annotation": @interface Annotation : NSObject <MKAnnotation> { CLLocationCoordinate2D coordinate; NSString *mPhotoID; NSString *mPhotoUrl; NSString *mPhotoName; NSString *mOwner; NSString *mAddress; } @property (nonatomic, assign) CLLocationCoordinate2D coordinate; @property (nonatomic, copy) NSString *mPhotoID; @property (nonatomic, copy) NSString *mPhotoUrl; @property (nonatomic, copy) NSString *mPhotoName; @property (nonatomic, copy) NSString *mOwner; @property (nonatomic, copy) NSString *mAddress; - (id) initWithCoordinates:(CLLocationCoordinate2D)coordinate; - (id) setPhotoId:(NSString *)id url:(NSString *)url owner:(NSString *)owner address:(NSString *)address andName:(NSString *)name; @end I want to set the annotation property of the uibutton at - (MKAnnotationView *)mapView:(MKMapView *)pMapView viewForAnnotation:(id )annotation, in order to refer to it at the button push handler (-(IBAction) showDetails:(id)sender). The problem is that I can't set the annotation property of the button. I get the following message at run time: 2010-04-27 08:15:11.781 HotLocations[487:207] *** -[UIButton setMAnnotation:]: unrecognized selector sent to instance 0x5063400 2010-04-27 08:15:11.781 HotLocations[487:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[UIButton setMAnnotation:]: unrecognized selector sent to instance 0x5063400' 2010-04-27 08:15:11.781 HotLocations[487:207] Stack: ( 32080987, 2472563977, 32462907, 32032374, 31884994, 55885, 30695992, 30679095, 30662137, 30514190, 30553882, 30481385, 30479684, 30496027, 30588515, 63333386, 31865536, 31861832, 40171029, 40171226, 2846639 ) I appreciate the help. Tzur.

    Read the article

  • if statement is giving me some trouble

    - by kevin Mendoza
    For some reason, this if statement is giving me an "Expected : before ] token. if ([ [mine commodity] isEqualToString:@"Gold"] && [gold == YES]) { [tempMine setAnnotationType:iProspectLiteAnnotationTypeGold]; [mapView addAnnotation:tempMine]; } is there some typo here that I'm not seeing?

    Read the article

  • Can the memory used by MKMapView be released some how?

    - by gdr
    I am using an MKMapView in my iPhone application. When I load this view, the activity monitor instrument shows that the real memory of my App is increasing significantly. It keeps going up as you move the map around or zoom in and out. Once the View controller that loads this view is removed, the memory that was allocated due to the usage of the mapView does not get freed up. Is there something that can be done to get all this memory back?

    Read the article

  • Adding map overlays

    - by diana
    Hi all, I am using iPhone os4 for development. I need to add overlays to mapview. Apple now provides overlays as a new feature of os4. How can i add overlays.Any help will be greatly appreciated.

    Read the article

  • iPhone dev - showing two locations on the map

    - by Brian
    Now I have the coordinate of two locations, let say locationA with latitude 40 and longitude -80, locationB with latitude 30 and longitude -70, I want to create a mapView that I can see both locations with appropriate viewing distance. I got the new coordinate by finding the midpoint (in this example, {35, -75}), but the question is, How can I get an appropriate viewing distance? In particular, how can I calculate CLLocationDistance (if I'm using MKCoordinateRegionMakeWithDistance) or MKCoordinateSpan (if I'm using MKCoordinateSpanMake). Thanks in advance.

    Read the article

  • which view/widget can support zooming in android?

    - by Sephy
    Hi everybody, I think my question is fairly clear, I would like to know if every kind of view can support zoom. I know that some have built in zoom controls like the MapView and the WebView, but how about a LinearLayout with some TextViews and ImageViews? I will edit this post to have a list of the answers.

    Read the article

  • Application stopped unexpectedly at Luanch

    - by Chris Stryker
    I've run this on a device and on the emulator. The app stops unexpectedly on both I have not a clue what is wrong currently It uses Google API Maps I compiled with Google Api 7 Followed this tutorial http://developer.android.com/guide/tutorials/views/hello-mapview.html (Made some alterations clearly) I did use the correct API Key That the final apk is signed with This is the source(If you compile it shouldnt work as it is unsigned) This is the compiled signed apk

    Read the article

  • Problem designing google maps app in the application

    - by Rahul Varma
    I have seen the tutorial provided to display google maps here... http://developer.android.com/resources/tutorials/views/hello-mapview.html. But sadly when i try to extend MapActivity instead of Activity the whole program is getting ruined and showing errors starting from onCreate... Whats the solution and how could i get google maps working in my application???

    Read the article

  • Finding user location before map loads

    - by 4thSpace
    I'm trying to find the user's location using: CLLocationCoordinate2D _location; CLLocation *userLoc = nil; if(appDelegate.clLocationManager.locationServicesEnabled){ userLoc = mapView.userLocation.location; _location = userLoc.coordinate; } The problem is that I haven't yet initialized the map so the above doesn't work. Is there a way to get the user's location without using mapkit? Or should I be using a different technique?

    Read the article

  • Android googlemap Out of memory

    - by Xiaofeng
    Hi, I made an android application with googlemap api, and draw some 16x16 png (about 200 count) on overlay. When I move or zoom on/in mapview, "out of memory" error occurs very often. I also used the googlemap appication in my htc itself. Seams that it uses about 14+MB memmory, and never happens "out of memory". How to save memmory usage in a googlemap api, or how to enlarge android api memmory limit. Thanks a lot!

    Read the article

  • Android & Google Maps - close info window with back button

    - by m4ch3t3
    I have an activity that holds a fragment with Google Map view in it. App adds several dozens of markers to the MapView, using MarkerManager and ClusterRenderer to form clusters. The problem is that when I have marker's InfoWindow opened and I press hardware Back button, it closes the app. Instead of that, I would like to have the InfoWindow closed. Is there any straightforward way to achieve this?

    Read the article

  • MapsActivity not beeing found

    - by Johnny Rottenweed
    I am trying to get a simple map displayed. This is what I have: package com.chance.squat; import com.chance.squat.R; import com.google.android.maps.MapActivity; import android.os.Bundle; public class Maps extends MapActivity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.maps); } @Override protected boolean isRouteDisplayed() { return false; } } <?xml version="1.0" encoding="utf-8"?> <com.google.android.maps.MapView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/mapview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:clickable="true" android:apiKey="A2:D9:A5:1C:21:6F:D7:44:47:23:31:EC:1A:98:EF:36" /> <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.chance.squat" android:versionCode="1" android:versionName="1.0"> <application android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@style/CustomTheme"> <uses-library android:name="com.google.android.maps"/> <activity android:name=".MyApp" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="com.chance.squat.Search" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> </intent-filter> </activity> <activity android:name="com.chance.squat.Add" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> </intent-filter> </activity> <activity android:name="com.chance.squat.About" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> </intent-filter> </activity> </application> <uses-permission android:name="android.permission.INTERNET"/> </manifest> I also have downloaded the Google APIs for version 8 and have set to build against them. My problem is it doesn't seem to find import com.google.android.maps.MapActivity and I don't know why or what the next step is. Can anyone help?

    Read the article

< Previous Page | 5 6 7 8 9 10 11  | Next Page >