谷歌地图Api相当新的.我有一系列数据,我想循环并绘制在地图上.看起来相当简单,但我发现的所有多标记教程都非常复杂.
让我们使用谷歌网站上的数据数据作为例子:
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]
];
Run Code Online (Sandbox Code Playgroud)
我只是想绘制所有这些点,并在单击时弹出一个infoWindow以显示名称.
我一直试图设计我的谷歌地图InfoWindow,但文档在这个主题上非常有限.你怎么样的风格InfoWindow?
地图标记的默认Google Maps InfoWindow非常圆.如何创建带方角的自定义InfoWindow?
我们的一个生产页面停止正常工作.追溯到其中一个依赖项不再存在的事实:
http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/src/infobox.js
此URL用于作为网页基础的大多数示例代码中.
这可能很容易解决,但快速谷歌显示没有人注意到这一点,我认为它发生在最后一小时,只是想把信息放在那里以防人们恐慌.
我目前正在使用谷歌地图,现在一切正常.但我想改变InfoWindow的样式.我一直在研究,但还没有找到任何有用的东西来帮助我理解InfoWindow(甚至不是API文档.)
所以; 如何更改地图中InfoWindow框的颜色,背景,边框等样式?
提前致谢.
继承我的代码:
<!DOCTYPE html>
<head>
<title>Google Maps Example</title>
<script src='http://code.jquery.com/jquery.min.js' type='text/javascript'></script>
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0; padding: 0 font-family: Helvetica;}
#map_canvas { height: 100% }
.InfoWindow {
background: #000;
}
</style>
</head>
<body>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
var infowindow = null;
$(document).ready(function () { initialize(); });
function initialize() {
var centerMap = new google.maps.LatLng(59.9149, 10.72974);
var myOptions = {
zoom: 14,
center: centerMap,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map …Run Code Online (Sandbox Code Playgroud)