@progress/kendo-charts 2.7.2-dev.202502101310 → 2.7.2-develop.1
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/dist/cdn/js/kendo-charts.js +1 -1
- package/dist/cdn/main.js +1 -1
- package/dist/es/barcode/barcode-validator.js +10 -12
- package/dist/es/barcode/barcode.js +84 -96
- package/dist/es/barcode/encodings/code11.js +41 -57
- package/dist/es/barcode/encodings/code128.js +222 -354
- package/dist/es/barcode/encodings/code39-extended.js +20 -34
- package/dist/es/barcode/encodings/code39.js +49 -75
- package/dist/es/barcode/encodings/code93-extended.js +12 -24
- package/dist/es/barcode/encodings/code93.js +52 -70
- package/dist/es/barcode/encodings/ean13.js +28 -42
- package/dist/es/barcode/encodings/ean8.js +8 -18
- package/dist/es/barcode/encodings/encoding.js +18 -24
- package/dist/es/barcode/encodings/main.js +13 -10
- package/dist/es/barcode/encodings/msi.js +56 -112
- package/dist/es/barcode/encodings/postnet.js +31 -45
- package/dist/es/barcode/surface-size.js +2 -2
- package/dist/es/chart/aggregates/aggregates.js +23 -23
- package/dist/es/chart/aggregates/default-aggregates.js +10 -18
- package/dist/es/chart/aggregates/series-aggregator.js +42 -54
- package/dist/es/chart/animations/bar-chart-animation.js +15 -26
- package/dist/es/chart/animations/bubble-animation.js +7 -17
- package/dist/es/chart/animations/clip-animation.js +13 -23
- package/dist/es/chart/animations/fade-in-animation.js +6 -16
- package/dist/es/chart/animations/pie-animation.js +6 -16
- package/dist/es/chart/api-elements/chart-axis.js +14 -22
- package/dist/es/chart/api-elements/chart-pane.js +10 -8
- package/dist/es/chart/api-elements/chart-plotarea.js +4 -10
- package/dist/es/chart/api-elements/find-axis-by-name.js +1 -1
- package/dist/es/chart/area-chart/area-chart.js +46 -60
- package/dist/es/chart/area-chart/area-segment.js +46 -52
- package/dist/es/chart/area-chart/spline-area-segment.js +12 -21
- package/dist/es/chart/area-chart/step-area-segment.js +6 -15
- package/dist/es/chart/axis-group-range-tracker.js +14 -20
- package/dist/es/chart/bar-chart/bar-chart.js +65 -80
- package/dist/es/chart/bar-chart/bar-label.js +25 -32
- package/dist/es/chart/bar-chart/bar.js +76 -91
- package/dist/es/chart/box-plot-chart/box-plot-chart.js +33 -48
- package/dist/es/chart/box-plot-chart/box-plot.js +55 -68
- package/dist/es/chart/box-plot-chart/vertical-box-plot.js +13 -23
- package/dist/es/chart/bubble-chart/bubble-chart.js +51 -64
- package/dist/es/chart/bubble-chart/bubble.js +21 -27
- package/dist/es/chart/bullet-chart/bullet-chart.js +45 -57
- package/dist/es/chart/bullet-chart/bullet.js +48 -57
- package/dist/es/chart/bullet-chart/target.js +1 -11
- package/dist/es/chart/candlestick-chart/candlestick-chart.js +41 -55
- package/dist/es/chart/candlestick-chart/candlestick.js +60 -69
- package/dist/es/chart/categorical-chart.js +178 -206
- package/dist/es/chart/chart-container.js +30 -39
- package/dist/es/chart/chart.js +641 -701
- package/dist/es/chart/constants.js +103 -103
- package/dist/es/chart/crosshair/crosshair-tooltip.js +22 -34
- package/dist/es/chart/crosshair/crosshair.js +39 -47
- package/dist/es/chart/donut-chart/donut-chart.js +36 -48
- package/dist/es/chart/donut-chart/donut-segment.js +12 -24
- package/dist/es/chart/error-bars/categorical-error-bar.js +5 -15
- package/dist/es/chart/error-bars/error-bar-base.js +37 -49
- package/dist/es/chart/error-bars/error-range-calculator.js +46 -56
- package/dist/es/chart/error-bars/scatter-error-bar.js +6 -16
- package/dist/es/chart/funnel-chart/funnel-chart.js +86 -103
- package/dist/es/chart/funnel-chart/funnel-segment.js +46 -54
- package/dist/es/chart/funnel-chart/pyramid-chart.js +5 -11
- package/dist/es/chart/heatmap-chart/color-scale.js +7 -9
- package/dist/es/chart/heatmap-chart/heatmap-chart.js +87 -110
- package/dist/es/chart/heatmap-chart/heatmap-point.js +72 -78
- package/dist/es/chart/highlight.js +26 -36
- package/dist/es/chart/layout/cluster-layout.js +16 -25
- package/dist/es/chart/layout/radar-cluster-layout.js +15 -24
- package/dist/es/chart/layout/radar-stack-layout.js +10 -22
- package/dist/es/chart/layout/stack-wrap.js +12 -24
- package/dist/es/chart/layout/utils.js +2 -2
- package/dist/es/chart/legend/legend-item-line-area.js +8 -19
- package/dist/es/chart/legend/legend-item-line.js +21 -31
- package/dist/es/chart/legend/legend-item-marker.js +18 -28
- package/dist/es/chart/legend/legend-item-square.js +8 -18
- package/dist/es/chart/legend/legend-item.js +91 -105
- package/dist/es/chart/legend/legend-layout.js +18 -25
- package/dist/es/chart/legend/legend.js +68 -92
- package/dist/es/chart/line-chart/line-chart.js +35 -48
- package/dist/es/chart/line-chart/line-point.js +90 -103
- package/dist/es/chart/line-chart/line-segment.js +23 -34
- package/dist/es/chart/line-chart/spline-segment.js +10 -20
- package/dist/es/chart/line-chart/step-line-mixin.js +14 -17
- package/dist/es/chart/line-chart/step-line-segment.js +4 -14
- package/dist/es/chart/mixins/accessibility-attributes-mixin.js +7 -7
- package/dist/es/chart/mixins/clip-animation-mixin.js +7 -7
- package/dist/es/chart/mixins/line-chart-mixin.js +27 -31
- package/dist/es/chart/mixins/note-mixin.js +3 -3
- package/dist/es/chart/mixins/pie-chart-mixin.js +9 -9
- package/dist/es/chart/mixins/plotarea-events-mixin.js +1 -1
- package/dist/es/chart/mixins/point-events-mixin.js +1 -1
- package/dist/es/chart/ohlc-chart/ohlc-chart.js +4 -14
- package/dist/es/chart/ohlc-chart/ohlc-point.js +15 -28
- package/dist/es/chart/pan-and-zoom/accept-key.js +3 -3
- package/dist/es/chart/pan-and-zoom/mousewheel-zoom.js +25 -33
- package/dist/es/chart/pan-and-zoom/pannable.js +29 -37
- package/dist/es/chart/pan-and-zoom/to-chart-axis-ranges.js +3 -3
- package/dist/es/chart/pan-and-zoom/zoom-selection.js +61 -70
- package/dist/es/chart/pane.js +71 -79
- package/dist/es/chart/pie-chart/pie-chart.js +153 -183
- package/dist/es/chart/pie-chart/pie-segment.js +82 -98
- package/dist/es/chart/plotarea/categorical-plotarea.js +285 -318
- package/dist/es/chart/plotarea/donut-plotarea.js +12 -22
- package/dist/es/chart/plotarea/funnel-plotarea.js +17 -27
- package/dist/es/chart/plotarea/heatmap-plotarea.js +139 -167
- package/dist/es/chart/plotarea/pie-plotarea.js +15 -25
- package/dist/es/chart/plotarea/plotarea-base.js +423 -462
- package/dist/es/chart/plotarea/plotarea-factory.js +15 -20
- package/dist/es/chart/plotarea/polar-plotarea-base.js +37 -51
- package/dist/es/chart/plotarea/polar-plotarea.js +39 -49
- package/dist/es/chart/plotarea/radar-plotarea.js +55 -65
- package/dist/es/chart/plotarea/xy-plotarea.js +111 -128
- package/dist/es/chart/polar-area-chart/polar-area-chart.js +22 -36
- package/dist/es/chart/polar-area-chart/polar-area-segment.js +7 -17
- package/dist/es/chart/polar-area-chart/spline-polar-area-segment.js +15 -25
- package/dist/es/chart/polar-line-chart/polar-line-chart.js +2 -11
- package/dist/es/chart/polar-scatter-chart/polar-scatter-chart.js +6 -16
- package/dist/es/chart/radar-area-chart/radar-area-chart.js +11 -21
- package/dist/es/chart/radar-area-chart/radar-area-segment.js +3 -13
- package/dist/es/chart/radar-area-chart/spline-radar-area-segment.js +3 -13
- package/dist/es/chart/radar-bar-chart/radar-bar-chart.js +19 -29
- package/dist/es/chart/radar-bar-chart/radar-segment.js +6 -12
- package/dist/es/chart/radar-line-chart/radar-line-chart.js +26 -35
- package/dist/es/chart/range-area-chart/range-area-chart.js +46 -58
- package/dist/es/chart/range-area-chart/range-area-point.js +55 -66
- package/dist/es/chart/range-area-chart/range-area-segment.js +19 -28
- package/dist/es/chart/range-area-chart/range-line-point.js +4 -14
- package/dist/es/chart/range-area-chart/spline-range-area-segment.js +11 -18
- package/dist/es/chart/range-area-chart/step-range-area-segment.js +7 -16
- package/dist/es/chart/range-bar-chart/range-bar-chart.js +18 -29
- package/dist/es/chart/range-bar-chart/range-bar.js +10 -23
- package/dist/es/chart/register-charts.js +20 -16
- package/dist/es/chart/scatter-charts/scatter-chart.js +100 -122
- package/dist/es/chart/scatter-charts/scatter-line-chart.js +15 -25
- package/dist/es/chart/selection.js +176 -201
- package/dist/es/chart/series-binder.js +55 -66
- package/dist/es/chart/theme/base-theme.js +75 -79
- package/dist/es/chart/theme/load-theme.js +52 -52
- package/dist/es/chart/tooltip/base-tooltip.js +17 -24
- package/dist/es/chart/tooltip/shared-tooltip.js +25 -31
- package/dist/es/chart/tooltip/tooltip.js +10 -20
- package/dist/es/chart/trendlines/calculate-moving-average.js +11 -13
- package/dist/es/chart/trendlines/calculate-polynomial.js +24 -26
- package/dist/es/chart/trendlines/calculate-slope.js +12 -14
- package/dist/es/chart/trendlines/check-all-positive.js +2 -5
- package/dist/es/chart/trendlines/exponential-trendline.js +15 -24
- package/dist/es/chart/trendlines/get-scatter-trendline-data.js +6 -7
- package/dist/es/chart/trendlines/get-trendline-data.js +6 -6
- package/dist/es/chart/trendlines/linear-trendline.js +12 -21
- package/dist/es/chart/trendlines/logarithmic-trendline.js +14 -23
- package/dist/es/chart/trendlines/moving-average.js +15 -26
- package/dist/es/chart/trendlines/polynomial-trendline.js +13 -21
- package/dist/es/chart/trendlines/power-trendline.js +15 -24
- package/dist/es/chart/trendlines/scatter-exponential-trendline.js +15 -24
- package/dist/es/chart/trendlines/scatter-linear-trendline.js +10 -16
- package/dist/es/chart/trendlines/scatter-logarithmic-trendline.js +17 -27
- package/dist/es/chart/trendlines/scatter-moving-average.js +7 -10
- package/dist/es/chart/trendlines/scatter-polynomial-trendline.js +11 -16
- package/dist/es/chart/trendlines/scatter-power-trendline.js +15 -22
- package/dist/es/chart/trendlines/scatter-trendline-registry.js +1 -1
- package/dist/es/chart/trendlines/scatter-value-getter.js +2 -5
- package/dist/es/chart/trendlines/trendline-factory.js +1 -1
- package/dist/es/chart/trendlines/trendline-registry.js +1 -1
- package/dist/es/chart/trendlines/x-value-limits.js +6 -8
- package/dist/es/chart/utils/any-has-z-index.js +1 -1
- package/dist/es/chart/utils/bind-segments.js +8 -8
- package/dist/es/chart/utils/categories-count.js +3 -3
- package/dist/es/chart/utils/count-numbers.js +4 -4
- package/dist/es/chart/utils/create-out-of-range-points.js +13 -22
- package/dist/es/chart/utils/eval-options.js +7 -10
- package/dist/es/chart/utils/filter-series-by-type.js +4 -4
- package/dist/es/chart/utils/get-field.js +1 -1
- package/dist/es/chart/utils/has-gradient-overlay.js +1 -1
- package/dist/es/chart/utils/is-date-axis.js +2 -2
- package/dist/es/chart/utils/parse-date-category.js +2 -2
- package/dist/es/chart/utils/segment-visible.js +2 -2
- package/dist/es/chart/waterfall-chart/waterfall-chart.js +41 -55
- package/dist/es/chart/waterfall-chart/waterfall-segment.js +16 -24
- package/dist/es/chart-wizard/get-wizard-data-from-data-rows.js +5 -6
- package/dist/es/chart-wizard/messages.js +1 -1
- package/dist/es/chart-wizard/state.js +145 -137
- package/dist/es/chart-wizard.js +12 -12
- package/dist/es/common/add-class.js +3 -3
- package/dist/es/common/align-path-to-pixel.js +2 -2
- package/dist/es/common/auto-text-color.js +1 -1
- package/dist/es/common/constants.js +53 -53
- package/dist/es/common/create-hash-set.js +59 -65
- package/dist/es/common/cycleDown.js +1 -1
- package/dist/es/common/deep-extend.js +10 -12
- package/dist/es/common/element-scale.js +9 -9
- package/dist/es/common/element-styles.js +8 -8
- package/dist/es/common/event-map.js +4 -4
- package/dist/es/common/event-utils.js +13 -13
- package/dist/es/common/find.js +2 -2
- package/dist/es/common/font-loader.js +42 -44
- package/dist/es/common/get-aria-template.js +2 -4
- package/dist/es/common/get-spacing.js +2 -4
- package/dist/es/common/get-supported-features.js +7 -7
- package/dist/es/common/get-template.js +2 -4
- package/dist/es/common/getter.js +5 -5
- package/dist/es/common/grep.js +3 -3
- package/dist/es/common/has-classes.js +2 -2
- package/dist/es/common/hash-map.js +11 -11
- package/dist/es/common/instance-observer.js +28 -33
- package/dist/es/common/keys.js +1 -1
- package/dist/es/common/map.js +4 -4
- package/dist/es/common/matrix.js +142 -150
- package/dist/es/common/mousewheel-delta.js +2 -2
- package/dist/es/common/observable.js +40 -52
- package/dist/es/common/remove-class.js +1 -1
- package/dist/es/common/render-icon.js +50 -60
- package/dist/es/common/set-default-options.js +1 -1
- package/dist/es/common/sparse-array-limits.js +4 -4
- package/dist/es/common/user-events.js +124 -150
- package/dist/es/core/axis-label.js +38 -43
- package/dist/es/core/axis.js +293 -345
- package/dist/es/core/box-element.js +36 -46
- package/dist/es/core/box.js +75 -83
- package/dist/es/core/category-axis.js +265 -314
- package/dist/es/core/chart-element.js +98 -109
- package/dist/es/core/constants.js +3 -3
- package/dist/es/core/curve-processor.js +86 -93
- package/dist/es/core/date-category-axis.js +381 -413
- package/dist/es/core/date-value-axis.js +108 -118
- package/dist/es/core/float-element.js +54 -78
- package/dist/es/core/gradients.js +3 -3
- package/dist/es/core/logarithmic-axis.js +134 -186
- package/dist/es/core/mixins/grid-lines-mixin.js +18 -20
- package/dist/es/core/mixins/radar-numeric-axis-mixin.js +46 -51
- package/dist/es/core/note.js +58 -73
- package/dist/es/core/numeric-axis.js +111 -133
- package/dist/es/core/pattern.js +4 -8
- package/dist/es/core/point.js +25 -34
- package/dist/es/core/polar-axis.js +73 -91
- package/dist/es/core/radar-category-axis.js +90 -114
- package/dist/es/core/radar-logarithmic-axis.js +10 -20
- package/dist/es/core/radar-numeric-axis.js +10 -20
- package/dist/es/core/ring.js +61 -68
- package/dist/es/core/root-element.js +40 -48
- package/dist/es/core/sector.js +11 -17
- package/dist/es/core/shape-builder.js +13 -23
- package/dist/es/core/shape-element.js +27 -37
- package/dist/es/core/text-box.js +50 -59
- package/dist/es/core/text.js +13 -24
- package/dist/es/core/title.js +19 -25
- package/dist/es/core/utils/auto-axis-max.js +3 -3
- package/dist/es/core/utils/auto-axis-min.js +3 -3
- package/dist/es/core/utils/auto-major-unit.js +4 -4
- package/dist/es/core/utils/box-diff.js +9 -9
- package/dist/es/core/utils/create-axis-grid-line.js +2 -4
- package/dist/es/core/utils/create-axis-tick.js +2 -4
- package/dist/es/core/utils/guid.js +3 -3
- package/dist/es/core/utils/rect-to-box.js +2 -2
- package/dist/es/date-utils/absolute-date-diff.js +2 -2
- package/dist/es/date-utils/add-duration.js +5 -5
- package/dist/es/date-utils/ceil-date.js +1 -1
- package/dist/es/date-utils/constants.js +17 -17
- package/dist/es/date-utils/date-index.js +3 -3
- package/dist/es/date-utils/duration.js +1 -1
- package/dist/es/date-utils/lte-date-index.js +4 -4
- package/dist/es/date-utils/parse-date.js +1 -1
- package/dist/es/date-utils/parse-dates.js +2 -2
- package/dist/es/date-utils/start-of-week.js +3 -5
- package/dist/es/date-utils/to-date.js +1 -1
- package/dist/es/date-utils/to-time.js +2 -2
- package/dist/es/drawing-utils.js +18 -17
- package/dist/es/gauges/arc/arc-gauge.js +29 -38
- package/dist/es/gauges/arc/arc-scale.js +16 -29
- package/dist/es/gauges/arc/range-pointer-animation.js +16 -25
- package/dist/es/gauges/arc/range-pointer.js +25 -46
- package/dist/es/gauges/circular/circular-gauge.js +7 -17
- package/dist/es/gauges/constants.js +14 -14
- package/dist/es/gauges/gauge.js +84 -96
- package/dist/es/gauges/linear/arrow-linear-pointer-animation.js +13 -25
- package/dist/es/gauges/linear/arrow-linear-pointer.js +23 -35
- package/dist/es/gauges/linear/bar-linear-pointer-animation.js +15 -24
- package/dist/es/gauges/linear/bar-linear-pointer.js +38 -51
- package/dist/es/gauges/linear/linear-gauge.js +61 -83
- package/dist/es/gauges/linear/linear-pointer.js +25 -39
- package/dist/es/gauges/linear/linear-scale.js +57 -74
- package/dist/es/gauges/pointer.js +11 -21
- package/dist/es/gauges/radial/radial-gauge.js +58 -81
- package/dist/es/gauges/radial/radial-pointer-animation.js +9 -15
- package/dist/es/gauges/radial/radial-pointer.js +33 -48
- package/dist/es/gauges/radial/radial-scale.js +154 -186
- package/dist/es/gauges/utils/build-label-element.js +10 -12
- package/dist/es/gauges/utils/get-range.js +2 -2
- package/dist/es/gauges/utils/pad.js +3 -3
- package/dist/es/gauges/utils/unpad.js +1 -1
- package/dist/es/map/attribution.js +42 -52
- package/dist/es/map/constants.js +5 -5
- package/dist/es/map/crs.js +68 -112
- package/dist/es/map/datums.js +3 -3
- package/dist/es/map/extent.js +40 -54
- package/dist/es/map/layers/bubble.js +52 -70
- package/dist/es/map/layers/layer.js +50 -56
- package/dist/es/map/layers/marker.js +109 -129
- package/dist/es/map/layers/shape.js +111 -133
- package/dist/es/map/layers/tile.js +144 -170
- package/dist/es/map/location.js +70 -78
- package/dist/es/map/map.js +261 -291
- package/dist/es/map/navigator.js +33 -39
- package/dist/es/map/scroller/draggable.js +98 -134
- package/dist/es/map/scroller/fx.js +39 -46
- package/dist/es/map/scroller/scroller.js +144 -174
- package/dist/es/map/tooltip/tooltip.js +15 -25
- package/dist/es/map/utils.js +25 -26
- package/dist/es/map/zoom.js +30 -36
- package/dist/es/qrcode/encodings/data-modes/alpha-numeric-data-mode.js +14 -26
- package/dist/es/qrcode/encodings/data-modes/byte-data-mode.js +15 -25
- package/dist/es/qrcode/encodings/data-modes/data-mode-instances.js +8 -7
- package/dist/es/qrcode/encodings/data-modes/numeric-data-mode.js +14 -24
- package/dist/es/qrcode/encodings/data-modes/qr-data-mode.js +15 -21
- package/dist/es/qrcode/encodings/encoders/iso-encoder.js +6 -16
- package/dist/es/qrcode/encodings/encoders/utf8-encoder.js +28 -36
- package/dist/es/qrcode/encodings/encoding-result.js +4 -10
- package/dist/es/qrcode/encodings/encoding.js +68 -192
- package/dist/es/qrcode/encodings/free-cell-visitor.js +16 -24
- package/dist/es/qrcode/encodings/utils/choose-mode.js +44 -0
- package/dist/es/qrcode/encodings/utils/get-data-codewords-count.js +13 -0
- package/dist/es/qrcode/encodings/utils/get-data-string.js +13 -0
- package/dist/es/qrcode/encodings/utils/get-modes.js +35 -0
- package/dist/es/qrcode/encodings/utils/get-version.js +23 -0
- package/dist/es/qrcode/encodings/utils/index.js +5 -0
- package/dist/es/qrcode/encodings/version-codewords.js +1 -1
- package/dist/es/qrcode/qrcode-validator.js +3 -5
- package/dist/es/qrcode/qrcode.js +104 -114
- package/dist/es/qrcode/utils.js +4 -4
- package/dist/es/sankey/calculation.js +286 -307
- package/dist/es/sankey/element.js +15 -23
- package/dist/es/sankey/label.js +29 -44
- package/dist/es/sankey/legend.js +15 -29
- package/dist/es/sankey/link.js +80 -98
- package/dist/es/sankey/node.js +26 -37
- package/dist/es/sankey/sankey.js +318 -385
- package/dist/es/sankey/title.js +9 -20
- package/dist/es/sankey/utils.js +18 -23
- package/dist/es/services/chart-service.js +24 -28
- package/dist/es/services/dom-events-builder.js +15 -15
- package/dist/es/services/format-service.js +30 -35
- package/dist/es/services/intl-service.js +14 -18
- package/dist/es/services/map-service.js +11 -11
- package/dist/es/services/template-service.js +9 -9
- package/dist/es/sparkline/shared-tooltip.js +11 -21
- package/dist/es/sparkline/sparkline.js +50 -60
- package/dist/es/stock/constants.js +3 -3
- package/dist/es/stock/fade-out-animation.js +12 -21
- package/dist/es/stock/navigator-hint.js +37 -49
- package/dist/es/stock/navigator.js +130 -161
- package/dist/es/stock/stock-chart.js +58 -67
- package/dist/es2015/chart/legend/legend-item.js +1 -1
- package/dist/es2015/qrcode/encodings/encoders/iso-encoder.js +1 -1
- package/dist/es2015/qrcode/encodings/encoders/utf8-encoder.js +1 -1
- package/dist/es2015/qrcode/encodings/encoding.js +3 -127
- package/dist/es2015/qrcode/encodings/utils/choose-mode.js +44 -0
- package/dist/es2015/qrcode/encodings/utils/get-data-codewords-count.js +13 -0
- package/dist/es2015/qrcode/encodings/utils/get-data-string.js +13 -0
- package/dist/es2015/qrcode/encodings/utils/get-modes.js +35 -0
- package/dist/es2015/qrcode/encodings/utils/get-version.js +23 -0
- package/dist/es2015/qrcode/encodings/utils/index.js +5 -0
- package/dist/npm/main.js +3222 -3589
- package/dist/systemjs/kendo-charts.js +1 -1
- package/package.json +19 -57
package/dist/es/map/map.js
CHANGED
|
@@ -79,7 +79,7 @@ import MapService from './../services/map-service';
|
|
|
79
79
|
|
|
80
80
|
import { CENTER_CHANGE, INIT, ZOOM_CHANGE } from './constants';
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
let math = Math,
|
|
83
83
|
min = math.min,
|
|
84
84
|
pow = math.pow,
|
|
85
85
|
Point = g.Point,
|
|
@@ -92,31 +92,21 @@ var math = Math,
|
|
|
92
92
|
VELOCITY_MULTIPLIER = 5,
|
|
93
93
|
DEFAULT_ZOOM_RATE = 1;
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
const layersMap = {
|
|
96
96
|
bubble: BubbleLayer,
|
|
97
97
|
shape: ShapeLayer,
|
|
98
|
-
tile: TileLayer
|
|
98
|
+
tile: TileLayer,
|
|
99
|
+
[MARKER]: MarkerLayer
|
|
99
100
|
};
|
|
100
|
-
layersMap[MARKER] = MarkerLayer;
|
|
101
101
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
if ( themeOptions === void 0 ) themeOptions = {};
|
|
106
|
-
if ( context === void 0 ) context = {};
|
|
107
|
-
|
|
108
|
-
Observable.call(this);
|
|
102
|
+
class Map extends Observable {
|
|
103
|
+
constructor(element, options = {}, themeOptions = {}, context = {}) {
|
|
104
|
+
super();
|
|
109
105
|
|
|
110
106
|
this._init(element, options, themeOptions, context);
|
|
111
107
|
}
|
|
112
108
|
|
|
113
|
-
|
|
114
|
-
Map.prototype = Object.create( Observable && Observable.prototype );
|
|
115
|
-
Map.prototype.constructor = Map;
|
|
116
|
-
|
|
117
|
-
Map.prototype.destroy = function destroy () {
|
|
118
|
-
var this$1 = this;
|
|
119
|
-
|
|
109
|
+
destroy() {
|
|
120
110
|
this.scroller.destroy();
|
|
121
111
|
|
|
122
112
|
if (this._tooltip) {
|
|
@@ -134,28 +124,24 @@ var Map = (function (Observable) {
|
|
|
134
124
|
}
|
|
135
125
|
|
|
136
126
|
if (isArray(this.markers)) {
|
|
137
|
-
this.markers.forEach(
|
|
127
|
+
this.markers.forEach(markerLayer => {
|
|
138
128
|
markerLayer.destroy();
|
|
139
129
|
});
|
|
140
130
|
} else {
|
|
141
131
|
this.markers.destroy();
|
|
142
132
|
}
|
|
143
133
|
|
|
144
|
-
for (
|
|
145
|
-
this
|
|
134
|
+
for (let i = 0; i < this.layers.length; i++) {
|
|
135
|
+
this.layers[i].destroy();
|
|
146
136
|
}
|
|
147
137
|
|
|
148
138
|
off(this.element, MOUSEWHEEL, this._mousewheelHandler);
|
|
149
139
|
|
|
150
|
-
|
|
151
|
-
}
|
|
140
|
+
super.destroy();
|
|
141
|
+
}
|
|
152
142
|
|
|
153
143
|
// eslint-disable-next-line no-unused-vars
|
|
154
|
-
|
|
155
|
-
if ( options === void 0 ) options = {};
|
|
156
|
-
if ( themeOptions === void 0 ) themeOptions = {};
|
|
157
|
-
if ( context === void 0 ) context = {};
|
|
158
|
-
|
|
144
|
+
_init(element, options = {}, themeOptions = {}, context = {}) {
|
|
159
145
|
this.support = getSupportedFeatures();
|
|
160
146
|
this.context = context;
|
|
161
147
|
|
|
@@ -178,19 +164,19 @@ var Map = (function (Observable) {
|
|
|
178
164
|
this._initLayers();
|
|
179
165
|
this._reset();
|
|
180
166
|
|
|
181
|
-
|
|
182
|
-
this._mousewheelHandler =
|
|
167
|
+
const mousewheelThrottled = throttle(this._mousewheel.bind(this), MOUSEWHEEL_THROTTLE);
|
|
168
|
+
this._mousewheelHandler = (e) => {
|
|
183
169
|
e.preventDefault();
|
|
184
170
|
mousewheelThrottled(e);
|
|
185
171
|
};
|
|
186
172
|
on(this.element, MOUSEWHEEL, this._mousewheelHandler);
|
|
187
|
-
}
|
|
173
|
+
}
|
|
188
174
|
|
|
189
|
-
|
|
175
|
+
_initOptions(options) {
|
|
190
176
|
this.options = deepExtend({}, this.options, options);
|
|
191
|
-
}
|
|
177
|
+
}
|
|
192
178
|
|
|
193
|
-
|
|
179
|
+
_initElement(element) {
|
|
194
180
|
this.element = element;
|
|
195
181
|
|
|
196
182
|
addClass(element, "k-map");
|
|
@@ -198,91 +184,83 @@ var Map = (function (Observable) {
|
|
|
198
184
|
element.setAttribute("data-role", "map");
|
|
199
185
|
removeChildren(element);
|
|
200
186
|
|
|
201
|
-
|
|
187
|
+
const div = convertToHtml("<div />");
|
|
202
188
|
this.element.appendChild(div);
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
Map.prototype.initServices = function initServices (context) {
|
|
206
|
-
if ( context === void 0 ) context = {};
|
|
189
|
+
}
|
|
207
190
|
|
|
191
|
+
initServices(context = {}) {
|
|
208
192
|
this.widgetService = new MapService(this, context);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
Map.prototype.initObserver = function initObserver (context) {
|
|
212
|
-
if ( context === void 0 ) context = {};
|
|
193
|
+
}
|
|
213
194
|
|
|
195
|
+
initObserver(context = {}) {
|
|
214
196
|
this.observers = [];
|
|
215
197
|
this.addObserver(context.observer);
|
|
216
|
-
}
|
|
198
|
+
}
|
|
217
199
|
|
|
218
|
-
|
|
200
|
+
addObserver(observer) {
|
|
219
201
|
if (observer) {
|
|
220
202
|
this.observers.push(observer);
|
|
221
203
|
}
|
|
222
|
-
}
|
|
204
|
+
}
|
|
223
205
|
|
|
224
|
-
|
|
225
|
-
|
|
206
|
+
removeObserver(observer) {
|
|
207
|
+
const index = this.observers.indexOf(observer);
|
|
226
208
|
|
|
227
209
|
if (index >= 0) {
|
|
228
210
|
this.observers.splice(index, 1);
|
|
229
211
|
}
|
|
230
|
-
}
|
|
212
|
+
}
|
|
231
213
|
|
|
232
|
-
|
|
233
|
-
|
|
214
|
+
requiresHandlers(eventNames) {
|
|
215
|
+
const observers = this.observers;
|
|
234
216
|
|
|
235
|
-
for (
|
|
217
|
+
for (let idx = 0; idx < observers.length; idx++) {
|
|
236
218
|
if (observers[idx].requiresHandlers(eventNames)) {
|
|
237
219
|
return true;
|
|
238
220
|
}
|
|
239
221
|
}
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
Map.prototype.trigger = function trigger (name, args) {
|
|
243
|
-
if ( args === void 0 ) args = {};
|
|
222
|
+
}
|
|
244
223
|
|
|
224
|
+
trigger(name, args = {}) {
|
|
245
225
|
args.sender = this;
|
|
246
226
|
|
|
247
|
-
|
|
248
|
-
|
|
227
|
+
const observers = this.observers;
|
|
228
|
+
let isDefaultPrevented = false;
|
|
249
229
|
|
|
250
|
-
for (
|
|
230
|
+
for (let idx = 0; idx < observers.length; idx++) {
|
|
251
231
|
if (observers[idx].trigger(name, args)) {
|
|
252
232
|
isDefaultPrevented = true;
|
|
253
233
|
}
|
|
254
234
|
}
|
|
255
235
|
|
|
256
236
|
if (!isDefaultPrevented) {
|
|
257
|
-
|
|
237
|
+
super.trigger(name, args);
|
|
258
238
|
}
|
|
259
239
|
|
|
260
240
|
return isDefaultPrevented;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
Map.prototype._notifyObserver = function _notifyObserver (name, args) {
|
|
264
|
-
if ( args === void 0 ) args = {};
|
|
241
|
+
}
|
|
265
242
|
|
|
243
|
+
_notifyObserver(name, args = {}) {
|
|
266
244
|
args.sender = this;
|
|
267
245
|
|
|
268
|
-
|
|
269
|
-
|
|
246
|
+
const observers = this.observers;
|
|
247
|
+
let isDefaultPrevented = false;
|
|
270
248
|
|
|
271
|
-
for (
|
|
249
|
+
for (let idx = 0; idx < observers.length; idx++) {
|
|
272
250
|
if (observers[idx].trigger(name, args)) {
|
|
273
251
|
isDefaultPrevented = true;
|
|
274
252
|
}
|
|
275
253
|
}
|
|
276
254
|
|
|
277
255
|
return isDefaultPrevented;
|
|
278
|
-
}
|
|
256
|
+
}
|
|
279
257
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
258
|
+
zoom(level) {
|
|
259
|
+
let options = this.options;
|
|
260
|
+
let result;
|
|
283
261
|
|
|
284
262
|
if (defined(level)) {
|
|
285
|
-
|
|
263
|
+
const zoomLevel = math.round(limitValue(level, options.minZoom, options.maxZoom));
|
|
286
264
|
|
|
287
265
|
if (options.zoom !== zoomLevel) {
|
|
288
266
|
options.zoom = zoomLevel;
|
|
@@ -296,14 +274,14 @@ var Map = (function (Observable) {
|
|
|
296
274
|
}
|
|
297
275
|
|
|
298
276
|
return result;
|
|
299
|
-
}
|
|
277
|
+
}
|
|
300
278
|
|
|
301
|
-
|
|
302
|
-
|
|
279
|
+
center(center) {
|
|
280
|
+
let result;
|
|
303
281
|
|
|
304
|
-
if (center
|
|
305
|
-
|
|
306
|
-
|
|
282
|
+
if (center) {
|
|
283
|
+
const current = Location.create(center);
|
|
284
|
+
const previous = Location.create(this.options.center);
|
|
307
285
|
if (!current.equals(previous)) {
|
|
308
286
|
this.options.center = current.toArray();
|
|
309
287
|
this.widgetService.notify(CENTER_CHANGE, { center: this.options.center });
|
|
@@ -316,100 +294,98 @@ var Map = (function (Observable) {
|
|
|
316
294
|
}
|
|
317
295
|
|
|
318
296
|
return result;
|
|
319
|
-
}
|
|
297
|
+
}
|
|
320
298
|
|
|
321
|
-
|
|
322
|
-
|
|
299
|
+
extent(extent) {
|
|
300
|
+
let result;
|
|
323
301
|
|
|
324
|
-
if (extent
|
|
325
|
-
this._setExtent(extent
|
|
302
|
+
if (extent) {
|
|
303
|
+
this._setExtent(extent);
|
|
326
304
|
result = this;
|
|
327
305
|
} else {
|
|
328
306
|
result = this._getExtent();
|
|
329
307
|
}
|
|
330
308
|
|
|
331
309
|
return result;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
Map.prototype.setOptions = function setOptions (options) {
|
|
335
|
-
if ( options === void 0 ) options = {};
|
|
310
|
+
}
|
|
336
311
|
|
|
337
|
-
|
|
312
|
+
setOptions(options = {}) {
|
|
313
|
+
const element = this.element;
|
|
338
314
|
|
|
339
315
|
this.destroy();
|
|
340
316
|
removeChildren(element);
|
|
341
317
|
this._init(element, options, {}, this.context);
|
|
342
318
|
|
|
343
319
|
this._reset();
|
|
344
|
-
}
|
|
320
|
+
}
|
|
345
321
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
322
|
+
locationToLayer(location, zoom) {
|
|
323
|
+
let clamp = !this.options.wraparound;
|
|
324
|
+
const locationObject = Location.create(location);
|
|
349
325
|
|
|
350
326
|
return this.crs.toPoint(locationObject, this._layerSize(zoom), clamp);
|
|
351
|
-
}
|
|
327
|
+
}
|
|
352
328
|
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
329
|
+
layerToLocation(point, zoom) {
|
|
330
|
+
let clamp = !this.options.wraparound;
|
|
331
|
+
const pointObject = Point.create(point);
|
|
356
332
|
|
|
357
333
|
return this.crs.toLocation(pointObject, this._layerSize(zoom), clamp);
|
|
358
|
-
}
|
|
334
|
+
}
|
|
359
335
|
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
336
|
+
locationToView(location) {
|
|
337
|
+
const locationObject = Location.create(location);
|
|
338
|
+
let origin = this.locationToLayer(this._viewOrigin);
|
|
339
|
+
let point = this.locationToLayer(locationObject);
|
|
364
340
|
|
|
365
341
|
return point.translateWith(origin.scale(-1));
|
|
366
|
-
}
|
|
342
|
+
}
|
|
367
343
|
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
344
|
+
viewToLocation(point, zoom) {
|
|
345
|
+
const origin = this.locationToLayer(this._getOrigin(), zoom);
|
|
346
|
+
const pointObject = Point.create(point);
|
|
347
|
+
const pointResult = pointObject.clone().translateWith(origin);
|
|
372
348
|
|
|
373
349
|
return this.layerToLocation(pointResult, zoom);
|
|
374
|
-
}
|
|
350
|
+
}
|
|
375
351
|
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
352
|
+
eventOffset(e) {
|
|
353
|
+
let x;
|
|
354
|
+
let y;
|
|
355
|
+
let offset = elementOffset(this.element);
|
|
380
356
|
|
|
381
357
|
if ((e.x && e.x[LOCATION]) || (e.y && e.y[LOCATION])) {
|
|
382
358
|
x = e.x[LOCATION] - offset.left;
|
|
383
359
|
y = e.y[LOCATION] - offset.top;
|
|
384
360
|
} else {
|
|
385
|
-
|
|
361
|
+
let event = e.originalEvent || e;
|
|
386
362
|
x = valueOrDefault(event.pageX, event.clientX) - offset.left;
|
|
387
363
|
y = valueOrDefault(event.pageY, event.clientY) - offset.top;
|
|
388
364
|
}
|
|
389
365
|
|
|
390
|
-
|
|
366
|
+
const point = new g.Point(x, y);
|
|
391
367
|
|
|
392
368
|
return point;
|
|
393
|
-
}
|
|
369
|
+
}
|
|
394
370
|
|
|
395
|
-
|
|
396
|
-
|
|
371
|
+
eventToView(e) {
|
|
372
|
+
let cursor = this.eventOffset(e);
|
|
397
373
|
return this.locationToView(this.viewToLocation(cursor));
|
|
398
|
-
}
|
|
374
|
+
}
|
|
399
375
|
|
|
400
|
-
|
|
376
|
+
eventToLayer(e) {
|
|
401
377
|
return this.locationToLayer(this.eventToLocation(e));
|
|
402
|
-
}
|
|
378
|
+
}
|
|
403
379
|
|
|
404
|
-
|
|
405
|
-
|
|
380
|
+
eventToLocation(e) {
|
|
381
|
+
let cursor = this.eventOffset(e);
|
|
406
382
|
return this.viewToLocation(cursor);
|
|
407
|
-
}
|
|
383
|
+
}
|
|
408
384
|
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
385
|
+
viewSize() {
|
|
386
|
+
let element = this.element;
|
|
387
|
+
let scale = this._layerSize();
|
|
388
|
+
let width = element.clientWidth;
|
|
413
389
|
|
|
414
390
|
if (!this.options.wraparound) {
|
|
415
391
|
width = min(scale, width);
|
|
@@ -419,24 +395,24 @@ var Map = (function (Observable) {
|
|
|
419
395
|
width: width,
|
|
420
396
|
height: min(scale, element.clientHeight)
|
|
421
397
|
};
|
|
422
|
-
}
|
|
398
|
+
}
|
|
423
399
|
|
|
424
|
-
|
|
400
|
+
exportVisual() {
|
|
425
401
|
this._reset();
|
|
426
402
|
return false;
|
|
427
|
-
}
|
|
403
|
+
}
|
|
428
404
|
|
|
429
|
-
|
|
405
|
+
hideTooltip() {
|
|
430
406
|
if (this._tooltip) {
|
|
431
407
|
this._tooltip.hide();
|
|
432
408
|
}
|
|
433
|
-
}
|
|
409
|
+
}
|
|
434
410
|
|
|
435
|
-
|
|
436
|
-
|
|
411
|
+
_setOrigin(origin, zoom) {
|
|
412
|
+
let size = this.viewSize(),
|
|
437
413
|
topLeft;
|
|
438
414
|
|
|
439
|
-
|
|
415
|
+
const originLocation = this._origin = Location.create(origin);
|
|
440
416
|
topLeft = this.locationToLayer(originLocation, zoom);
|
|
441
417
|
topLeft.x += size.width / 2;
|
|
442
418
|
topLeft.y += size.height / 2;
|
|
@@ -444,10 +420,10 @@ var Map = (function (Observable) {
|
|
|
444
420
|
this.widgetService.notify(CENTER_CHANGE, { center: this.options.center });
|
|
445
421
|
|
|
446
422
|
return this;
|
|
447
|
-
}
|
|
423
|
+
}
|
|
448
424
|
|
|
449
|
-
|
|
450
|
-
|
|
425
|
+
_getOrigin(invalidate) {
|
|
426
|
+
let size = this.viewSize(),
|
|
451
427
|
topLeft;
|
|
452
428
|
|
|
453
429
|
if (invalidate || !this._origin) {
|
|
@@ -458,29 +434,27 @@ var Map = (function (Observable) {
|
|
|
458
434
|
}
|
|
459
435
|
|
|
460
436
|
return this._origin;
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
Map.prototype._setExtent = function _setExtent (newExtent) {
|
|
464
|
-
var this$1 = this;
|
|
437
|
+
}
|
|
465
438
|
|
|
466
|
-
|
|
467
|
-
|
|
439
|
+
_setExtent(newExtent) {
|
|
440
|
+
let raw = Extent.create(newExtent);
|
|
441
|
+
let se = raw.se.clone();
|
|
468
442
|
|
|
469
443
|
if (this.options.wraparound && se.lng < 0 && newExtent.nw.lng > 0) {
|
|
470
444
|
se.lng = 180 + (180 + se.lng);
|
|
471
445
|
}
|
|
472
446
|
|
|
473
|
-
|
|
447
|
+
const extent = new Extent(raw.nw, se);
|
|
474
448
|
this.center(extent.center());
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
449
|
+
let width = this.element.clientWidth;
|
|
450
|
+
let height = this.element.clientHeight;
|
|
451
|
+
let zoom;
|
|
478
452
|
|
|
479
453
|
for (zoom = this.options.maxZoom; zoom >= this.options.minZoom; zoom--) {
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
454
|
+
let topLeft = this.locationToLayer(extent.nw, zoom);
|
|
455
|
+
let bottomRight = this.locationToLayer(extent.se, zoom);
|
|
456
|
+
let layerWidth = math.abs(bottomRight.x - topLeft.x);
|
|
457
|
+
let layerHeight = math.abs(bottomRight.y - topLeft.y);
|
|
484
458
|
|
|
485
459
|
if (layerWidth <= width && layerHeight <= height) {
|
|
486
460
|
break;
|
|
@@ -488,28 +462,28 @@ var Map = (function (Observable) {
|
|
|
488
462
|
}
|
|
489
463
|
|
|
490
464
|
this.zoom(zoom);
|
|
491
|
-
}
|
|
465
|
+
}
|
|
492
466
|
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
467
|
+
_getExtent() {
|
|
468
|
+
let nw = this._getOrigin();
|
|
469
|
+
let bottomRight = this.locationToLayer(nw);
|
|
470
|
+
let size = this.viewSize();
|
|
497
471
|
|
|
498
472
|
bottomRight.x += size.width;
|
|
499
473
|
bottomRight.y += size.height;
|
|
500
474
|
|
|
501
|
-
|
|
475
|
+
let se = this.layerToLocation(bottomRight);
|
|
502
476
|
|
|
503
477
|
return new Extent(nw, se);
|
|
504
|
-
}
|
|
478
|
+
}
|
|
505
479
|
|
|
506
|
-
|
|
480
|
+
_zoomAround(pivot, level) {
|
|
507
481
|
this._setOrigin(this.layerToLocation(pivot, level), level);
|
|
508
482
|
this.zoom(level);
|
|
509
|
-
}
|
|
483
|
+
}
|
|
510
484
|
|
|
511
|
-
|
|
512
|
-
|
|
485
|
+
_initControls() {
|
|
486
|
+
let controls = this.options.controls;
|
|
513
487
|
if (controls.attribution) {
|
|
514
488
|
this._createAttribution(controls.attribution);
|
|
515
489
|
}
|
|
@@ -523,50 +497,50 @@ var Map = (function (Observable) {
|
|
|
523
497
|
this._createZoomControl(controls.zoom);
|
|
524
498
|
}
|
|
525
499
|
}
|
|
526
|
-
}
|
|
500
|
+
}
|
|
527
501
|
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
502
|
+
_createControlElement(options, defaultPosition) {
|
|
503
|
+
let pos = options.position || defaultPosition;
|
|
504
|
+
let posSelector = '.' + renderPos(pos).replace(' ', '.');
|
|
505
|
+
let wrap = this.element.querySelector('.k-map-controls' + posSelector) || [];
|
|
532
506
|
|
|
533
507
|
if (wrap.length === 0) {
|
|
534
|
-
|
|
535
|
-
addClass(div
|
|
536
|
-
wrap = div
|
|
508
|
+
let div = document.createElement("div");
|
|
509
|
+
addClass(div, 'k-map-controls ' + renderPos(pos));
|
|
510
|
+
wrap = div;
|
|
537
511
|
this.element.appendChild(wrap);
|
|
538
512
|
}
|
|
539
513
|
|
|
540
|
-
|
|
514
|
+
let div = document.createElement("div");
|
|
541
515
|
|
|
542
516
|
wrap.appendChild(div);
|
|
543
517
|
|
|
544
518
|
return div;
|
|
545
|
-
}
|
|
519
|
+
}
|
|
546
520
|
|
|
547
|
-
|
|
548
|
-
|
|
521
|
+
_createAttribution(options) {
|
|
522
|
+
let element = this._createControlElement(options, 'bottomRight');
|
|
549
523
|
this.attribution = new Attribution(element, options);
|
|
550
|
-
}
|
|
524
|
+
}
|
|
551
525
|
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
526
|
+
_createNavigator(options) {
|
|
527
|
+
let element = this._createControlElement(options, 'topLeft');
|
|
528
|
+
let navigator = this.navigator = new Navigator(element, deepExtend({}, options, { icons: this.options.icons }));
|
|
555
529
|
|
|
556
530
|
this._navigatorPan = this._navigatorPan.bind(this);
|
|
557
531
|
navigator.bind('pan', this._navigatorPan);
|
|
558
532
|
|
|
559
533
|
this._navigatorCenter = this._navigatorCenter.bind(this);
|
|
560
534
|
navigator.bind('center', this._navigatorCenter);
|
|
561
|
-
}
|
|
535
|
+
}
|
|
562
536
|
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
537
|
+
_navigatorPan(e) {
|
|
538
|
+
let scroller = this.scroller;
|
|
539
|
+
let x = scroller.scrollLeft + e.x;
|
|
540
|
+
let y = scroller.scrollTop - e.y;
|
|
541
|
+
let bounds = this._virtualSize;
|
|
542
|
+
let width = this.element.clientWidth;
|
|
543
|
+
let height = this.element.clientHeight;
|
|
570
544
|
|
|
571
545
|
// TODO: Move limits to scroller
|
|
572
546
|
x = limitValue(x, bounds.x.min, bounds.x.max - width);
|
|
@@ -575,21 +549,21 @@ var Map = (function (Observable) {
|
|
|
575
549
|
this.scroller.one('scroll', proxy(this._scrollEnd, this));
|
|
576
550
|
|
|
577
551
|
this.scroller.scrollTo(-x, -y);
|
|
578
|
-
}
|
|
552
|
+
}
|
|
579
553
|
|
|
580
|
-
|
|
554
|
+
_navigatorCenter() {
|
|
581
555
|
this.center(this.options.center);
|
|
582
|
-
}
|
|
556
|
+
}
|
|
583
557
|
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
558
|
+
_createZoomControl(options) {
|
|
559
|
+
let element = this._createControlElement(options, 'topLeft');
|
|
560
|
+
let zoomControl = this.zoomControl = new ZoomControl(element, options, this.options.icons);
|
|
587
561
|
|
|
588
562
|
this._zoomControlChange = this._zoomControlChange.bind(this);
|
|
589
563
|
zoomControl.bind('change', this._zoomControlChange);
|
|
590
|
-
}
|
|
564
|
+
}
|
|
591
565
|
|
|
592
|
-
|
|
566
|
+
_zoomControlChange(e) {
|
|
593
567
|
if (!this.trigger('zoomStart', { originalEvent: e })) {
|
|
594
568
|
this.zoom(this.zoom() + e.delta);
|
|
595
569
|
|
|
@@ -597,12 +571,12 @@ var Map = (function (Observable) {
|
|
|
597
571
|
originalEvent: e
|
|
598
572
|
});
|
|
599
573
|
}
|
|
600
|
-
}
|
|
574
|
+
}
|
|
601
575
|
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
576
|
+
_initScroller() {
|
|
577
|
+
let friction = this.support.mobileOS ? FRICTION_MOBILE : FRICTION;
|
|
578
|
+
let zoomable = this.options.zoomable !== false;
|
|
579
|
+
let scroller = this.scroller = new Scroller(this.element.children[0], {
|
|
606
580
|
friction: friction,
|
|
607
581
|
velocityMultiplier: VELOCITY_MULTIPLIER,
|
|
608
582
|
zoom: zoomable,
|
|
@@ -619,46 +593,44 @@ var Map = (function (Observable) {
|
|
|
619
593
|
scroller.userEvents.bind('tap', proxy(this._tap, this));
|
|
620
594
|
|
|
621
595
|
this.scrollElement = scroller.scrollElement;
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
Map.prototype._initLayers = function _initLayers () {
|
|
625
|
-
var this$1 = this;
|
|
596
|
+
}
|
|
626
597
|
|
|
627
|
-
|
|
598
|
+
_initLayers() {
|
|
599
|
+
let defs = this.options.layers,
|
|
628
600
|
layers = this.layers = [];
|
|
629
601
|
|
|
630
|
-
for (
|
|
631
|
-
|
|
602
|
+
for (let i = 0; i < defs.length; i++) {
|
|
603
|
+
let options = defs[i];
|
|
632
604
|
|
|
633
|
-
|
|
605
|
+
const layer = this._createLayer(options);
|
|
634
606
|
layers.push(layer);
|
|
635
607
|
}
|
|
636
|
-
}
|
|
608
|
+
}
|
|
637
609
|
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
610
|
+
_createLayer(options) {
|
|
611
|
+
let type = options.type || 'shape';
|
|
612
|
+
let layerDefaults = this.options.layerDefaults[type];
|
|
613
|
+
let layerOptions = type === MARKER ?
|
|
642
614
|
deepExtend({}, this.options.markerDefaults, options, { icons: this.options.icons }) :
|
|
643
615
|
deepExtend({}, layerDefaults, options);
|
|
644
616
|
|
|
645
|
-
|
|
646
|
-
|
|
617
|
+
let layerConstructor = layersMap[type];
|
|
618
|
+
let layer = new layerConstructor(this, layerOptions);
|
|
647
619
|
|
|
648
620
|
if (type === MARKER) {
|
|
649
621
|
this.markers = layer;
|
|
650
622
|
}
|
|
651
623
|
|
|
652
624
|
return layer;
|
|
653
|
-
}
|
|
625
|
+
}
|
|
654
626
|
|
|
655
|
-
|
|
627
|
+
_createTooltip() {
|
|
656
628
|
return new Tooltip(this.widgetService, this.options.tooltip);
|
|
657
|
-
}
|
|
629
|
+
}
|
|
658
630
|
|
|
659
631
|
/* eslint-disable arrow-body-style */
|
|
660
|
-
|
|
661
|
-
|
|
632
|
+
_initMarkers() {
|
|
633
|
+
const markerLayers = (this.options.layers || []).filter(x => {
|
|
662
634
|
return x && x.type === MARKER;
|
|
663
635
|
});
|
|
664
636
|
|
|
@@ -670,13 +642,13 @@ var Map = (function (Observable) {
|
|
|
670
642
|
|
|
671
643
|
this.markers = new MarkerLayer(this, deepExtend({}, this.options.markerDefaults, { icons: this.options.icons }));
|
|
672
644
|
this.markers.add(this.options.markers);
|
|
673
|
-
}
|
|
645
|
+
}
|
|
674
646
|
/* eslint-enable arrow-body-style */
|
|
675
647
|
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
648
|
+
_scroll(e) {
|
|
649
|
+
let origin = this.locationToLayer(this._viewOrigin).round();
|
|
650
|
+
let movable = e.sender.movable;
|
|
651
|
+
let offset = new g.Point(movable.x, movable.y).scale(-1).scale(1 / movable.scale);
|
|
680
652
|
|
|
681
653
|
origin.x += offset.x;
|
|
682
654
|
origin.y += offset.y;
|
|
@@ -692,9 +664,9 @@ var Map = (function (Observable) {
|
|
|
692
664
|
origin: this._getOrigin(),
|
|
693
665
|
center: this.center()
|
|
694
666
|
});
|
|
695
|
-
}
|
|
667
|
+
}
|
|
696
668
|
|
|
697
|
-
|
|
669
|
+
_scrollEnd(e) {
|
|
698
670
|
if (!this._scrollOffset || !this._panComplete()) {
|
|
699
671
|
return;
|
|
700
672
|
}
|
|
@@ -707,46 +679,46 @@ var Map = (function (Observable) {
|
|
|
707
679
|
origin: this._getOrigin(),
|
|
708
680
|
center: this.center()
|
|
709
681
|
});
|
|
710
|
-
}
|
|
682
|
+
}
|
|
711
683
|
|
|
712
|
-
|
|
684
|
+
_panComplete() {
|
|
713
685
|
return now() - (this._panEndTimestamp || 0) > 50;
|
|
714
|
-
}
|
|
686
|
+
}
|
|
715
687
|
|
|
716
|
-
|
|
688
|
+
_scaleStart(e) {
|
|
717
689
|
if (this.trigger('zoomStart', { originalEvent: e })) {
|
|
718
|
-
|
|
690
|
+
let touch = e.touches[1];
|
|
719
691
|
|
|
720
692
|
if (touch) {
|
|
721
693
|
touch.cancel();
|
|
722
694
|
}
|
|
723
695
|
}
|
|
724
|
-
}
|
|
696
|
+
}
|
|
725
697
|
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
698
|
+
_scale(e) {
|
|
699
|
+
let scale = this.scroller.movable.scale;
|
|
700
|
+
let zoom = this._scaleToZoom(scale);
|
|
701
|
+
let gestureCenter = new g.Point(e.center.x, e.center.y);
|
|
702
|
+
let centerLocation = this.viewToLocation(gestureCenter, zoom);
|
|
703
|
+
let centerPoint = this.locationToLayer(centerLocation, zoom);
|
|
704
|
+
let originPoint = centerPoint.translate(-gestureCenter.x, -gestureCenter.y);
|
|
733
705
|
|
|
734
706
|
this._zoomAround(originPoint, zoom);
|
|
735
707
|
|
|
736
708
|
this.trigger('zoomEnd', {
|
|
737
709
|
originalEvent: e
|
|
738
710
|
});
|
|
739
|
-
}
|
|
711
|
+
}
|
|
740
712
|
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
713
|
+
_scaleToZoom(scaleDelta) {
|
|
714
|
+
let scale = this._layerSize() * scaleDelta;
|
|
715
|
+
let tiles = scale / this.options.minSize;
|
|
716
|
+
let zoom = math.log(tiles) / math.log(2);
|
|
745
717
|
|
|
746
718
|
return math.round(zoom);
|
|
747
|
-
}
|
|
719
|
+
}
|
|
748
720
|
|
|
749
|
-
|
|
721
|
+
_reset() {
|
|
750
722
|
if (this.attribution) {
|
|
751
723
|
this.attribution.filter(this.center(), this.zoom());
|
|
752
724
|
}
|
|
@@ -758,31 +730,31 @@ var Map = (function (Observable) {
|
|
|
758
730
|
|
|
759
731
|
this.trigger('beforeReset');
|
|
760
732
|
this.trigger('reset');
|
|
761
|
-
}
|
|
733
|
+
}
|
|
762
734
|
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
735
|
+
_resetScroller() {
|
|
736
|
+
let scroller = this.scroller;
|
|
737
|
+
let x = scroller.dimensions.x;
|
|
738
|
+
let y = scroller.dimensions.y;
|
|
739
|
+
let scale = this._layerSize();
|
|
740
|
+
let nw = this.extent().nw;
|
|
741
|
+
let topLeft = this.locationToLayer(nw).round();
|
|
770
742
|
|
|
771
743
|
scroller.movable.round = true;
|
|
772
744
|
scroller.reset();
|
|
773
745
|
scroller.userEvents.cancel();
|
|
774
746
|
|
|
775
|
-
|
|
747
|
+
let zoom = this.zoom();
|
|
776
748
|
|
|
777
749
|
scroller.dimensions.forcedMinScale = pow(2, this.options.minZoom - zoom);
|
|
778
750
|
scroller.dimensions.maxScale = pow(2, this.options.maxZoom - zoom);
|
|
779
751
|
|
|
780
|
-
|
|
752
|
+
let xBounds = {
|
|
781
753
|
min: -topLeft.x,
|
|
782
754
|
max: scale - topLeft.x
|
|
783
755
|
};
|
|
784
756
|
|
|
785
|
-
|
|
757
|
+
let yBounds = {
|
|
786
758
|
min: -topLeft.y,
|
|
787
759
|
max: scale - topLeft.y
|
|
788
760
|
};
|
|
@@ -793,7 +765,7 @@ var Map = (function (Observable) {
|
|
|
793
765
|
}
|
|
794
766
|
|
|
795
767
|
if (this.options.pannable === false) {
|
|
796
|
-
|
|
768
|
+
let viewSize = this.viewSize();
|
|
797
769
|
xBounds.min = yBounds.min = 0;
|
|
798
770
|
xBounds.max = viewSize.width;
|
|
799
771
|
yBounds.max = viewSize.height;
|
|
@@ -809,41 +781,41 @@ var Map = (function (Observable) {
|
|
|
809
781
|
x: xBounds,
|
|
810
782
|
y: yBounds
|
|
811
783
|
};
|
|
812
|
-
}
|
|
784
|
+
}
|
|
813
785
|
|
|
814
786
|
// kept for API compatibility, not used
|
|
815
|
-
|
|
816
|
-
}
|
|
787
|
+
_renderLayers() {
|
|
788
|
+
}
|
|
817
789
|
|
|
818
|
-
|
|
819
|
-
|
|
790
|
+
_layerSize(zoom) {
|
|
791
|
+
const newZoom = valueOrDefault(zoom, this.options.zoom);
|
|
820
792
|
return this.options.minSize * pow(2, newZoom);
|
|
821
|
-
}
|
|
793
|
+
}
|
|
822
794
|
|
|
823
|
-
|
|
795
|
+
_tap(e) {
|
|
824
796
|
if (!this._panComplete()) {
|
|
825
797
|
return;
|
|
826
798
|
}
|
|
827
799
|
|
|
828
|
-
|
|
800
|
+
let cursor = this.eventOffset(e);
|
|
829
801
|
this.hideTooltip();
|
|
830
802
|
|
|
831
803
|
this.trigger('click', {
|
|
832
804
|
originalEvent: e,
|
|
833
805
|
location: this.viewToLocation(cursor)
|
|
834
806
|
});
|
|
835
|
-
}
|
|
807
|
+
}
|
|
836
808
|
|
|
837
|
-
|
|
838
|
-
|
|
809
|
+
_doubleTap(e) {
|
|
810
|
+
let options = this.options;
|
|
839
811
|
|
|
840
812
|
if (options.zoomable !== false) {
|
|
841
813
|
if (!this.trigger('zoomStart', { originalEvent: e })) {
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
814
|
+
let toZoom = this.zoom() + DEFAULT_ZOOM_RATE;
|
|
815
|
+
let cursor = this.eventOffset(e);
|
|
816
|
+
let location = this.viewToLocation(cursor);
|
|
817
|
+
let postZoom = this.locationToLayer(location, toZoom);
|
|
818
|
+
let origin = postZoom.translate(-cursor.x, -cursor.y);
|
|
847
819
|
|
|
848
820
|
this._zoomAround(origin, toZoom);
|
|
849
821
|
|
|
@@ -852,20 +824,20 @@ var Map = (function (Observable) {
|
|
|
852
824
|
});
|
|
853
825
|
}
|
|
854
826
|
}
|
|
855
|
-
}
|
|
827
|
+
}
|
|
856
828
|
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
829
|
+
_mousewheel(e) {
|
|
830
|
+
let delta = mousewheelDelta(e) > 0 ? -1 : 1;
|
|
831
|
+
let options = this.options;
|
|
832
|
+
let fromZoom = this.zoom();
|
|
833
|
+
let toZoom = limitValue(fromZoom + delta, options.minZoom, options.maxZoom);
|
|
862
834
|
|
|
863
835
|
if (options.zoomable !== false && toZoom !== fromZoom) {
|
|
864
836
|
if (!this.trigger('zoomStart', { originalEvent: e })) {
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
837
|
+
let cursor = this.eventOffset(e);
|
|
838
|
+
let location = this.viewToLocation(cursor);
|
|
839
|
+
let postZoom = this.locationToLayer(location, toZoom);
|
|
840
|
+
let origin = postZoom.translate(-cursor.x, -cursor.y);
|
|
869
841
|
|
|
870
842
|
this._zoomAround(origin, toZoom);
|
|
871
843
|
|
|
@@ -874,19 +846,17 @@ var Map = (function (Observable) {
|
|
|
874
846
|
});
|
|
875
847
|
}
|
|
876
848
|
}
|
|
877
|
-
}
|
|
849
|
+
}
|
|
878
850
|
|
|
879
|
-
|
|
880
|
-
|
|
851
|
+
_toDocumentCoordinates(point) {
|
|
852
|
+
const offset = elementOffset(this.element);
|
|
881
853
|
|
|
882
854
|
return {
|
|
883
855
|
left: round(point.x + offset.left),
|
|
884
856
|
top: round(point.y + offset.top)
|
|
885
857
|
};
|
|
886
|
-
}
|
|
887
|
-
|
|
888
|
-
return Map;
|
|
889
|
-
}(Observable));
|
|
858
|
+
}
|
|
859
|
+
}
|
|
890
860
|
|
|
891
861
|
setDefaultOptions(Map, {
|
|
892
862
|
name: 'Map',
|