Map on on all scenes - ios

I'm making a prototype app heavily based on maps. I'm trying to replicate the way Apple Maps on iOS10 works, where there is a fullscreen map in the background and different scenes appears as cards on top and the content/markers in the map updates accordingly. The map will display markers and polylines, depending on the active scene, similar to this.
I have trouble figuring out how the app needs to be structured so that the map is present and "fixed" between all scenes, but also updates based on which card is being displayed.

Related

Using MKMapView with a custom MKOverlay. Can the local attractions that come with Apple Maps by default appear above the overlay layer?

I have an MKMapView with an MKOverlay on top, I'm wondering if its possible to have road names, place names, places of interest and everything like that, that comes by default with Apple Maps, can be displayed above my MKMapView so I don't have to add all this information manually as annotations. I know this is possible with the Google Maps API on Android so wasn't sure if I could do this with Apple Maps.
I've added an image that shows iOS versus Android to show what I am envisioning:
So, I've found a solution to this issue. If you're using the addOverlay: method in MKMapView, you can use:
[self.myMapView addOverlay:customOverlay level:MKOverlayLevelAboveRoads];
MKOverlayLevelAboveRoads means place labels including shields and point of interest icons are shown above your overlay.
MKOverlayLevelAboveLabels means your overlay will appear on top of everything (which i believe is the default based on my experiences).

Define custom navigation paths in Google Maps

I am trying to implement something like Google's indoor maps feature, locally in my iOS app, using GroundOverlays. I could easily get the overlay part done by overlaying a .png image at some position in the map, using the API. I could also implement a custom floors switcher, just like Google's one, so it changes the floor overlay image. However, I still miss the ability to navigate in the native indoor maps. How can I define custom navigation paths in that region so when user navigates between two points inside it, the calculated path gets generated with respecting them?

MKMapView "Legal" Label necessary for custom maps?

I´m using MKMapView for displaying MKTileOverlays. The overlays are drawn by myself and i don't show any map data from Apple or Google. Do I need the "Legal" label on top of the map? I only use the MKMapView to display custom tiles and put some custom annotations on it. Do I really need the legal patch here? Will my app be rejected if I drop it?
The legal link is required by Apple and there is some possibility that your app will get rejected if you remove it by using private class i.e. (if you loop the subviews of the map for MKAttributedLabel and remove/hide it). Your case is a bit more challenging of their rules due to the usage of tiles, but on a previous project of mine, where I needed a small mapView and the link was appearing quite bad on that small area, I extended the bottom area of the map a bit so that link is obscured by the view in front of it. The app got published without a problem.

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.

Make MapView display normal Apple Maps when I don't have a tile in my MKTileOverlay set

I am working on an iOS map that uses a "custom" map, stored completley in my application so it can always be accessed offline. I am using a custom MKTileOverlay URL to my local file store to make this happen, etc.
However, as my application's map only covers a small geographic area, I would like to have have the MapView display the standard Apple Map in such cases. When I overlay the map and set "canReplaceMapContent" to true, I just get a blank white space for map tiles that aren't present.
I don't really want to set canReplaceMapContent to FALSE, because most of the time a user will be using my (custom) map, so I wouldn't want the overhead of rendering the Apple map that would be completely covered.
Is there any way I can return a "nil" to a function or something to tell MapKit to not use the TileOverlay, and just use the regular Apple map instead?
No, but here's an idea: have two MKMapViews with the same frame, one with your custom map and canReplaceMapContent = YES and the other without and NO. You can hide one and show the other, transferring annotations if necessary, and you might be able to produce a convincing swap.

Resources