方案1:
代码语言:javascript复制var div = document.createElement('div');
var marker = new ol.Overlay({
element : div,
id : mkId,
position : newPos,
positioning : 'center-center'
});
map.addOverlay(marker);
$(div).popover({
'placement': 'top',
'animation': false,
'html': true,
'title':'<div id="tcontent" ><a>' feature.get('name') '</a></div>',
'content': getNationFltHTML(feature)
});
$(div).popover('show');
方案2:
代码语言:javascript复制var div = document.createElement('div');
var marker = new ol.Overlay({
element : div,
id : mkId,
position : newPos,
positioning : 'center-center'
});
map.addOverlay(marker);
$(div).popover({
'placement': 'top',
'animation': false,
'html': true,
'title':'<div id="tcontent" ><a>' feature.get('name') '</a></div>',
'content': getNationFltHTML(feature)
});
$(div).popover('show');