相关疑难解决方法(0)

如何在google map api中创建多个infowindow

我在地图中创建了3个标记,其数据来自json.但是当我点击一个标记并尝试打开信息窗口时,只有最后一个标记会正确响应..请帮助我....这个代码....

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">  
    <script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
    <script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
    <script src="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/src/markerclusterer.js" type="text/javascript"></script>
</head>
<body>
    <script>
        var json = [
            {
                "title": "Stockholm",
                "lat": 59.3,
                "lng": 18.1,
                "description": "Stockholm is the capital and the largest city of Sweden and constitutes the most populated urban area in Scandinavia with a population of 2.1 million in the metropolitan area (2010)"
            },
            {
                "title": "Oslo",
                "lat": 59.9,
                "lng": 10.8,
                "description": "Oslo is a municipality, and the capital and most populous …
Run Code Online (Sandbox Code Playgroud)

javascript infowindow google-maps-api-3 google-maps-markers

18
推荐指数
1
解决办法
2万
查看次数