One caveat: while MVCArrayBinder correctly forwards get/set calls to
its MVCArray, it does not forward events from the MVCArray to its
observers. This means that if you directly call
polyline.getPath().setAt(0, ...), the 0th Marker does not know it
needs to repaint.
MVCArrayBinder could support this too, like:
function MVCArrayBinder(mvcArray){
var me = this;
me.array_ = mvcArray;
function forwardSetAt(index) {
google.maps.event.trigger(me, index + '_changed');
}
google.maps.event.addListener(mvcArray, 'set_at', forwardSetAt);
}
Note: I haven't checked that this code works, so there might be a bug.
But you get the idea.
Ben
> --
> You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
> To post to this group, send email to google-map...@googlegroups.com.
> To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
>
Yes, that line has no effect. The subsequent marker.bindTo(...) clobbers it.
> title: '#' + len,
> map: map,
> draggable : true
> });
> marker.bindTo('position', poly.binder, (len-1).toString());
>
> ...
>
Oops, I've updated the reference. The reference change should go live
in the next week or so. Thanks!