I'm interested i开发者_如何转开发n a way to implement moving objects in a Google maps application. So far, I've done so by creating new OverlayItems and discarding the old ones, than doing populate to update the map. This, however, seems impractical and inefficient to me.
The problem I encounter is that the latitude and longitude attributes of GeoPoint
are final, so I cannot change them once the GeoPoint
is created.
Any suggestions on how to solve (or work around) this? Why are these attributes final?
Creating and destroying objects in ItemizedOverlay is expensive, an alternative would be to extend the Overlay class and perform your own draw() where you don't need to use GeoPoint and thus can update the lat/lon values yourself.
BTW: you do perform populate() only once for each set, and not for each item in the set?
精彩评论