@maptrip/map-tiles 1.0.8
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/README.md +239 -0
- package/dist/map-tiles.js +13558 -0
- package/lib/api-extensions/google/MapTripGoogleMapType.js +25 -0
- package/lib/api-extensions/leaflet/MapTripLeafletGridLayer.js +24 -0
- package/lib/api-extensions/openlayers/MapTripOpenLayersSource.js +43 -0
- package/lib/core/CollisionDetector.js +65 -0
- package/lib/core/VectorTileFactory.js +245 -0
- package/lib/core/VectorTileLoader.js +127 -0
- package/lib/core/VectorTileRenderer.js +826 -0
- package/lib/core/constants.js +18 -0
- package/lib/core/rendering_config_default.js +1107 -0
- package/lib/core/rendering_config_grayscale.js +1107 -0
- package/lib/core/rendering_config_traffic.js +120 -0
- package/lib/main.js +18 -0
- package/package.json +47 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
const RENDERING_CONFIG_TRAFFIC = {
|
|
2
|
+
"background": [
|
|
3
|
+
{
|
|
4
|
+
"from": 1,
|
|
5
|
+
"to": 19,
|
|
6
|
+
"color": "rgba(0, 0, 0, 0)"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"layers": {
|
|
10
|
+
"trafficFlowFast": "trafficFlowFast",
|
|
11
|
+
"trafficFlowMedium": "trafficFlowMedium",
|
|
12
|
+
"trafficFlowSlow": "trafficFlowSlow"
|
|
13
|
+
},
|
|
14
|
+
"renderers": {
|
|
15
|
+
"trafficFlowFast": [
|
|
16
|
+
{
|
|
17
|
+
"from": 1,
|
|
18
|
+
"to": 8,
|
|
19
|
+
"line": {
|
|
20
|
+
"color": "rgba(80, 220, 50, 0.5)",
|
|
21
|
+
"width": 1
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"from": 9,
|
|
26
|
+
"to": 12,
|
|
27
|
+
"line": {
|
|
28
|
+
"color": "rgba(80, 220, 50, 0.5)",
|
|
29
|
+
"width": 2
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"from": 13,
|
|
34
|
+
"to": 15,
|
|
35
|
+
"line": {
|
|
36
|
+
"color": "rgba(80, 220, 50, 0.5)",
|
|
37
|
+
"width": 4
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"from": 16,
|
|
42
|
+
"to": 19,
|
|
43
|
+
"line": {
|
|
44
|
+
"color": "rgba(80, 220, 50, 0.5)",
|
|
45
|
+
"width": 6
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"trafficFlowMedium": [
|
|
50
|
+
{
|
|
51
|
+
"from": 1,
|
|
52
|
+
"to": 8,
|
|
53
|
+
"line": {
|
|
54
|
+
"color": "rgba(255, 165, 0, 0.5)",
|
|
55
|
+
"width": 1
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"from": 9,
|
|
60
|
+
"to": 12,
|
|
61
|
+
"line": {
|
|
62
|
+
"color": "rgba(255, 165, 0, 0.5)",
|
|
63
|
+
"width": 2
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"from": 13,
|
|
68
|
+
"to": 15,
|
|
69
|
+
"line": {
|
|
70
|
+
"color": "rgba(255, 165, 0, 0.5)",
|
|
71
|
+
"width": 4
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"from": 16,
|
|
76
|
+
"to": 19,
|
|
77
|
+
"line": {
|
|
78
|
+
"color": "rgba(255, 165, 0, 0.5)",
|
|
79
|
+
"width": 6
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
"trafficFlowSlow": [
|
|
84
|
+
{
|
|
85
|
+
"from": 1,
|
|
86
|
+
"to": 8,
|
|
87
|
+
"line": {
|
|
88
|
+
"color": "rgba(200, 0, 0, 0.5)",
|
|
89
|
+
"width": 1
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"from": 9,
|
|
94
|
+
"to": 12,
|
|
95
|
+
"line": {
|
|
96
|
+
"color": "rgba(200, 0, 0, 0.5)",
|
|
97
|
+
"width": 2
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"from": 13,
|
|
102
|
+
"to": 15,
|
|
103
|
+
"line": {
|
|
104
|
+
"color": "rgba(200, 0, 0, 0.5)",
|
|
105
|
+
"width": 4
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"from": 16,
|
|
110
|
+
"to": 19,
|
|
111
|
+
"line": {
|
|
112
|
+
"color": "rgba(200, 0, 0, 0.5)",
|
|
113
|
+
"width": 6
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export { RENDERING_CONFIG_TRAFFIC };
|
package/lib/main.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { VectorTileFactory } from "./core/VectorTileFactory.js";
|
|
2
|
+
import { RENDERING_CONFIG_DEFAULT } from "./core/rendering_config_default.js";
|
|
3
|
+
import { RENDERING_CONFIG_GRAYSCALE } from "./core/rendering_config_grayscale.js";
|
|
4
|
+
import { RENDERING_CONFIG_TRAFFIC } from "./core/rendering_config_traffic.js";
|
|
5
|
+
|
|
6
|
+
import { MapTripGoogleMapType } from "./api-extensions/google/MapTripGoogleMapType.js";
|
|
7
|
+
import { MapTripLeafletGridLayer } from "./api-extensions/leaflet/MapTripLeafletGridLayer.js";
|
|
8
|
+
import { MapTripOpenLayersSource } from "./api-extensions/openlayers/MapTripOpenLayersSource.js";
|
|
9
|
+
|
|
10
|
+
export {
|
|
11
|
+
VectorTileFactory,
|
|
12
|
+
RENDERING_CONFIG_DEFAULT,
|
|
13
|
+
RENDERING_CONFIG_GRAYSCALE,
|
|
14
|
+
RENDERING_CONFIG_TRAFFIC,
|
|
15
|
+
MapTripLeafletGridLayer,
|
|
16
|
+
MapTripGoogleMapType,
|
|
17
|
+
MapTripOpenLayersSource,
|
|
18
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@maptrip/map-tiles",
|
|
3
|
+
"version": "1.0.8",
|
|
4
|
+
"description": "API to use MapTrip map tiles in other map APIs",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"map",
|
|
7
|
+
"mapping"
|
|
8
|
+
],
|
|
9
|
+
"author": "infoware GmbH",
|
|
10
|
+
"license": "ISC",
|
|
11
|
+
"type": "module",
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"lib"
|
|
15
|
+
],
|
|
16
|
+
"main": "./dist/map-tiles.js",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"import": "./dist/map-tiles.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
24
|
+
"dev": "vite src",
|
|
25
|
+
"build": "vite build",
|
|
26
|
+
"prepublishOnly": "npm run build"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"vite": "^4.5.0",
|
|
30
|
+
"eslint": "^8.52.0",
|
|
31
|
+
"leaflet": "~1.9.x",
|
|
32
|
+
"ol": "~8.2.x",
|
|
33
|
+
"@googlemaps/js-api-loader": "^1.16.2"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"rtree": "^1.4.2",
|
|
37
|
+
"webfontloader": "^1.6.28"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"leaflet": "~1.9.x",
|
|
41
|
+
"ol": "~8.2.x",
|
|
42
|
+
"@googlemaps/js-api-loader": "^1.16.2"
|
|
43
|
+
},
|
|
44
|
+
"directories": {
|
|
45
|
+
"lib": "lib"
|
|
46
|
+
}
|
|
47
|
+
}
|