diff --git a/debug/vector/vector2.html b/debug/vector/vector2.html
index e51dfd94ea0..695d736c8d8 100644
--- a/debug/vector/vector2.html
+++ b/debug/vector/vector2.html
@@ -26,7 +26,7 @@
var path = L.polygon([
[route, [[50.5, 30.5], [50.5, 40], [40, 40]]],
- [[20, 0], [20, 40], [0, 40]]
+ [[[20, 0], [20, 40], [0, 40]]]
], {renderer: canvas}).addTo(map).bindPopup('Hello Canvas');
var poly = L.polyline([
diff --git a/spec/suites/layer/vector/PolygonSpec.js b/spec/suites/layer/vector/PolygonSpec.js
index 7014838f195..07c0170f4f9 100644
--- a/spec/suites/layer/vector/PolygonSpec.js
+++ b/spec/suites/layer/vector/PolygonSpec.js
@@ -36,8 +36,11 @@ describe('Polygon', function () {
var polygon = new L.Polygon(originalLatLngs);
- //getLatLngs() returns only external ring
- expect(polygon.getLatLngs()).to.eql([L.latLng([0, 10]), L.latLng([10, 10]), L.latLng([10, 0])]);
+ // getLatLngs() returns both rings
+ expect(polygon.getLatLngs()).to.eql([
+ [L.latLng([0, 10]), L.latLng([10, 10]), L.latLng([10, 0])],
+ [L.latLng([2, 3]), L.latLng([2, 4]), L.latLng([3, 4])]
+ ]);
});
});
@@ -68,8 +71,10 @@ describe('Polygon', function () {
var polygon = new L.Polygon([]);
polygon.setLatLngs(latLngs);
- //getLatLngs() returns only external ring
- expect(polygon.getLatLngs()).to.eql([L.latLng([0, 10]), L.latLng([10, 10]), L.latLng([10, 0])]);
+ expect(polygon.getLatLngs()).to.eql([
+ [L.latLng([0, 10]), L.latLng([10, 10]), L.latLng([10, 0])],
+ [L.latLng([2, 3]), L.latLng([2, 4]), L.latLng([3, 4])]
+ ]);
});
});