mkmapview

Subclassing MKOVerlay View- canDrawMapRect not called

元气小坏坏 提交于 2019-12-11 05:30:03
问题 I am attempting to subclass MKOverlayView to create a custom overlay. I understand that in order to do this, one must override the following two methods - (void)drawMapRect:(MKMapRect)mapRect zoomScale:(MKZoomScale)zoomScale inContext:(CGContextRef)context; - (BOOL)canDrawMapRect:(MKMapRect)mapRect zoomScale:(MKZoomScale)zoomScale; My question arrises from the latter method. For some reason, when I override it in my MKOverlayView subclass, it does not get called. According to documentation,

Does MKMapView support the “little man” street view?

為{幸葍}努か 提交于 2019-12-11 05:04:36
问题 There is no little man icon to drag onto a street in a map. Is there a way to enable him programmatically? Thanks. 回答1: The MKMapView does not have support for the "little man" (Pegman) or Street View. One alternative is to use the Google Maps Javascript API V3 directly. In a UIWebView, load an html file (added as a resource in your app) containing a Google map. For sample html files containing Street View, look for the streetview-*.html files on the Google Maps Javascript API V3 Examples

Add extra detail to MKPointAnnotation other than title and subtitle

混江龙づ霸主 提交于 2019-12-11 04:31:26
问题 I wish to pass informations from a Pin annotation to another viewController.I can pass the title and subtitle of the annotation but I need to pass some extra information along with these. Is there a way to add extra information to a MKPointAnnotation other than just title and subtitle? here I have the pin title and subtitle set so it appears on the map: var zoopin = MKPointAnnotation() zoopin.coordinate = zoo zoopin.title = "The zoo" zoopin.subtitle = "hello this is the zoo" mapView

How to display several MKPinAnnotation with same Latitude / Longitude?

落花浮王杯 提交于 2019-12-11 04:02:28
问题 My iPad App is retrieving geographical objects from a database. In this database some objects have the same longitude / Latitude. As a consequence in the MkMapView I'm adding several MKPinAnnotation with the same Lat/Long. Unfortunately only one is displayed, I suppose it the last one I have added. How can I have only one MKPinAnnotation object (for a given coordinate) and when user clicks on it I will display MKPinAnnotation for each objects sharing the same coordinates? Something similar to

Mapview crashes in iOS 6

妖精的绣舞 提交于 2019-12-11 02:56:11
问题 I'm having a problem when I'm loading map view in iOS 6. But it's working 100% with previous OS versions. Here's the code: //.h file MKMapView *galleryListMap; //map view NSMutableArray *copyOfAllRecords; //array with locations And here is the code structure in my .m file. I have synthesized variables and released them in dealloc method. //this will runs in a background thread and populateMap method will make all the annotations //[self performSelectorInBackground:@selector(populateMap)

show map callout through code in iPhone

守給你的承諾、 提交于 2019-12-11 02:33:03
问题 I have tried several things but am unable to solve it out. I have 10 custom annotations on the map depending upon the area visible. Now I have 2 buttons next and previous. Clicking on which the callout of annotation must get displayed. i.e if i click on next buton then callout of annotation 1 will appear and when i click next again then the callout of first will hide and callout of second will appear. I have tried out [self.mapView selectAnnotation:self.nextSelectedAnnotationView.annotation

How to rotate iOS MKMapView so that it north-oriented when switching tracking mode?

房东的猫 提交于 2019-12-11 02:26:48
问题 I am working on an iPad app (iOS 5.1), and I use MKMapView to display a map in my app. I am switching between the three different map orientation modes using MKUserTrackingModeNone, MKUserTrackingModeFollow, MKUserTrackingModeFollowWithHeading and this works. However I have a problem with the orientation of the map not resetting to north-facing orientation (north on the map being at the top of the screen) when switching from MKUserTrackingModeFollowWithHeading to MKUserTrackingModeNone. On

setUserTrackingMode to MKUserTrackingModeFollow without changing zoom level

∥☆過路亽.° 提交于 2019-12-11 02:25:59
问题 At Apple Documentation of setUserTrackingMode:animated: it is stated that: Setting the tracking mode to MKUserTrackingModeFollow or MKUserTrackingModeFollowWithHeading causes the map view to center the map on that location and begin tracking the user’s location. If the map is zoomed out, the map view automatically zooms in on the user’s location, effectively changing the current visible region. My question, is there a way we can retain current zoom level on map, while setting the user

MKMapView Cannot Zoom Map

纵然是瞬间 提交于 2019-12-11 02:16:52
问题 I created a really basic app that just shows an MKMapView and the UserLocation. I'm having problems drawing this base map sometimes (it only shows pieces of the map), and whenever I pinch zoom the map, it fails to redraw, and just shows the blank gray tiles. The console shows this whenever it needs to get a new map tile: /SourceCache/GoogleMobileMaps/GoogleMobileMaps-263.5/googlenav/mac/Loader.mm:231 server returned error: 502 This looks like a gateway error, but that doesn't make any sense,

Drawing a polygon in MKMapView IOS 7 is not correct

喜夏-厌秋 提交于 2019-12-11 02:08:40
问题 In MKMapView , I created a polygon using these points: 1- lat = 0.0; long = -170; 2- lat = 0.0; long = 170; 3- lat = 10; long = 180; The first two points are only 20 degrees apart, but the MKMapView draws it in the other direction around the world (which is 170 + 170 = 340 degrees apart). Is there any fix to that? 回答1: I'm surprised you're having issues with this in iOS 7, as they handle spanning the meridian better than prior versions. In iOS 7, the following: CLLocationCoordinate2D