I had been removing/adding the annotations initially, but it causes the 
annotations to "blink" since there is a slight delay between removing an 
annotation and adding it back. I need it to be a smooth instant change for my 
application, such that you can make it appear to drag across the map like it 
can using setCoordinate in xCode/Objective-C. I have tried many forms of 
setNeedsDisplay, but none redraw the annotation on the map outside of the zoom 
command. Is there an event/method/flag that tells the ViewController the 
annotation has changed besides removing it and adding a new one? The adding and 
removing also appears to be the most processor heavy, which will slow the 
application down when I end up moving hundreds of annotations at once.

~Chris

Sent from my iPhone

On Sep 15, 2011, at 12:19 PM, "Jeff Stedfast" <[email protected]> wrote:

> Hi Chris,
> 
> I've taken a look at this and the problem is that once an
> MKAnnotationView is created for your MKAnnotation subclass, you are
> doing nothing to signal to the MKMapView that anything has changed.
> Setting a new coordinate on your MKAnnotation subclass has no way of
> notifying the parent MKMapView that it needs to redraw.
> 
> Here's what I suggest you do:
> 
> In your MKAnnotation subclass (MyAnnotation), add an event that gets
> emitted when you set/change the coordinate. Then, have your
> ViewController that owns the MKMapView listen for those events on each
> of your MyAnnotations. When the event is emitted, have your
> ViewController remove the annotation and re-add it.
> 
> I tested this and it works.
> 
> Jeff
> 
> On Thu, Sep 15, 2011 at 9:26 AM, Chris Hamblett <[email protected]> 
> wrote:
>> I've added self-contained sample code to Bug 724
>> bug 724
>> Any updates on a binding that sets off the MapView KVO flag? Is this fixed
>> on a new development build?
>> ~Chris
>> _______________________________________________
>> MonoTouch mailing list
>> [email protected]
>> http://lists.ximian.com/mailman/listinfo/monotouch
>> 
>> 
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to