Not able to move map after starting navigation - ios

hi i am using skobbler offline map in my application and everything works fine except one thing, after starting navigation i am able to rotate, zoom in, zoom out in the map but cannot move the map please help solving this. if i set follow user position to NO it works fine but i have to follow user position while in navigation. i had already tried this
Not able to move map after starting Navigation SKMAPS but i want follow user position to be YES .please help thanks in advance
[SKRoutingService sharedInstance].navigationDelegate = self;
SKNavigationSettings* navSettings = [SKNavigationSettings navigationSettings];
navSettings.navigationType=SKNavigationTypeReal;
navSettings.distanceFormat=SKDistanceFormatMilesFeet;
[[SKRoutingService sharedInstance]startNavigationWithSettings:navSettings];
self.mapView.settings.followUserPosition = YES;
self.mapView.settings.displayMode = SKMapDisplayMode2D;

I think that these 2 requirements are conflicting:
you want to be able to pan the map - this means that you should be able to move where ever you want on the map disregarding the current user position
you want to follow the user position - this means that the map should automatically recenter on the user every time the user position is updated
From my view you can switch between these 2 scenarios (see for example the "Car navigation UI" example in the skobbler/Telenav demo project - there once you start panning the map you go to 2D without following the user position and when you click the "back" button you switch back to 3D navigation following the user position) but you can't have both at the same time (as they are logically exclusive).
If I'm missing a specific use case let me know

Related

swipe left to pull next view according to thumb speed

I am working on and app in which i have to take user to next view if user swipe next. Simply swipe gesture working dine.
But the problem is a little of left swipe take the user to next view.
What i want to implement is to make user see pulling next view by itself and next view coming over to the present view according to the thumb swipe speed. Something like shown in the screenshot
See that library
https://github.com/zhxnlai/ZLSwipeableView
The same thing happening , if a required velocity is not there than card is not discarded , go to ZLSwipeableView and you can find code there , the hint you needed , like that
CGPoint velocity = [recognizer velocityInView:self];
CGFloat velocityMagnitude = sqrt(pow(velocity.x,2)+pow(velocity.y,2));
CGPoint normalizedVelocity = CGPointMake(velocity.x/velocityMagnitude, velocity.y/velocityMagnitude);
Use UIpanGestureRecognizer, track the area swiped and move to next Screen or you have to use UIContainer

How to continue navigation after changing screens - Skobbler

After a navigation has started, user has an option to switch between screens.
There are two screens with two different maps - one showing navigation and another showing some POIs.
Whenever screen is changed, new delegates are set and [SKRoutingService sharedInstance].mapView is set to the map view of that screen.
Everything works fine, only thing that happens and I want to avoid it - when I go back to the initial screen, the navigation starts from the start again (I was testing this in simulation mode on an iPhone 6 so far).
This happens when I set delegate
[SKRoutingService sharedInstance].routingDelegate = self;
If I don't set the delegate, on return to the main navigation screen, navigation will continue from the position it is intended to, but all the navigation delegate methods will not function.
However, if i set this delegate, navigation will start from the starting point.
How to avoid this ?
Currently, the "navigation" part is shared between all instances of the map - if you start the navigation in one instance, one you switch to another instance then you'll still have the navigation perspective. If you stop it in one view, it will stop across all instances.
What you could do is switch the map do 2D and enable panning - this way you'll still be able to interact with the map (zoom to your POI) and still have the navigation on.
Something similar to what happens in the demo project in the "Car navigation UI" demo when you start panning the map (after starting navigation).
You could really ask this question better. It's hard to understand what the question is about on first reading.
Having said that, it sounds like you're using a 3rd party routing framework, and setting that routingDelegate property has an unintended side-effect (of restarting the navigation). To avoid this, I'd create a new object that should be the routingDelegate all the time. Then this object can notify any other objects that need to know about routing events. This way, you avoid the side effects that are triggered by setting the routingDelegate.

Navigate a route without following it in the SKMapView

SKMaps is an excellent framework for a lot of mapping uses. I have a bit of a unique requirement and I'm hoping someone might have a solution. I'm curious if I can calculate a route, paint that route on the map, and then start navigation without having the map adopt the follow-the-driver UI. I want to be able to continue some basic interaction with the map (including animating different points to the center, etc) while navigation is in-progress.
My ViewController is both the routing delegate and the navigation delegate of the SKRoutingService shared instance. I did attempt to set the routing service's mapView pointer to nil when the route gets calculated, right before I start navigation, but to no success -- the mapView still zooms into the current location, the current position icon changes to the navigation one, and the map starts following the driver.
Any ideas?
Set the following after starting navigation:
[[SKRoutingService sharedInstance]startNavigationWithSettings:navSettings];
self.mapView.settings.followUserPosition = NO;
self.mapView.settings.headingMode = SKHeadingModeNone;
self.mapView.settings.displayMode = SKMapDisplayMode2D;
SKCoordinateRegion region;
region.center = CLLocationCoordinate2DMake(37.9667, 23.7167);
region.zoomLevel = 17;
self.mapView.visibleRegion = region;
This would start the navigation but not change the view (the user position will still change on the map, reflecting the change in position)

Progmatically Setting Heading in MKMapView

I would like my MKMapView to rotate based on heading which is set progmatically.
All I have been able to do is rotate the view itself but then of course the street names, etc are upside down.
Can someone please help me out?
It does not appear to me that you can manually set the heading for the map view. You can set the behavior that rotates the map view to follow the user's current compass heading, though:
[mapView setUserTrackingMode:MKUserTrackingModeFollowWithHeading
animated:YES];
This question is old so many things have changed until. But there is definetly the possibility like so in swift:
mapView.camera.heading = 0

Problems with current location pin

I'm working on an app that shows a couple of places on the map along with the user's current position.
I have two small problems with it:
First off, I want the current location pin to be the default blue circle, but it shows a green pin just like the other locations.
Second problem, whenever I touch the screen, the current location pin drops again. It just can't seem to be steady like the other ones. It's like it's being called whenever I interact with the app.
Make sure you set your mapView delegate to self...that should fix the pin color. Not sure about your other problem
// in the viewDidLoad
[mapView setDelegate:self];
where "mapView" is defined as "IBOutlet MKMapView *mapView;"

Resources