How To: Map tile with real-time traffic

It is really cool to show the map tile with real-time traffic on the dashboard. This is something I wanted to have for a while. And I was able to get this setup in 2 minutes following the steps below.

Steps:

  1. Get a MS Bing map API from here
    https://www.bingmapsportal.com/Application

    (Why not Google Map? Because Google map static image api doesn’t allow traffic layer.:frowning: )

  2. Go to the link below and setup your map parameter using the API Key from Step 1
    https://staticmapmaker.com/bing/

    (Don’t forget to check the “Show traffic” box.)

  3. Copy the generated URL

  4. Add a Media Tile in SharpTools dashboard, and paste the URL we got from Step 3 in the “Media URL” field, set the Refresh Interval to 300 seconds, and hit “Create”

(Since MS Bing API Key allows free 125k API calls per year, so you may not want to set the refresh interval to be less than 5 minutes.See here for API usage limit details.)

Here you go. Very cool map tile with real-time traffic right here!

6 Likes

I received an email from bing maps that navteqna and navteqeu datasources are being shutdown. Does this mean this tile will stop working or does it not rely on the data sources?

Hi Derek,
From the URL generated in the Bing Static Map Maker mentioned in the original post, it doesn’t seem to use navteqna nor navteqeu, so I don’t think this real-time traffic image tile will be impacted. :slight_smile:

Hi James, thanks for checking. I really like this feature and would hate to lose it.

Hi James,
The map looks great !! thanks.
It will be even greater if there was a way to see pins at my family members locations. Is that possible ?
Your help is really appreciated… Thanks again :pray:

@Shai_Dotan, that is actually a pretty cool idea. But unfortunately, based on my quick research, shared location is not available through Google Map API at this moment, and I don’t think Bing even has the location sharing feature though. I will take another look later if this can be achieved in different way then.

2 Likes

I followed your steps exactly, but the site is just giving me a broken image link. Is there something wrong with staticmapmaker, or my bing API?

Hi @steinauf, can you take a screenshot of the Bing static map link generator page and the link you created and send them to me over message so you don’t expose your API key. I can take a look for you when I have a chance.

1 Like

Figured it out. When I copied the coordinates from bing maps, it included a space after the comma that it didn’t like. Deleted space, map shows up!

2 Likes

Glad to hear you got it figured out and thanks for sharing.

1 Like

@Tedis_Agolli has shared another traffic related solution using Google API to get estimated commute time that can be displayed as a image in the dashboard. See below for details, and that’s pretty cool.

2 Likes

Has anyone tried using the pushpin URL parameters to locate people on the map dynamically based on something like Life360 lat/lon coordinates?

This might help some

1 Like

@James Man this is great, I’ve been wanting something like this for a while so thanks for sharing!! I will get this setup TONIGHT.

I do have a follow up. This can only be used to show a traffic map in a general area and not on a direct route (say morning work commute) correct? Reason I ask is I have been curious about passing “commute time” to smartthings to build automations on but I am not sure this would be able to do that.

Either way, this is awesome information.

@James scratch that follow up question I had - I just came back and read the entire thread and saw the alternate google solution. I will look at that first.