javascript - 在 Google Maps API 中创建图像按钮
问题描述
我想使用 Google Maps JavaScript API 在我的 Google Maps 中插入一个徽标,该徽标悬停在地图上并链接到网站。我已经知道如何创建按钮,但不知道如何将图像插入这些按钮。我该怎么做?
解决方案
您可以使用绝对位置属性和 z-index 属性使元素出现在地图上。请参阅链接的 jsFiddle
#map_div{
z-index : 0;
}
img{
position : absolute;
display : inline;
top : 100px;
left : 100px;
z-index : 1;
}
见 jsFiddle http://jsfiddle.net/4mtyu/8774/
推荐阅读
- c++ - 如何使用 opencv 转到视频中的特定时间?
- php - 更新 SQL 数据库列会更新具有相同数据的所有行
- java - 我可以完全用一种跨平台语言开发一个多平台项目-windows/Android-吗?
- python - 为什么 all() 为空的可迭代对象返回 True?
- html - Github Pages 在一个站点上显示嵌入的 YouTube 视频,但在另一个站点上不显示,有解决办法吗?
- r - 将列表保存为 csv
- python - request.form.get('kEy') 中的键的情况如何在所有变体中处理?
- node.js - 使用 ExpressJs 时应该在哪里定义 DocumentClient?
- javascript - 根据索引的嵌套数组的总和
- r - R过滤器基于data.table中的多个键,一个键不受限制