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