MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Trafficmaps

    Scheduled Pinned Locked Moved Development
    63 Posts 11 Posters 75.2k Views 12 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J Offline
      Jeff @wscheer
      last edited by

      @wscheer
      I found the mistake ;)

      In your maproute.js it says “map_key” not “api_key”.

      W 1 Reply Last reply Reply Quote 0
      • W Offline
        wscheer @Jeff
        last edited by

        @Jeff omg I’m such a doof. I’ll go back in my previous post and fix that.

        I’m so glad you got it working! I searched for months to find a map like this. I hope you enjoy it :)

        1 Reply Last reply Reply Quote 0
        • Z Offline
          Zoltan @wscheer
          last edited by Zoltan

          @wscheer
          My map is working and it shows the traffic. I however also have a map that don’t update and tried the Math.random() that you mentioned. The moment i add this to the line my map disappear completely which suggest i broke something. Do i interpret it wrong and can you please advise.

          Like this the code is working fine:

          wrapper.src = ‘http://dev.virtualearth.net/REST/v1/Imagery/Map/Road/-26.0460,27.9790/13?mapSize=500,420&ml=TrafficFlow&key=Asm#####AJWIWc5o8Onf4fhH8O3IEe2e8ZcHaLTBWhx4_BWTvOW4S5xj60MuUJf4’;

          Like this it isn’t working:

          wrapper.src = ‘http://dev.virtualearth.net/REST/v1/Imagery/Map/Road/-26.0460,27.9790/13?mapSize=500,420&pp=Math.random(),Math.random()&ml=TrafficFlow&key=Asm#####AJWIWc5o8Onf4fhH8O3IEe2e8ZcHaLTBWhx4_BWTvOW4S5xj60MuUJf4’;

          strawberry 3.141S 1 Reply Last reply Reply Quote 0
          • strawberry 3.141S Offline
            strawberry 3.141 Project Sponsor Module Developer @Zoltan
            last edited by

            @zoltan try the following:

            wrapper.src = 'http://dev.virtualearth.net/REST/v1/Imagery/Map/Road/-26.0460,27.9790/13?mapSize=500,420&pp=' + Math.random() + ',' + Math.random() + '&ml=TrafficFlow&key=Asm#####AJWIWc5o8Onf4fhH8O3IEe2e8ZcHaLTBWhx4_BWTvOW4S5xj60MuUJf4';
            

            This way you use the actual value and not Math.random() as a string.

            Please create a github issue if you need help, so I can keep track

            Z 1 Reply Last reply Reply Quote 0
            • Z Offline
              Zoltan @strawberry 3.141
              last edited by

              @strawberry-3-141 said in Trafficmaps:

              http://dev.

              Thanks very much. You are a legend. It’s finally working after me trying everything that I could think of.
              One of my biggest mistakes was I started with “http:// and ended with jf4”; which works fine without the Math.random. Clearly ‘ was the way to go and not “.

              strawberry 3.141S 1 Reply Last reply Reply Quote 0
              • strawberry 3.141S Offline
                strawberry 3.141 Project Sponsor Module Developer @Zoltan
                last edited by

                @zoltan ' and " makes no difference. Your problem was, that you didn’t seperate the function call Math.random() from the link as text. So you literally had Math.random() in your link.

                Please create a github issue if you need help, so I can keep track

                Z 1 Reply Last reply Reply Quote 0
                • Z Offline
                  Zoltan @strawberry 3.141
                  last edited by

                  @strawberry-3-141 Ok, then it was me chasing ghosts again lol. I really appreciate the help and advice, thanks.

                  1 Reply Last reply Reply Quote 0
                  • 1
                  • 2
                  • 3
                  • 4
                  • 5
                  • 6
                  • 7
                  • 1 / 7
                  • First post
                    Last post
                  Enjoying MagicMirror? Please consider a donation!
                  MagicMirror created by Michael Teeuw.
                  Forum managed by Sam, technical setup by Karsten.
                  This forum is using NodeBB as its core | Contributors
                  Contact | Privacy Policy