小编sja*_*itt的帖子

使用Google Maps API为InfoWindow设置样式

我目前正在使用谷歌地图,现在一切正常.但我想改变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)

javascript google-maps

21
推荐指数
3
解决办法
6万
查看次数

标签 统计

google-maps ×1

javascript ×1