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:
euzuro
2008-01-26 00:00:37 +00:00
parent 082ff954d6
commit 3ccf5af733

View File

@@ -86,6 +86,15 @@ OpenLayers.Control.ArgParser = OpenLayers.Class(OpenLayers.Control, {
if (i == this.map.controls.length) {
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) {
this.center = new OpenLayers.LonLat(parseFloat(args.lon),
parseFloat(args.lat));
@@ -98,15 +107,6 @@ OpenLayers.Control.ArgParser = OpenLayers.Class(OpenLayers.Control, {
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();
}
}
},