Is it possible to draw sprites or fluent animated markers over a Mapkit Google map?
Thanks
It was pretty easy to include an animation for MKAnnotation.
You just need to add an animated UIImageView as a subview inside the MKAnnotationView you return for viewForAnnotation: method for that particular annotation.
Try by making custom markers and than add animated UIImageview.
Related
Here is my code: https://ghostbin.com/paste/mvhdx
When my view is zoomed-in/out, the annotations resize. Is there a way to disable this behavior and keep the annotations at the size that they were created at?
Another bonus question, how do you prohibit a MKAnnotationView from rotating as well?
If you want to create shapes that are fixed to geography, you may want to look at overlays instead of annotations.
iOS7AnimatedMapOverlay shows how to add overlays to annotations.
I want to add a UIView to fixed coordinates on the mapview like a annotation. To be more specific the UIView should stay fixed at these coordinates on the mapview when the mapview is in interaction (moving, zooming, etc.) exactly the same like a annotation does it.
I tried to solve it with MKMapPoint but without success.
Hope someone has a tipp!
As I understand you want to use custom annotatin view. There is an answer for that question. I dont think you can use a UIView as you described.
How to create Custom MKAnnotationView and custom annotation title and subtitle
I want to add multiple pins on map which should remain animated continuously. Below are sample images which I want to use as Pin,
Is there any possible way to get this type of animated pin within MapKit? If possible then please suggest me appropriate way for it.
As per my knowledge it is quite tough to implement. You can easily implement animation on any UIImageView but when you add any image on custom image then you can change custom pin image via using KVO or via NSTimer.
Please follow Animation with MapView Custom Pin link to better understanding with custom pin annotation.
You can change pin image too after a certain period of time like as Zooming change pin image
and Custom pin animation - MKMapView.
I hope it will help you to better understanding. Thanks
You could create a custom MKAnnotationView and give it a UIImageView as a subview.
Then, split the GIF into separate frames, to use in the UIImageView, as documented in this SO question.
I have got a MapView with some custom MKAnnotation, MKAnnotationView which I use to create nice custom callout.
Anyway, for my main Annotation Pin, I use some nice image of pins with a pre-rendered shadow on their left.
However, I would like the annotation not to get selected when the user touch its shadow. Because when their are a lot of them, the shadow of one can overlap another, and the wrong one gets selected because the shadow gets touched.
I have tried to use a separate image for the shadow and put it in a UIImageView inside the MKAnnotationView but it does not change anything, even if I put enableUserInteraction = NO.
any idea?
Make your MKAnnotationView the size of the image excluding the shadow. Change it's frame so that it encompasses the part you want it to receive touch. The shadow should exceed this frame, but shouldn't be cut off.
in iOS 5.0, I first place annotations on the map and also set the centre offset to CGPointMake(0,-annotationView.frame.size.height/2); right after setting the custom image for the annotation in the mapView:viewForAnnotation: method... after this the pins still appear at the original position which would be the case when the centre offset was not applied.
However, when I pinch or zoom the map, the annotation jumps to the correct position as would be the case with the centerOffset being set and then behaves correctly..
What could be the reason and solution for this?
Any help would be much appreciated.
Baffled!!
I was finally able to solve it by subclassing the MKAnnotationView and in the initWithAnnotation:reuseIdentifier: constructor method, synchronously get the annotationView image and then set the centerOffset to CGPointMake(0.0, -img.size.height/2);
If there are too many annotations, this will slow down the display of annotations, so would need to handle that differently.