0

MarkerClusterer に問題があります。クラスターを取得できません。すべてのマーカーはまだ独自のものです。FireBug は役に立ちません。http://gmaps-utility-library-dev.googlecode.com/svn/tags/markerclusterer/1.0/例とドキュメントは役に立ちません..

誰かが私を助けてくれることを願っています!

<!DOCTYPE html>
<html>
<head>
    </script>
      <style type="text/css">
      html { height: 100% }
      body { height: 100%; margin: 0; padding: 0 }
      #map-canvas { height: 100% }
    </style>
    <script type="text/javascript" src="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/src/data.json"></script>
    <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3&sensor=false"></script>
        <script type="text/javascript">
      var script = '<script type="text/javascript" src="../src/markerclusterer';
      if (document.location.search.indexOf('compiled') !== -1) {
        script += '_compiled';
      }
      script += '.js"><' + '/script>';
      document.write(script);
    </script>

<script type='text/javascript'> 

function initialize() {

var mapOptions = {
center: new google.maps.LatLng(0,0), 
zoom: 1, 
mapTypeId: google.maps.MapTypeId.ROADMAP};

var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
var markers = [];
var mcOptions = {gridSize: 50, maxZoom: 15};

var myLatlng_1 = new google.maps.LatLng(48.047111,11.4471008);
var marker_1 = new google.maps.Marker({ position: myLatlng_1,map: map, title:'Twitter - click to see content'});

var contentstring_1 = 'asdf';

var infowindow_1 = new google.maps.InfoWindow({content: contentstring_1});

google.maps.event.addListener(marker_1, 'click', function(){ infowindow_1.open(map,marker_1);});

markers.push(marker_1, false);


            (...)

var myLatlng_5 = new google.maps.LatLng(48.001163813597,11.28131322089);
var marker_5 = new google.maps.Marker({ position: myLatlng_5,map: map, title:'Twitter - click to see content'});

var contentstring_5 = 'asdf';

var infowindow_5 = new google.maps.InfoWindow({content: contentstring_5});

google.maps.event.addListener(marker_5, 'click', function(){ infowindow_5.open(map,marker_5);});

markers.push(marker_5, false);
var markerCluster = new MarkerClusterer(map, markers, mcOptions);

}

google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body>

<div id="map-canvas" style="border:1; border-color: black; position:absolute; width:800px; height:450px;"></div>  

</body>
</html>
4

1 に答える 1

0

終わり。"markers.push(marker_1);" 「偽」なしで

于 2013-07-24T06:28:32.197 に答える