leaflet-with-dashoffset-canvas-fix 1.9.4

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.
Files changed (90) hide show
  1. package/CHANGELOG.md +2191 -0
  2. package/LICENSE +26 -0
  3. package/README.md +3 -0
  4. package/package.json +149 -0
  5. package/src/Leaflet.js +24 -0
  6. package/src/control/Control.Attribution.js +148 -0
  7. package/src/control/Control.Layers.js +443 -0
  8. package/src/control/Control.Scale.js +132 -0
  9. package/src/control/Control.Zoom.js +146 -0
  10. package/src/control/Control.js +174 -0
  11. package/src/control/index.js +17 -0
  12. package/src/core/Browser.js +220 -0
  13. package/src/core/Class.js +135 -0
  14. package/src/core/Events.js +344 -0
  15. package/src/core/Handler.js +57 -0
  16. package/src/core/Util.js +241 -0
  17. package/src/core/index.js +15 -0
  18. package/src/dom/DomEvent.DoubleTap.js +91 -0
  19. package/src/dom/DomEvent.Pointer.js +97 -0
  20. package/src/dom/DomEvent.js +315 -0
  21. package/src/dom/DomUtil.js +349 -0
  22. package/src/dom/Draggable.js +220 -0
  23. package/src/dom/PosAnimation.js +113 -0
  24. package/src/dom/index.js +9 -0
  25. package/src/geo/LatLng.js +137 -0
  26. package/src/geo/LatLngBounds.js +251 -0
  27. package/src/geo/crs/CRS.EPSG3395.js +20 -0
  28. package/src/geo/crs/CRS.EPSG3857.js +27 -0
  29. package/src/geo/crs/CRS.EPSG4326.js +23 -0
  30. package/src/geo/crs/CRS.Earth.js +33 -0
  31. package/src/geo/crs/CRS.Simple.js +36 -0
  32. package/src/geo/crs/CRS.js +139 -0
  33. package/src/geo/crs/index.js +15 -0
  34. package/src/geo/index.js +7 -0
  35. package/src/geo/projection/Projection.LonLat.js +28 -0
  36. package/src/geo/projection/Projection.Mercator.js +49 -0
  37. package/src/geo/projection/Projection.SphericalMercator.js +44 -0
  38. package/src/geo/projection/index.js +26 -0
  39. package/src/geometry/Bounds.js +219 -0
  40. package/src/geometry/LineUtil.js +306 -0
  41. package/src/geometry/Point.js +222 -0
  42. package/src/geometry/PolyUtil.js +129 -0
  43. package/src/geometry/Transformation.js +79 -0
  44. package/src/geometry/index.js +8 -0
  45. package/src/images/layers.svg +1 -0
  46. package/src/images/logo.svg +1 -0
  47. package/src/images/marker.svg +1 -0
  48. package/src/layer/DivOverlay.js +348 -0
  49. package/src/layer/FeatureGroup.js +94 -0
  50. package/src/layer/GeoJSON.js +452 -0
  51. package/src/layer/ImageOverlay.js +270 -0
  52. package/src/layer/Layer.js +275 -0
  53. package/src/layer/LayerGroup.js +159 -0
  54. package/src/layer/Popup.js +506 -0
  55. package/src/layer/SVGOverlay.js +50 -0
  56. package/src/layer/Tooltip.js +444 -0
  57. package/src/layer/VideoOverlay.js +106 -0
  58. package/src/layer/index.js +24 -0
  59. package/src/layer/marker/DivIcon.js +74 -0
  60. package/src/layer/marker/Icon.Default.js +66 -0
  61. package/src/layer/marker/Icon.js +165 -0
  62. package/src/layer/marker/Marker.Drag.js +161 -0
  63. package/src/layer/marker/Marker.js +419 -0
  64. package/src/layer/marker/index.js +8 -0
  65. package/src/layer/tile/GridLayer.js +923 -0
  66. package/src/layer/tile/TileLayer.WMS.js +137 -0
  67. package/src/layer/tile/TileLayer.js +289 -0
  68. package/src/layer/tile/index.js +6 -0
  69. package/src/layer/vector/Canvas.js +493 -0
  70. package/src/layer/vector/Circle.js +113 -0
  71. package/src/layer/vector/CircleMarker.js +109 -0
  72. package/src/layer/vector/Path.js +148 -0
  73. package/src/layer/vector/Polygon.js +159 -0
  74. package/src/layer/vector/Polyline.js +307 -0
  75. package/src/layer/vector/Rectangle.js +57 -0
  76. package/src/layer/vector/Renderer.getRenderer.js +45 -0
  77. package/src/layer/vector/Renderer.js +133 -0
  78. package/src/layer/vector/SVG.Util.js +39 -0
  79. package/src/layer/vector/SVG.VML.js +144 -0
  80. package/src/layer/vector/SVG.js +207 -0
  81. package/src/layer/vector/index.js +14 -0
  82. package/src/map/Map.js +1751 -0
  83. package/src/map/handler/Map.BoxZoom.js +152 -0
  84. package/src/map/handler/Map.DoubleClickZoom.js +55 -0
  85. package/src/map/handler/Map.Drag.js +235 -0
  86. package/src/map/handler/Map.Keyboard.js +183 -0
  87. package/src/map/handler/Map.ScrollWheelZoom.js +91 -0
  88. package/src/map/handler/Map.TapHold.js +102 -0
  89. package/src/map/handler/Map.TouchZoom.js +130 -0
  90. package/src/map/index.js +17 -0
