open street map stopped working

Posted on
  • It's pretty odd, I have been developing some apps for myself and playing around, I have some widgets and an app. Today I wanted to try out the open street maps app again, which already worked a couple weeks ago and its just a black screen, even though I have some maps loaded and if I click the button, nothing happens.
    This is what I get on the console:

    Uncaught Error: Function "draw" not found!
     at line 38 col 19 in openstmap.app.js
      const count = m.draw();
                      ^
    in function "redraw" called from line 240 col 10 in openstmap.app.js
      redraw();
             ^
    in function "showMap" called from line 271 col 9 in openstmap.app.js
    showMap();
    

    So I kind of assume that the app has no access to the module "require("openstmap")". Would love some help with this since I don't understand really why this is happening, thanks

  • Funny, both your problems are centered about a variable named 'm' in completely different contexts. Can you please add the versions numbers of the firmware and the apps?

    Do you have the "minify" option enabled in the app loader?
    Also I would say downloading the files boot0, openstmap.app.js and openstmap from the watch and attaching them here could help.

  • Funny, both your problems are centered about a variable named 'm'

    Good spot! @etznabchen maybe you could try removing the widgets you'd made yourself and see if that helps?

    There's a really good chance that maybe in your widget code (which can load alongside apps) you do something like m = ... - maybe you wanted a local variable and forgot to use var m = ..., and so it's overwritten the m variable maps was using

    It'd be worth checking your firmware version - the last week or so, we went through a few changes in the 'cutting edge' builds that broke some things (specifically loading saved JSON which openstreetmap does) - so if you updsated to cutting edge in the last few weeks I'd definitely update again.

  • hmm i searched through all my bangle projects and there was one instance inside a watchface I did where i was defining "m" but inside a function scope:

    const extractTime = function (d) {
        var h = d.getHours(),
          m = d.getMinutes();
        return ("0" + h).substr(-2) + ":" + ("0" + m).substr(-2);
      };
    

    which shouldn't make a difference really, I still gave it a different name and it made no difference.
    I did play around with different *.boot.js files but erased all of them and like I said in the other post, when the step counting failed, I did a factory reset and it still came the same issue :(

    @user140377: So my firmware is "2v19". My apps are:

    widlock (0.08), widalarm (0.01), boot (0.59), widbt (0.09), notify (0.13), activityreminder (0.11), altimeter (0.03), compass (0.09), ltherm (0.02), mylocation (0.10), astrocalc (0.06), gpsinfo (0.12), hrm (0.11), messageicons (0.05), widmessages (0.05), messages (0.62), android (0.32), files (0.08), calendar (0.16), ptlaunch (0.15), sleeplog (0.15), sleepphasealarm (0.16), dtlaunch (0.24), stopwatch (0.05), waveclk (0.03), dragboard (0.09), noteify (0.03), smpltmr (0.08), torch (0.11), widmp (0.08), magnav (0.06), widgps (0.09), setting (0.68), weather (0.26), messagegui (0.75), recorder (0.35), waypoints (0.03), health (0.27), gpsnav (0.08), qrcode (0.06), accellog (0.06), sched (0.22), alarm (0.45), chess (0.02), widram (0.03), nerdclock (0.1), sdclock (0.1), pomoplus (0.06), lucid (0.1), airhistory (0.1), openstmap (0.26)

    Out of them "airhistory", "nerdclock", "sdclock" and "lucid" are mine and not published, but none have a "m" variable defined. I don´t have the minified option on and never had. I will attach the files you proposed. I did found in the boot0 file in line 14 a function definition with "m"

    function m(){var a=require("Storage").readJSON("health.js­on",1)
    

    not sure if its supposed to be there.

    Thanks both of you for your quick reply and help:)


    3 Attachments

  • ok, did you upload a map to the watch from the webinterface? If not you can upload one from the page under "download icon". Also check "read more" link of openstmap.

    Because this is the error I get when I launch openstmap if no map is installed. Seems like we have not tested that for some time.

    @Gordon
    Seems like require("openstmap") does not forward any exception that the openstmap library internally throws?

    Anyway I have opened PR #3118 to display a message if no map is installed.

  • @user140377 I actually didn't had a map when I uploaded these files, but yesterday when trying to make it work I had a map, and uploaded two at some point, was erasing and uploading cause thought at the beginning there was a problem with the maps.

    Weirdly enough I deleted the widmp widget like you pointed out in the other issue, and now the open street map works. I even tried installing it again and open street map immediately stops working and when erasing it works again, so it's definitely an issue with that widget. Cool, Open street map issue solved thanks a lot

  • Glad that solved it! Thanks for tracking this down @user140377

    And sorry for blaming your code @etznabchen - it's just if someone's been writing code and then something on the watch breaks after, that's usually the first port of call ;)

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

open street map stopped working

Posted by Avatar for etznabchen @etznabchen

Actions