},
onFeatureUnselect: function (feature) {
- var popup = feature.popup;
+ var map = feature.layer.map;
+ var permaControl = map.getControlsByClass("OpenLayers.Control.Permalink");
+ if (permaControl[0]) {
+ permaControl[0].div.style.display = "";
+ }
+ if (!feature.popup) {
+ this.map.events.unregister("movestart", this, this._unselect);
+ return;
+ }
+ popup = feature.popup;
if (popup.visible()) {
popup.hide();
}
onFeatureSelect: function(feature) {
var map = feature.layer.map;
+ var permaControl = map.getControlsByClass("OpenLayers.Control.Permalink");
+ if (permaControl[0]) {
+ permaControl[0].div.style.display = "none";
+ }
var popup = feature.popup;
var brCorner = SYP.Utils.brCorner(map, 8);
// we cannot reuse popup; we need to recreate it in order for IE
// expressions to work. Otherwise, we get a 0x0 image on second view.
- if (popup) {
+ if (popup) {
popup.destroy();
}
var contentHTML;
} else {
contentHTML = feature.attributes.description;
}
+ if (!contentHTML || !contentHTML.length) {
+ this.map.events.register("movestart", this, this._unselect = function () { this.unselect(feature)});
+ return;
+ }
popup = SYP.createPopup(brCorner, contentHTML);
var control = this;
popup.hide = function () {