0
我遇到Google Maps羣集功能的問題。這是正確的聚類和放置在地圖上的聚類計數和累計計數總計給定的位置/標記的正確數量。但是,當給定羣集內的位置計數大於9(或大於1位數)時,不會顯示圖標。有沒有人有一個想法如何解決這個問題?我正在爲羣集使用「標準」Google Maps藍色圖標。藍色圖標顯示4個標記的羣集。但是132和79個標記只顯示132和79個計數 - 沒有藍色圖標。我沒有一個方便的地方來快速爲公衆消費屏幕截圖。當羣集計數> 1位時,Google Maps Clusterer不顯示圖標
var tableContent = "";
$.each(data, function (i, item) {
iCount++;
var aCount = iCount.toString();
var iCt = item.RECNO;
//table += "<tr><td>" + '(' + aCount + ') ' + item.DDSPNM + "</td></tr>";
tableContent += '<tr>';
var rowContent = "";
rowContent += "<strong>" + item.DDSPNM + "</strong>" + "<br>"
rowContent += item.DCTRNUM;
tableContent += '<td>' + rowContent + '</td>';
tableContent += '</tr>';
var latlng = new google.maps.LatLng(item.Latitude, item.Longitude);
locations.push(latlng);
var marker = new google.maps.Marker({
position: latlng,
label: { text: aCount, color: 'black', fontSize: "12px" },
title: 'this is ' + item.DDSPNM,
map: map
});
gmarkers.push(marker);
});
if (iCount == 0)
{
table += "<tr><td>No providers were found in the specified location. Please change your search criteria and try the search again.</td></tr>";
tableContent += "<tr><td>No providers were found in the specified location. Please change your search criteria and try the search again.</td></tr>";
}
$('#results').append(tableContent);
// Instantiate pagination after data is available
pager = new Pager('results', 10);
pager.init();
pager.showPageNav('pager', 'pageNavPosition');
pager.showPage(1);
// set the bounds for the map and re-size/re-position to display all markers
var bounds = new google.maps.LatLngBounds();
for (var i = 0; i < locations.length; i++) {
bounds.extend(locations[i]);
}
map.fitBounds(bounds);
var markerCluster = new MarkerClusterer(map, gmarkers,
{ imagePath: @Url.Content("~/Images/m")});
}
請忽略什麼是用戶醜陋的演示文稿,這是我現在工作的一塊。但是我很難理解爲什麼當簇的數量大於9(或者大於1位)時簇的圖標不顯示。