iPhone MKMapKit Image Overlay - iphone

How can an image overlay be applied to a MKMapView? Basically, when you zoom in a specific location, I want an image to appear on top of the map that gives a more detailed view of the location.
I've had a look around and found different types of methods to use. I had a working example for an older SDK using the DrawMapRect function but this no longer seems to work on 4.2.

This is a good place to start...
http://developer.apple.com/library/ios/#documentation/MapKit/Reference/MKOverlayView_class/Reference/Reference.html
I was looking for polygon sample code though.
#omniscian: If you have solved it you should post something helpful for others. This page has a high google rank.

Related

How to Implement Radar View for Locations on Map?

I used several applications that are providing "radar view" for listing locations on map. I have been searching for examples or guidelines but I probably choose wrong keywords, I'm not sure why, I had no results.
I simply attached an image because it's hard to explain this feature but I'm sure there are people making this in their projects.
For the ones who does not know, radar view works on camera and shows locations that you marked on the direction you turn the camera. Moreover, some usages are providing the distance etc. but that's not primarily objective for me.
Hope to get some help, thanks in advance.
P.S. The name of the application is 'Turkcell Pusula' in store, left is normal view, right is radar view as you can see.
It's called "augmented reality" and that's a short tutorial using 3DAR for this:
http://www.youtube.com/watch?v=WPSD2LoUi3c&feature=related
Also, there are some repositories using 3DAR:
https://github.com/search?type=Repositories&language=Objective-C&q=3dar&repo=&langOverride=&x=18&y=11&start_value=1

How to implement 360' show case on ios?

Ah ... where to start ,Before I learn the iphone app develop
I found a very interesting app : The Elements
You can see every object is rotatable like 3D
But it is by take many photos from every angle form objects
How to implement it ??(via Scroll view ???)
And I found Apple's new HTML5 sample
Looks like the HTML version is not smooth as the app version
Maybe it just because of the photos too less ...
So , my question is what if I have a series of pictures , how to change the picture when finger swipe the view ???And the swipe speed also effect the rotate speed.
Thanks for any reply or answers : )
I think you can look into FVImageSequence, However you may need to modify the code to auto-rotate the complete sequence.
A link to original post is here
The Elements app as described in your original question is just a sequence of photos that were taken on each degree by a professional Photographer.
hope that helps.
i think it has nothing to do with photos. Most likely its normal 3D rendering.
Nineveh GL 3D Engine allow you to import 3D objects models(like .obj models that you can create with some application like Google SketchUP) easily in your iPhone app, you can find some tutorials here. And as #GameBit said, i don't think that by changing images when the user scrolls is the best approach.

Resizing Custom MKAnnotationView According to MapKit Zoom Level

Here is the situation:
I am displaying images on the map by using custom annotations. Everything works fine but I would like to improve it visually by resizing the AnnotationView so that it shrinks as the map is zoomed out. I want to do this because, obviously, more annotations fill up the screen and need to be shrunk so that they don't overlap each other too much and the user can see more annotations. (Of course, I would like to enlarge AnnotationViews when the map is zoomed in again).
I have achieved this by removing all annotations from the map and adding them back again, whenever regionDidChangeAnimated is called. However, these images are loaded from the internet, so downloading the images again (since the annotations have been removed) doesn't seem to make sense.
I hope I have explained the situation well, and hope to contribute to SO in the future.
Thanks in advance.
P.S. I'm developing with iOS 4.0
Since you are using iOS 4.0 I would suggest using a class that conforms to the MKOverlay protocol instead of MKAnnotationView. Overlays zoom with the map and will scale appropriately. You can probably use 1 overlay to handle all your annotations. Check out the HazardMap demo Apple provided in the 2010 WWDC talks on http://developer.apple.com
Alternatively, you could use something like the k nearest neighbors algorithm to group annotations per zoom scale. However, that can be kind of slow if you have a lot of annotations. I tried it once with several thousand annotations and did not like the performance hit that was incurred. I think < 1000 annotations might have decent performance with this method though.
It sounds like you're already on the right path and that the only real problem is the downloading of the images. Is there any particular reason you can't cache them by writing them to the documents directory (or the cache directory if you want them to go way when the app quits) when you receive them and look there first before displaying them?

Is there a View Controller to show thumbnails like the Photos app?

I am looking to replicate the image gallery view that shows thumbnails, like in the photos app on the iPhone.
Is there a view controller or any examples that anyone can provide to replicate this?
There isn't one provided by Apple. I would recommend looking at Three20. It has a few things with look a lot like the Photos app.
Another option is AQGridView.
Take a look at the video of Session 104 from the WWDC 2010. It's basically a 40 minute tutorial on how to do the photo app.
Bear in mind that allowing users to zoom will greatly increase the space required. If you use CATiledLayers, that is, which, depending on your desired zoom level, you should consider doing.
Oh, and there is source code ;)
What they don't tell you is how they did their tiling. I found that you can
a) download ready-made tiles from the server with the app or with a content update (you can use ImageMagick's crop tileWidthXtileHeight - e.g. crop 100x100 - to do the tiling). This has the disadvantage of large downloads.
b) download ready-made tiles from the server as needed (may lead to lags in your app, but then MKMapView does it quite nicely, doesn't it?)
c) tile on the phone as needed (here you can also consider caching the results, although that will likely mean you have to check space left on the device)
I've recently given enormego's PhotoViewer a try. It's easy to use, and it's much more focused than the Three20 project. (Which I also use and like a lot.)

Are tile overlays possible with the iPhone's MapKit

I already have a tile source set up for use with the Google Maps JavaScript API. I am trying to translate this for use with the iPhone MapKit. I have correctly implemented the javascript zooming levels into mapkit. Whenever - (void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated is called, I snap the region to the nearest zoom level based on the same center point.
Is it possible to implement a solution possibly with CATiledLayer to implement a tiling solution. Does the iPhone use the standard 256x256 tiles like google maps does natively? Any direction or help on this would be greatly appreciated. I would rather not waste a couple weeks trying to implement this if it's not possible.
FWIW, I spent quite a bit of time looking for a decent solution… before diving into a CATiledLayer example, I noticed MKOverlay and MKOverlayView — which are new in iOS 4 and plug right into a MKMapView.
Couldn’t find a good example implementation of using MKOverlays that pull arbitrary image data (say, UIImages from a remote tile server), but I tinkered around with the API enough until I got it working.
Built a simple example implementation of it in case anyone (like me) wants a reference:
http://github.com/mtigas/iOS-MapLayerDemo
Hope this helps someone out in the future.
MapKit doesn't provide much in the way of custom tile sources (in fact, it provides absolutely nothing to customize sources: you either use Google Maps or you don't). I've been working with a similar problem myself, though, and I've found RouteMe to be a pretty good solution for custom maps: http://code.google.com/p/route-me/
Built-in support exists for OpenStreetMaps, OpenAerialMaps (which is currently offline), Virtual Earth, and Yahoo Maps, but the framework makes it pretty easy to plug in your own tile source, too.
Yes, since iOS 7, MKTileOverlay will do:
https://developer.apple.com/library/ios/documentation/MapKit/Reference/MKTileOverlay_class/Reference/Reference.html