Comments (6)
Tried the following:
mapView = new MapView(getActivity(), 256, new DefaultResourceProxyImpl(getActivity()), new CustomTileProvider(getActivity()));
public class CustomTileProvider extends MapTileProviderBasic {
public CustomTileProvider(Context pContext) {
this(new SimpleRegisterReceiver(pContext), new NetworkAvailabliltyCheck(pContext),
TileSourceFactory.DEFAULT_TILE_SOURCE);
}
public CustomTileProvider(IRegisterReceiver pRegisterReceiver, INetworkAvailablityCheck aNetworkAvailablityCheck,
ITileSource pTileSource) {
super(pRegisterReceiver, aNetworkAvailablityCheck, pTileSource);
mTileProviderList.set(0, new CustomMapTileFilesystemProvider(pRegisterReceiver, pTileSource));
}
@Override
public void setTileSource(ITileSource aTileSource) {
super.setTileSource(aTileSource);
}
}
public class CustomMapTileFilesystemProvider extends MapTileFilesystemProvider {
public CustomMapTileFilesystemProvider(IRegisterReceiver pRegisterReceiver, ITileSource pTileSource) {
super(pRegisterReceiver, pTileSource, OpenStreetMapTileProviderConstants.ONE_YEAR * 10);
}
}
I've replaced Filesystemprovider with my own, Also subclassed MapTileProviderBasic and fed it to mapView.
From my Offline tile source I see that tiles are loaded. Tiles are on filesystem, are correct bitmaps but mapView displays zero zoom, default map source.
Why is that?
from osmdroid.
Okay. Issue is eluded.
Fix. Created constructors for every situation, subclassed MapTileProviderArray.
For notice: I would suggest to allow changing to mMaximumCachedFileAge of MapTileFilesystemProvider;
Or add getFileAge to ITileSource interface.
from osmdroid.
I think this is similar to issue 203 in the old repository. There was never enough interest to fix it, but suggestions and pull requests are always welcome.
from osmdroid.
I'm very surprised that no one encountered a huge slowdown once 7 day period expires.
It is real pain.
Most of the problem also comes from gesture listener.
It catches all events from ViewPager, even on other pages. And by doing so, it forces MapTileFilesystemProvider to provide tiles. MapView is not even visible, but GC occurs and CPU/Mem is being used like hell.
My nexus4 was generating approx 1k getDrawable requests / second. And it really slows down the program.
from osmdroid.
@Anfet think you an whip up an example to reproduce this?
from osmdroid.
@Anfet we can now adjust or override the expiration time on donwloaded tiles. See #481 and the Configuration class
from osmdroid.
Related Issues (20)
- java.lang.NullPointerException: Attempt to invoke interface method 'boolean org.osmdroid.views.overlay.OverlayManager.add(java.lang.Object)' on a null object reference HOT 2
- IP tracker and ad in wiki HOT 3
- open street map don't display
- TileSourceFactory US aviation maps don't load any more
- Writing and reading data from the real time database for Osmdroid HOT 1
- delete markers
- Animating the movement of a cursor along a polyline with two colors codes: the completed part and the part to do ? HOT 1
- displaying the route and deleting the marker zi database HOT 1
- BingMapTileSource always crash HOT 2
- Some issues when initializing mapsforge
- Zoom changes ignored if performed while an animation is underway
- Issue: GroundOverlay bad placement when invalidate map
- GroundOverlay - Draw White Image on Android 11
- Map View throwing Error as Too many receivers, total of 1000, registered HOT 1
- CPU usage continually between 30 and 40% when on a closed network HOT 2
- Proposal for new location indicator (puck) HOT 1
- Question: Timeout handling in TileDownloader class HOT 2
- Crash when activity closed: MapView
- Confusing logic in CacheManager function cleanAreaAsync
- load 4326 coordinate system wmts map service
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from osmdroid.