• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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 67.9k 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.
  • W Offline
    wscheer @Jeff
    last edited by Nov 27, 2016, 9:44 PM

    @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 Nov 6, 2018, 4:00 PM Nov 6, 2018, 3:58 PM

      @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’;

      S 1 Reply Last reply Feb 9, 2019, 7:01 AM Reply Quote 0
      • S Offline
        strawberry 3.141 Project Sponsor Module Developer @Zoltan
        last edited by Feb 9, 2019, 7:01 AM

        @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 Feb 11, 2019, 5:28 AM Reply Quote 0
        • Z Offline
          Zoltan @strawberry 3.141
          last edited by Feb 11, 2019, 5:28 AM

          @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 “.

          S 1 Reply Last reply Feb 12, 2019, 8:45 PM Reply Quote 0
          • S Offline
            strawberry 3.141 Project Sponsor Module Developer @Zoltan
            last edited by Feb 12, 2019, 8:45 PM

            @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 Feb 15, 2019, 4:55 PM Reply Quote 0
            • Z Offline
              Zoltan @strawberry 3.141
              last edited by Feb 15, 2019, 4:55 PM

              @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
              • 7 / 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