MKMapview: How to get moving directions of current location pin? - ios7

I am working in a maps related application. In my application I would like to display destination pin and current location pin. On top of this I need to display an image like 'arrow' which should display moving direction of the user. Can anyone suggest me how do I achieve this.
Thanks

If I understand you correctly you want something like an arrow pointing which way they are moving, so grab the heading, and draw an overlay image on the map of the arrow. Then have it update the overlay when the heading changes.
documentation here: https://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CLHeading_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40008772
https://developer.apple.com/library/ios/documentation/userexperience/Conceptual/LocationAwarenessPG/AnnotatingMaps/AnnotatingMaps.html#//apple_ref/doc/uid/TP40009497-CH6-SW1
also this might help:
MKOverlayRenderer to display UIImage over map view

Related

How to build below screen in titanium?

below i attached an app help guide screen. I am understanding how to build this screen.
If any body have idea please share here
View with semi transparent background color (backgroundColor:"rgba(0,0,0,0.5)";) and some images on top of it.
So, using images is bad. You'll need images for translations and if you do this as one image you'll need to ensure all devices are covered so your arrows point to the right element.
Minimise images == smaller app.
First thing you'll need to do is a create a blocker view -- so that's a view that will fill the screen and have a black background with opacity.
You can't apply that to the window as everything in it will be semi-transparent so:
Create a transparent Window that fills the screen.
Add to that window a view that fills the window and has opacity say 0.5 and black background
Add to the Window (not the view you just created) the other elements and button -- ideally, these should be individual graphics of the arrows, sized in such a way that you can position them based on the host element (the item they are pointing to / referring to). Use real text so you can handle translations / reduce file size.
So you'll need a way to associate each tip with a control they are anchored too, and that will ensure that regardless of the screen size, the tip will appear in the correct place.
First of all, always give a try before putting questions anywhere because it makes you learn things on your own for long time.
The easiest step for you to do this is to ask your designer to create a complete image just like that & you just have to show it on top.
If you have to show that image in different translations, then you can ask your designer to provide you required translations images.

Load larger image on tap of small image with animation

I'm trying to load a large version of an image in the centre of the user's screen when then tap on a smaller version of the image that's already on my view.
Ideally I want to do this using an animation to get to the new image like a vertical flip.
Also if there's a way to make the background look greyed out like it's not the foreground then that would be even better.
Here's an image of what I'm after, I'm at work at the moment so haven't got access to the actual code / images.
I'm a new user so can't add pictures. Click here if you want to see what I'm thinking.
Image
There is an KGmodal Example Exist in GitHUB hope that Might Help you.
You have to Change the content view and Add an Imageview Programatically (with required size ) in the content View.
Follow the below link: https://github.com/kgn/KGModal
For Fliping the image see the tutorial iphone Flip Image.
In the end I added the larger image on to begin with and set its alpha to 0, then added a gesture recognizer on the smaller image that animated the larger one and gradually changed its alpha to 1. The did the reverse on the large image. Don't know why I didn't think of that in the first place!

Zoom in and Out through a NSView or Magnify

I am hoping to be able to make something similar to the universal access zoom window shown below. I have already created an NSView and using a fill operation I made a rect with a clear "see through" composite to see through my window and show the desktop. Now I am wondering if it is possible to zoom in and out inside my view just like the picture below. I was thinking this might be an IkImageView or something I could apply but i wasent sure how it was done. Does anyone know how to do this or show me where I could find this in the docs? Some code would be great. Thanks!
Take a look at Apple's example CIAnnotation. In this example is magnifying image but I think You can achieve what You want. You can download sample code from here.
CIAnnotation app example:
References and guides which can help You with this:
Core Image Programming guide
Quartz 2D Programming Guide
NSGraphicsContext Class Reference
NSView supports zoom through - (void)scaleUnitSquareToSize:(NSSize)newUnitSize
This zooms the content of the view, so to use this you would have to set the Desktop behind the mouse as view content (NSImage maybe?) and then zoom the view. It will have to update when the mouse is dragged.
Check the ImageKit part of Quartz, in particular the class IKImageView. It has zoom features, but I have not worked with it myself yet.

