maxbounds example fixes (#4680)

This commit is contained in:
Zsolt Ero 2016-06-28 15:14:24 +02:00 committed by Iván Sánchez Ortega
parent 01790eacda
commit 26df85e841
3 changed files with 5 additions and 6 deletions

View File

@ -44,8 +44,8 @@
}); });
var latlngs = L.rectangle(bounds).getLatLngs(); var latlngs = L.rectangle(bounds).getLatLngs();
L.polyline(latlngs.concat([latlngs[0]])).addTo(map1); L.polyline(latlngs[0].concat(latlngs[0][0])).addTo(map1);
L.polyline(latlngs.concat([latlngs[0]])).addTo(map2); L.polyline(latlngs[0].concat(latlngs[0][0])).addTo(map2);
</script> </script>
</body> </body>

View File

@ -30,9 +30,6 @@
maxBounds: bounds maxBounds: bounds
}); });
var latlngs = L.rectangle(bounds).getLatLngs();
L.polyline(latlngs.concat([latlngs[0]])).addTo(map);
map.setMaxBounds(bounds); // Should not enter infinite recursion map.setMaxBounds(bounds); // Should not enter infinite recursion
</script> </script>

View File

@ -30,8 +30,10 @@
maxBounds: bounds maxBounds: bounds
}); });
var latlngs = L.rectangle(bounds).getLatLngs(); var latlngs = L.rectangle(bounds).getLatLngs();
L.polyline(latlngs.concat([latlngs[0]])).addTo(map); L.polyline(latlngs[0].concat(latlngs[0][0])).addTo(map);
map.setMaxBounds(bounds); // Should not enter infinite recursion map.setMaxBounds(bounds); // Should not enter infinite recursion