-1
我已經看過以前提出的類似於我的問題,以及以下谷歌地圖api開發人員信息頁疊加層上的所有建議,但沒有答案幫助 - m試圖簡單地將標記的顏色從標準更改爲綠色,但是每次嘗試將fillColor等添加到我的代碼時,它都不會顯示標記或根本不會顯示地圖。任何人有任何想法我做錯了什麼?谷歌地圖api標記顏色變化的問題
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);
}
}
fillColor不適用於標記。請參閱[文檔](https://developers.google.com/maps/documentation/javascript/reference#MarkerOptions)。 [有關更改標記顏色的最新問題](http://stackoverflow.com/questions/18392077/change-marker-icon-api-google-maps-v3-with-a-select/18393215#18393215)(舉例...) – geocodezip