Make it so that blank label ("") on area marker disables popup on area

This commit is contained in:
Mike Primm 2011-12-15 23:48:11 +08:00 committed by mikeprimm
parent 102012aa91
commit 708f0b3c80

View File

@ -125,18 +125,19 @@ componentconstructors['markers'] = function(dynmap, configuration) {
}
}
area.timestamp = ts;
var popup = document.createElement('div');
if(area.desc) {
$(popup).addClass('AreaPopup').append(area.desc);
if(area.label != "") {
var popup = document.createElement('div');
if(area.desc) {
$(popup).addClass('AreaPopup').append(area.desc);
}
else if(area.markup) {
$(popup).addClass('AreaPopup').append(area.label);
}
else {
$(popup).text(area.label);
}
area.our_area.bindPopup(popup, {});
}
else if(area.markup) {
$(popup).addClass('AreaPopup').append(area.label);
}
else {
$(popup).text(area.label);
}
area.our_area.bindPopup(popup, {});
set.layergroup.addLayer(area.our_area);
}