Tile Overlays in iPhone App - iphone

There is a webpage I am looking at that displays a Google Map (via javascript), but certain areas of the map have an overlay (textures appear different than the rest of the map, etc.). From what I can gather, this is done on the webpage via a getTileURL function, which depends on the zoom level and current coordinate.
I am interested in portraying this same overlay in my iPhone application, which currently has a mapView set up. Is there anyway to implement the same sort of getTile function in objective-c for a mapView?
If someone could please provide some sample code or point me in the right direction I would greatly appreciate it. Thank you.

Related

Display Annotations without Mapview

I am doing project related to Augment reality.I have to display annotations on transparent background.
I have array of latitude, longitude.
I search on net,almost all topics are related to display on mapview.
Is it possible to show annotations on uiview or transparent mapview.
any help would be appreciated.
Yes it is possible assuming you want to overlay these annotations over a camera view. There is a good open source library,
http://www.mixare.org/
Note: This library isn't that great performance vise however it will serve the purpose. If you are making a project for high end clients then go for ARLab SDK.
http://www.arlab.com/
They have perfected Augmented reality very well.

With the new maps in iOS6, is it possible to change colors of layers (parks, water, building)

I understand it's not ideal to change mapkit colors but specifically for a location based game I'm creating I'd like to have to colors much less dramatic and more dark. Is there a built in way that I can accomplish this? Since the game won't be specific to a certain region custom overlays wouldn't really work. I know with the old google maps the only way to do so was to create a javascript version of the map and add it in a webview (not ideal for the game) but with this new apple maps is there a way to redraw the shapes of these elements (parks, water, building) with a different color.
I don't have a complete understanding how the previous or current mapkits work from the ground up so if I'm missing any information or am confusing I apologize.
No there is no way you can do that in the current iOS6 maps.
The MapKit Reference does not have any inbuilt functions to do that.
I would seriously ask you to reconsider changing colors of the current MapKit even if you could do it through some other hack. You might get rejected from the App Store.
You have 2 options
a. Instead use your own maps from other vendors if you want to change colors and so for different places.
b. Overlays are a good way to go too but they are heavy work on REST side of downloading maps. I am currently using this in my map right now because all my map tiles are generated on the fly and I do not have to do too intensive work on the iPhone.

Using custom map with MKMapKit

I am creating an iPhone app for OS4.0, and I am attempting to integrate a custom map with a standard MKMapView. I have been provided a map in .eps format (vector image), and I want to somehow overlay this on an MKMapView in and restrict the scrolling boundaries of the map so users cannot scroll outside the boundaries of the custom map. What's the best way to go about this?
I have read some stuff about hosting map tiles on a server, but this seems overly complex for my application. This would just be a map for an attraction roughly the size of a public zoo, so I would think that it would be conceivable to just convert the .eps to a .png file, and overlay it, but this might not give the best performance.
I understand that I could conceivable use a UIScrollView to do the job, but the problem is that I have dynamically generated MKPinAnnotationViews placed on the map, whose position must be based on latitude and longitude, so I can't think on an elegant or reasonable way to do it with a scrollview. Any ideas?
Thanks!
-Matt
Apple has a great bit of example code that will show you what you need to do. Check out the TileMap sample - it is available as part of the (free) WWDC 2010 samples download.
It shows you how to use the gdal2tiles utility to convert an input map into a tree of overlay tiles.
Another good bit of Apple sample code to check out is HazardMap, which is part of the regular SDK samples.

iPhone - Image overlay MapKit framework?

I can see with iOS4 you can now tile an image on google maps (Been looking at the TileMap example from apple). This is great as this is what I want to do, but from what I can see I need to know the GEO reference of the image so I can raster the images with the appropriate zoom levels, etc. What I have is an artist image, which is a map of a specific area and I want to overlay this image on google maps.
Am I missing something here, but can this be done with a none standard map and having different zoom levels?
The main reason why I need to use google maps is because of the GPS functionality, so the user will know where they currently are on the map.
Georeferencing is how you "pin" your image to the world. It is a tricky process, but not too hard once you dig into it.
You've already found the TileMap example code - that is the first step.
Next, check out MapTiler.org. There you will find links and some binaries that you can use to process your image into georeferenced tiles.
If you don't know the lat/long coordinates for your image, you can use Google Earth to interactively overlay the image onto the map, and then copy the coordinates out.
Good luck!

polyines on iphone

I want to know how to display the route between two Points on
map using mapkit framework in iphone
Is there any Api that can used to display the route between two
Pins. If not Is Polyines is standard to show route between two
pins.Can we display the route on Map with the help of polyines on iphone
or is it dummy route between two points.
Thanks in advance
There's a nice sample on how to accomplish this with a custom MKAnnotationView here: http://spitzkoff.com/craig/?p=108
You can find a working example at http://github.com/leviathan/nvpolyline This solution is especially targeted at iPhone OS versions prior to v.4.0
Although it can also be used in v.4.0 Hope this helps.
You could use Quartz to draw your lines.
Get the context of your map view
Move to the point of your first pin
Add a point to the point of your second pin
Configure your stroke (line-style, width, color)
Draw
A good tutorial about drawing with Quartz:
http://www.cocoadevcentral.com/d/intro_to_quartz_two/
If you do this you will have your app rejected. You are not allowed to use the Google Map tiles (and thus MapKit) for routing.
You can use one of the open map frameworks, they may also support API's for drawing routes atop them. I would explore that before figuring out how to draw your own polylines.