Route following simulation in iOS - iphone

I am working on moving a map annotation along a route that has been mapped out in iOS, but I wanted it to follow the path given for the directions. So to be clear, I want a simulation of the user following the route of the map without actually doing the route. I have tried doing research and yes, I have seen the breadcrumb tutorial but I am really unsure how to go about following a route as described. Is there some way to get the map with the route broken down into points/data?
Any help or links are appreciated.

Change and animate the coordinates of the annotation along an array of coordinates.
But this requires that you have the "route" as sequence of coordinates. The apple route you will not get as coordinates.
You could use OpenStreetMap to get a vector based route (coordinates).

Related

Custom tiles yet geo accurate in LeafletJS

I'm interested in custom map tiles, and using advice from here and here, I've experimented with exactly that. For a prototype I did a very geeky map of the Star Trek Federation, with episode links moving you around the planets/systems etc.
While that's all fine and dandy for fantastical locations, I'd also be interested in using heavily stylised renditions of real world locations, yet still using real lat,lng points. So, for example, a bespoke, yet mostly geo accurate, map of London, chopped into tiles, but if you passed in lat,lng coords for Camden Tube (51.53911 -0.14235), you would move to that location.
Any ideas how you configure LeafletJS to do this, without going the route of using Google Maps with custom tiles?
If I understand correctly, you have 2 different applications:
Your Star Trek map, for which you are satisfied.
Stylised map of real world, for which you would like real lat,lng coordinates to be accurate?
Then your question is how to create your custom tiles, so that Leaflet shows the stylised view of London when passed the real London coordinates?
In that case, it would be probably just a matter of correctly numbering your tiles. Or the reverse, modifying the tile numbers used by Leaflet to build the tiles URL. For the latter solution, see Specifying Lat & Long for Leaflet TileLayer
I'm not quite sure what you mean by "mostly geo accurate". It sounds like you probably just want to generate your own map tiles from some kind of source like OpenStreetMap. In that case, TileMill (although kind of obsolete) is probably the easiest way to go.
There are basically three parts:
Generate some map tiles (eg TileMill)
Host them (eg TileStream)
Point Leaflet at them

iOS 7 MKMapView Does not provide a route between two points

Hi there am using the Map Kit, i did add several points based on Lat & long Data, so far, it's all good. I Did try to implement the MKDirections methods but i get this response: A route to the destination from its nearest road cannot be determined, NSLocalizedDescription=Directions Not Available, MKDirectionsErrorCode=7, MKErrorGEOError=-403
My question is: If i somehow own the data of those routes between two points, is there a way to draw the route using the MapKit instead of asking apple to provide a route?
thanks in advance for your responses
Yes, you can draw a polyline, if you know the sequence of lat,lon coordinates along the road from start to destination.
Apples BreadCrumbs demo code shows how to do that.

How to achieve density/heat map effect in iOS (iPhone/iPad)?

http://www.econguru.com/heat-map-of-worldwide-gdp-ppp-per-capita-2008/
This is CIA world Factbook map, each country has different color depth based on their GDP number. High GDP country has deeper color.
Right now, I am considering to develop such effect into my iPhone/iPad map app. I may want to use the apple map (probably not google map since iOS 6 has its own map), but I am not sure how to get such effect based on the country the user visited.
For example, the user visited US the most, then the map shows deeper color in US.
I haven't seen such effect in iPhone app yet. Any suggestion would be appreciated!
This should be doable using MapKit and overlays. You would need to construct an overlay for each area of the heat map and then set the color according to the data. I suspect the hardest part is going to be getting the geographic data you need to construct the paths for each region. AFAICT, there's no -pathForState: or -pathForCountry: type of functions in MapKit, so you're going to need to find another source for that information. But in terms of drawing overlays, it's all there in MapKit. Check out this sample code.
EDIT:
This question has some pointers on where to get that data.
You can get the coordinates ready to go in json format from the D3 project on github:
https://github.com/latentflip/d3/blob/master/data/world-countries.json
You can download this json, use NSJsonSerialization with the file to load the json into a Dictionary or an array, and then build your overlays from there.
One other thing: you aren't technically after a heat map; what you're afer is more of a "thematic" map.
Try the LFHeatMap class. Seems to be what you're looking for.
https://github.com/gpolak/LFHeatMap

Draw route openstreet maps

I have several geo points witch I want to use to draw a route using the openstreet maps. Where can I start is there any documentation for this map ?
Thanks
There are several ways to plot routes on OSM. JXMapViewer is good if you're coding in java and should allow you to do whatever you want.
http://wiki.openstreetmap.org/wiki/JXMapViewer2

Weird issue in bing maps display

I am displaying bing maps in a metro app. I am drawing both pushpins and polylines on the map but they get drawn on opposite sides of the map which looks very weird. Please look at the following image:
The line and image is being drawn at opposite sides of the map.
Could someone please suggest a solution of this problem.
Can I somehow restrict my view to display each country only once?
So I think one of my other answer might help you out here.
How to show the full map and prevent scrolling in Bing Maps API
You can constrain the map to a certain zoomlevel range and lat/long range, so that you don't see the same coordinates twice. Let me know if you need any further details on how to do this.