GithubHelp home page GithubHelp logo

Comments (4)

afsuarez avatar afsuarez commented on August 15, 2024

Yes, there is the following method:

  • setThemePath(themePath, {onSuccess, onError}*)

That method works in both modes, and allows you to change only the renderer and not the whole map as ''setOfflineTileLayer'' does. The path you should provide is the absolute path to the render theme you want to use. What I can not tell you right now is if it will work properly or not, because all themes that i have used until now are the ones provided by mapsforge.

Tell me how it works when you try it.

from mapsforge-cordova-plugin.

robotnic avatar robotnic commented on August 15, 2024

I tried this, but it does not work

        mapsforge.cache.setThemePath("themes/Elevelo_Cycling.xml",{ onSuccess: function(result) {
                console.log("theme ok");
            },
            onError: function() {
                console.log("theme error")
            }
        });

No error, no success

from mapsforge-cordova-plugin.

afsuarez avatar afsuarez commented on August 15, 2024

Yeah, i've fixed it for the next version. Today i was busy so i couldnt upload it, but hopefully tomorrow it will be uploaded.

In the new version you will be able to place your custom themes under the renderthemes in assets folder and then for use it you just invoke it like this: mapsforge.cache.setThemePath("Elevelo_Cycling.xml"); and it should work. The other way is to place the theme anywhere in the device and provide the full path as usual (i.e: I used /mnt/sdcard/Elevelo_Cycling.xml when i had it in the sdcard and it worked).

About the callbacks, i made a huge mistake, because I was using the error callback only for parameter checks, and then i was logging any other exception through the android logger but i wasn't invoking the callback. It is also fixed now, so sorry for any inconveniences about that.

from mapsforge-cordova-plugin.

afsuarez avatar afsuarez commented on August 15, 2024

After last commit, it should work as I mentioned in my previous message.

from mapsforge-cordova-plugin.

Related Issues (14)

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.