Hi!!
I have a compatibility problem with my iPhone project.
I am using an external iPhone API, and i have the following code to add a marker to a map:
Ok, this goes well, but i want to make a little change.
I want to add an animated marker to the map instead to add a simple image.
I have seen this implementation:
The problem is that "initWithUIImage:" only accept UIImage.
So, how can i add an animated image here?
I have a compatibility problem with my iPhone project.
I am using an external iPhone API, and i have the following code to add a marker to a map:
Code:
RMMarker *newMarker;
UIImage *blueMarkerImage = [UIImage imageNamed:@"marker.png"];
newMarker = [[RMMarker alloc] initWithUIImage:blueMarkerImage anchorPoint:CGPointMake(0.5, 1.0)];
[mapView.contents.markerManager addMarker:newMarker AtLatLong:position];
[newMarker release];
Ok, this goes well, but i want to make a little change.
I want to add an animated marker to the map instead to add a simple image.
I have seen this implementation:
Code:
NSArray *myImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"myImage1.png"],
[UIImage imageNamed:@"myImage2.png"],
[UIImage imageNamed:@"myImage3.png"],
[UIImage imageNamed:@"myImage4.gif"],
nil];
UIImageView *myAnimatedView = [UIImageView alloc];
[myAnimatedView initWithFrame:[self bounds]];
myAnimatedView.animationImages = myImages;
myAnimatedView.animationDuration = 0.25; // seconds
myAnimatedView.animationRepeatCount = 0; // 0 = loops forever
[myAnimatedView startAnimating];
[self addSubview:myAnimatedView];
[myAnimatedView release];
The problem is that "initWithUIImage:" only accept UIImage.
So, how can i add an animated image here?