all files / maps/layers/ polygon.js

100% Statements 23/23
100% Branches 4/4
100% Functions 7/7
100% Lines 23/23
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37     27× 27×     27× 31×     31× 31× 29× 29× 29× 29× 29× 29×     27×   3430×          
define(["require", "exports", "@syncfusion/ej2-base", "../utils/helper"], function (require, exports, ej2_base_1, helper_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var Polygon = (function () {
        function Polygon(maps) {
        }
        Polygon.prototype.polygonRender = function (maps, layerIndex, factor) {
            var currentLayer = maps.layersCollection[layerIndex];
            var polygonsSVGObject = maps.renderer.createGroup({
                id: maps.element.id + '_LayerIndex_' + layerIndex + '_Polygons_Group'
            });
            currentLayer.polygonSettings.polygons.map(function (polygonSetting, polygonIndex) {
                var polygonSVGObject = maps.renderer.createGroup({
                    id: maps.element.id + '_LayerIndex_' + layerIndex + '_Polygons_Group_' + polygonIndex
                });
                var polygonData = polygonSetting.points;
                if (!ej2_base_1.isNullOrUndefined(polygonSetting.points) && polygonSetting.points.length > 0) {
                    var path = helper_1.calculatePolygonPath(maps, factor, currentLayer, polygonData);
                    var pathOptions = new helper_1.PathOption(maps.element.id + '_LayerIndex_' + layerIndex + '_PolygonIndex_' + polygonIndex, polygonSetting.fill, (polygonSetting.borderWidth / factor), polygonSetting.borderColor, polygonSetting.opacity, polygonSetting.borderOpacity, '', path);
                    var polygonEle = maps.renderer.drawPath(pathOptions);
                    helper_1.maintainSelection(maps.selectedPolygonElementId, maps.polygonSelectionClass, polygonEle, 'PolygonselectionMapStyle');
                    polygonSVGObject.appendChild(polygonEle);
                    polygonsSVGObject.appendChild(polygonSVGObject);
                }
            });
            return polygonsSVGObject;
        };
        Polygon.prototype.getModuleName = function () {
            return 'Polygon';
        };
        Polygon.prototype.destroy = function () {
        };
        return Polygon;
    }());
    exports.Polygon = Polygon;
});