Rotating MapView according to compass

I'm working on Map application that needs to work like original MapView on iOS.
I need to rotate mapview according to compass heading value. I tried MTLocation example also I also tried this answer But my results is not good.
Please see the screen shot.
When I rotate mapview according to heading value Map is rotating but as you can see on screen tiles is missing.
How can I solve this display problem ?
Regards
- Fatih
Hy,
I'm the author of MTLocation. Thanks for using it by the way!
For this to work you have to make sure, that your MKMapView is a subview of your ViewController's view (and not the view itself). Then you have to increase the frame of your mapView with a simple Pytaghoras - calculation: the width and height must be at least as big as the diagonal: sqrt(visibleWidth[320]^2 + visibleHeight[480-88]^2) = 506.
So that means
mapView = [[MKMapView alloc] initWithFrame:CGRectMake(-100,-100,520,520)];
Hope that helped, please consider upvoting if it fixed your problem.
You can consider using a bigger frame for the MKMapView object. It should probably be a square with each side equal to the length of the device's diagonal. The problem with this approach is that there are regions of this object that the user won't see but we process information like views for annotations related to that region anyway. Other properties like visibleMapRect would be least helpful.
Another alternative would be to be zoom in by scaling the MKMapView object on rotation. But this might make the map blurry (untested). You could zoom out on the region displayed in the map but it could lead to frequent refreshes. You can look at a middle ground where you don't zoom out until the map is rotated over a certain angle. You can also look at using two views where one of the views is off screen and updated so that it can replace the view after a certain amount of rotation so that it feels seamless.
I am working towards making my own maps application in iPhone. I want my maps to rotate as the user turns. I tried setUserTrackingMode available in iOS 5, but due to some reason it doesn't work. So I decided to take help of MTLocation framework here.
Till now I have done the following.
created a new project and copied all .m and .h files in that.
Import MapKit.h and MTLocation.h.
In Viewcontroller.h, defined property for mapView (should I define a property for locateMeItem).
In ViewDidLoad, paste the code given at the end of the page here.
I get a few errors:
Can't see the locateMe button when created programatically.
Undefined property headingEnabled.
myCustomSelector has no effect.
self.toolbar- toolbar is not a instance of ViewController.
I have tried a code at gist[dot]github[dot]com/1373050 too, but I get similar errors.
Can anybody explain a detailed procedure of this.

How to display indeterminate NSProgressIndicator in the NSOutlineView?

I need to display a progress of loading of item's children. Please advise how to implement a progress indicator like it's done in Mail application:
(source: quicksnapper.com)
P. S. Here a source code of using indicator sub-views: http://snippets.dzone.com/posts/show/7684
This is harder than it should be, because Apple does not provide an NSProgressIndicatorCell. While table and outline views support the idea of custom cells being displayed within them, they are not set up to easily support custom subviews.
So the trick becomes, how do you get a a complete NSProgressIndicator view to display and animate at the desired spot in your window, without the ability to actually install it in the table view row?
The trick I've used is to literally install the NSProgressIndicator as a subview of the outline or table view itself. To find the location to add the subview, so it looks like it's "in the row", use the frameOfCellAtColumn:row: method. You can then position your progress indicator within that location of the outline view. When you're done spinning the progress indicator, you probably don't want to show it any more, so just remove it from its superview and discard it.
You will want to make sure you set the required autosizing flags on the progress indicator, so that it floats in the correct direction when/if your outline view is resized.
I'm sure there are other hacks like this to achieve the desired end result. I don't think there is any super-clean way to accomplish this trick.
Vienna is an open-source (Apache license) feed reader that has this in its source list. You should look at the Vienna source code to see how they did it.
Viena's implementation is not perfect. Add a feed to a folder then as it is loading and the progress indicator is busy collapse that folder. You will see the progress indicator still running in the same location.