Having google and apple maps in the app - objective-c

I'm using Apple Maps as default maps in my view.
I would need to integrate Google Maps in my app, and give users to select type of map:
Google Map or Apple Map.
I have different methods, which show radius overlay, pins, and other thing. Is there any ways to have 1 MapView, and just to change type of the map? google or apple.
Whats is the best practice with integration both maps to the app.

You won't be able to simply use both different maps and switch between them because they do not share the same API, or even a similar API. This means that every single piece of information needs to be handled appropriately for each individual map because annotations and overlay are handled differently on each map. My recommendation would be to use UIViewControllerContainment, create a class, something like VRMapViewController, put the methods this class needs to implement in order to have some data added/removed, and then implement two subclasses: VRAppleMapViewController and VRGoogleMapViewController. In this subclasses you will handle the customization needed for each control in order to present the data inside the map (configuring annotations and overlays, etc). Each class will also handle delegate callbacks from their respective map views.

Related

HERE Maps REST API - rotation of tile labels

I'm using REST API provided by HERE Maps to display a map inside an application. As I'm not using any SDKs provided by HERE, I'm forced to fetch map tiles and render them using react-native-maps (custom tiles).
<UrlTile urlTemplate={...} />
What I'm getting is this:
current behaviour on rotate
regular (north up) view
Basically, all of the labels don't rotate on map rotation, and that makes them hard to read. Is there any possible way to handle tile rotation using only REST API?
Tile REST API doesn't support rotation. You may try to investigate the possibility of implementing rotation in react-native-maps.

Exclude objects from camera in Three.js

i'm wondering if it's possible to hide a list of objects from a camera (used to build a reflaction map over a plan, simulating the water).
So basicly i'd want to hide a list of objects from the water reflaction.
The Object3D.visible property will of course hide the object for the main camera too so it's useless.
Any idea?
before you update the reflection camera, hide the objects, when the reflection map is rendered, make them visible again.
without your current code i wouldnt be able to provide you with example code since there are several ways to accomplish reflection.

The best way to implement Offline Map in iOS

Can anyone suggest the best way to implement the offline map with following features.
Add MKOverlayView with local static Map image
Restrict to zoom outside the MKOverlay area
Google Map should not appear on the screen
Add multiple annotations of some fixed locations
Tracking & rotating
I have used Mapkit framework to start of with & already added MKOverlayView in it. Now while adding few fixed annotations it doesn't allow to add without internet.
I don't think all above things can be achieved only using Mapkit framework. So can anyone suggest me the exact solution for it ?
Any suggestions of hints will be appreciated.
Thanks.
It is possible to make map kit load map contents from a private map database. I don't remember if this is new in iOS 6 or 7. I want to say iOS 7. There was a WWDC session where an Apple engineer set up a private map as a demo.
Usually you'd host the map on a server and have your app download map tiles from the server. In your case you'd have it load tiles from a local directory on the device. However, map content gets big fast. You'd only be able to cover fairly modest areas before the file sizes of your map content became prohibitively large.
I would recommend that you look into MBXMapKit:
http://mapbox.com/mbxmapkit

how to highlight countries in ios maps

I am building an app in which I have to highlight some countries dynamically in the world map.
In short I want to customize the whole view of ios maps as shown in the images.
can this be done using MapKit or is there any other method. Thanks in advance
You want to look into the Mapbox iOS SDK which will allow you to do this and more with a MapKit-like API. In particular, you will want to quickly make a custom map with TileMill using the provided Natural Earth data set for world country borders, enable UTFGrid interactivity so that the tapped regions can be identified, and use the RMShape class on an RMAnnotation onto the map view to add/color country polygons as needed. This sounds a little complex but the tools exist, are entirely free and open source, and I can help you with this process.

How to find route between two location in iOS5

I know that it's pretty complicated in earlier version, is there any new way around in ios 5.Regarding this i can get locations by using Core locations GEOCoder, But wanted to draw the route between them, also iOS 5 has the ability to show alternate routes for a single destination from the source.
Hope Some One Help Me
Note:I'm using Map kit and core location not UIWebView with Google API.
My Problem : Draw the route between two end location ( origin and destination ).
Development needs: iOS 5 sdk(which has the features to do so),Xcode 4.2.
UI Design : In my case it's very simple design. Two Input text fields and one button then MKMapView.
Frameworks : Map kit framework and Core Location frame work
Development Steps :Get Two Input locations Here i used the method geocodeAddressString: completionHandler: of Geo Coder class(from Core Location Framework) for getting the coordinates for the given location string(Available in iOS5)Used MkPoint Annotation object for creating annotation on the locations in mapThen sent a request to the google API for getting the Direction between two locationAs of the google API Response (Available in both JSON & XML) You would have overview_polyline object , which has the array of location coordinates. But they were encoded, you have to use the correct decoding module to get the latitude and longitude. with the decoded location coordinates you can create the poly lines using MKPolyline instance method. MKPolyline *polyLine = [MKPolyline polylineWithCoordinates:coordinates count:[overlayPoints count]];
[mapView addOverlay:polyLine]; Now the polyline have been drawn over the map still it will not be visible As the final go we have to override the viewForOverlay method for displaying the poly line view.
Hope this may be help full for you guys, if anything you may not understand then let me know.Cheers,Arun
There is no route function in iOS 5 SDK.
So to make a route you need to parse data from route providers, such as Google Maps API or use SDK from CloudMade Maps. Then you use MKPolyline to connect parsed points to show route on MKMapView.
Probably there are existing open-source projects with routes, try to search on github.com.