Method didSelectAnnotation does not work (Skobbler iOS) - 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.

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 - First steps

I'm having problems taking the first few steps with MapBox iOS SDK (1.4.1).
I've started with the suggested code over here: https://www.mapbox.com/mapbox-ios-sdk/examples/
- (void)viewDidLoad {
[super viewDidLoad];
self.mapBoxView.tileSource = [[RMMapboxSource alloc] initWithMapID:#"my_map_id" enablingDataOnMapView:_mapBoxView];
self.mapBoxView.userTrackingMode = RMUserTrackingModeNone;
CLLocationCoordinate2D centerLocation;
centerLocation.latitude = NRMapStartLatitude;
centerLocation.longitude = NRMapStartLongitude;
[self.mapBoxView setCenterCoordinate:centerLocation];
[self.mapBoxView setZoom:7 animated:YES];
}
No matter what I do the map starts at a location in Washington D.C. but I've set the center coordinate to be somewhere in Europe.
The same with the zoom. No matter what value I try it has no effect on the map.
There's something with the NSLog output that confuses me. At startup it says:
Using watermarked example map ID examples.map-z2effxa8. Please go to
https://mapbox.com and create your own map style.
I was assuming that this is something that I already did by registering for a free account there and starting with my first project.
Added the tilesource 'My First Map' to the container
Origin is calculated at: 120.786199, -85.000000 Map initialised. tileSource:RMMapboxSource:
Mapbox iOS Example, zooms 0-19, no interactivity, minZoom:2.000000, maxZoom:18.000000,
zoom:18.000000 at {-77.032458,38.913175}
Apparently the sample project in the iOS SDK is loaded and ignoring everything else I try to configure.
So, how do I configure the map so I can interact with the API. What am I missing?
Any kind of help is highly appreciated. Thank you!
OK, whoever is struggling with that. The trick is to set the zoom BEFORE you set the center coordinate..
..for whatever reason.

MKMapView in iOS 7

I have a problem with MKMapView in iOS7, I have been using it with iOS5 and worked flawless (at least what Im trying to do).
Well my problem is that .userTrackingMode won't work in iOS7. Been searching for an answer but haven't found any.
I want to show user location, it work fine with .showsUserLocation. But when I want to track it its like it just ignores it. Anyone have a fix?
This is how I wrote it in iOS 5:
mMapView.showsUserLocation = YES;
mMapView.userTrackingMode = YES;
mMapView.userInteractionEnabled = NO;
And what I know there wasn't any changes with the code in the upgrade.
EDIT:
Don't know why but I used
[self.mapView setUserTrackingMode:MKUserTrackingModeFollow animated:YES];
inside a method that change a label every time that the location change. Then its working.
Don't know why it's not working when I declare it in viewDidLoad... ?
Welp, in Apple's documentation for MKMapView, ".userTrackingMode" is not a BOOL but instead it's an "enum" (Integer) property:
typedef enum : NSInteger {
MKUserTrackingModeNone = 0,
MKUserTrackingModeFollow,
MKUserTrackingModeFollowWithHeading,
} MKUserTrackingMode;
Maybe you're setting it wrongly could be part of the problem?
Also, the best way to set it is via this API:
- (void)setUserTrackingMode:(MKUserTrackingMode)mode animated:(BOOL)animated (I've linked the Apple documentation for you). There's a useful "animated" argument there.

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