Show tint effect when info window is tapped in google Maps - ios

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

Related

GMSPolygon zIndex not working?

Using the latest Google Maps iOS SDK I have a map with overlapping Polygon area's. When trying to tap them, the
- (void) mapView: (GMSMapView *) mapView didTapOverlay: (GMSOverlay *) overlay
function does not loop thru all overlays.
Trying to set the zIndex value to a higher value doesn't seem to make any difference. The value is set, but still I cannot tap the other overlapped overlay..
Anyone has found the same problem? or maybe has another solution?
Was a bug in google maps iOS SDK. Fixed now.

Disable panning while zooming

I switched from google maps api for iOS to here maps api for iOS . I would like to disable panning/scrolling of map while zooming in order to keep gps location of centre point same. Any suggestion? Thanks in advance.
You could use
[MPAMapView disableMapGestures:] apis to disable panning/scrolling.
Details could be found # https://developer.here.com/mobile-sdks/documentation/ios/topics/map-gestures.html
You can accomplish this use case using a combination of NMAMapGestureDelegate and NMAMapViewDelegate.
For example, you can implement the NMAMapGestureDelegate - (void)mapView:(NMAMapView *)mapView didReceivePinch:(float)pinch atLocation:(CGPoint)location; handler method to add some extra code to disable the gestures you wish to block. And then re-enable the gestures once the pinch gesture has ended.
Something like this should do the trick, you may have to play with the implementation a bit to get it working how you would like:
- (void)mapView:(NMAMapView *)mapView didReceivePinch:(float)pinch atLocation:(CGPoint)location
{
[mapView disableMapGestures:(NMAMapGestureTypePan | NMAMapGestureTypeTwoFingerPan)];
// execute default pinch behaviour
[mapView.defaultGestureHandler mapView:mapView didReceivePinch:pinch atLocation:location];
}
...
- (void)mapViewDidEndMovement:(NMAMapView *)mapView
{
[mapView enableMapGestures:NMAMapGestureTypeAll];
}
You can look at NMAMapView - (NSInteger)respondToEvents:(NSInteger)events withBlock:(NMAMapEventBlock)block as well. It's possible responding to the NMAMapEventGestureEnded event using respondToEvents may work better for your use case.
More Information:
Map Gestures
NMAMapGestureDelegate
NMAMapViewDelegate
Map Event Blocks

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

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