使用gmaps.js 我怎么能遍历(HTML)之类的东西:
<h1 id="location">Phuket</h1>
<div class="blist">
<h3>Some hotel name</h3>
<p>Adress 1</p>
</div>
<div class="blist">
<h3>Another hotel name</h3>
<p>Adress 2</p>
</div>
<div class="blist">
<h3>Some name</h3>
<p>Adress 3</p>
</div>
<div class="blist">
<h3>Some other name</h3>
<p>Adress 4</p>
</div>
..和:
- 地理代码 + 向地图添加标记
<h3>
在每个标记弹出窗口中添加名称- 将链接添加到与它对应的每个弹出窗口(如锚链接)
- 为所有 GEO 代码锁定使用并添加#location,因为没有该上下文,每个名称都不会说太多
我必须使用循环,但即使搜索了几个小时也没有找到任何好的例子。有人会认为这将是一种常用的.. :)