简体   繁体   English

如何将位智事件标记添加到带有流量的Google Maps javascript API生成的地图中?

[英]How do I add waze incident markers to a google maps javascript API-generated map with traffic?

I created a map showing traffic with the google maps javascript API using the TrafficLayer object. 我使用TrafficLayer对象通过google maps javascript API创建了一个显示交通的地图。 A googlmaps.com-generated map of the same area displays waze incident icons, but they do not show up on my map. 由googlmaps.com生成的同一区域的地图显示位智偶发图标,但它们未显示在我的地图上。 Is there a way to include the incident markers when generating the traffic map? 生成交通地图时,是否可以包含事件标记? Here is my code: 这是我的代码:

<script>
  var map;
  function initMap() {
    map = new google.maps.Map(document.getElementById('map'), {
      center: {lat: 37.794086, lng: -122.400445},
      zoom: 12
    });
    var trafficLayer = new google.maps.TrafficLayer();
    trafficLayer.setMap(map);
  }

</script>
<script src="https://maps.googleapis.com/maps/api/js?key=xxxxxxxx&callback=initMap"
async defer></script>

At present it is impossible to add layer with incidents / constructions markers on the google traffic map. 目前,无法在Google交通地图上添加带有事件/构造标记的图层。

Discussion on this topic takes place since 2010 and is available on the site: https://code.google.com/p/gmaps-api-issues/issues/detail?id=2411 该主题的讨论自2010年以来进行,可以在以下网站上进行讨论: https : //code.google.com/p/gmaps-api-issues/issues/detail?id=2411

It remains to wait for the response of the google developers. 它仍然在等待谷歌开发人员的回应。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Google Maps API中添加多个叠加标记 - How do I add multiple overlay markers in google maps api 从Internet Explorer打印API生成的Google地图 - Printing API-Generated Google Maps from Internet Explorer 地图标记未显示(Javascript Google Maps API) - Map Markers do not appear (Javascript Google Maps API) 如何在 NextJS+React 中使用 api 生成的内容创建用户可自定义的动态 url? - How do I create user-customizable dynamic url with api-generated content in NextJS+React? 如何使用Google Maps Javascript API在多边形顶部添加标记? - How to add markers on top of a polygon using Google Maps Javascript API? 如何使用 Google Maps API 自定义不同的标记 CSS? - How do I customize different markers CSS with Google Maps API? 如何以编程方式在Google地图中添加多个标记? - How do I add multiple markers in Google Maps programmatically? 如何使标记可拖动,标记和删除? 使用Google Maps JavaScript API - How do I make markers draggable, labeled, and deletable? with Google maps javascript API 如何向多个标记添加相同的事件侦听器,然后区分 Google Maps API v3 中侦听器中的标记? - How do I add same event listener to many markers and then differentiate between the markers in the listeners in Google Maps API v3? 如何将标记添加到带有延迟的Google地图 - How do I add the markers to the google maps wth delays
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM