do not cast to LonLat if center is null in Map moveTo

This commit is contained in:
Bart van den Eijnden
2012-03-15 16:53:22 +01:00
parent bb6cf0c2d1
commit a3874b8f97
2 changed files with 22 additions and 1 deletions

View File

@@ -1797,7 +1797,7 @@ OpenLayers.Map = OpenLayers.Class({
* options - {Object}
*/
moveTo: function(lonlat, zoom, options) {
if (!(lonlat instanceof OpenLayers.LonLat)) {
if (lonlat != null && !(lonlat instanceof OpenLayers.LonLat)) {
lonlat = new OpenLayers.LonLat(lonlat);
}
if (!options) {