我经常移动一个点,问题是为了将点保持在地图内并且在移动时不会丢失,我必须重新加载地图。你怎么能避免给它充电,因为运动每两秒发生一次,地图每两秒重新加载一次太不舒服了。
这里的代码:
cont++;
final long EXECUTION_TIME = 2000;
final Handler handler = new Handler();
handler.postDelayed(new Runnable() {
int aux = 0;
@Override
public void run() {
GraphicsOverlay graphicsOverlay1 = new GraphicsOverlay();
Graphic g1 = new Graphic(getLatLong(aux), attributes, sms);
graphicsOverlay1.getGraphics().add(g1);
mMap.getGraphicsOverlays().add(graphicsOverlay1);
map = new ArcGISMap(basemapType, getLatLong(aux).getY(), getLatLong(aux).getX(), 17);
mMap.setMap(map); //Here is where the map is reloaded, some other way to avoid this burden
handler.postDelayed(this, EXECUTION_TIME);
}
)};