MapController calls do not work inside of event handler?
I'm trying to move the map with a 3-finger gesture, rather than one. If I do a scrollBy() or setMapCenter() in my main activity, things seem to work as expected. Howevver, if I make these calls inside of my ACTION_MOVE, for example, they seem to have no effect. Posting doesn't really work well either.
There's another issue - the event.getX/Y() are floats, and the mapController.scrollBy() takes ints - as real-time dragging at normal speeds seems to require the sub-int resolution, making real-time updading hard to do.
And it seems really odd which methods are on the mapView and which on the mapController.
UPDATE : scrollBy() when executed in the event handler will move any overlays, but not the underlying map
So bas开发者_C百科icially what I want to be able "return true" form ACTION_MOVE and so have my code rather than the base code handle map tracking via user gesture
You may have to post a slight delay,
Something like:
Handler handler = new Handler();
// Method Block
{
handler.postDelayed(new Runnable()
{
// Code etc
}, 500);
}
// End code block
When ever I play with map stuff, allot of the controller actions have to have be fired after the map has stopped being touched.. (I know that sounds like a pain).
I have written quite a bit of map library stuff (Android Map Library) and know what you mean where nothing seems to happen. Or the map just seems to ignore inputs, the only way I have managed it was with delayed controller commands.
Let me know your thoughts and I might be able to help a bit more.
Cheers, Chris
精彩评论