简体   繁体   English

数据映射如何显示图像而不是气泡?

[英]How does datamaps display images instead of bubbles?

I use the following code to display bubbles on datamaps. 我使用以下代码在数据映射上显示气泡。 I want to show images instead of colored bubbles. 我想显示图像而不是彩色的气泡。 How can I implement it? 我该如何实施?

 var bubs = [];             
 for (var ix in newsData) { 
   bubs.push({              
     name: newsData[ix].id, 
     latitude: newsData[ix].latitude,                       
     longitude: newsData[ix].longitude,                     
     radius: 18,            
     fillKey: 'gt50',       
     title: newsData[ix].title                              
   });                      
 };                         

 map.bubbles(bubs, {        
   popupTemplate: function(geo, data) {                     
     return "<div class='hoverinfo'><strong>" + geo.title + "</strong></div>";                                              
   }
});

I believe that this is not possible out of the box. 我相信这是不可能的。 But check out the datamaps-icons-plugin . 但是请查看datamaps-icons-plugin Alternatively there is the datamaps-custom-marker plugin. 另外,还有datamaps-custom-marker插件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM