mobile-sdk
mobile-sdk copied to clipboard
Refresh Datasource without Remove and Add the layer
i am using a TileDataSource on a layer RasterTileLayer.
TileDataSource windTileDataSource = new GribTilesMapLayer(projections, MainActivity.this, gribFileTileSource, windselectedtype);
RasterTileLayer windlayer = new RasterTileLayer(windTileDataSource);
mapView.getLayers().add(windlayer);
i load new data to the windTileDataSource and do i need to remove the windlayer everytime and add it again to the mapview? i am doing like this
mapView.getLayers().remove(windlayer);
windlayer = new RasterTileLayer(windTileDataSource);
mapView.getLayers().add(windlayer);
Is there anyway to refresh the datasource other than this method? to acheive a smooth data change on the mapview.
Yes, there is a method called notifyTilesChanged
in TileDataSource
class.