How to get all the map tiles between two coordinates - ios

We created an app for offline maps, and i need to get the map tiles between the two coordinates for particular zoom level
I found a way to convert Coordinates to Map tiles
http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#Lon..2Flat._to_tile_numbers
Can anybody suggest a way to get these map tiles between two coordinates?
We are using OpenStreet Maps with iOS MapKit framework
EDIT:
I Recently found these two, they are providing pbf files, but i'm unable to find how to load it into a MKMapView
http://download.geofabrik.de/europe/germany/bayern/oberbayern.html
http://extract.bbbike.org

Related

Draw polylines which follow the roads gemoetry

In my app I want to highlight certain roads, which can easily be achieved just by drawing polylines on top of the roads. (I am using the Google Maps SDK, by the way). However these polylines won't follow the road's geometry, they will just connect two coordinates with a straight line. (I have a coordinate for the start of the road which I want to highlight and the end of it). The coordinates won't change, the same roads will be highlighted through out the whole time in the app.
The question is: Is there a way I could draw these polylines not to be straight but to follow the road's geometry? If it's not possible in the SDK, is there a tool on the internet which will connect two coordinates following the roads between them? Because if there is, than I could get the coordinates of those poylines and parse them in my app.
Cheers!
as #Fabian has suggested, if you have a small set of polylines to show in your app, and your app works mostly offline, it would be better to get all the polylines during the development. And there are two ways:
1) through the direction API, you might able to skip all the implementation by using the WEB API, which is meant for webserver.
https://maps.googleapis.com/maps/api/directions/json?origin=Toronto&destination=Montreal&avoid=highways&mode=bicycling&key=API_KEY
2) or, with the Snap to Road API, which might gives you a better control over your route compare to the direction API. This API is meant to fix the pool GPS data you get from the sensor and snap those on the road.

iOS Google Maps: Draw images along a polyline?

Using the Google Maps SDK for iOS (latest version), I'm trying to figure out some way to display images along a polyline on the map. I don't want the images to zoom in/out with the map, but I do want them to rotate with it -- the images are of various types of arrows, which need to be pointing in the direction of the route.
Is this something anyone knows how to do fairly straightforwardly?

Is getting mile markers in Apple MapKit or Google Maps SDK possible?

I can't find any documentation about using mile markers, only latitude and longitude. Is this even possible? Basically the situation is I get a JSON with a road and a mile marker and I want to be able to represent that data on a map. I know I could tediously convert mile markers to coordinates, but that just seems asinine. Is there another way?
You will likely need outside data for this. Check state or even US DOT data sources for something you could use here. You could then represent it on a map with MapKit directly (annotations) or possibly look into making your own raster layer with Mapbox Studio.

How do you allow the map to zoom more than the map actually has

We have an iPhone app that uses mapbox to display offline maps created using tilemill. In previous versions of Mapbox the user could zoom in as much as they wanted even though the map had only be created to a level 15 zoom. This was important to us as we overlay a GPX track and waypoints over the map and it is important we can zoom in to view that information. The map of course distorted but wasn't a major issue.
We have created various maps with tilemill however we are finding that to be able to zoom in to the level we require needs a map of 100s of megabytes which is not feasible for an iPhone app. In previous editions of Mapbox the user was able to zoom in further than the zoom set when creating the app.
Is there any way to zoom into the maps further? or are there any other alternatives to view offline maps on a mobile device?
Thanks.
Additional comment: Another option would be to hide all data at zoom levels above 17 so that the map would go blank above zoom 17. i.e. user can zoom in but once they past a certain point the map goes blank. Therefore not requiring the thousands of tile images above zoom level 17. How could we do that in Tilemill?

Adding Multiple Markers To Google Map on iPhone app

I am writing an iPhone application that uses google maps SDK to display a city. I need to add multiple markers on the map to identify certain locations.
I could loop through and add each marker upon the map load, but I don't believe this is a efficient technique(it seems very unnecessarily and resource heavy!!)?
Or is there some "Lazy loading" technique I could use to pull in the markers that are currently in view?
For that you can add it in map region wise, you have to add marker only for current displaying map region, but for this also you need to run loop.
So you can avoid other markers that would added to map.

Resources