【问题标题】:Show Address On Google Maps Label And Add Business Name On Maps在 Google 地图标签上显示地址并在地图上添加商家名称
【发布时间】:2020-01-13 15:46:44
【问题描述】:

我对 Google MAPs API 非常陌生。我正在尝试为我的业务创建一个复制下图的地图。我也有下面的代码,其中我有纬度和经度坐标,以及基于这些坐标启动的标记。我如何使用 javascript 显示类似的内容,页面加载位置

  1. 如下标签显示公司名称和地址,还有一个可点击的链接(方向箭头,图中未显示)
  2. 自定义 html 在地图上的标记旁边显示公司名称

?

 <div id="map"></div>
 <script>
    function initMap() {
        // The location of UluruBBS
        var uluru = { lat: 33.931, lng:  -84.337732 };
        // The map, centered at Uluru
        var map = new google.maps.Map(
        document.getElementById('map'), { zoom: 15, center: uluru });
        // The marker, positioned at Uluru
        var marker = new google.maps.Marker({ position: uluru, map: map });
     }

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

【问题讨论】:

标签: javascript google-maps google-maps-api-2


【解决方案1】:

通过 google maps api docs 找到另一种选择 - 使用 Google Maps Embedded API。请参阅文档以获取更多信息。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-07-22
    • 1970-01-01
    • 2012-01-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-10-21
    相关资源
    最近更新 更多