For an Android App I have created a custom overlay here, to display various items of game data on the map.
In general the overlay works fine and smoothly!
However there is one geometrical constellation which is not working as expected: Some objects within the overlay are not bound to geocoordinates, but to current user location. Now it happens, that Osmdroid is selectively redrawing the screen. When the screen is not focussed to user location, the user location bound stuff is not updated correctly: New stuff gets only drawn in some selective rectangle, old stuff isn't deleted outside that rectangle.
So far I failed to find a mechanism to communicate the required redraw of an overlay to the basic Osmdroid system? I.e. to invalidate the surroundings of the current user location? Any hint, clue or pointer?
答案 0 :(得分:0)
通过研究示例代码,我意识到他们确实认为向地图组件发出适当的无效调用以确保其自身的光学完整性是重叠的责任。
我仍在努力使用坐标进行正确的invalidate(left, top, right, buttom)
调用,因为我的更新实际上是在位置更改时发生的,而且我不清楚要失效的地图的屏幕像素是否需要相对于旧的位置或新的位置。这实际上是一个时间问题。
然而,获取CPU字节并发出postInvalidate()
只是看起来像预期的那样,目前还不清楚实际上失去了多少性能。