umap-project 1.14.0a1__py3-none-any.whl → 1.14.0a2__py3-none-any.whl
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.
Potentially problematic release.
This version of umap-project might be problematic. Click here for more details.
- umap/__init__.py +1 -1
- umap/static/.gitignore +0 -0
- umap/static/umap/base.css +994 -0
- umap/static/umap/bitbucket.png +0 -0
- umap/static/umap/content.css +395 -0
- umap/static/umap/favicons/apple-touch-icon.png +0 -0
- umap/static/umap/favicons/favicon.ico +0 -0
- umap/static/umap/favicons/icon-192.png +0 -0
- umap/static/umap/favicons/icon-512.png +0 -0
- umap/static/umap/favicons/icon.svg +5 -0
- umap/static/umap/font/FiraSans-Light.woff +0 -0
- umap/static/umap/font/FiraSans-Light.woff2 +0 -0
- umap/static/umap/font/FiraSans-LightItalic.woff +0 -0
- umap/static/umap/font/FiraSans-LightItalic.woff2 +0 -0
- umap/static/umap/font/FiraSans-SemiBold.woff +0 -0
- umap/static/umap/font/FiraSans-SemiBold.woff2 +0 -0
- umap/static/umap/font.css +33 -0
- umap/static/umap/github.png +0 -0
- umap/static/umap/img/16-white.svg +190 -0
- umap/static/umap/img/16.svg +182 -0
- umap/static/umap/img/24-white.svg +62 -0
- umap/static/umap/img/24.svg +90 -0
- umap/static/umap/img/edit.svg +7 -0
- umap/static/umap/img/icon-bg.png +0 -0
- umap/static/umap/img/logo.svg +4 -0
- umap/static/umap/img/logo_filigree.png +0 -0
- umap/static/umap/img/logo_small.svg +14 -0
- umap/static/umap/img/marker.png +0 -0
- umap/static/umap/img/opensource.svg +7 -0
- umap/static/umap/img/osm.svg +7 -0
- umap/static/umap/img/search.gif +0 -0
- umap/static/umap/img/source/16-white.svg +980 -0
- umap/static/umap/img/source/16.svg +201 -0
- umap/static/umap/img/source/24-white.svg +83 -0
- umap/static/umap/img/source/24.svg +110 -0
- umap/static/umap/js/components/fragment.js +13 -0
- umap/static/umap/js/modules/global.js +8 -0
- umap/static/umap/js/modules/urls.js +29 -0
- umap/static/umap/js/umap.autocomplete.js +336 -0
- umap/static/umap/js/umap.browser.js +148 -0
- umap/static/umap/js/umap.controls.js +1542 -0
- umap/static/umap/js/umap.core.js +851 -0
- umap/static/umap/js/umap.datalayer.permissions.js +72 -0
- umap/static/umap/js/umap.features.js +1216 -0
- umap/static/umap/js/umap.forms.js +1267 -0
- umap/static/umap/js/umap.icon.js +234 -0
- umap/static/umap/js/umap.importer.js +166 -0
- umap/static/umap/js/umap.js +2010 -0
- umap/static/umap/js/umap.layer.js +1636 -0
- umap/static/umap/js/umap.permissions.js +212 -0
- umap/static/umap/js/umap.popup.js +340 -0
- umap/static/umap/js/umap.share.js +254 -0
- umap/static/umap/js/umap.slideshow.js +165 -0
- umap/static/umap/js/umap.tableeditor.js +120 -0
- umap/static/umap/js/umap.ui.js +240 -0
- umap/static/umap/js/umap.xhr.js +304 -0
- umap/static/umap/locale/am_ET.js +447 -0
- umap/static/umap/locale/am_ET.json +445 -0
- umap/static/umap/locale/ar.js +447 -0
- umap/static/umap/locale/ar.json +445 -0
- umap/static/umap/locale/ast.js +447 -0
- umap/static/umap/locale/ast.json +445 -0
- umap/static/umap/locale/bg.js +447 -0
- umap/static/umap/locale/bg.json +445 -0
- umap/static/umap/locale/br.js +447 -0
- umap/static/umap/locale/br.json +445 -0
- umap/static/umap/locale/ca.js +447 -0
- umap/static/umap/locale/ca.json +445 -0
- umap/static/umap/locale/cs_CZ.js +447 -0
- umap/static/umap/locale/cs_CZ.json +445 -0
- umap/static/umap/locale/da.js +447 -0
- umap/static/umap/locale/da.json +445 -0
- umap/static/umap/locale/de.js +447 -0
- umap/static/umap/locale/de.json +445 -0
- umap/static/umap/locale/el.js +447 -0
- umap/static/umap/locale/el.json +445 -0
- umap/static/umap/locale/en.js +447 -0
- umap/static/umap/locale/en.json +445 -0
- umap/static/umap/locale/en_US.json +445 -0
- umap/static/umap/locale/es.js +447 -0
- umap/static/umap/locale/es.json +445 -0
- umap/static/umap/locale/et.js +447 -0
- umap/static/umap/locale/et.json +445 -0
- umap/static/umap/locale/eu.js +413 -0
- umap/static/umap/locale/eu.json +411 -0
- umap/static/umap/locale/fa_IR.js +447 -0
- umap/static/umap/locale/fa_IR.json +445 -0
- umap/static/umap/locale/fi.js +447 -0
- umap/static/umap/locale/fi.json +445 -0
- umap/static/umap/locale/fr.js +447 -0
- umap/static/umap/locale/fr.json +445 -0
- umap/static/umap/locale/gl.js +447 -0
- umap/static/umap/locale/gl.json +445 -0
- umap/static/umap/locale/he.js +447 -0
- umap/static/umap/locale/he.json +445 -0
- umap/static/umap/locale/hr.js +447 -0
- umap/static/umap/locale/hr.json +445 -0
- umap/static/umap/locale/hu.js +447 -0
- umap/static/umap/locale/hu.json +445 -0
- umap/static/umap/locale/id.js +447 -0
- umap/static/umap/locale/id.json +445 -0
- umap/static/umap/locale/is.js +447 -0
- umap/static/umap/locale/is.json +445 -0
- umap/static/umap/locale/it.js +447 -0
- umap/static/umap/locale/it.json +445 -0
- umap/static/umap/locale/ja.js +447 -0
- umap/static/umap/locale/ja.json +445 -0
- umap/static/umap/locale/ko.js +447 -0
- umap/static/umap/locale/ko.json +445 -0
- umap/static/umap/locale/lt.js +447 -0
- umap/static/umap/locale/lt.json +445 -0
- umap/static/umap/locale/ms.js +447 -0
- umap/static/umap/locale/ms.json +445 -0
- umap/static/umap/locale/nl.js +447 -0
- umap/static/umap/locale/nl.json +445 -0
- umap/static/umap/locale/no.js +447 -0
- umap/static/umap/locale/no.json +445 -0
- umap/static/umap/locale/pl.js +447 -0
- umap/static/umap/locale/pl.json +445 -0
- umap/static/umap/locale/pl_PL.json +445 -0
- umap/static/umap/locale/pt.js +447 -0
- umap/static/umap/locale/pt.json +445 -0
- umap/static/umap/locale/pt_BR.js +447 -0
- umap/static/umap/locale/pt_BR.json +445 -0
- umap/static/umap/locale/pt_PT.js +447 -0
- umap/static/umap/locale/pt_PT.json +445 -0
- umap/static/umap/locale/ro.js +447 -0
- umap/static/umap/locale/ro.json +445 -0
- umap/static/umap/locale/ru.js +447 -0
- umap/static/umap/locale/ru.json +445 -0
- umap/static/umap/locale/si.js +439 -0
- umap/static/umap/locale/si.json +437 -0
- umap/static/umap/locale/sk_SK.js +447 -0
- umap/static/umap/locale/sk_SK.json +445 -0
- umap/static/umap/locale/sl.js +447 -0
- umap/static/umap/locale/sl.json +445 -0
- umap/static/umap/locale/sr.js +447 -0
- umap/static/umap/locale/sr.json +445 -0
- umap/static/umap/locale/sv.js +447 -0
- umap/static/umap/locale/sv.json +445 -0
- umap/static/umap/locale/th_TH.js +447 -0
- umap/static/umap/locale/th_TH.json +445 -0
- umap/static/umap/locale/tr.js +447 -0
- umap/static/umap/locale/tr.json +445 -0
- umap/static/umap/locale/uk_UA.js +447 -0
- umap/static/umap/locale/uk_UA.json +445 -0
- umap/static/umap/locale/vi.js +447 -0
- umap/static/umap/locale/vi.json +445 -0
- umap/static/umap/locale/vi_VN.json +445 -0
- umap/static/umap/locale/zh.js +447 -0
- umap/static/umap/locale/zh.json +445 -0
- umap/static/umap/locale/zh_CN.json +445 -0
- umap/static/umap/locale/zh_TW.Big5.json +445 -0
- umap/static/umap/locale/zh_TW.js +447 -0
- umap/static/umap/locale/zh_TW.json +445 -0
- umap/static/umap/map.css +1843 -0
- umap/static/umap/nav.css +81 -0
- umap/static/umap/openstreetmap.png +0 -0
- umap/static/umap/test/.eslintrc +22 -0
- umap/static/umap/test/Choropleth.js +243 -0
- umap/static/umap/test/Controls.js +100 -0
- umap/static/umap/test/DataLayer.js +495 -0
- umap/static/umap/test/Feature.js +382 -0
- umap/static/umap/test/Map.Export.js +106 -0
- umap/static/umap/test/Map.Init.js +46 -0
- umap/static/umap/test/Map.js +342 -0
- umap/static/umap/test/Marker.js +122 -0
- umap/static/umap/test/Permissions.js +74 -0
- umap/static/umap/test/Polygon.js +367 -0
- umap/static/umap/test/Polyline.js +402 -0
- umap/static/umap/test/TableEditor.js +100 -0
- umap/static/umap/test/URLs.js +54 -0
- umap/static/umap/test/Util.js +549 -0
- umap/static/umap/test/_pre.js +460 -0
- umap/static/umap/test/index.html +135 -0
- umap/static/umap/theme.css +1 -0
- umap/static/umap/twitter.png +0 -0
- {umap_project-1.14.0a1.dist-info → umap_project-1.14.0a2.dist-info}/METADATA +1 -1
- {umap_project-1.14.0a1.dist-info → umap_project-1.14.0a2.dist-info}/RECORD +182 -6
- {umap_project-1.14.0a1.dist-info → umap_project-1.14.0a2.dist-info}/WHEEL +0 -0
- {umap_project-1.14.0a1.dist-info → umap_project-1.14.0a2.dist-info}/entry_points.txt +0 -0
- {umap_project-1.14.0a1.dist-info → umap_project-1.14.0a2.dist-info}/licenses/LICENSE +0 -0
umap/static/umap/nav.css
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
header {
|
|
2
|
+
margin: 14px 0;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
footer {
|
|
6
|
+
height: 140px;
|
|
7
|
+
margin-top: 40px;
|
|
8
|
+
background-color: #2E3641;
|
|
9
|
+
text-align: center;
|
|
10
|
+
line-height: 140px;
|
|
11
|
+
color: #fff;
|
|
12
|
+
}
|
|
13
|
+
footer a {
|
|
14
|
+
color: #fff;
|
|
15
|
+
text-decoration: underline;
|
|
16
|
+
}
|
|
17
|
+
footer a.branding {
|
|
18
|
+
background-image: url("./img/logo_filigree.png");
|
|
19
|
+
background-position: left center;
|
|
20
|
+
background-repeat: no-repeat;
|
|
21
|
+
background-size: 60px auto;
|
|
22
|
+
font-size: 30px;
|
|
23
|
+
font-weight: bold;
|
|
24
|
+
height: 140px;
|
|
25
|
+
padding-left: 70px;
|
|
26
|
+
display: inline-block;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
footer .i18n_switch {
|
|
30
|
+
display: inline-block;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
.umap-nav {
|
|
35
|
+
display: flex;
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
}
|
|
38
|
+
.umap-nav a {
|
|
39
|
+
color: #3A4259;
|
|
40
|
+
padding: .4rem;
|
|
41
|
+
}
|
|
42
|
+
.umap-nav a:hover {
|
|
43
|
+
text-decoration: underline;
|
|
44
|
+
}
|
|
45
|
+
.umap-nav h1 {
|
|
46
|
+
margin-bottom: 0;
|
|
47
|
+
}
|
|
48
|
+
.umap-nav h1 a {
|
|
49
|
+
background-image: url("./img/logo.svg");
|
|
50
|
+
background-position: left center;
|
|
51
|
+
background-repeat: no-repeat;
|
|
52
|
+
background-size: 60px auto;
|
|
53
|
+
line-height: 70px;
|
|
54
|
+
padding-left: 80px;
|
|
55
|
+
display: block;
|
|
56
|
+
font-size: 2.5rem;
|
|
57
|
+
}
|
|
58
|
+
.umap-nav ul {
|
|
59
|
+
text-align: center;
|
|
60
|
+
}
|
|
61
|
+
.umap-nav ul li {
|
|
62
|
+
line-height: 2.5rem;
|
|
63
|
+
}
|
|
64
|
+
.umap-nav .button,
|
|
65
|
+
.umap-nav .button:hover {
|
|
66
|
+
text-decoration: none;
|
|
67
|
+
min-width: 150px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@media only screen and (min-width: 500px) {
|
|
71
|
+
.umap-nav ul li {
|
|
72
|
+
display: inline-block;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
@media only screen and (min-width: 750px) {
|
|
76
|
+
.umap-nav {
|
|
77
|
+
flex-direction: row;
|
|
78
|
+
justify-content: space-between;
|
|
79
|
+
align-items: baseline;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"globals": {
|
|
3
|
+
"describe": true,
|
|
4
|
+
"happen": true,
|
|
5
|
+
"assert": true,
|
|
6
|
+
"before": true,
|
|
7
|
+
"after": true,
|
|
8
|
+
"it": true,
|
|
9
|
+
"sinon": true,
|
|
10
|
+
"qs": true,
|
|
11
|
+
"enableEdit": true,
|
|
12
|
+
"disableEdit": true,
|
|
13
|
+
"changeInputValue": true,
|
|
14
|
+
"resetMap": true,
|
|
15
|
+
"initMap": true,
|
|
16
|
+
"clickCancel": true,
|
|
17
|
+
"map": true,
|
|
18
|
+
"qs": true,
|
|
19
|
+
"qsa": true,
|
|
20
|
+
"qst": true
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
const POLYGONS = {
|
|
2
|
+
_umap_options: defaultDatalayerData(),
|
|
3
|
+
type: 'FeatureCollection',
|
|
4
|
+
features: [
|
|
5
|
+
{
|
|
6
|
+
type: 'Feature',
|
|
7
|
+
properties: {
|
|
8
|
+
name: 'number 1',
|
|
9
|
+
value: 45,
|
|
10
|
+
},
|
|
11
|
+
geometry: {
|
|
12
|
+
type: 'Polygon',
|
|
13
|
+
coordinates: [
|
|
14
|
+
[
|
|
15
|
+
[0, 49],
|
|
16
|
+
[-2, 47],
|
|
17
|
+
[1, 46],
|
|
18
|
+
[3, 47],
|
|
19
|
+
[0, 49],
|
|
20
|
+
],
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
type: 'Feature',
|
|
26
|
+
properties: {
|
|
27
|
+
name: 'number 2',
|
|
28
|
+
value: 87,
|
|
29
|
+
},
|
|
30
|
+
geometry: {
|
|
31
|
+
type: 'Polygon',
|
|
32
|
+
coordinates: [
|
|
33
|
+
[
|
|
34
|
+
[0, 49],
|
|
35
|
+
[2, 50],
|
|
36
|
+
[6, 49],
|
|
37
|
+
[4, 47],
|
|
38
|
+
[0, 49],
|
|
39
|
+
],
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
type: 'Feature',
|
|
45
|
+
properties: {
|
|
46
|
+
name: 'number 3',
|
|
47
|
+
value: 673,
|
|
48
|
+
},
|
|
49
|
+
geometry: {
|
|
50
|
+
type: 'Polygon',
|
|
51
|
+
coordinates: [
|
|
52
|
+
[
|
|
53
|
+
[4, 47],
|
|
54
|
+
[6, 49],
|
|
55
|
+
[11, 47],
|
|
56
|
+
[9, 45],
|
|
57
|
+
[4, 47],
|
|
58
|
+
],
|
|
59
|
+
],
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
type: 'Feature',
|
|
64
|
+
properties: {
|
|
65
|
+
name: 'number 4',
|
|
66
|
+
value: 674,
|
|
67
|
+
},
|
|
68
|
+
geometry: {
|
|
69
|
+
type: 'Polygon',
|
|
70
|
+
coordinates: [
|
|
71
|
+
[
|
|
72
|
+
[2, 46],
|
|
73
|
+
[4, 47],
|
|
74
|
+
[8, 45],
|
|
75
|
+
[6, 43],
|
|
76
|
+
[2, 46],
|
|
77
|
+
],
|
|
78
|
+
],
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
type: 'Feature',
|
|
83
|
+
properties: {
|
|
84
|
+
name: 'number 5',
|
|
85
|
+
value: 839,
|
|
86
|
+
},
|
|
87
|
+
geometry: {
|
|
88
|
+
type: 'Polygon',
|
|
89
|
+
coordinates: [
|
|
90
|
+
[
|
|
91
|
+
[-2, 47],
|
|
92
|
+
[1, 46],
|
|
93
|
+
[0, 44],
|
|
94
|
+
[-4, 45],
|
|
95
|
+
[-2, 47],
|
|
96
|
+
],
|
|
97
|
+
],
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
type: 'Feature',
|
|
102
|
+
properties: {
|
|
103
|
+
name: 'number 6',
|
|
104
|
+
value: 3829,
|
|
105
|
+
},
|
|
106
|
+
geometry: {
|
|
107
|
+
type: 'Polygon',
|
|
108
|
+
coordinates: [
|
|
109
|
+
[
|
|
110
|
+
[1, 45],
|
|
111
|
+
[5, 43],
|
|
112
|
+
[4, 42],
|
|
113
|
+
[0, 44],
|
|
114
|
+
[1, 45],
|
|
115
|
+
],
|
|
116
|
+
],
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
type: 'Feature',
|
|
121
|
+
properties: {
|
|
122
|
+
name: 'number 7',
|
|
123
|
+
value: 4900,
|
|
124
|
+
},
|
|
125
|
+
geometry: {
|
|
126
|
+
type: 'Polygon',
|
|
127
|
+
coordinates: [
|
|
128
|
+
[
|
|
129
|
+
[9, 45],
|
|
130
|
+
[12, 47],
|
|
131
|
+
[15, 45],
|
|
132
|
+
[13, 43],
|
|
133
|
+
[9, 45],
|
|
134
|
+
],
|
|
135
|
+
],
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
type: 'Feature',
|
|
140
|
+
properties: {
|
|
141
|
+
name: 'number 8',
|
|
142
|
+
value: 4988,
|
|
143
|
+
},
|
|
144
|
+
geometry: {
|
|
145
|
+
type: 'Polygon',
|
|
146
|
+
coordinates: [
|
|
147
|
+
[
|
|
148
|
+
[7, 43],
|
|
149
|
+
[9, 45],
|
|
150
|
+
[12, 43],
|
|
151
|
+
[10, 42],
|
|
152
|
+
[7, 43],
|
|
153
|
+
],
|
|
154
|
+
],
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
type: 'Feature',
|
|
159
|
+
properties: {
|
|
160
|
+
name: 'number 9',
|
|
161
|
+
value: 9898,
|
|
162
|
+
},
|
|
163
|
+
geometry: {
|
|
164
|
+
type: 'Polygon',
|
|
165
|
+
coordinates: [
|
|
166
|
+
[
|
|
167
|
+
[4, 42],
|
|
168
|
+
[6, 43],
|
|
169
|
+
[9, 41],
|
|
170
|
+
[7, 40],
|
|
171
|
+
[4, 42],
|
|
172
|
+
],
|
|
173
|
+
],
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
],
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
describe('L.U.Choropleth', function () {
|
|
180
|
+
let path = '/map/99/datalayer/edit/62/',
|
|
181
|
+
poly1,
|
|
182
|
+
poly4,
|
|
183
|
+
poly9
|
|
184
|
+
|
|
185
|
+
before(function () {
|
|
186
|
+
this.server = sinon.fakeServer.create()
|
|
187
|
+
this.server.respondWith(/\/datalayer\/62\/\?.*/, JSON.stringify(POLYGONS))
|
|
188
|
+
this.map = initMap({ umap_id: 99 })
|
|
189
|
+
this.datalayer = this.map.getDataLayerByUmapId(62)
|
|
190
|
+
this.server.respond()
|
|
191
|
+
this.datalayer.options.type = 'Choropleth'
|
|
192
|
+
this.datalayer.options.choropleth = {
|
|
193
|
+
property: 'value',
|
|
194
|
+
}
|
|
195
|
+
enableEdit()
|
|
196
|
+
this.datalayer.eachLayer(function (layer) {
|
|
197
|
+
if (layer.properties.name === 'number 1') {
|
|
198
|
+
poly1 = layer
|
|
199
|
+
} else if (layer.properties.name === 'number 4') {
|
|
200
|
+
poly4 = layer
|
|
201
|
+
} else if (layer.properties.name === 'number 9') {
|
|
202
|
+
poly9 = layer
|
|
203
|
+
}
|
|
204
|
+
})
|
|
205
|
+
})
|
|
206
|
+
after(function () {
|
|
207
|
+
this.server.restore()
|
|
208
|
+
resetMap()
|
|
209
|
+
})
|
|
210
|
+
|
|
211
|
+
describe('#init()', function () {
|
|
212
|
+
it('datalayer should have 9 features', function () {
|
|
213
|
+
assert.equal(this.datalayer._index.length, 9)
|
|
214
|
+
})
|
|
215
|
+
})
|
|
216
|
+
describe('#compute()', function () {
|
|
217
|
+
it('choropleth should compute default colors', function () {
|
|
218
|
+
this.datalayer.resetLayer(true)
|
|
219
|
+
assert.deepEqual(
|
|
220
|
+
this.datalayer.layer.options.breaks,
|
|
221
|
+
[45, 673, 3829, 4900, 9898, 9898]
|
|
222
|
+
)
|
|
223
|
+
assert.equal(poly1._path.attributes.fill.value, '#eff3ff')
|
|
224
|
+
assert.equal(poly4._path.attributes.fill.value, '#bdd7e7')
|
|
225
|
+
assert.equal(poly9._path.attributes.fill.value, '#3182bd')
|
|
226
|
+
})
|
|
227
|
+
it('can change brewer scheme', function () {
|
|
228
|
+
this.datalayer.options.choropleth.brewer = 'Reds'
|
|
229
|
+
this.datalayer.resetLayer(true)
|
|
230
|
+
assert.equal(poly1._path.attributes.fill.value, '#fee5d9')
|
|
231
|
+
assert.equal(poly4._path.attributes.fill.value, '#fcae91')
|
|
232
|
+
assert.equal(poly9._path.attributes.fill.value, '#de2d26')
|
|
233
|
+
})
|
|
234
|
+
it('choropleth should allow to change steps', function () {
|
|
235
|
+
this.datalayer.options.choropleth.brewer = 'Blues'
|
|
236
|
+
this.datalayer.options.choropleth.classes = 6
|
|
237
|
+
this.datalayer.resetLayer(true)
|
|
238
|
+
assert.equal(poly1._path.attributes.fill.value, '#eff3ff')
|
|
239
|
+
assert.equal(poly4._path.attributes.fill.value, '#c6dbef')
|
|
240
|
+
assert.equal(poly9._path.attributes.fill.value, '#3182bd')
|
|
241
|
+
})
|
|
242
|
+
})
|
|
243
|
+
})
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
describe('L.U.Controls', function () {
|
|
2
|
+
before(function () {
|
|
3
|
+
this.server = sinon.fakeServer.create()
|
|
4
|
+
this.server.respondWith(
|
|
5
|
+
/\/datalayer\/62\/\?.*/,
|
|
6
|
+
JSON.stringify(RESPONSES.datalayer62_GET)
|
|
7
|
+
)
|
|
8
|
+
this.map = initMap({ umap_id: 99 })
|
|
9
|
+
this.server.respond()
|
|
10
|
+
this.datalayer = this.map.getDataLayerByUmapId(62)
|
|
11
|
+
})
|
|
12
|
+
after(function () {
|
|
13
|
+
this.server.restore()
|
|
14
|
+
resetMap()
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
describe('#databrowser()', function () {
|
|
18
|
+
let poly, marker, line
|
|
19
|
+
before(function () {
|
|
20
|
+
this.datalayer.eachLayer(function (layer) {
|
|
21
|
+
if (!poly && layer instanceof L.Polygon) {
|
|
22
|
+
poly = layer
|
|
23
|
+
} else if (!line && layer instanceof L.Polyline) {
|
|
24
|
+
line = layer
|
|
25
|
+
} else if (!marker && layer instanceof L.Marker) {
|
|
26
|
+
marker = layer
|
|
27
|
+
}
|
|
28
|
+
})
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
it('should be opened at datalayer button click', function () {
|
|
32
|
+
var button = qs('.umap-browse-actions .umap-browse-link')
|
|
33
|
+
assert.ok(button)
|
|
34
|
+
happen.click(button)
|
|
35
|
+
assert.ok(qs('#umap-ui-container .umap-browse-data'))
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
it('should contain datalayer section', function () {
|
|
39
|
+
assert.ok(qs('#browse_data_datalayer_62'))
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
it("should contain datalayer's features list", function () {
|
|
43
|
+
assert.equal(qsa('#browse_data_datalayer_62 ul li').length, 3)
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
it('should sort feature in natural order', function () {
|
|
47
|
+
poly.properties.name = '9. a poly'
|
|
48
|
+
marker.properties.name = '1. a marker'
|
|
49
|
+
line.properties.name = '100. a line'
|
|
50
|
+
this.datalayer.reindex()
|
|
51
|
+
this.map.openBrowser()
|
|
52
|
+
const els = qsa('.umap-browse-features li')
|
|
53
|
+
assert.equal(els.length, 3)
|
|
54
|
+
assert.equal(els[0].textContent, '1. a marker')
|
|
55
|
+
assert.equal(els[1].textContent, '9. a poly')
|
|
56
|
+
assert.equal(els[2].textContent, '100. a line')
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
it("should redraw datalayer's features list at feature delete", function () {
|
|
60
|
+
var oldConfirm = window.confirm
|
|
61
|
+
window.confirm = function () {
|
|
62
|
+
return true
|
|
63
|
+
}
|
|
64
|
+
enableEdit()
|
|
65
|
+
happen.once(qs('path[fill="DarkBlue"]'), { type: 'contextmenu' })
|
|
66
|
+
happen.click(qs('.leaflet-contextmenu .umap-delete'))
|
|
67
|
+
assert.equal(qsa('#browse_data_datalayer_62 ul li').length, 2)
|
|
68
|
+
window.confirm = oldConfirm
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
it("should redraw datalayer's features list on edit cancel", function () {
|
|
72
|
+
clickCancel()
|
|
73
|
+
happen.click(qs('.umap-browse-actions .umap-browse-link'))
|
|
74
|
+
assert.equal(qsa('#browse_data_datalayer_62 ul li').length, 3)
|
|
75
|
+
})
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
describe('#exportPanel()', function () {
|
|
79
|
+
it('should be opened at datalayer button click', function () {
|
|
80
|
+
let button = qs('.leaflet-control-embed button')
|
|
81
|
+
assert.ok(button)
|
|
82
|
+
happen.click(button)
|
|
83
|
+
assert.ok(qs('#umap-ui-container .umap-share'))
|
|
84
|
+
})
|
|
85
|
+
it('should update iframe link', function () {
|
|
86
|
+
let textarea = qs('.umap-share-iframe')
|
|
87
|
+
assert.ok(textarea)
|
|
88
|
+
console.log(textarea.textContent)
|
|
89
|
+
assert.include(textarea.textContent, 'src="')
|
|
90
|
+
assert.include(textarea.textContent, 'href="')
|
|
91
|
+
// We should ave both, once for iframe link, once for full screen
|
|
92
|
+
assert.include(textarea.textContent, 'scrollWheelZoom=true')
|
|
93
|
+
assert.include(textarea.textContent, 'scrollWheelZoom=false')
|
|
94
|
+
assert.notInclude(textarea.textContent, 'datalayers=62')
|
|
95
|
+
let switcher = qs('label[title="Keep current visible layers"]')
|
|
96
|
+
happen.click(switcher)
|
|
97
|
+
assert.include(textarea.textContent, 'datalayers=62')
|
|
98
|
+
})
|
|
99
|
+
})
|
|
100
|
+
})
|