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:
@@ -75,16 +75,30 @@ OpenLayers.Layer.VirtualEarth.prototype =
|
||||
|
||||
// create VEMap, hide nav controls
|
||||
this.vemap = new VEMap(this.name);
|
||||
this.vemap.LoadMap();
|
||||
this.vemap.HideDashboard();
|
||||
|
||||
// catch pans and zooms from VE Map
|
||||
this.vemap.AttachEvent("onendcontinuouspan",
|
||||
this.catchPanZoom.bindAsEventListener(this));
|
||||
this.vemap.AttachEvent("onendzoom",
|
||||
this.catchPanZoom.bindAsEventListener(this));
|
||||
} 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();
|
||||
|
||||
// catch pans and zooms from VE Map
|
||||
this.vemap.AttachEvent("onendcontinuouspan",
|
||||
this.catchPanZoom.bindAsEventListener(this));
|
||||
this.vemap.AttachEvent("onendzoom",
|
||||
this.catchPanZoom.bindAsEventListener(this));
|
||||
}
|
||||
|
||||
},
|
||||
@@ -142,7 +156,8 @@ OpenLayers.Layer.VirtualEarth.prototype =
|
||||
/**
|
||||
* @param {event} e
|
||||
*/
|
||||
catchPanZoom: function(e) {
|
||||
catchPanZoom: function(e) {
|
||||
|
||||
var veCenter = this.vemap.GetCenter();
|
||||
var veZoom = this.vemap.GetZoomLevel();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user