Allow setting center from array.
This commit is contained in:
@@ -38,6 +38,10 @@ OpenLayers.LonLat = OpenLayers.Class({
|
||||
* it will be the y coordinate of the map location in your map units.
|
||||
*/
|
||||
initialize: function(lon, lat) {
|
||||
if (OpenLayers.Util.isArray(lon)) {
|
||||
lat = lon[1];
|
||||
lon = lon[0];
|
||||
}
|
||||
this.lon = OpenLayers.Util.toFloat(lon);
|
||||
this.lat = OpenLayers.Util.toFloat(lat);
|
||||
},
|
||||
|
||||
@@ -1703,6 +1703,9 @@ OpenLayers.Map = OpenLayers.Class({
|
||||
* options - {Object}
|
||||
*/
|
||||
moveTo: function(lonlat, zoom, options) {
|
||||
if (!(lonlat instanceof OpenLayers.LonLat)) {
|
||||
lonlat = new OpenLayers.LonLat(lonlat);
|
||||
}
|
||||
if (!options) {
|
||||
options = {};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user