您好!这里有个示例您可以参考一下:
function(features){
var community_name = features[0].data.小区名称;
var community_address = features[0].data.ADDRESS;
var contentHTML = "<table class='table table-striped'>";
contentHTML += "<h5>小区名称:"+community_name+"</h5>";
contentHTML += "<h5>小区地址:"+community_address+"</h5>";
contentHTML += "<tr>";
contentHTML += "<th>二手房ID</th>";
contentHTML += "<th>发布价</th>";
contentHTML += "<th>面积</th>";
contentHTML += "<th>上次调价前价格</th>";
contentHTML += "<th>上次调价变化</th>";
contentHTML += "<th>上次调价时间</th>";
contentHTML += "<th>发布日期</th>";
contentHTML += "</tr>";
for(var i=0;i<features.length;i++){
contentHTML += "<tr>";
contentHTML += "<td>"+features[i].data.二手房ID+"</td>";
contentHTML += "<td>"+features[i].data.发布价+"</td>";
contentHTML += "<td>"+features[i].data.面积+"</td>";
contentHTML += "<td>"+features[i].data.上次调价前价格+"</td>";
contentHTML += "<td>"+features[i].data.上次调价变化+"</td>";
contentHTML += "<td>"+features[i].data.上次调价时间+"</td>";
contentHTML += "<td>"+features[i].data.发布日期+"</td>";
contentHTML += "</tr>";
}
contentHTML += "</table>";
//size = new SuperMap.Size(44, 33),
//var offset = new SuperMap.Pixel(0, -40);
//icon = new SuperMap.Icon("../theme/images/marker.png", size, offset);
var lonLat = map.getCenter();
var popwin = new SuperMap.Popup.FramedCloud("chicken",
lonLat,
new SuperMap.Size(750,200),//popup气泡的大小
contentHTML,
null,
true,
null);
popwin.panMapIfOutOfView = false;
popwin.autoSize = false;
popwin.maxSize = new SuperMap.Size(750,380);
map.addPopup(popwin);
},
其中,contentHTML中的内容及是弹出窗口的内容,如果您想自己设定popup的样式与内容,更改contentHTML中的内容即可。