setNeedsDisplayInMapRect - Deprecated iOS7 - ios

I am currently trying the Apple example Breadcrumb to track and draw a path where the user has been.
Having updated the base SDK to 7, it is alerting me that setNeedsDisplayInMapRect is deprecated as of iOS 7.
I have looked in the reference documents and they advise that this should be replaced with MKOverlayRenderer.
As this is all new to me, I am struggling to fully grasp how to swap this around. Does anyone have any experience with this and can explain how to do so?

Change CrumPathView parent class to MKOverlayRenderer (available iOS 7.0 onwards) from MKOverlayView (deprecated on iOS 7.0) as both classes expose the same methods with couple of new extra methods introduced in MKOverlayRenderer.
Implement following MKMapViewDelegate's method (available in iOS 7.0 onwards) as a replacement for deprecated
// Deprecated in iOS 7.0
- (MKOverlayView *)mapView:(MKMapView *)mapView viewForOverlay:(id <MKOverlay>)overlay
// Method to replace above deprecated method (available in iOS 7.0)
- (MKOverlayRenderer *)mapView:(MKMapView *)mapView rendererForOverlay:(id < MKOverlay >)overlay

Related

Show tint effect when info window is tapped in google Maps

I am creating a InfoWindow by using the following method,
- (UIView *)mapView:(GMSMapView *)mapView markerInfoWindow:(GMSMarker *)marker
And I am handling the event related to tapping of InfoWindow using,
- (void) mapView:(GMSMapView *)mapView didTapInfoWindowOfMarker:(GMSMarker *)marker
But I want to show a tint effect when the InfoWindow is tapped. I want to implement this effect with google maps.This effect can be seen in Apple Maps. In Apple maps if you drop a pin and the tap the InfoWindow it shows the tint effect. I want to implement this feature like Apple maps in google Maps.
Based on the Official Google documention for Google Maps API, it is not possible to customize the infowindow's color however there is a work around for that. What you can do is to insert images as a background to make it tinted.
I found a video tutorial which discuss how to insert images using GMSMa[ViewDelegate: https://www.youtube.com/watch?v=ILiBXYscsyY

Mapbox iOS SDK 2 - Detect click on polygon

I need to recognize which MGLPolygon was selected by user on Mapbox 2.0 map.
- (void)mapView:(MGLMapView *)mapView didSelectAnnotation:(id <MGLAnnotation>)annotation
doesn't work.
How can I customize MGLPolygon to make it clickable?
This functionality isn't supported yet: https://github.com/mapbox/mapbox-gl-native/issues/2082

Custom callout view in Mapbox iOS sdk 2.0

I am using Mapbox iOS SDK. I installed it using cocoapods. I need to create a custom callout view and to do so I found below method in the previous SDK version 1.x.x.
- (RMMapLayer *)mapView:(RMMapView *)mapView layerForAnnotation:(RMAnnotation *)annotation
And current SDK version is 2.0 where they change the protocol name from RMMapViewDelegate to MGLMapViewDelegate, now the problem is I am not able to find the alternate method for layerForAnnotation in this new protocol. Can anybody suggest me what to do.
Currently, you can't supply a custom view/layer as in 1.x.x, but you can provide custom imagery.
- (nullable MGLAnnotationImage *)mapView:(MGLMapView *)mapView imageForAnnotation:(id<MGLAnnotation>)annotation;
Watch this space for proper views:
https://github.com/mapbox/mapbox-gl-native/issues/1784

Method didSelectAnnotation does not work (Skobbler iOS)

This problem appeared after an update to the latest Skobbler version.
When I try to select any annotation, only this method get's called
-(void)mapView:(SKMapView *)mapView
didTapAtCoordinate:(CLLocationCoordinate2D)coordinate
But not didSelectAnnotation.
After zooming the
didSelectAnnotation method works fine.
Anyone knows what's happening?
The answer is simple. I've just set
annotationTapZoomLimit = 0
in map's settings.
Thanks for attention.

Google Maps iOS rightCalloutAccessoryView replacement?

Just wondering what's the rightCalloutAccessoryView (the blue button below) replacement in the Google Maps SDK? Or do I need to make a custom view.....
EDIT:
Is there a better option than GMSMapViewDelegate's:
- (void)mapView:(GMSMapView *)mapView
didTapInfoWindowOfMarker:(id<GMSMarker>)marker;?
(it isn't obvious to the user that you can tap the info window...)
EDIT 2
This Plane Finder - Live Flight Status Tracker seems to use default callouts with the iOS SDK: http://bit.ly/PFinder. How do you do that?
Found it! :)
See https://github.com/ryanmaxwell/GoogleMapsCalloutView for an example project :)

Resources