Making it so moveTo is only called once when creating a map with center and layers options. r=crschmidt (closes #3114)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@11480 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -600,6 +600,14 @@ OpenLayers.Map = OpenLayers.Class({
|
||||
|
||||
// add any initial layers
|
||||
if (options && options.layers) {
|
||||
/**
|
||||
* If you have set options.center, the map center property will be
|
||||
* set at this point. However, since setCenter has not been caleld,
|
||||
* addLayers gets confused. So we delete the map center in this
|
||||
* case. Because the check below uses options.center, it will
|
||||
* be properly set below.
|
||||
*/
|
||||
delete this.center;
|
||||
this.addLayers(options.layers);
|
||||
// set center (and optionally zoom)
|
||||
if (options.center) {
|
||||
|
||||
Reference in New Issue
Block a user