Does MapKit offer position/scale controls? - ios

Does the iOS 7.1+ SDK Mapkit offer Map Controls like the one in the image?
... or is this only covered via the gestures?
Are the controls exclusive to the google sdk?

No. MapKit doesn't include controls like the ones illustrated.
MKMapView (the map view in MapKit) typically uses touch gestures to adjust the scale and position of the map. You can pinch in/out to zoom out/in, and you can pan to adjust the displayed area.
There's nothing to prevent you from adding your own controls to a map view if you want to, but given the touch interface it's hard to see why that would be necessary. Indeed, even Google doesn't use those controls in its Google Maps app.

Related

Here Maps - iOS Premium- infoBubble

I am trying to display a popup above the marker when the marker is selected. But infoBubble functionality is not implemented in premium SDK.
Is there a workaround for this?
You should use MapOverlays instead: https://developer.here.com/documentation/ios-premium/api_reference_jazzy/Classes/NMAMapOverlay.html
Then add you implementation to the MapView via: https://developer.here.com/documentation/ios-premium/api_reference_jazzy/Classes/NMAMapView.html#%2Fc:objc(cs)NMAMapView(im)addMapOverlay:
The idea behind is, that you can use a normal UIView (very flexible, your own design, etc.) and stick it to a position on the map (and the mapview will keep it in place then).

Add text under markers in mapbox ios

I'm using Mapbox SDK in my iOS app (using Swift).
I want a label to show under every marker like this:
I couldn't find anywhere in the docs or on stackoverflow how I can achieve that. I tried to make the text a part of the marker image, but the text does not resize itself that way and things are a mess when markers are close (or when you zoom out).
Does anybody know how I can make that happen?
Right now, you'll want to do this at the GL style level using Mapbox Studio — not as dynamic annotations.
Doing it in the style allows labels to be recalculated and customized based on the surrounding data and map state, whereas annotations currently aren't as customizable.

Is there any way to synchronize the Map Vector (OpenGL layer) and UIKit?

Say you have a fixed pin in the middle of the screen using an UIImageView on top of the GMSMapView. At some point in the flow I need to remove the fixed pin and add it as a marker in the map.
One could do so by setting the fixed pin hidden property to true and then adding a GMSMarker in the center of the map using the same asset as the UIImageView. That works except that there is a visual glitch since adding the marker touches the OpenGL layer whether hiding the pin uses UIKit.
Is there any way to synchronize these two operations?
Not really. See this question for a discussion on OpenGL-UIKit syncing — the conclusion is that Apple has access to the private CAEAGLLayer.synchronized and nobody else does.
This is part of the reason why Google limits their SDK map views to 30fps, I'd imagine. Developing on top of a third-party SDK especially limits your syncing possibilities, as you have no/extremely-limited access to GLKView, CAEAGLLayer, or EAGLContext.
I'd suggest investigating Mapbox GL for iOS if you're looking for more wiggle-room and openness. See this issue about ongoing efforts to improve inter-layer view syncing.

iOS Google Maps Api Tiled Overlays

My app currently is using the google maps api v2 for iOS. I would like to add custom tiled overlays, which I realize is not support by the api.
The first approach I took to this problem was to try to extend the GMSOverlay class but I later found that the drawLayer method was never being called.
Next, I tried having my custom class extend UIView and then add my class as a subview to the map view. I was able to use the GMSMapViewDelegate method didChangeCameraPosition to report camera updates back to my custom class so that the tiles could be redrawn. This mostly worked with a couple exceptions, first, only the initial set of tiles would load, and if you panned or zoomed from the initial X,Y,Z the map tiles would not update via the drawInRect method. The second problem was that my custom UIView was covering all the markers and their corresponding callouts after tapping.
My question is, does anyone having any experience adding custom tiles or subclassing the GMSOverlay class to add, for example, custom weather tiles over top of the google map?
Good news from the release notes of v. 1.3.0 of Google Maps SDK for iOS (released today):
Support for custom tile overlays (image-based) via GMSTileLayer.
See: https://developers.google.com/maps/documentation/ios/releases
Have you tried looking at this example?
https://github.com/mtigas/iOS-MapLayerDemo
It is based on the MKMapKit, not the Google-Map SDK. It supports tiles with zoom and is very easy to extend, and might point you in the right direction.
If you need to generate tiles for the map, you can use MapTiler
http://www.maptiler.org/
The Windows version of MapTiler gives more fine grained control of the tile generation.

MKMapView rotation

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.

Resources