Giter Site home page Giter Site logo

Comments (6)

Anfet avatar Anfet commented on June 26, 2024

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.

Anfet avatar Anfet commented on June 26, 2024

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.

neilboyd avatar neilboyd commented on June 26, 2024

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.

Anfet avatar Anfet commented on June 26, 2024

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.

spyhunter99 avatar spyhunter99 commented on June 26, 2024

@Anfet think you an whip up an example to reproduce this?

from osmdroid.

spyhunter99 avatar spyhunter99 commented on June 26, 2024

@Anfet we can now adjust or override the expiration time on donwloaded tiles. See #481 and the Configuration class

from osmdroid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.