Giter Site home page Giter Site logo

Comments (3)

jm-cook avatar jm-cook commented on July 4, 2024

FYI I am currently having to add custom tile sources by using the built in ResourceProxy but without having to change the actual osmdroid source. It means I have to chose a built in resource string and override it, which I think is very messy:

   final ITileSource sj_tileSource = new XYTileSource("Nautical Raster Norway", ResourceProxy.string.fiets_nl, 0, 17, 256, ".jpg", 
            new String[] {"http://..."});
    TileSourceFactory.addTileSource(sj_tileSource);

    final ITileSource no_tileSource = new XYTileSource("Maps Norway", ResourceProxy.string.base_nl, 0, 17, 256, ".jpg", 
            new String[] {"http://..."});
    TileSourceFactory.addTileSource(no_tileSource);

    final ITileSource topo_tileSource = new XYTileSource("Topo Raster Norway", ResourceProxy.string.roads_nl, 0, 17, 256, ".jpg", 
            new String[] {"http://..."});
    TileSourceFactory.addTileSource(topo_tileSource);

And then in my res/strings/tile_sources.xml:

... Nautical Raster Norway Maps Norway Topo Raster Norway ... "

from osmdroid.

spyhunter99 avatar spyhunter99 commented on July 4, 2024

It looks like the ResourceProxy strings actually determine what directory downloaded tiles are stored in within /sdcard/osmdroid/tiles. I agree, this should be adjustable for anyone bringing in a custom tile source

from osmdroid.

spyhunter99 avatar spyhunter99 commented on July 4, 2024

Correction, resource proxy "string" is not actually used for ITileSources. I just removed the reference to it in master and it will be gone in the next release. What determines the download folder? the "name" that is set for the map provider.

More over, I just added a few examples to both the wiki and the source code for USGS map sources. Fair warning, the example source doesn't use the standard slippy map format ZXY, but rather ZYX. See https://github.com/osmdroid/osmdroid/wiki/How-to-use-the-osmdroid-library#tile-providers-vs-tile-source

To reiterate, the ResourceProxy.string for map source is not used! Just pick one and go for it. Feel free to reopen if there are more questions or open a new ticket.

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.