fix specs for polygon holes

This commit is contained in:
Vladimir Agafonkin 2013-12-13 12:41:55 -05:00
parent dc5151b81a
commit 33e23a69e7
2 changed files with 10 additions and 5 deletions

View File

@ -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([

View File

@ -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])]
]);
});
});