package/LICENSE ADDED
@@ -0,0 +1,26 @@
1
+ BSD 2-Clause License
2
+
3
+ Copyright (c) 2010-2023, Volodymyr Agafonkin
4
+ Copyright (c) 2010-2011, CloudMade
5
+ All rights reserved.
6
+
7
+ Redistribution and use in source and binary forms, with or without
8
+ modification, are permitted provided that the following conditions are met:
9
+
10
+ 1. Redistributions of source code must retain the above copyright notice, this
11
+ list of conditions and the following disclaimer.
12
+
13
+ 2. Redistributions in binary form must reproduce the above copyright notice,
14
+ this list of conditions and the following disclaimer in the documentation
15
+ and/or other materials provided with the distribution.
16
+
17
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
21
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ This is a fork of [Leaflet](https://github.com/Leaflet/Leaflet) version 1.9.4
2
+ (latest 1.9 version) with the [fix for dashOffset in the canvas
3
+ layer](https://github.com/Leaflet/Leaflet/pull/7867) implemented.
package/package.json ADDED
@@ -0,0 +1,149 @@
1
+ {
2
+ "name": "leaflet-with-dashoffset-canvas-fix",
3
+ "version": "1.9.4",
4
+ "homepage": "https://leafletjs.com/",
5
+ "description": "JavaScript library for mobile-friendly interactive maps",
6
+ "devDependencies": {
7
+ "@mapbox/eslint-plugin-script-tags": "^1.0.0",
8
+ "@rollup/plugin-json": "^4.1.0",
9
+ "bundlemon": "^1.4.0",
10
+ "eslint": "^8.23.0",
11
+ "eslint-config-mourner": "^2.0.3",
12
+ "git-rev-sync": "^3.0.2",
13
+ "happen": "~0.3.2",
14
+ "husky": "^8.0.1",
15
+ "karma": "^6.4.0",
16
+ "karma-chrome-launcher": "^3.1.1",
17
+ "karma-edge-launcher": "^0.4.2",
18
+ "karma-expect": "^1.1.3",
19
+ "karma-firefox-launcher": "^2.1.2",
20
+ "karma-ie-launcher": "^1.0.0",
21
+ "karma-mocha": "^2.0.1",
22
+ "karma-rollup-preprocessor": "^7.0.8",
23
+ "karma-safari-launcher": "~1.0.0",
24
+ "karma-sinon": "^1.0.5",
25
+ "leafdoc": "^2.3.0",
26
+ "lint-staged": "^13.0.3",
27
+ "mocha": "^9.2.2",
28
+ "prosthetic-hand": "^1.4.0",
29
+ "rollup": "^2.78.1",
30
+ "rollup-plugin-git-version": "^0.3.1",
31
+ "sinon": "^7.5.0",
32
+ "ssri": "^9.0.1",
33
+ "uglify-js": "^3.17.0"
34
+ },
35
+ "main": "dist/leaflet-src.js",
36
+ "style": "dist/leaflet.css",
37
+ "files": [
38
+ "dist",
39
+ "src",
40
+ "!dist/leaflet.zip",
41
+ "!*.leafdoc",
42
+ "CHANGELOG.md"
43
+ ],
44
+ "scripts": {
45
+ "docs": "node ./build/docs.js && node ./build/integrity.js",
46
+ "test": "karma start ./spec/karma.conf.js",
47
+ "build": "npm run rollup && npm run uglify",
48
+ "lint": "eslint .",
49
+ "lintfix": "npm run lint -- --fix",
50
+ "rollup": "rollup -c build/rollup-config.js",
51
+ "watch": "rollup -w -c build/rollup-config.js",
52
+ "uglify": "uglifyjs dist/leaflet-src.js -c -m -o dist/leaflet.js --source-map filename=dist/leaflet.js.map --source-map content=dist/leaflet-src.js.map --source-map url=leaflet.js.map --comments",
53
+ "bundlemon": "bundlemon --subProject js --defaultCompression none && bundlemon --subProject js-gzip --defaultCompression gzip",
54
+ "serve": "cd docs && bundle exec jekyll serve",
55
+ "prepare": "husky install"
56
+ },
57
+ "eslintConfig": {
58
+ "ignorePatterns": [
59
+ "dist",
60
+ "debug",
61
+ "docs/docs/highlight",
62
+ "docs/examples/choropleth/us-states.js",
63
+ "docs/examples/geojson/sample-geojson.js",
64
+ "docs/examples/map-panes/eu-countries.js",
65
+ "docs/examples/extending/extending-2-layers.md",
66
+ "docs/_posts/2012*",
67
+ "docs/_site",
68
+ "build/integrity.js"
69
+ ],
70
+ "root": true,
71
+ "env": {
72
+ "commonjs": true,
73
+ "amd": true,
74
+ "node": false
75
+ },
76
+ "extends": "mourner",
77
+ "plugins": [
78
+ "@mapbox/eslint-plugin-script-tags"
79
+ ],
80
+ "parserOptions": {
81
+ "ecmaVersion": 6,
82
+ "sourceType": "module"
83
+ },
84
+ "rules": {
85
+ "linebreak-style": [
86
+ 0,
87
+ "unix"
88
+ ],
89
+ "no-mixed-spaces-and-tabs": [
90
+ 2,
91
+ "smart-tabs"
92
+ ],
93
+ "indent": [
94
+ 2,
95
+ "tab",
96
+ {
97
+ "VariableDeclarator": 0,
98
+ "flatTernaryExpressions": true
99
+ }
100
+ ],
101
+ "curly": 2,
102
+ "spaced-comment": 2,
103
+ "strict": 0,
104
+ "wrap-iife": 0,
105
+ "key-spacing": 0,
106
+ "consistent-return": 0,
107
+ "no-unused-expressions": [
108
+ "error",
109
+ {
110
+ "allowShortCircuit": true
111
+ }
112
+ ]
113
+ },
114
+ "overrides": [
115
+ {
116
+ "files": [
117
+ "build/**/*"
118
+ ],
119
+ "env": {
120
+ "node": true
121
+ },
122
+ "rules": {
123
+ "global-require": 0
124
+ }
125
+ },
126
+ {
127
+ "files": [
128
+ "*.md"
129
+ ],
130
+ "rules": {
131
+ "eol-last": 0,
132
+ "no-unused-vars": 0
133
+ }
134
+ }
135
+ ]
136
+ },
137
+ "repository": {
138
+ "type": "git",
139
+ "url": "git://github.com/Leaflet/Leaflet.git"
140
+ },
141
+ "keywords": [
142
+ "gis",
143
+ "map"
144
+ ],
145
+ "license": "BSD-2-Clause",
146
+ "lint-staged": {
147
+ "*.(js|md)": "eslint --cache --fix"
148
+ }
149
+ }
package/src/Leaflet.js ADDED
@@ -0,0 +1,24 @@
1
+
2
+ import {version} from '../package.json';
3
+ export {version};
4
+
5
+ // control
6
+ export * from './control/index';
7
+
8
+ // core
9
+ export * from './core/index';
10
+
11
+ // dom
12
+ export * from './dom/index';
13
+
14
+ // geometry
15
+ export * from './geometry/index';
16
+
17
+ // geo
18
+ export * from './geo/index';
19
+
20
+ // layer
21
+ export * from './layer/index';
22
+
23
+ // map
24
+ export * from './map/index';
@@ -0,0 +1,148 @@
1
+
2
+ import {Control} from './Control';
3
+ import {Map} from '../map/Map';
4
+ import * as Util from '../core/Util';
5
+ import * as DomEvent from '../dom/DomEvent';
6
+ import * as DomUtil from '../dom/DomUtil';
7
+ import Browser from '../core/Browser';
8
+
9
+ var ukrainianFlag = '<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>';
10
+
11
+
12
+ /*
13
+ * @class Control.Attribution
14
+ * @aka L.Control.Attribution
15
+ * @inherits Control
16
+ *
17
+ * The attribution control allows you to display attribution data in a small text box on a map. It is put on the map by default unless you set its [`attributionControl` option](#map-attributioncontrol) to `false`, and it fetches attribution texts from layers with the [`getAttribution` method](#layer-getattribution) automatically. Extends Control.
18
+ */
19
+
20
+ export var Attribution = Control.extend({
21
+ // @section
22
+ // @aka Control.Attribution options
23
+ options: {
24
+ position: 'bottomright',
25
+
26
+ // @option prefix: String|false = 'Leaflet'
27
+ // The HTML text shown before the attributions. Pass `false` to disable.
28
+ prefix: '<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">' + (Browser.inlineSvg ? ukrainianFlag + ' ' : '') + 'Leaflet</a>'
29
+ },
30
+
31
+ initialize: function (options) {
32
+ Util.setOptions(this, options);
33
+
34
+ this._attributions = {};
35
+ },
36
+
37
+ onAdd: function (map) {
38
+ map.attributionControl = this;
39
+ this._container = DomUtil.create('div', 'leaflet-control-attribution');
40
+ DomEvent.disableClickPropagation(this._container);
41
+
42
+ // TODO ugly, refactor
43
+ for (var i in map._layers) {
44
+ if (map._layers[i].getAttribution) {
45
+ this.addAttribution(map._layers[i].getAttribution());
46
+ }
47
+ }
48
+
49
+ this._update();
50
+
51
+ map.on('layeradd', this._addAttribution, this);
52
+
53
+ return this._container;
54
+ },
55
+
56
+ onRemove: function (map) {
57
+ map.off('layeradd', this._addAttribution, this);
58
+ },
59
+
60
+ _addAttribution: function (ev) {
61
+ if (ev.layer.getAttribution) {
62
+ this.addAttribution(ev.layer.getAttribution());
63
+ ev.layer.once('remove', function () {
64
+ this.removeAttribution(ev.layer.getAttribution());
65
+ }, this);
66
+ }
67
+ },
68
+
69
+ // @method setPrefix(prefix: String|false): this
70
+ // The HTML text shown before the attributions. Pass `false` to disable.
71
+ setPrefix: function (prefix) {
72
+ this.options.prefix = prefix;
73
+ this._update();
74
+ return this;
75
+ },
76
+
77
+ // @method addAttribution(text: String): this
78
+ // Adds an attribution text (e.g. `'&copy; OpenStreetMap contributors'`).
79
+ addAttribution: function (text) {
80
+ if (!text) { return this; }
81
+
82
+ if (!this._attributions[text]) {
83
+ this._attributions[text] = 0;
84
+ }
85
+ this._attributions[text]++;
86
+
87
+ this._update();
88
+
89
+ return this;
90
+ },
91
+
92
+ // @method removeAttribution(text: String): this
93
+ // Removes an attribution text.
94
+ removeAttribution: function (text) {
95
+ if (!text) { return this; }
96
+
97
+ if (this._attributions[text]) {
98
+ this._attributions[text]--;
99
+ this._update();
100
+ }
101
+
102
+ return this;
103
+ },
104
+
105
+ _update: function () {
106
+ if (!this._map) { return; }
107
+
108
+ var attribs = [];
109
+
110
+ for (var i in this._attributions) {
111
+ if (this._attributions[i]) {
112
+ attribs.push(i);
113
+ }
114
+ }
115
+
116
+ var prefixAndAttribs = [];
117
+
118
+ if (this.options.prefix) {
119
+ prefixAndAttribs.push(this.options.prefix);
120
+ }
121
+ if (attribs.length) {
122
+ prefixAndAttribs.push(attribs.join(', '));
123
+ }
124
+
125
+ this._container.innerHTML = prefixAndAttribs.join(' <span aria-hidden="true">|</span> ');
126
+ }
127
+ });
128
+
129
+ // @namespace Map
130
+ // @section Control options
131
+ // @option attributionControl: Boolean = true
132
+ // Whether a [attribution control](#control-attribution) is added to the map by default.
133
+ Map.mergeOptions({
134
+ attributionControl: true
135
+ });
136
+
137
+ Map.addInitHook(function () {
138
+ if (this.options.attributionControl) {
139
+ new Attribution().addTo(this);
140
+ }
141
+ });
142
+
143
+ // @namespace Control.Attribution
144
+ // @factory L.control.attribution(options: Control.Attribution options)
145
+ // Creates an attribution control.
146
+ export var attribution = function (options) {
147
+ return new Attribution(options);
148
+ };