Linked Camera to game, and also fixed polygon last points are not equal

This commit is contained in:
Fan-Wu Yang
2018-10-15 16:25:40 +13:00
parent 25ad511530
commit d7f2051512
4 changed files with 80 additions and 53 deletions
+4
View File
@@ -85,6 +85,10 @@ module.exports = {
let polygonResult = [];
let polygonsMerged = [];
polygons.map((polygon) => {
if (polygon[0].lat != polygon[polygon.length - 1].lat &&
polygon[0].lng != polygon[polygon.length - 1].lng) {
polygon.push({lat: polygon[0].lat, lng: polygon[0].lng})
}
let intersect = module.exports.checkIntersects(polygonPoints, polygon.coords);
if (intersect != null) {
polygonPoints = module.exports.unionPolygon(polygonPoints, polygon.coords);