Google Maps JS API v3-简单多个标记示例 - Google Maps JS API v3 - Simple Multiple Marker Example

05/07 12:04
阅读数 13

问题:

Fairly new to the Google Maps Api. 对Google Maps Api来说还很新。 I've got an array of data that I want to cycle through and plot on a map. 我有一个要循环浏览并在地图上绘制的数据数组。 Seems fairly simple, but all the multi-marker tutorials I have found are quite complex. 看起来很简单,但是我发现的所有多标记教程都很复杂。

Let's use the data array from google's site for an example: 让我们以来自Google网站的数据数组为例:

var locations = [
  ['Bondi Beach', -33.890542, 151.274856, 4],
  ['Coogee Beach', -33.923036, 151.259052, 5],
  ['Cronulla Beach', -34.028249, 151.157507, 3],
  ['Manly Beach', -33.80010128657071, 151.28747820854187, 2],
  ['Maroubra Beach', -33.950198, 151.259302, 1]
];

I simply want to plot all of these points and have an infoWindow pop up when clicked to display the name. 我只想绘制所有这些点,并在单击以显示名称时弹出一个infoWindow。


解决方案:

参考一: https://stackoom.com/question/CpnQ/Google-Maps-JS-API-v-简单多个标记示例
参考二: https://oldbug.net/q/CpnQ/Google-Maps-JS-API-v3-Simple-Multiple-Marker-Example
展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
在线直播报名
返回顶部
顶部