@syncfusion/ej2-maps 19.4.55 → 19.4.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/ej2-maps.umd.min.js +2 -2
- package/dist/ej2-maps.umd.min.js.map +1 -1
- package/dist/es6/ej2-maps.es2015.js +64 -26
- package/dist/es6/ej2-maps.es2015.js.map +1 -1
- package/dist/es6/ej2-maps.es5.js +63 -25
- package/dist/es6/ej2-maps.es5.js.map +1 -1
- package/dist/global/ej2-maps.min.js +2 -2
- package/dist/global/ej2-maps.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +5 -5
- package/src/maps/maps.js +12 -7
- package/src/maps/model/export-image.js +18 -11
- package/src/maps/model/export-pdf.js +13 -6
- package/src/maps/model/print.js +3 -1
- package/src/maps/utils/helper.d.ts +8 -0
- package/src/maps/utils/helper.js +20 -2
package/dist/es6/ej2-maps.es5.js
CHANGED
|
@@ -1293,8 +1293,10 @@ function maintainSelection(elementId, elementClass, element, className) {
|
|
|
1293
1293
|
if (elementId) {
|
|
1294
1294
|
for (var index = 0; index < elementId.length; index++) {
|
|
1295
1295
|
if (element.getAttribute('id') === elementId[index]) {
|
|
1296
|
-
if (
|
|
1297
|
-
|
|
1296
|
+
if (index === 0 || element.tagName === 'g') {
|
|
1297
|
+
if (!isNullOrUndefined(elementClass) && !isNullOrUndefined(elementClass.id)) {
|
|
1298
|
+
document.body.appendChild(elementClass);
|
|
1299
|
+
}
|
|
1298
1300
|
if (element.id.indexOf('_MarkerIndex_') > -1 && element.childElementCount > 0) {
|
|
1299
1301
|
element.children[0].setAttribute('class', className);
|
|
1300
1302
|
}
|
|
@@ -2254,6 +2256,22 @@ function fixInitialScaleForTile(map) {
|
|
|
2254
2256
|
function getElementByID(id) {
|
|
2255
2257
|
return document.getElementById(id);
|
|
2256
2258
|
}
|
|
2259
|
+
/**
|
|
2260
|
+
* Function to get clientElement from id.
|
|
2261
|
+
*
|
|
2262
|
+
* @param {string} id - Specifies the id
|
|
2263
|
+
* @returns {Element} - Returns the element
|
|
2264
|
+
* @private
|
|
2265
|
+
*/
|
|
2266
|
+
function getClientElement(id) {
|
|
2267
|
+
var element = document.getElementById(id);
|
|
2268
|
+
if (!isNullOrUndefined(element)) {
|
|
2269
|
+
return element.getClientRects()[0];
|
|
2270
|
+
}
|
|
2271
|
+
else {
|
|
2272
|
+
return null;
|
|
2273
|
+
}
|
|
2274
|
+
}
|
|
2257
2275
|
/**
|
|
2258
2276
|
* To apply internalization
|
|
2259
2277
|
*
|
|
@@ -7488,12 +7506,14 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
7488
7506
|
this.checkInitialRender = false;
|
|
7489
7507
|
}
|
|
7490
7508
|
}
|
|
7491
|
-
|
|
7492
|
-
|
|
7493
|
-
&& this.layers[i].markerSettings[k].
|
|
7494
|
-
|
|
7495
|
-
|
|
7496
|
-
|
|
7509
|
+
if (!this.isResize) {
|
|
7510
|
+
for (var k = 0; k < this.layers[i].markerSettings.length; k++) {
|
|
7511
|
+
if (this.layers[i].markerSettings[k].selectionSettings && this.layers[i].markerSettings[k].selectionSettings.enable
|
|
7512
|
+
&& this.layers[i].markerSettings[k].initialMarkerSelection.length > 0) {
|
|
7513
|
+
var markerSelectionValues = this.layers[i].markerSettings[k].initialMarkerSelection;
|
|
7514
|
+
for (var j = 0; j < markerSelectionValues.length; j++) {
|
|
7515
|
+
this.markerInitialSelection(i, k, this.layers[i].markerSettings[k], markerSelectionValues[j].latitude, markerSelectionValues[j].longitude);
|
|
7516
|
+
}
|
|
7497
7517
|
}
|
|
7498
7518
|
}
|
|
7499
7519
|
}
|
|
@@ -7571,7 +7591,8 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
7571
7591
|
Maps.prototype.markerSelection = function (selectionSettings, map, targetElement, data) {
|
|
7572
7592
|
var border = {
|
|
7573
7593
|
color: selectionSettings.border.color,
|
|
7574
|
-
width: selectionSettings.border.width / map.scale
|
|
7594
|
+
width: selectionSettings.border.width / map.scale,
|
|
7595
|
+
opacity: selectionSettings.border.opacity
|
|
7575
7596
|
};
|
|
7576
7597
|
var markerSelectionProperties = {
|
|
7577
7598
|
opacity: selectionSettings.opacity,
|
|
@@ -7591,9 +7612,11 @@ var Maps = /** @__PURE__ @class */ (function (_super) {
|
|
|
7591
7612
|
if (this.selectedMarkerElementId.length === 0 || selectionSettings.enableMultiSelect) {
|
|
7592
7613
|
if (targetElement.tagName === 'g') {
|
|
7593
7614
|
targetElement.children[0].setAttribute('class', 'MarkerselectionMapStyle');
|
|
7615
|
+
this.selectedMarkerElementId.push(targetElement.children[0].id);
|
|
7594
7616
|
}
|
|
7595
7617
|
else {
|
|
7596
7618
|
targetElement.setAttribute('class', 'MarkerselectionMapStyle');
|
|
7619
|
+
this.selectedMarkerElementId.push(targetElement.id);
|
|
7597
7620
|
}
|
|
7598
7621
|
}
|
|
7599
7622
|
};
|
|
@@ -14797,7 +14820,9 @@ var Print = /** @__PURE__ @class */ (function () {
|
|
|
14797
14820
|
* @private
|
|
14798
14821
|
*/
|
|
14799
14822
|
Print.prototype.getHTMLContent = function (elements) {
|
|
14823
|
+
var elementRect = getClientElement(this.control.element.id);
|
|
14800
14824
|
var div = createElement('div');
|
|
14825
|
+
div.setAttribute("style", "margin-top:" + elementRect["top"] + "px");
|
|
14801
14826
|
if (elements) {
|
|
14802
14827
|
if (elements instanceof Array) {
|
|
14803
14828
|
Array.prototype.forEach.call(elements, function (value) {
|
|
@@ -14877,18 +14902,21 @@ var ImageExport = /** @__PURE__ @class */ (function () {
|
|
|
14877
14902
|
var isDownload = !(Browser.userAgent.toString().indexOf('HeadlessChrome') > -1);
|
|
14878
14903
|
var toolbarEle = document.getElementById(_this.control.element.id + '_ToolBar');
|
|
14879
14904
|
var svgParent = document.getElementById(_this.control.element.id + '_Tile_SVG_Parent');
|
|
14905
|
+
var tileParent = document.getElementById(_this.control.element.id + '_tile_parent');
|
|
14880
14906
|
var svgDataElement;
|
|
14907
|
+
var tileSvg;
|
|
14908
|
+
var svgObject = getElementByID(_this.control.element.id + '_svg').cloneNode(true);
|
|
14881
14909
|
if (!_this.control.isTileMap) {
|
|
14882
14910
|
svgDataElement = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' +
|
|
14883
14911
|
_this.control.svgObject.outerHTML + '</svg>';
|
|
14884
14912
|
}
|
|
14885
14913
|
else {
|
|
14886
|
-
|
|
14914
|
+
tileSvg = getElementByID(_this.control.element.id + '_Tile_SVG').cloneNode(true);
|
|
14887
14915
|
svgDataElement = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' +
|
|
14888
|
-
|
|
14916
|
+
svgObject.outerHTML + tileSvg.outerHTML + '</svg>';
|
|
14889
14917
|
}
|
|
14890
14918
|
var url = window.URL.createObjectURL(new Blob(type === 'SVG' ? [svgDataElement] :
|
|
14891
|
-
[(new XMLSerializer()).serializeToString(
|
|
14919
|
+
[(new XMLSerializer()).serializeToString(svgObject)], { type: 'image/svg+xml' }));
|
|
14892
14920
|
if (type === 'SVG') {
|
|
14893
14921
|
if (allowDownload) {
|
|
14894
14922
|
triggerDownload(fileName, type, url, isDownload);
|
|
@@ -14919,6 +14947,7 @@ var ImageExport = /** @__PURE__ @class */ (function () {
|
|
|
14919
14947
|
image_1.src = url;
|
|
14920
14948
|
}
|
|
14921
14949
|
else {
|
|
14950
|
+
var extraSpace_1 = getClientElement(_this.control.element.id);
|
|
14922
14951
|
var imgxHttp = new XMLHttpRequest();
|
|
14923
14952
|
var imgTileLength_1 = _this.control.mapLayerPanel.tiles.length;
|
|
14924
14953
|
var _loop_1 = function (i) {
|
|
@@ -14928,8 +14957,11 @@ var ImageExport = /** @__PURE__ @class */ (function () {
|
|
|
14928
14957
|
ctxt_1.fillStyle = _this.control.background ? _this.control.background : '#FFFFFF';
|
|
14929
14958
|
ctxt_1.fillRect(0, 0, _this.control.availableSize.width, _this.control.availableSize.height);
|
|
14930
14959
|
ctxt_1.font = _this.control.titleSettings.textStyle.size + ' Arial';
|
|
14931
|
-
|
|
14932
|
-
|
|
14960
|
+
var titleElement = document.getElementById(_this.control.element.id + '_Map_title');
|
|
14961
|
+
if (!isNullOrUndefined(titleElement)) {
|
|
14962
|
+
ctxt_1.fillStyle = titleElement.getAttribute('fill');
|
|
14963
|
+
ctxt_1.fillText(_this.control.titleSettings.text, parseFloat(titleElement.getAttribute('x')), parseFloat(titleElement.getAttribute('y')));
|
|
14964
|
+
}
|
|
14933
14965
|
exportTileImg.onload = (function () {
|
|
14934
14966
|
if (i === 0 || i === imgTileLength_1 + 1) {
|
|
14935
14967
|
if (i === 0) {
|
|
@@ -14938,12 +14970,12 @@ var ImageExport = /** @__PURE__ @class */ (function () {
|
|
|
14938
14970
|
ctxt_1.clip();
|
|
14939
14971
|
}
|
|
14940
14972
|
else {
|
|
14941
|
-
ctxt_1.setTransform(1, 0, 0, 1, parseFloat(svgParent.style.left), parseFloat(
|
|
14973
|
+
ctxt_1.setTransform(1, 0, 0, 1, parseFloat(svgParent.style.left), (parseFloat(tileParent.style.top) - extraSpace_1["top"]));
|
|
14942
14974
|
}
|
|
14943
14975
|
}
|
|
14944
14976
|
else {
|
|
14945
|
-
ctxt_1.setTransform(1, 0, 0, 1, parseFloat(tile.style.left) +
|
|
14946
|
-
(parseFloat(
|
|
14977
|
+
ctxt_1.setTransform(1, 0, 0, 1, parseFloat(tile.style.left) + _this.control.margin.left, parseFloat(tile.style.top) +
|
|
14978
|
+
(parseFloat(tileParent.style.top)) - extraSpace_1["top"]);
|
|
14947
14979
|
}
|
|
14948
14980
|
ctxt_1.drawImage(exportTileImg, 0, 0);
|
|
14949
14981
|
if (i === imgTileLength_1 + 1) {
|
|
@@ -14969,7 +15001,7 @@ var ImageExport = /** @__PURE__ @class */ (function () {
|
|
|
14969
15001
|
}
|
|
14970
15002
|
else {
|
|
14971
15003
|
setTimeout(function () {
|
|
14972
|
-
exportTileImg.src = window.URL.createObjectURL(new Blob([(new XMLSerializer()).serializeToString(
|
|
15004
|
+
exportTileImg.src = window.URL.createObjectURL(new Blob([(new XMLSerializer()).serializeToString(tileSvg)], { type: 'image/svg+xml' }));
|
|
14973
15005
|
}, 300);
|
|
14974
15006
|
}
|
|
14975
15007
|
}
|
|
@@ -15050,6 +15082,7 @@ var PdfExport = /** @__PURE__ @class */ (function () {
|
|
|
15050
15082
|
var svgParent = document.getElementById(_this.control.element.id + '_Tile_SVG_Parent');
|
|
15051
15083
|
var svgData;
|
|
15052
15084
|
var exportElement = _this.control.svgObject.cloneNode(true);
|
|
15085
|
+
var tileParent = document.getElementById(_this.control.element.id + '_tile_parent');
|
|
15053
15086
|
var backgroundElement = exportElement.childNodes[0];
|
|
15054
15087
|
var backgroundColor = backgroundElement.getAttribute('fill');
|
|
15055
15088
|
if ((_this.control.theme === 'Tailwind' || _this.control.theme === 'TailwindDark' || _this.control.theme === 'Bootstrap5' || _this.control.theme === 'Bootstrap5Dark')
|
|
@@ -15082,6 +15115,7 @@ var PdfExport = /** @__PURE__ @class */ (function () {
|
|
|
15082
15115
|
image.src = url;
|
|
15083
15116
|
}
|
|
15084
15117
|
else {
|
|
15118
|
+
var extraSpace_1 = getClientElement(_this.control.element.id);
|
|
15085
15119
|
var xHttp = new XMLHttpRequest();
|
|
15086
15120
|
var tileLength_1 = _this.control.mapLayerPanel.tiles.length;
|
|
15087
15121
|
var _loop_1 = function (i) {
|
|
@@ -15091,8 +15125,11 @@ var PdfExport = /** @__PURE__ @class */ (function () {
|
|
|
15091
15125
|
ctx.fillStyle = _this.control.background ? _this.control.background : '#FFFFFF';
|
|
15092
15126
|
ctx.fillRect(0, 0, _this.control.availableSize.width, _this.control.availableSize.height);
|
|
15093
15127
|
ctx.font = _this.control.titleSettings.textStyle.size + ' Arial';
|
|
15094
|
-
|
|
15095
|
-
|
|
15128
|
+
var titleElement = document.getElementById(_this.control.element.id + '_Map_title');
|
|
15129
|
+
if (!isNullOrUndefined(titleElement)) {
|
|
15130
|
+
ctx.fillStyle = titleElement.getAttribute('fill');
|
|
15131
|
+
ctx.fillText(_this.control.titleSettings.text, parseFloat(titleElement.getAttribute('x')), parseFloat(titleElement.getAttribute('y')));
|
|
15132
|
+
}
|
|
15096
15133
|
tileImg.onload = (function () {
|
|
15097
15134
|
if (i === 0 || i === tileLength_1 + 1) {
|
|
15098
15135
|
if (i === 0) {
|
|
@@ -15101,12 +15138,12 @@ var PdfExport = /** @__PURE__ @class */ (function () {
|
|
|
15101
15138
|
ctx.clip();
|
|
15102
15139
|
}
|
|
15103
15140
|
else {
|
|
15104
|
-
ctx.setTransform(1, 0, 0, 1, parseFloat(svgParent.style.left), parseFloat(
|
|
15141
|
+
ctx.setTransform(1, 0, 0, 1, parseFloat(svgParent.style.left), (parseFloat(tileParent.style.top) - extraSpace_1["top"]));
|
|
15105
15142
|
}
|
|
15106
15143
|
}
|
|
15107
15144
|
else {
|
|
15108
|
-
ctx.setTransform(1, 0, 0, 1, parseFloat(tile.style.left) +
|
|
15109
|
-
(parseFloat(
|
|
15145
|
+
ctx.setTransform(1, 0, 0, 1, parseFloat(tile.style.left) + _this.control.margin.left, (parseFloat(tile.style.top) +
|
|
15146
|
+
(parseFloat(tileParent.style.top)) - extraSpace_1["top"]));
|
|
15110
15147
|
}
|
|
15111
15148
|
ctx.drawImage(tileImg, 0, 0);
|
|
15112
15149
|
if (i === tileLength_1 + 1) {
|
|
@@ -15132,7 +15169,8 @@ var PdfExport = /** @__PURE__ @class */ (function () {
|
|
|
15132
15169
|
}
|
|
15133
15170
|
else {
|
|
15134
15171
|
setTimeout(function () {
|
|
15135
|
-
|
|
15172
|
+
var tileSvg = document.getElementById(_this.control.element.id + '_Tile_SVG');
|
|
15173
|
+
tileImg.src = window.URL.createObjectURL(new Blob([(new XMLSerializer()).serializeToString(tileSvg)], { type: 'image/svg+xml' }));
|
|
15136
15174
|
}, 300);
|
|
15137
15175
|
}
|
|
15138
15176
|
}
|
|
@@ -15180,5 +15218,5 @@ var PdfExport = /** @__PURE__ @class */ (function () {
|
|
|
15180
15218
|
* exporting all modules from maps index
|
|
15181
15219
|
*/
|
|
15182
15220
|
|
|
15183
|
-
export { Maps, load, loaded, click, rightClick, doubleClick, resize, tooltipRender, shapeSelected, shapeHighlight, mousemove, mouseup, mousedown, layerRendering, shapeRendering, markerRendering, markerClusterRendering, markerClick, markerClusterClick, markerMouseMove, markerClusterMouseMove, dataLabelRendering, bubbleRendering, bubbleClick, bubbleMouseMove, animationComplete, legendRendering, annotationRendering, itemSelection, itemHighlight, beforePrint, zoomIn, zoomOut, pan, Annotation, Arrow, Font, Border, CenterPosition, TooltipSettings, Margin, ConnectorLineSettings, MarkerClusterSettings, MarkerClusterData, ColorMappingSettings, InitialMarkerSelectionSettings, InitialShapeSelectionSettings, SelectionSettings, HighlightSettings, NavigationLineSettings, BubbleSettings, CommonTitleSettings, SubTitleSettings, TitleSettings, ZoomSettings, ToggleLegendSettings, LegendSettings, DataLabelSettings, ShapeSettings, MarkerBase, MarkerSettings, LayerSettings, Tile, MapsAreaSettings, Size, stringToNumber, calculateSize, createSvg, getMousePosition, degreesToRadians, radiansToDegrees, convertGeoToPoint, convertTileLatLongToPoint, xToCoordinate, yToCoordinate, aitoff, roundTo, sinci, acos, calculateBound, triggerDownload, Point, MinMax, GeoLocation, measureText, TextOption, PathOption, ColorValue, RectOption, CircleOption, PolygonOption, PolylineOption, LineOption, Line, MapLocation, Rect, PatternOptions, renderTextElement, convertElement, formatValue, convertStringToValue, convertElementFromLabel, drawSymbols, getValueFromObject, markerColorChoose, markerShapeChoose, clusterTemplate, mergeSeparateCluster, clusterSeparate, marker, markerTemplate, maintainSelection, maintainStyleClass, appendShape, drawCircle, drawRectangle, drawPath, drawPolygon, drawPolyline, drawLine, calculateShapes, drawDiamond, drawTriangle, drawCross, drawHorizontalLine, drawVerticalLine, drawStar, drawBalloon, drawPattern, getFieldData, checkShapeDataFields, checkPropertyPath, filter, getRatioOfBubble, findMidPointOfPolygon, isCustomPath, textTrim, findPosition, removeElement, calculateCenterFromPixel, getTranslate, getZoomTranslate, fixInitialScaleForTile, getElementByID, Internalize, getTemplateFunction, getElement, getShapeData, triggerShapeEvent, getElementsByClassName, querySelector, getTargetElement, createStyle, customizeStyle, triggerItemSelectionEvent, removeClass, elementAnimate, timeout, showTooltip, wordWrap, createTooltip, drawSymbol, renderLegendShape, getElementOffset, changeBorderWidth, changeNavaigationLineWidth, targetTouches, calculateScale, getDistance, getTouches, getTouchCenter, sum, zoomAnimate, animate, MapAjax, smoothTranslate, compareZoomFactor, calculateZoomLevel, processResult, LayerPanel, Bubble, BingMap, Marker, ColorMapping, DataLabel, NavigationLine, Legend, Highlight, Selection, MapsTooltip, Zoom, Annotations, Print, ImageExport, PdfExport };
|
|
15221
|
+
export { Maps, load, loaded, click, rightClick, doubleClick, resize, tooltipRender, shapeSelected, shapeHighlight, mousemove, mouseup, mousedown, layerRendering, shapeRendering, markerRendering, markerClusterRendering, markerClick, markerClusterClick, markerMouseMove, markerClusterMouseMove, dataLabelRendering, bubbleRendering, bubbleClick, bubbleMouseMove, animationComplete, legendRendering, annotationRendering, itemSelection, itemHighlight, beforePrint, zoomIn, zoomOut, pan, Annotation, Arrow, Font, Border, CenterPosition, TooltipSettings, Margin, ConnectorLineSettings, MarkerClusterSettings, MarkerClusterData, ColorMappingSettings, InitialMarkerSelectionSettings, InitialShapeSelectionSettings, SelectionSettings, HighlightSettings, NavigationLineSettings, BubbleSettings, CommonTitleSettings, SubTitleSettings, TitleSettings, ZoomSettings, ToggleLegendSettings, LegendSettings, DataLabelSettings, ShapeSettings, MarkerBase, MarkerSettings, LayerSettings, Tile, MapsAreaSettings, Size, stringToNumber, calculateSize, createSvg, getMousePosition, degreesToRadians, radiansToDegrees, convertGeoToPoint, convertTileLatLongToPoint, xToCoordinate, yToCoordinate, aitoff, roundTo, sinci, acos, calculateBound, triggerDownload, Point, MinMax, GeoLocation, measureText, TextOption, PathOption, ColorValue, RectOption, CircleOption, PolygonOption, PolylineOption, LineOption, Line, MapLocation, Rect, PatternOptions, renderTextElement, convertElement, formatValue, convertStringToValue, convertElementFromLabel, drawSymbols, getValueFromObject, markerColorChoose, markerShapeChoose, clusterTemplate, mergeSeparateCluster, clusterSeparate, marker, markerTemplate, maintainSelection, maintainStyleClass, appendShape, drawCircle, drawRectangle, drawPath, drawPolygon, drawPolyline, drawLine, calculateShapes, drawDiamond, drawTriangle, drawCross, drawHorizontalLine, drawVerticalLine, drawStar, drawBalloon, drawPattern, getFieldData, checkShapeDataFields, checkPropertyPath, filter, getRatioOfBubble, findMidPointOfPolygon, isCustomPath, textTrim, findPosition, removeElement, calculateCenterFromPixel, getTranslate, getZoomTranslate, fixInitialScaleForTile, getElementByID, getClientElement, Internalize, getTemplateFunction, getElement, getShapeData, triggerShapeEvent, getElementsByClassName, querySelector, getTargetElement, createStyle, customizeStyle, triggerItemSelectionEvent, removeClass, elementAnimate, timeout, showTooltip, wordWrap, createTooltip, drawSymbol, renderLegendShape, getElementOffset, changeBorderWidth, changeNavaigationLineWidth, targetTouches, calculateScale, getDistance, getTouches, getTouchCenter, sum, zoomAnimate, animate, MapAjax, smoothTranslate, compareZoomFactor, calculateZoomLevel, processResult, LayerPanel, Bubble, BingMap, Marker, ColorMapping, DataLabel, NavigationLine, Legend, Highlight, Selection, MapsTooltip, Zoom, Annotations, Print, ImageExport, PdfExport };
|
|
15184
15222
|
//# sourceMappingURL=ej2-maps.es5.js.map
|