Accessing Map Tiles of MKMapView - ios

I'm currently developing an app that needs to display a map of where the user is currently located in the world. For technical reasons, I need to access every map tiles as an image (png/jpg) before going in the rendering pipeline.
I have tried 3rd party services like MapBox, MapQuest as they have a REST api that enables me to receive a png/jpg of a tile according to the requested location. The issue here is that MapBox isn't free, so I was wondering if there was a way to access the tiles that Apple provides in it's maps app. What service are they using under the hood? Would I be violating some terms of use by going with this approach.
Please note that using some integrated "do-it-all" UIMapView is not an option for me, I need the image directly.
Thanks

Google has a REST API. You can see the details here https://developers.google.com/maps/documentation/staticmaps/?csw=1. It does cost money if you go over the usage limits.
I manually download Map Tiles for my app, but I don't use MKMapKit. I have my own MapView and I am using a combination of MapBox, Thunderforest, CalTopo, OSM, and map tiles that I generated and host on AWS. All of them have a pretty easy map tile URL scheme, but you do have to pay for most of them.

Related

Styling the traffic in Xamarin.iOS

Is there a way to change the style of the default traffic lines that appear when MKMapView.ShowsTraffic is set to true?
Thank you.
As you have probably already found out, the farthest you can go with traffic styling is exactly that one boolean variable showsTraffic that either shows it or not. MapKit is not really customizable apart from annotations and that's what you have to live with if you're not willing to use a 3rd party map provider. In my mind you have two choises:
Use a custom tile renderer with MKMapView
You can use the MKTileOverlay class coupled with the MKTileOverlayRenderer to fetch map tiles from a 3rd party service that supports tile fetching and customization, and then show those tiles instead of the default Apple map. One such service is Google Maps Tiles API but you need to request access to it from Google (it's not part of the normal Google Maps API) and it's paid.
If you're still willing to go that route, you can follow the Customize MapKitā€™s MKMapView with Google Maps styling wizard article on how to create your custom style and use it to request tiles from the Google Server. However, you should NOT use the Google Maps API address mentioned in the article, as circumventing the official Google API's and making requests straight to their servers is strictly not allowed and will get you banned and/or in trouble. Instead, you should use the official API I linked to above.
Use another map control altogether
I'm fully aware that the above is a lot work for just customizing the traffic lines, so if you're not willing to invest a lot of time and money, I'd suggest that you use another (customizable) map control instead of MkMapView. There are plenty of different options available, both free and paid.

how to replace layer url with portalItem for offline Arcgis runtime sdk

I am trying to gave offline access to my app. I am using ArcGis runtime 100 sdk. while implementing the same I found
//instantiate offline map task
self.offlineMapTask = AGSOfflineMapTask(portalItem: self.portalItem)
this code of line to start with. But when i did some research then found that we can use LayerUrls in place of PortalItem.
How should i replace it with layer url
To create an Offline Map Task, you can pass in a Map or a Portal Item that points at a Web Map.
You can use Layer URLs when creating Feature Layers (e.g. to add to a Map's operational layers).
I think you may be conflating Web Maps with Feature Layers.
By the way, for future questions: you could consider asking in the iOS Runtime SDK forum?

Integrate GoogleMaps with Mapbox iOS sdk

I'm using MapBox for a iPad app and we want to use various image sources for the map imagery.
Is there a way to get google map tiles and show them in MapBox?
We could construct the url's to get the tiles directly but google will block you if you do this, because we wouldn't be using the official API.
Is there any other option to solve this problem?
It is technically possible, but Google's terms of service don't allow display of their tiles outside of their own software frameworks.

Confused with Apple Map Vs Google Map

This might be a very stupid question for some people but I want to be make sure about this.
In iOS6 Apple has updated its Map application and added his own map. Now if I develop any native application and include map(MKMapView) into this so are their any changes which I should be aware of them?
Previously, I was using Google web service to fetch the latitude and longitude between two locations and draw direction. Does Apple provide its own web services for the same?
are their any changes which I should be aware of them?
MKMapView will still work fine, but the map it displays will look a little different. Also, if you limit your app to iOS versions that use only Apple's maps, you might not be subject to Google's terms and conditions. Read your agreements.
Does Apple provide its own web services for the same?
There's CLGeocoder. It's a class, not a web service, but that just makes it easier to use.
Using MKMapView framework didn't change just because the images are different. It should work fine.
Google's Terms Of Service say that you can't show their data on someone else's maps. So if your app is still getting data from a Google webservice you'll need to use the Google Map SDK that they have put out, not the usual MKMapView on iOS 6+.
If you are only using Google's webservice to turn a human readable address into lat/long then you can do that using CLGeocoder as Caleb suggested, but Google offer other services too.

How can i download individual map tiles from the Google Maps SDK (for iOS)?

I've been checking out the new Google Maps SDK for iOS that allows you to bypass Apple Maps for map related features in your app!
https://developers.google.com/maps/documentation/ios/intro
The SDK seems fairly easy to use, but i want to know:
If it is possible to use the SDK (are there API's) to download individual Map tiles?
If so, how?
Ive looked at the documentation given on their developer portal and it says the following:
https://developers.google.com/maps/documentation/ios/map
The key class when working with a Map object is the GMSMapView class. GMSMapView handles the following operations automatically:
Connecting to the Google Maps service.
Downloading map tiles.
Displaying tiles on the device screen.
Displaying various controls such as pan and zoom.
Responding to pan and zoom gestures by moving the map and zooming in or out.
Responding to two finger gestures by tilting the viewing angle of the map.
It seems like the downloading of the tiles happens automatically, or are there API's that allow manual access to the tiles?
If not, any workarounds would also help!
The documentation and header files do not indicate any way to download individual map tiles.
Even if you would find a workaround, you would not be allowed to use it. See clause 10.1.1 (a) in the Terms of Service:
No Access to Maps API(s) except through the Service. You must not access or use the Maps API(s) or any Content through any technology or means other than those provided in the Service, or through other explicitly authorized means Google may designate. For example, you must not access map tiles or imagery through interfaces or channels (including undocumented Google interfaces) other than the Maps API(s).

Resources