I'm trying to get live traffic show up on an embedded map on my SharePoint Site. The map is showing but no traffic. I tried a HTML file and the same, no traffic data.
I have a basic free key but I'm under the impression that that should not matter.
<iframe width="700" height="500"
src="https://www.bing.com/maps/embed?
h=500&w=700&cp=52.52954~-2.037698&lvl=15&typ=d&sty=r&trfc=1&key=(Secret)"
frameborder="0" scrolling="no">
</iframe>
I expected the traffic layer on the map. I tried making a HTML file and still no layer
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bing Maps Test</title>
</head>
<body>
<h1>Bing Maps Embed Test</h1>
<iframe width="700" height="500"
src="https://www.bing.com/maps/embed? h=500&w=700&cp=52.52954~-2.037698&lvl=15&typ=d&sty=r&trfc=1&key=YOUR_API_KEY"
frameborder="0" scrolling="no">
</iframe>
</body>
I think you found some old documentation or something as the
https://www.bing.com/maps/embedhasn't been a supported part of the Bing Maps platform for a long time. It used to be a very limited feature of the Bing Maps consumer site but had no connection to the developer APIs (didn't use keys either). It purposely does not provide traffic so as not to compete with the developer API's. The embedded maps were only meant for showing a single location on a map, primarily for the companies to put on their website to show where their main location is.The main way to embed a map using the developer API's is to use the configuration driven map framework: https://learn.microsoft.com/en-us/bingmaps/v8-web-control/map-control-concepts/configuration-driven-maps-framework/ This doesn't have an option to turn traffic on by default, but you can have the traffic buttons appear on the map. But it requires you to pass in a link to a JSON file with the configuration.
You can also create URL's to the Bing Maps website as documented here: https://learn.microsoft.com/en-us/bingmaps/articles/create-a-custom-map-url
Note that Sharepoint has map capabilities built in: https://learn.microsoft.com/en-us/sharepoint/dev/general-development/integrating-location-and-map-functionality-in-sharepoint