rearrange loading structure to account for ve libraries not being loaded and for the mozilla match bug

git-svn-id: http://svn.openlayers.org/trunk/openlayers@954 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-07-16 18:18:29 +00:00
parent 63b8cd6210
commit 500cc01778
+18 -3
View File
@@ -75,7 +75,23 @@ OpenLayers.Layer.VirtualEarth.prototype =
// create VEMap, hide nav controls // create VEMap, hide nav controls
this.vemap = new VEMap(this.name); this.vemap = new VEMap(this.name);
this.vemap.LoadMap(); } catch (e) {
// do nothing this is to keep from crashing
// if the VE library was not loaded.
}
if (this.vemap == null) {
this.loadWarningMessage();
} else {
try {
this.vemap.LoadMap();
} catch (e) {
// this is to catch a Mozilla bug without falling apart
}
this.vemap.HideDashboard(); this.vemap.HideDashboard();
// catch pans and zooms from VE Map // catch pans and zooms from VE Map
@@ -83,8 +99,6 @@ OpenLayers.Layer.VirtualEarth.prototype =
this.catchPanZoom.bindAsEventListener(this)); this.catchPanZoom.bindAsEventListener(this));
this.vemap.AttachEvent("onendzoom", this.vemap.AttachEvent("onendzoom",
this.catchPanZoom.bindAsEventListener(this)); this.catchPanZoom.bindAsEventListener(this));
} catch (e) {
this.loadWarningMessage();
} }
}, },
@@ -143,6 +157,7 @@ OpenLayers.Layer.VirtualEarth.prototype =
* @param {event} e * @param {event} e
*/ */
catchPanZoom: function(e) { catchPanZoom: function(e) {
var veCenter = this.vemap.GetCenter(); var veCenter = this.vemap.GetCenter();
var veZoom = this.vemap.GetZoomLevel(); var veZoom = this.vemap.GetZoomLevel();