Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refresh Datasource without Remove and Add the layer #526

Open
binu8051 opened this issue Dec 17, 2022 · 1 comment
Open

Refresh Datasource without Remove and Add the layer #526

binu8051 opened this issue Dec 17, 2022 · 1 comment

Comments

@binu8051
Copy link

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.

@mtehver
Copy link
Contributor

mtehver commented Dec 22, 2022

Yes, there is a method called notifyTilesChanged in TileDataSource class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants