arg parser triggers load of baselayer too early. thanks for the patch, kleptog. i've taken it upon myself to run the damn tests. all pass. (Closes #1290)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@5900 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -86,6 +86,15 @@ OpenLayers.Control.ArgParser = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
if (i == this.map.controls.length) {
|
if (i == this.map.controls.length) {
|
||||||
|
|
||||||
var args = OpenLayers.Util.getParameters();
|
var args = OpenLayers.Util.getParameters();
|
||||||
|
// Be careful to set layer first, to not trigger unnecessary layer loads
|
||||||
|
if (args.layers) {
|
||||||
|
this.layers = args.layers;
|
||||||
|
|
||||||
|
// when we add a new layer, set its visibility
|
||||||
|
this.map.events.register('addlayer', this,
|
||||||
|
this.configureLayers);
|
||||||
|
this.configureLayers();
|
||||||
|
}
|
||||||
if (args.lat && args.lon) {
|
if (args.lat && args.lon) {
|
||||||
this.center = new OpenLayers.LonLat(parseFloat(args.lon),
|
this.center = new OpenLayers.LonLat(parseFloat(args.lon),
|
||||||
parseFloat(args.lat));
|
parseFloat(args.lat));
|
||||||
@@ -98,15 +107,6 @@ OpenLayers.Control.ArgParser = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
this.setCenter);
|
this.setCenter);
|
||||||
this.setCenter();
|
this.setCenter();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.layers) {
|
|
||||||
this.layers = args.layers;
|
|
||||||
|
|
||||||
// when we add a new layer, set its visibility
|
|
||||||
this.map.events.register('addlayer', this,
|
|
||||||
this.configureLayers);
|
|
||||||
this.configureLayers();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user