-1

以前に寄せられた私のものと同様の質問からのすべての提案を確認し、オーバーレイに関する Google マップ API 開発者情報ページをたどりましたが、回答が役に立ちませんでした。マーカーの色を単に変更しようとしています。標準から緑ですが、コードにfillColorなどを追加しようとするたびに、マーカーが表示されないか、マップがまったく表示されません。誰が私が間違っているのか分かりますか?

    function createMap() {
        // map options
        var options = {
            zoom: 4,
            center: new google.maps.LatLng(39.909736, -98.522109), // centered US
            mapTypeId: google.maps.MapTypeId.ROADMAP,
            mapTypeControl: false
        };

        // init map
        map = new google.maps.Map(document.getElementById('map_canvas'), options);
    }

    function addMarker() {
    fetchNewQuote();
    var indext;
    for (indext = 0; indext <array.length; ++indext) {
        splitarr = array[indext].split(":");
        geosplit = splitarr[1].split(", ");
        if (indext < 50) {
        $('#tweet_table').append(array[indext] + "</br></br>");
        }          
        var marker = new google.maps.Marker({
            position: new google.maps.LatLng(geosplit[0], geosplit[1]),
            map: map,
            title: 'Click me to see what this individual tweeted!' 
          });

          (function(marker, splitarr, indext) {
              var tweetclick = "TOBACCO VISUALIZATION</br>" + "Keyword: " + splitarr[0] + "</br> Coordinates: " + splitarr[1] + "</br> Tweet: " + splitarr[2];
              google.maps.event.addListener(marker, 'click', function() {
                  infowindow = new google.maps.InfoWindow({
                      content: tweetclick
                  });
                  infowindow.open(map, marker);
              });
          })(marker, splitarr, indext);
          marker.setMap(map);
          markersArray.push(marker);
        }
    }
4

1 に答える 1