2017-02-16 24 views
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位)时簇的图标不显示。

回答

0

对不起,堵塞这个问题的作品。我所能说的都是......我认为所有的图标都在我的VS项目中启用,这是错误的。我只能说,一旦我启用了所有图标,黄色,红色等开始出现多位数字。

对不起,个人搞砸了!