Hi.
It appears as if the VirtualEarth implementation in OpenLayers uses the
supplied name as a div id. This will create a problem if you are using
multiple instances of the control with the same layer names. I am
providing the attached trivial patch as a potential solution.
-brandin
Index: lib/OpenLayers/Layer/VirtualEarth.js
===================================================================
--- lib/OpenLayers/Layer/VirtualEarth.js (revision 8947)
+++ lib/OpenLayers/Layer/VirtualEarth.js (working copy)
@@ -94,14 +94,15 @@
loadMapObject:function() {
// create div and set to same size as map
- var veDiv = OpenLayers.Util.createDiv(this.name);
+ var divId = OpenLayers.Util.createUniqueID(this.name + "_");
+ var veDiv = OpenLayers.Util.createDiv(divId);
var sz = this.map.getSize();
veDiv.style.width = sz.w + "px";
veDiv.style.height = sz.h + "px";
this.div.appendChild(veDiv);
try { // crash prevention
- this.mapObject = new VEMap(this.name);
+ this.mapObject = new VEMap(divId);
} catch (e) { }
if (this.mapObject != null) {
_______________________________________________
Dev mailing list
[email protected]
http://openlayers.org/mailman/listinfo/dev