fix infinite recursion in latLngBounds factory, close #933

This commit is contained in:
Vladimir Agafonkin 2012-12-11 17:03:33 +02:00
parent f5cfab73a1
commit df03016f0c

View File

@ -15,7 +15,7 @@ L.LatLngBounds = L.Class.extend({
// extend the bounds to contain the given point or bounds
extend: function (obj) { // (LatLng) or (LatLngBounds)
if (typeof obj[0] === 'number' || obj instanceof L.LatLng) {
if (typeof obj[0] === 'number' || typeof obj[0] === 'string' || obj instanceof L.LatLng) {
obj = L.latLng(obj);
} else {
obj = L.latLngBounds(obj);