zoom: true,
callback: function(extent) {
$("#loading").hide();
- $("#browse_map .secondary-actions").show();
- if (extent) {
+ if (extent && extent.isValid()) {
+ $("#browse_map .secondary-actions").show();
+
$("a.bbox[data-editor=remote]").click(function () {
return remoteEditHandler(extent);
});
$("#object_edit").show();
updatelinks(map.getCenter(), 16, null, extent, object);
- } else {
- $("#small_map").hide();
}
}
});
map._objectLayer.addData(xml);
- if (options.zoom) map.fitBounds(map._objectLayer.getBounds());
- if (options.callback) options.callback(map._objectLayer.getBounds());
+ var bounds = map._objectLayer.getBounds();
+
+ if (options.zoom && bounds.isValid()) map.fitBounds(bounds);
+ if (options.callback) options.callback(bounds);
map._objectLayer.addTo(map);
}