I found this in Google Maps API:
By default, no location data is shown on the map. You may enable the
blue "My Location" dot and compass direction by setting
myLocationEnabled on GMSMapView.
However, as it's stated, when I set myLocationEnabled to YES, both user location and compass direction are visible. Is there a way to keep user location but prevent compass arrow from appearing on the map? I don't use it in my project and I would like to save some battery by not using things I don't really need in my app.
Any ideas?
Related
I'm using Mapbox maps v10.7.0, how to add user location icon as like Google maps, want to show user's current location back, after user dragged the map/zoom to see other location
Mapbox didn't provide any build-in-buttons like google to get the current location. We need to do it manually with the help of camera positions
I'm trying to develop an app with a built in navigation feature using Apple Maps. The goal is for it to show the user's current location and rotate to face the direction they are heading in. However, I'd also like it to not view from the top down, more of a tilt, like in Waze.
I can have it follow the user and rotate with the correct heading, etc. using .followWithHeading. But I can't figure out how to have it tilt. I've also tried using a map camera which enables me to tilt it. However, I then can't get the coordinates since I can't use both didUpdateLocation and didUpdateHeading in a single location manager. Any ideas?
In the Apple Maps app there is a blue arrow pointing in the direction the phone is facing(marked on the attached screenshot).I can't find how to do the same in my app using MapKit.
I need the map to be facing north and the blue dot with an arrow, just like in the default mode in the apple Maps app.I know I can do this by manually drawing an arrow. But, since it is already implemented in the Maps app, is there a standard setting that allows to achieve this in MapKit?
Currently the only way to achieve this is to create it manually, as Apple does not have any exposed API for it yet.
I posted quite a detailed implementation answer on this post: https://stackoverflow.com/a/40808645/4769084
Basically you need to add your own 'blue arrow icon' to the mapView user location view, then track the device's 'heading' to rotate the 'blue arrow icon' appropriately.
I'm building an iPhone app. There is a screen with a map (MKMapView) always showing. But to preserve battery, I don't want user location to be updated all the time, only automatically (every 15 minutes) and manually (onclick).
But, I also want to show this user location on the map.
The problem is, if I showsUserLocation for my MapView, it automatically starts updating location, hence drains battery.
I tried activating the showsUserLocation option, saving the MKUserLocation, then deactivating the showsUserLocation then adding the saved MKUserLocation as an annotation by hand, but it actually shows a WARNING and reactivate the showsUserLocation option !
So I guess the last way is by hand:
I built a blue dot annotation myself but it doesn't have the glowing effect and the accuracy circle around. Do you have any idea how to do this? Or if there is any other way, please share.
Thanks !
well you will have to go with your 'last way' -- MKAnnotationViews can easily be animated -- just treat it like any UIView :) there
see MKMapView current location showing as custom pins for how to mae custom Pins
Just use native flag to enable this like so:
[mapView setShowsUserLocation:YES]
If you want some help on the user location annotation stuff, check out how it's done in MapBox:
http://mapbox.com/mapbox-ios-sdk
In particular you want RMUserLocation. The whole SDK is open source.
Apple's latest Maps application allows a user to rotate a map. How can I add this functionality to my MKMapView? I presumed it'd just be a case of setting a boolean property (similar to zoomEnabled), but I can't find anything relevant in the documentation.
There is no built-in rotation support in the MapKit of iOS. You could use regular view transforms (but than all street names etc. will also be rotated of course), or you use the Google Maps SDK or MapBox or something else.
The Google Maps SDK does support rotation, even 3D rotation. The SDK Download includes an example project showcasing the functionality.
Actually MKMapView does support map rotation starting with iOS 5.0. Either you use the MKUserTrackingBarButtonItem control in your toolbar (user taps it until the map is rotating), or you set the userTrackingMode property to MKUserTrackingModeFollowWithHeading.