Compare commits
608 Commits
3f17341b2e
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3b2ea10fdc | ||
| c20754e10a | |||
|
|
c4b8e9664c | ||
| 7822015f8c | |||
| 48261c9657 | |||
|
|
a6bd28ac45 | ||
|
|
674a0f2a9e | ||
| 77800fe0f7 | |||
| 3251ba4022 | |||
| a758a38a0a | |||
| 3c6a8e28c1 | |||
| b72e309fbe | |||
| d7b978c477 | |||
| 930d4fe0b7 | |||
| 642ea33c3c | |||
| 429ab24408 | |||
|
|
eed70c449b | ||
| 4bef16aa2b | |||
| 05bc18c291 | |||
| 35ab2f7c90 | |||
| 2eca9b2562 | |||
|
|
e0c89f4358 | ||
| 604c1176c3 | |||
|
|
0ff8992874 | ||
| b5b84c2547 | |||
| c2b016b2b9 | |||
|
|
d44531274b | ||
| c52ee36d1b | |||
|
|
9b86927e2c | ||
|
|
e224b80995 | ||
|
|
88f3d9ef1a | ||
| 6737029a61 | |||
|
|
d4786564bd | ||
| 6fd69d7999 | |||
|
|
4ec75b3d5a | ||
| 04e3f1e71f | |||
| f66187d3a2 | |||
|
|
df77631299 | ||
| a8d0f05c81 | |||
|
|
df0d13e5dd | ||
|
|
c79637be77 | ||
|
|
b347220dd4 | ||
|
|
b5e11da9a8 | ||
|
|
edeadef96f | ||
|
|
267a299589 | ||
|
|
9d45c25a95 | ||
|
|
2ffce50c47 | ||
|
|
f50ff878e0 | ||
| 09c74448a8 | |||
| 205b73b30e | |||
|
|
313cc59fe7 | ||
| c3fb42c65f | |||
|
|
6b73fb0d55 | ||
| ea641caf38 | |||
| ac15b2018d | |||
|
|
fe73f615ad | ||
|
|
3e1b3ee78e | ||
|
|
58391b7828 | ||
|
|
b2b2a1e8be | ||
|
|
0d96a1be4f | ||
| d599430cb0 | |||
|
|
e17911b339 | ||
|
|
9d6cbffb3d | ||
|
|
a11eb81e73 | ||
|
|
4fc3ad933c | ||
|
|
e6d90c9e61 | ||
| 250b3841fe | |||
| 51291cd86f | |||
|
|
e9e3b719a4 | ||
|
|
1c0ad57b0a | ||
|
|
8684ba25c8 | ||
| 78ca3044cf | |||
| 2e55b5a70e | |||
|
|
af0a3dca2d | ||
| f039898c26 | |||
|
|
ab19b1c2ce | ||
| a2641f8ea5 | |||
|
|
d6841c8f83 | ||
| 187b24ab97 | |||
| b80ddf7854 | |||
|
|
79bc3d9082 | ||
| 1c92ad4c28 | |||
|
|
61e6de0052 | ||
| fb25b92349 | |||
|
|
e78f2893ae | ||
| 51170b45e9 | |||
|
|
7365bea145 | ||
| dc096065b4 | |||
|
|
b9850311ea | ||
| ee9c050db3 | |||
|
|
95200d9920 | ||
|
|
ee1ce21cca | ||
|
|
467f7447bf | ||
|
|
1df4496058 | ||
|
|
134220d75f | ||
|
|
80ef4ed6fe | ||
|
|
2137f3f07e | ||
| a46e8040b2 | |||
|
|
2ca9730735 | ||
| 3d2ca8fb9f | |||
| 6810da8b79 | |||
|
|
4866a6f22d | ||
| 84a1004977 | |||
| 39c619a837 | |||
|
|
758613aa12 | ||
| 6914a61bc4 | |||
| 9f43287433 | |||
|
|
10df983ae3 | ||
| 78249811ab | |||
| df14427d60 | |||
|
|
c7c131d437 | ||
| b2fe8f3bd7 | |||
|
|
3027c69fa8 | ||
| 5995d205a4 | |||
|
|
fd479c92d8 | ||
| e9880d6eb2 | |||
|
|
a4438d8a90 | ||
| 89061774de | |||
|
|
362e6c8534 | ||
| 64a0e58238 | |||
|
|
a3d4dfbd59 | ||
| 4c106ebff3 | |||
|
|
d21f304081 | ||
| 2bad3274fd | |||
|
|
5c8fd64521 | ||
| 72ba8eca81 | |||
|
|
f89f741265 | ||
| 50af55acb2 | |||
|
|
cc879b85e5 | ||
| b4a0a4584d | |||
| 8ab1611f39 | |||
|
|
475c522039 | ||
| 068396ac9a | |||
|
|
4a30707ec6 | ||
| 852b1db895 | |||
|
|
fcbd68eca0 | ||
| 3a42f9114e | |||
| 3f664b472c | |||
|
|
57811f3f2e | ||
| 5e1bc6d705 | |||
| d4a230f96d | |||
|
|
ed1e1478b2 | ||
| afe013a59a | |||
| db3734f8a3 | |||
|
|
86f75c7f78 | ||
| a7abb4072b | |||
|
|
61d6446d75 | ||
| 392008ae4b | |||
| 093c26c7f3 | |||
|
|
a8e1ba6c02 | ||
| e64fbfd014 | |||
| 8cd7b85de2 | |||
|
|
ddc7f97e27 | ||
| 24e3765c28 | |||
|
|
86f3ddb34b | ||
| d6c55ef82b | |||
| d977ddfb7b | |||
|
|
0e8bd5343d | ||
| ceeaa89ba3 | |||
|
|
c3dbf85eb6 | ||
| ad5fe95b55 | |||
|
|
31d3e58062 | ||
| 0231421cef | |||
|
|
6b95fb7f77 | ||
| da7e193219 | |||
| 31f9b48bd7 | |||
|
|
1d6b30edff | ||
| 349a76395b | |||
|
|
32b3b98f76 | ||
| 010ed6e010 | |||
| a8675f5c49 | |||
|
|
f76ef44dee | ||
| 2387a0e39e | |||
| 98980fc857 | |||
|
|
6f7d8fe248 | ||
| 03a1ccd597 | |||
|
|
f2c133e9bd | ||
|
|
9c866e500f | ||
| 3b692359c6 | |||
| 3d4042e8c6 | |||
|
|
3db760dd96 | ||
| b5828cd0fa | |||
| af4e6f45d1 | |||
|
|
79def90bc7 | ||
| 53c60427f1 | |||
|
|
7d7e5bcd37 | ||
| 72a172ccb2 | |||
| 2728a91ab4 | |||
|
|
28d2b5d4a3 | ||
| b70e385097 | |||
| 7392c6170c | |||
| 367348088a | |||
|
|
5efd5b78c9 | ||
| 0498d64c36 | |||
|
|
e17ac435b5 | ||
|
|
3e11c7cefd | ||
|
|
b3dcd1e58b | ||
|
|
681fc819a6 | ||
| 2a62d2df48 | |||
|
|
004bcea0b6 | ||
| 8efa46fa66 | |||
| cefa788295 | |||
| 2da783d6be | |||
| 749be159f1 | |||
|
|
4e24527950 | ||
| 45263a59f4 | |||
|
|
5cdef30c71 | ||
| cdba2af921 | |||
| 658c2c84cd | |||
| 3f9b4dcdaa | |||
|
|
a63159367f | ||
| b9d1c8f61f | |||
|
|
eb34de193c | ||
| 5612bb3d66 | |||
| 0e42efac75 | |||
| 3247880b7c | |||
| a250ecdcc1 | |||
| 93e497ec3f | |||
| 10a1f07622 | |||
| 07d6c1bc10 | |||
|
|
1bddc28767 | ||
| a999c05631 | |||
|
|
f3252a378d | ||
| 4ab1e43d40 | |||
|
|
2719f2fcf4 | ||
| 55914bf7d2 | |||
| 26ca9be4e7 | |||
| 0ed342404e | |||
|
|
26ae1c7f06 | ||
| f71d0fe256 | |||
|
|
7544203202 | ||
| 41a30e0b64 | |||
| f14fc1a4fc | |||
|
|
21ebda4753 | ||
| 3a80a6f7f3 | |||
| 71a2ef44e6 | |||
|
|
1610391d56 | ||
| b778e5726c | |||
| fc4abf9a5b | |||
|
|
1274d96f1d | ||
| 35ccb4f4c5 | |||
|
|
d6587bd63b | ||
|
|
ede75f63f5 | ||
| 274f33e709 | |||
| 4384b12944 | |||
|
|
10ebdf276a | ||
| 9c270bfe75 | |||
| 9031d3e171 | |||
|
|
c3158c1064 | ||
| 315b64a561 | |||
|
|
030dbcec5d | ||
| 876020828e | |||
| 393b881e3b | |||
| 8594a94d62 | |||
|
|
c543ac7c94 | ||
| 97d6d569a0 | |||
| 023048a5bb | |||
| 4a685d675d | |||
|
|
1125f4586e | ||
| 3bdba527ec | |||
| fb03cfce44 | |||
| 6f93cf254c | |||
| b5a3a62cee | |||
| d306d5c4c1 | |||
| e79ae2f623 | |||
| bdf4e03b49 | |||
| 7d5c10d902 | |||
| fb192c6e4d | |||
|
|
6356f149a6 | ||
| 5c5914327c | |||
|
|
e306bf601f | ||
| f8459aaca4 | |||
|
|
47fbc5eab9 | ||
| 564d08b5b9 | |||
| 7e17a49dc6 | |||
|
|
ce52cbdbed | ||
| 752e1e2c42 | |||
|
|
6b617ed4ad | ||
| 9b19950945 | |||
|
|
3f286ee042 | ||
| 747499d009 | |||
|
|
c74163976a | ||
|
|
c9f43b5b53 | ||
|
|
6a240abc0c | ||
|
|
7d8b18a27d | ||
|
|
4a328054dd | ||
|
|
3e482470b6 | ||
|
|
3bacb8a5d9 | ||
|
|
47afa20a01 | ||
|
|
f0646a8f6a | ||
| 36ebc03189 | |||
| c0d40d2d5e | |||
|
|
14e504cc79 | ||
| b060fd34bb | |||
| 0694d4e467 | |||
|
|
7c5867a332 | ||
| 8f958e33f1 | |||
| aa2f305b27 | |||
|
|
d02da8f334 | ||
| 253553c534 | |||
| 4641e351fd | |||
|
|
84cf6a3f6e | ||
| 92b29135b5 | |||
|
|
f6aebb2f80 | ||
| daf78f32b7 | |||
| 42245612d2 | |||
| a05c1fa874 | |||
| 4bda94c360 | |||
| feaad02c33 | |||
| af9acebaff | |||
|
|
7ba35052ec | ||
| 2e40d023b1 | |||
|
|
c4f4a4f61e | ||
| 6b095b7f49 | |||
| b2791eb80b | |||
|
|
4d5ed915ad | ||
| 2fb5967c26 | |||
|
|
820543913f | ||
| ce2f06091b | |||
|
|
5714cdce72 | ||
| 10e43e1ea5 | |||
| 8fa84c6ea8 | |||
|
|
9f872d0af0 | ||
| f6bed668f6 | |||
| f70e30204d | |||
| 7339b91328 | |||
| 88667b3986 | |||
| a996caa73b | |||
| ed6f8f4231 | |||
| 94ef2e269b | |||
| da624f0535 | |||
| 3da646dc4d | |||
| 778e40a26d | |||
|
|
94ff567567 | ||
| b20ab34859 | |||
| 1988b3f74d | |||
| b0587bc4c3 | |||
| 681d372ef3 | |||
| b1922cdb10 | |||
|
|
5774bff8df | ||
| 6254a3be98 | |||
|
|
7943cefddf | ||
| a2a287961c | |||
| 8e8f18ad7c | |||
|
|
5cbb6f32f9 | ||
| b2469f731e | |||
|
|
beb439469f | ||
| ef49f62ca2 | |||
|
|
67abc67d9a | ||
|
|
1f7f410916 | ||
| 2f176be8c6 | |||
| 1118c5ca60 | |||
|
|
c7831d1d87 | ||
| 31c5e0cb52 | |||
|
|
c6a632894d | ||
| e652c7bb5b | |||
| 818e04d1f3 | |||
|
|
ebbac409a0 | ||
| 5cc976ddd3 | |||
| 38eae3263e | |||
|
|
a3eb2d9617 | ||
| 03e3c7ad95 | |||
| 8fd8675260 | |||
| 187811e4e2 | |||
| 8e304fc6eb | |||
|
|
4c93a9f766 | ||
| 93554bc7c4 | |||
| d074cd81cf | |||
|
|
127dc44917 | ||
|
|
aa5a8f0843 | ||
|
|
a10aca92f1 | ||
|
|
e42e94fcf7 | ||
|
|
2b83ccad1f | ||
|
|
e31d428c4b | ||
|
|
429e54ef8d | ||
|
|
02e13337bf | ||
|
|
b4eb7aaeac | ||
|
|
7e21c725d8 | ||
|
|
dd889ea7cc | ||
|
|
4dab5a00b1 | ||
|
|
5cc58e8988 | ||
|
|
0944e595d3 | ||
|
|
32bebec0df | ||
|
|
c0cf210600 | ||
|
|
f85a27a8e5 | ||
|
|
88ae8b829f | ||
|
|
fcb60ed8bc | ||
|
|
3d535507fb | ||
|
|
e89bdac47d | ||
|
|
4038702841 | ||
|
|
7ced2d2a7b | ||
|
|
c53981f4a6 | ||
|
|
076dec27d5 | ||
|
|
5354aa8d0a | ||
|
|
12143c8e69 | ||
|
|
50519e9236 | ||
|
|
7f6d007c04 | ||
|
|
98be4f05cc | ||
|
|
79558e2168 | ||
|
|
b966241997 | ||
|
|
60a7384f88 | ||
|
|
76f225b996 | ||
|
|
37a25c6b29 | ||
|
|
6c45842387 | ||
|
|
d37b0866d5 | ||
|
|
270f244128 | ||
|
|
ebddf688c6 | ||
|
|
f1c572ecc9 | ||
|
|
af5361b6c3 | ||
|
|
6daf0eab4a | ||
|
|
66fe0e9534 | ||
|
|
75ccc6dda4 | ||
|
|
e45ec785d7 | ||
|
|
b067b50937 | ||
|
|
0c2e6364ac | ||
|
|
b232fb2c8e | ||
|
|
4a19694c1a | ||
|
|
af766abe54 | ||
|
|
6333d78eab | ||
|
|
c06fe315d8 | ||
|
|
bc1f44f0b7 | ||
|
|
95bb8da8b7 | ||
|
|
68f8ff9cdd | ||
|
|
9e122fefd3 | ||
|
|
b47ead21be | ||
|
|
ebe43c3b27 | ||
|
|
686084f5cf | ||
|
|
0abaf15101 | ||
|
|
9dd2b5cdb5 | ||
|
|
2246a98bbb | ||
|
|
6265b66baf | ||
|
|
5488206588 | ||
|
|
b4f2042aa0 | ||
|
|
21dca2163b | ||
|
|
2bc02323ae | ||
|
|
8b073fb855 | ||
|
|
5d28b547a1 | ||
|
|
f2407dc12a | ||
|
|
f02b317cf4 | ||
|
|
270b774c33 | ||
|
|
864b72c82c | ||
|
|
c5716b0102 | ||
|
|
ad097121da | ||
|
|
79b33cff50 | ||
|
|
e01417f3b3 | ||
|
|
68ffc6f7d9 | ||
|
|
ef7cf410b9 | ||
|
|
151ba2563e | ||
|
|
78f4dca9a1 | ||
|
|
52bf963afd | ||
|
|
e6cfb85b8e | ||
|
|
6576e7cb6d | ||
|
|
7d7528ab4c | ||
|
|
34a79ec833 | ||
|
|
6cd5b0e5d7 | ||
|
|
412ddc01d1 | ||
|
|
10edf0728b | ||
|
|
57189ce4df | ||
|
|
e72f933014 | ||
|
|
782e7adb00 | ||
|
|
17b78476ee | ||
|
|
93630d5a09 | ||
|
|
79f09d0e0e | ||
|
|
02016eb404 | ||
|
|
59760ad201 | ||
|
|
6eca90abb6 | ||
|
|
b853b4d3f7 | ||
|
|
6e815e3442 | ||
|
|
befa82d0f6 | ||
|
|
5df0e6e423 | ||
|
|
669f93a327 | ||
|
|
73ff1fd47f | ||
|
|
e07c3aeb3d | ||
|
|
700b29c3d1 | ||
|
|
0ffdbfd3ca | ||
|
|
756db80b77 | ||
|
|
b2559be980 | ||
|
|
a9754a8eff | ||
|
|
d5961d4c96 | ||
|
|
56e35345fc | ||
|
|
9755f5a635 | ||
|
|
2ff1aff9f3 | ||
|
|
164ac7e3ad | ||
|
|
85a7e890bd | ||
|
|
8766293966 | ||
|
|
d2cad491b9 | ||
|
|
16d2c6abae | ||
|
|
a212b59d73 | ||
|
|
3574e34659 | ||
|
|
13704c6845 | ||
|
|
bbe337d115 | ||
|
|
e1b6e59b6a | ||
|
|
3685644888 | ||
|
|
050adcbc0f | ||
|
|
0a12005d5d | ||
|
|
8a4644049b | ||
|
|
ca7e5e03be | ||
|
|
a1ceabec47 | ||
|
|
917b875732 | ||
|
|
7df2004671 | ||
|
|
c50a79d723 | ||
|
|
519d789281 | ||
|
|
b5038e9661 | ||
|
|
bab69698c6 | ||
|
|
5c6ea6a391 | ||
|
|
328edc396b | ||
|
|
9cd8b81149 | ||
|
|
80e1f8042e | ||
|
|
1a1bdb314e | ||
|
|
51ec1bd3b4 | ||
|
|
c8440ca536 | ||
|
|
889d1b4f9e | ||
|
|
97b458e812 | ||
|
|
0378565b88 | ||
|
|
8ca8874707 | ||
|
|
dc2772aabf | ||
|
|
ce0e561a3f | ||
|
|
ba9aab03a9 | ||
|
|
f10686423d | ||
|
|
c1688f68c2 | ||
|
|
c916b2f155 | ||
|
|
5df9ac295d | ||
|
|
065a45dc98 | ||
|
|
6b66777699 | ||
|
|
9927ba0929 | ||
|
|
a05a29703c | ||
|
|
76952cac67 | ||
|
|
9b27a997f3 | ||
|
|
014e3143fd | ||
|
|
7eaf1686e1 | ||
|
|
d4bf2a6667 | ||
|
|
9d7cf637ee | ||
|
|
979f80ce89 | ||
|
|
c677a9b639 | ||
|
|
9440b91d90 | ||
|
|
2b18167761 | ||
|
|
da8b2f1d3a | ||
|
|
10e4e6abc6 | ||
|
|
6acfe7c32f | ||
|
|
d08c1b2008 | ||
|
|
a47e1d9a63 | ||
|
|
4187522739 | ||
|
|
c0d0088f6e | ||
|
|
d43dff3085 | ||
|
|
9a04e1f848 | ||
|
|
621773a6f1 | ||
|
|
a9672c44bf | ||
|
|
155c212f89 | ||
|
|
ee35c3f1b8 | ||
|
|
0a405f5515 | ||
|
|
b618b7c40f | ||
|
|
f10e68c4ad | ||
|
|
870c3c2c77 | ||
|
|
1559f15c7f | ||
|
|
96345e54fb | ||
|
|
f61590c677 | ||
|
|
6f1ec4a17a | ||
|
|
786e9392b1 | ||
|
|
f229c25b8f | ||
|
|
9bdd1ff35f | ||
|
|
4dd7a15b30 | ||
|
|
a4aa7dbb7d | ||
|
|
681d2fe273 | ||
| 87547aafcc | |||
| 6ab5ba8a56 | |||
| 78b7ef44d9 | |||
| e19ca94653 | |||
|
|
a85378374b | ||
| 9e3f6010c3 | |||
| e6a637b866 | |||
|
|
ccf77805a0 | ||
| 2b2e1bfafa | |||
| 3fd4ac2f94 | |||
| 9849eaf1e7 | |||
| b516cc07e2 | |||
| c9c9a2ddbf | |||
| 1d0f3b958d | |||
| 45537cb2e9 | |||
| 652ddc0cdc | |||
| fd3b331cc0 | |||
| 9facbe76c8 | |||
| 20dff38cf7 | |||
| e374bb8a73 | |||
| 294b9c6dd3 | |||
| d92bf54c8d | |||
| 914e272fc2 | |||
|
|
b182b7fda6 | ||
|
|
22040b43b3 | ||
|
|
50170cf599 | ||
|
|
2deff46a7e | ||
|
|
e939a787ba | ||
|
|
4ae9562ce1 | ||
|
|
288e507e6c | ||
| d9848a8ba3 | |||
| a9d42484cc | |||
| a276593c7f | |||
| ff50650c28 | |||
| d7efeb8d59 | |||
| fd71d1f38e | |||
| bc8c9f8bf9 | |||
| 0865ca1a93 | |||
| 1bc3983f55 | |||
| 945d88839f | |||
| 7c06343909 | |||
| b8f8f27794 | |||
| 2a31771ac6 | |||
| 19dce51a28 | |||
| b29cd8e4c9 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -51,4 +51,5 @@ projects/common-map/node_modules/
|
||||
.angular/*
|
||||
projects/common-map3d/node_modules/
|
||||
projects/common-map/node_modules/
|
||||
projects/ng-openlayers/node_modules/
|
||||
projects/common/node_modules/
|
||||
|
||||
76
Jenkinsfile
vendored
76
Jenkinsfile
vendored
@@ -1,54 +1,24 @@
|
||||
pipeline {
|
||||
agent any
|
||||
environment {
|
||||
PACKAGE_VERSION_PREFIX=sh(script: 'jq .version package.json |sed "s/\\"//g"', returnStdout: true).trim()
|
||||
PACKAGE_VERSION="${PACKAGE_VERSION_PREFIX}"
|
||||
}
|
||||
stages {
|
||||
stage('npm install'){
|
||||
steps {
|
||||
sh '''rm -rf node_modules/
|
||||
npm install --legacy-peer-deps
|
||||
cd projects/common
|
||||
npm install --legacy-peer-deps
|
||||
cd ../common-map
|
||||
npm install --legacy-peer-deps
|
||||
cd ../common-map3d
|
||||
npm install --legacy-peer-deps
|
||||
'''
|
||||
}
|
||||
}
|
||||
stage('build'){
|
||||
steps {
|
||||
sh '''ng build common --configuration production
|
||||
ng build common-map --configuration production
|
||||
ng build common-map3d --configuration production'''
|
||||
}
|
||||
}
|
||||
stage('npm publish'){
|
||||
steps {
|
||||
sh '''cd dist/common
|
||||
npm version ${PACKAGE_VERSION} --allow-same-version
|
||||
npm publish
|
||||
cd ../common-map
|
||||
npm version ${PACKAGE_VERSION} --allow-same-version
|
||||
npm publish
|
||||
cd ../common-map3d
|
||||
npm version ${PACKAGE_VERSION} --allow-same-version
|
||||
npm publish'''
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
post {
|
||||
always {
|
||||
emailext (
|
||||
body: '${DEFAULT_CONTENT}',
|
||||
mimeType: 'text/html',
|
||||
replyTo: '${DEFAULT_REPLYTO}',
|
||||
subject: '${DEFAULT_SUBJECT}',
|
||||
to: emailextrecipients([[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']])
|
||||
)
|
||||
}
|
||||
}
|
||||
@Library('farmmaps-shared-library') _
|
||||
|
||||
pipeline {
|
||||
agent any;
|
||||
options {
|
||||
copyArtifactPermission projectNames: env.allProjectsArtifactPermission;
|
||||
disableConcurrentBuilds();
|
||||
}
|
||||
stages {
|
||||
stage('FarmmapsLibBuildAll') {
|
||||
steps {
|
||||
stepFarmmapsLibBuildAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
success {
|
||||
postSuccess();
|
||||
}
|
||||
always {
|
||||
postAlways();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,54 +1,24 @@
|
||||
pipeline {
|
||||
agent any
|
||||
environment {
|
||||
PACKAGE_VERSION_PREFIX=sh(script: 'jq .version package.json |sed "s/\\"//g"', returnStdout: true).trim()
|
||||
PACKAGE_VERSION="${PACKAGE_VERSION_PREFIX + '-prerelease.' + env.BUILD_NUMBER}"
|
||||
}
|
||||
stages {
|
||||
stage('npm install'){
|
||||
steps {
|
||||
sh '''rm -rf node_modules/
|
||||
npm install --legacy-peer-deps
|
||||
cd projects/common
|
||||
npm install --legacy-peer-deps
|
||||
cd ../common-map
|
||||
npm install --legacy-peer-deps
|
||||
cd ../common-map3d
|
||||
npm install --legacy-peer-deps
|
||||
'''
|
||||
}
|
||||
}
|
||||
stage('build'){
|
||||
steps {
|
||||
sh '''ng build common --configuration production
|
||||
ng build common-map --configuration production
|
||||
ng build common-map3d --configuration production'''
|
||||
}
|
||||
}
|
||||
stage('npm publish'){
|
||||
steps {
|
||||
sh '''cd dist/common
|
||||
npm version ${PACKAGE_VERSION}
|
||||
npm publish
|
||||
cd ../common-map
|
||||
npm version ${PACKAGE_VERSION}
|
||||
npm publish
|
||||
cd ../common-map3d
|
||||
npm version ${PACKAGE_VERSION}
|
||||
npm publish'''
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
post {
|
||||
always {
|
||||
emailext (
|
||||
body: '${DEFAULT_CONTENT}',
|
||||
mimeType: 'text/html',
|
||||
replyTo: '${DEFAULT_REPLYTO}',
|
||||
subject: '${DEFAULT_SUBJECT}',
|
||||
to: emailextrecipients([[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']])
|
||||
)
|
||||
}
|
||||
}
|
||||
@Library('farmmaps-shared-library') _
|
||||
|
||||
pipeline {
|
||||
agent any;
|
||||
options {
|
||||
copyArtifactPermission projectNames: env.allProjectsArtifactPermission;
|
||||
disableConcurrentBuilds();
|
||||
}
|
||||
stages {
|
||||
stage('FarmmapsLibBuildAll') {
|
||||
steps {
|
||||
stepFarmmapsLibBuildAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
success {
|
||||
postSuccess();
|
||||
}
|
||||
always {
|
||||
postAlways();
|
||||
}
|
||||
}
|
||||
}
|
||||
127
README.md
127
README.md
@@ -1,65 +1,64 @@
|
||||
# Farmmaps viewer
|
||||
|
||||
This is a sample FarmMaps client in Angular 7.x.
|
||||
|
||||
|
||||
## Quick start
|
||||
|
||||
Use one of the two options below to get started.
|
||||
|
||||
## Option 1, Using docker
|
||||
|
||||
*Dependencies*
|
||||
|
||||
* docker desktop
|
||||
|
||||
*Setup*
|
||||
|
||||
```
|
||||
docker pull node:12.13.1
|
||||
docker run -t -i --entrypoint /bin/bash -p 4200:4200 node:12.13.1
|
||||
```
|
||||
|
||||
Inside the running container
|
||||
```
|
||||
git clone https://git.akkerweb.nl/FarmMaps/FarmMapsLib.git
|
||||
cd FarmMapsLib
|
||||
npm config set @farmmaps:registry https://repository.akkerweb.nl/repository/npm-group/
|
||||
npm install -g @angular/cli
|
||||
npm install
|
||||
ng serve --host 0.0.0.0
|
||||
```
|
||||
*Go*
|
||||
|
||||
Point your browser to http://localhost:4200
|
||||
|
||||
## Option 2, Using local machine
|
||||
|
||||
*Dependencies*
|
||||
|
||||
* npm 6.9.0
|
||||
* nodejs 10.16.0
|
||||
* git
|
||||
|
||||
*Setup*
|
||||
|
||||
```
|
||||
git clone https://git.akkerweb.nl/FarmMaps/FarmMapsLib.git
|
||||
cd FarmMapsLib
|
||||
npm config set @farmmaps:registry https://repository.akkerweb.nl/repository/npm-group/
|
||||
npm install -g @angular/cli
|
||||
npm install
|
||||
ng serve
|
||||
```
|
||||
*Go*
|
||||
|
||||
Point your browser to http://localhost:4200
|
||||
|
||||
*ESLint*
|
||||
|
||||
```
|
||||
npm run lint src
|
||||
npm run lint projects/common/src
|
||||
npm run lint projects/common-map/src
|
||||
npm run lint projects/common-map3d/src
|
||||
# Farmmaps viewer
|
||||
|
||||
This is a sample FarmMaps client in Angular 7.x.
|
||||
|
||||
## Quick start
|
||||
|
||||
Use one of the two options below to get started.
|
||||
|
||||
## Option 1, Using docker
|
||||
|
||||
*Dependencies*
|
||||
|
||||
* docker desktop
|
||||
|
||||
*Setup*
|
||||
|
||||
```
|
||||
docker pull node:12.13.1
|
||||
docker run -t -i --entrypoint /bin/bash -p 4200:4200 node:12.13.1
|
||||
```
|
||||
|
||||
Inside the running container
|
||||
```
|
||||
git clone https://git.akkerweb.nl/FarmMaps/FarmMapsLib.git
|
||||
cd FarmMapsLib
|
||||
npm config set @farmmaps:registry https://repository.akkerweb.nl/repository/npm-group/
|
||||
npm install -g @angular/cli
|
||||
npm install
|
||||
ng serve --host 0.0.0.0
|
||||
```
|
||||
*Go*
|
||||
|
||||
Point your browser to http://localhost:4200
|
||||
|
||||
## Option 2, Using local machine
|
||||
|
||||
*Dependencies*
|
||||
|
||||
* npm 6.9.0
|
||||
* nodejs 10.16.0
|
||||
* git
|
||||
|
||||
*Setup*
|
||||
|
||||
```
|
||||
git clone https://git.akkerweb.nl/FarmMaps/FarmMapsLib.git
|
||||
cd FarmMapsLib
|
||||
npm config set @farmmaps:registry https://repository.akkerweb.nl/repository/npm-group/
|
||||
npm install -g @angular/cli
|
||||
npm install
|
||||
ng serve
|
||||
```
|
||||
*Go*`
|
||||
|
||||
Point your browser to http://localhost:4200
|
||||
|
||||
*ESLint*
|
||||
|
||||
```
|
||||
npm run lint src
|
||||
npm run lint projects/common/src
|
||||
npm run lint projects/common-map/src
|
||||
npm run lint projects/common-map3d/src
|
||||
```
|
||||
124
angular.json
124
angular.json
@@ -129,43 +129,14 @@
|
||||
"extract-i18n": {
|
||||
"builder": "@angular-devkit/build-angular:extract-i18n",
|
||||
"options": {
|
||||
"browserTarget": "farmmaps-lib-app:build"
|
||||
"buildTarget": "farmmaps-lib-app:build"
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"builder": "@angular/build:unit-test",
|
||||
"options": {
|
||||
"main": "src/test.ts",
|
||||
"polyfills": "src/polyfills.ts",
|
||||
"tsConfig": "src/tsconfig.spec.json",
|
||||
"karmaConfig": "src/karma.conf.js",
|
||||
"styles": [
|
||||
"src/styles.css"
|
||||
],
|
||||
"scripts": [],
|
||||
"assets": [
|
||||
"src/favicon.ico",
|
||||
"src/assets"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"farmmaps-lib-app-e2e": {
|
||||
"root": "e2e/",
|
||||
"projectType": "application",
|
||||
"prefix": "",
|
||||
"architect": {
|
||||
"e2e": {
|
||||
"builder": "@angular-devkit/build-angular:protractor",
|
||||
"options": {
|
||||
"protractorConfig": "e2e/protractor.conf.js",
|
||||
"devServerTarget": "farmmaps-lib-app:serve"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"devServerTarget": "farmmaps-lib-app:serve:production"
|
||||
}
|
||||
"browsers": ["chromium"]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -189,11 +160,10 @@
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"builder": "@angular/build:unit-test",
|
||||
"options": {
|
||||
"main": "projects/common/src/test.ts",
|
||||
"tsConfig": "projects/common/tsconfig.spec.json",
|
||||
"karmaConfig": "projects/common/karma.conf.js"
|
||||
"browsers": ["chromium"]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -209,19 +179,18 @@
|
||||
"options": {
|
||||
"tsConfig": "projects/common-map/tsconfig.lib.json",
|
||||
"project": "projects/common-map/ng-package.json"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"tsConfig": "projects/common-map/tsconfig.lib.prod.json"
|
||||
}
|
||||
}
|
||||
, "configurations": {
|
||||
"production": {
|
||||
"tsConfig": "projects/common-map/tsconfig.lib.prod.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"builder": "@angular/build:unit-test",
|
||||
"options": {
|
||||
"main": "projects/common-map/src/test.ts",
|
||||
"tsConfig": "projects/common-map/tsconfig.spec.json",
|
||||
"karmaConfig": "projects/common-map/karma.conf.js"
|
||||
"browsers": ["chromium"]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -245,11 +214,46 @@
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"builder": "@angular/build:unit-test",
|
||||
"options": {
|
||||
"main": "projects/common-map3d/src/test.ts",
|
||||
"tsConfig": "projects/common-map3d/tsconfig.spec.json",
|
||||
"karmaConfig": "projects/common-map3d/karma.conf.js"
|
||||
"browsers": ["chromium"]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"ng-openlayers": {
|
||||
"projectType": "library",
|
||||
"root": "projects/ng-openlayers",
|
||||
"sourceRoot": "projects/ng-openlayers/src",
|
||||
"prefix": "ng-openlayers",
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:ng-packagr",
|
||||
"options": {
|
||||
"tsConfig": "projects/ng-openlayers/tsconfig.lib.json",
|
||||
"project": "projects/ng-openlayers/ng-package.json"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"tsConfig": "projects/ng-openlayers/tsconfig.lib.prod.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular/build:unit-test",
|
||||
"options": {
|
||||
"tsConfig": "projects/ng-openlayers/tsconfig.spec.json",
|
||||
"browsers": ["chromium"]
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"builder": "@angular-eslint/builder:lint",
|
||||
"options": {
|
||||
"lintFilePatterns": [
|
||||
"projects/ng-openlayers/**/*.ts",
|
||||
"projects/ng-openlayers/**/*.html"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -257,5 +261,31 @@
|
||||
},
|
||||
"cli": {
|
||||
"analytics": false
|
||||
},
|
||||
"schematics": {
|
||||
"@schematics/angular:component": {
|
||||
"type": "component"
|
||||
},
|
||||
"@schematics/angular:directive": {
|
||||
"type": "directive"
|
||||
},
|
||||
"@schematics/angular:service": {
|
||||
"type": "service"
|
||||
},
|
||||
"@schematics/angular:guard": {
|
||||
"typeSeparator": "."
|
||||
},
|
||||
"@schematics/angular:interceptor": {
|
||||
"typeSeparator": "."
|
||||
},
|
||||
"@schematics/angular:module": {
|
||||
"typeSeparator": "."
|
||||
},
|
||||
"@schematics/angular:pipe": {
|
||||
"typeSeparator": "."
|
||||
},
|
||||
"@schematics/angular:resolver": {
|
||||
"typeSeparator": "."
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
// Protractor configuration file, see link for more information
|
||||
// https://github.com/angular/protractor/blob/master/lib/config.ts
|
||||
|
||||
const { SpecReporter } = require('jasmine-spec-reporter');
|
||||
|
||||
exports.config = {
|
||||
allScriptsTimeout: 11000,
|
||||
specs: [
|
||||
'./src/**/*.e2e-spec.ts'
|
||||
],
|
||||
capabilities: {
|
||||
'browserName': 'chrome'
|
||||
},
|
||||
directConnect: true,
|
||||
baseUrl: 'http://localhost:4200/',
|
||||
framework: 'jasmine',
|
||||
jasmineNodeOpts: {
|
||||
showColors: true,
|
||||
defaultTimeoutInterval: 30000,
|
||||
print: function() {}
|
||||
},
|
||||
onPrepare() {
|
||||
require('ts-node').register({
|
||||
project: require('path').join(__dirname, './tsconfig.e2e.json')
|
||||
});
|
||||
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
|
||||
}
|
||||
};
|
||||
@@ -1,23 +0,0 @@
|
||||
import { AppPage } from './app.po';
|
||||
import { browser, logging } from 'protractor';
|
||||
|
||||
describe('workspace-project App', () => {
|
||||
let page: AppPage;
|
||||
|
||||
beforeEach(() => {
|
||||
page = new AppPage();
|
||||
});
|
||||
|
||||
it('should display welcome message', () => {
|
||||
page.navigateTo();
|
||||
expect(page.getTitleText()).toEqual('Welcome to farmmaps-lib-app!');
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
// Assert that there are no errors emitted from the browser
|
||||
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
|
||||
expect(logs).not.toContain(jasmine.objectContaining({
|
||||
level: logging.Level.SEVERE,
|
||||
} as logging.Entry));
|
||||
});
|
||||
});
|
||||
@@ -1,11 +0,0 @@
|
||||
import { browser, by, element } from 'protractor';
|
||||
|
||||
export class AppPage {
|
||||
navigateTo() {
|
||||
return browser.get(browser.baseUrl) as Promise<any>;
|
||||
}
|
||||
|
||||
getTitleText() {
|
||||
return element(by.css('app-root h1')).getText() as Promise<string>;
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
{
|
||||
"extends": "../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../out-tsc/app",
|
||||
"module": "commonjs",
|
||||
"target": "es5",
|
||||
"types": [
|
||||
"jasmine",
|
||||
"jasminewd2",
|
||||
"node"
|
||||
]
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 143 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -51,7 +51,17 @@
|
||||
content: "i";
|
||||
}
|
||||
|
||||
hallo
|
||||
.fm-carbon:before {
|
||||
content: "j";
|
||||
}
|
||||
|
||||
.fm-bo-akkerbouw:before {
|
||||
content: "k";
|
||||
}
|
||||
|
||||
.fm-grass:before {
|
||||
content: "l";
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "FarmMaps";
|
||||
|
||||
40025
package-lock.json
generated
40025
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
121
package.json
121
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "farmmaps-lib-app",
|
||||
"version": "3.0.2",
|
||||
"version": "4.20.0",
|
||||
"scripts": {
|
||||
"ng": "ng",
|
||||
"start": "ng serve",
|
||||
@@ -11,79 +11,90 @@
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@angular/animations": "^14.1.3",
|
||||
"@angular/common": "^14.1.3",
|
||||
"@angular/compiler": "^14.1.3",
|
||||
"@angular/core": "^14.1.3",
|
||||
"@angular-eslint/eslint-plugin": "^15.2.1",
|
||||
"@angular/forms": "^14.1.3",
|
||||
"@angular/platform-browser": "^14.1.3",
|
||||
"@angular/platform-browser-dynamic": "^14.1.3",
|
||||
"@angular/router": "^14.1.3",
|
||||
"@angular-eslint/eslint-plugin": "20.7.0",
|
||||
"@angular/animations": "21.1.0",
|
||||
"@angular/common": "21.1.0",
|
||||
"@angular/compiler": "21.1.0",
|
||||
"@angular/core": "21.1.0",
|
||||
"@angular/forms": "21.1.0",
|
||||
"@angular/platform-browser": "21.1.0",
|
||||
"@angular/platform-browser-dynamic": "21.1.0",
|
||||
"@angular/router": "21.1.0",
|
||||
"@farmmaps/common": "file:dist/common",
|
||||
"@farmmaps/common-map": "file:dist/common-map",
|
||||
"@farmmaps/common-map3d": "file:dist/common-map3d",
|
||||
"@microsoft/signalr": "^3.1.16",
|
||||
"@ng-bootstrap/ng-bootstrap": "^13.0.0",
|
||||
"@ngrx/effects": "^14",
|
||||
"@ngrx/router-store": "^14",
|
||||
"@ngrx/store": "^14",
|
||||
"@popperjs/core": "^2.11.6",
|
||||
"angular-oauth2-oidc": "^13",
|
||||
"assert": "^2.0.0",
|
||||
"bootstrap": "^5.2.0",
|
||||
"@farmmaps/ng-openlayers": "file:dist/ng-openlayers",
|
||||
"@microsoft/signalr": "10.0.0",
|
||||
"@ng-bootstrap/ng-bootstrap": "20.0.0",
|
||||
"@ngrx/effects": "21.0.1",
|
||||
"@ngrx/router-store": "21.0.1",
|
||||
"@ngrx/store": "21.0.1",
|
||||
"@popperjs/core": "2.11.8",
|
||||
"angular-oauth2-oidc": "20.0.2",
|
||||
"assert": "2.1.0",
|
||||
"bootstrap": "5.3.8",
|
||||
"browserify-zlib": "^0.2.0",
|
||||
"buffer": "^6.0.3",
|
||||
"cesium": "^1.97.0",
|
||||
"core-js": "^2.6.12",
|
||||
"https-browserify": "^1.0.0",
|
||||
"moment": "^2.29.4",
|
||||
"ngrx-store-localstorage": "^14",
|
||||
"ngx-avatar": "^4.1.0",
|
||||
"ngx-clipboard": "^14.0.1",
|
||||
"ngx-image-cropper": "^3.3.5",
|
||||
"ngx-openlayers": "1.0.0-next.19",
|
||||
"ngx-uploadx": "^5.2.0",
|
||||
"ol": "6.14.1",
|
||||
"ngrx-store-localstorage": "20.1.0",
|
||||
"ngx-avatars": "1.10.1",
|
||||
"ngx-clipboard": "^16.0.0",
|
||||
"ngx-image-cropper": "^7.0.0",
|
||||
"ngx-uploadx": "7.0.1",
|
||||
"ol": "^8.2.0",
|
||||
"olcs": "^2.13.1",
|
||||
"resumablejs": "^1.1.0",
|
||||
"rxjs": "^6.6.7",
|
||||
"rxjs": "^7.8.1",
|
||||
"stream": "^0.0.2",
|
||||
"stream-http": "^3.2.0",
|
||||
"tassign": "^1.0.0",
|
||||
"tslib": "^2.4.0",
|
||||
"url": "^0.11.0",
|
||||
"util": "^0.12.4",
|
||||
"zone.js": "~0.11.4"
|
||||
"zone.js": "~0.15.1"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@lmdb/lmdb-linux-x64": "^3.1.0",
|
||||
"@rollup/rollup-linux-x64-gnu": "^4.21.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-builders/custom-webpack": "^14",
|
||||
"@angular-devkit/build-angular": "^14.1.3",
|
||||
"@angular/cli": "^14.1.3",
|
||||
"@angular/compiler-cli": "^14.1.3",
|
||||
"@angular/language-service": "^14.1.3",
|
||||
"@angular/localize": "^14.1.3",
|
||||
"@angular-builders/custom-webpack": "21.0.3",
|
||||
"@angular-devkit/build-angular": "21.1.0",
|
||||
"@angular/build": "21.1.0",
|
||||
"@angular/cli": "21.1.0",
|
||||
"@angular/compiler-cli": "21.1.0",
|
||||
"@angular/language-service": "21.1.0",
|
||||
"@angular/localize": "21.1.0",
|
||||
"@types/arcgis-rest-api": "^10.4.5",
|
||||
"@types/jasmine": "~2.8.8",
|
||||
"@types/jasminewd2": "^2.0.9",
|
||||
"@types/node": "^12.20.15",
|
||||
"@typescript-eslint/eslint-plugin": "^5.54.0",
|
||||
"@typescript-eslint/eslint-plugin-tslint": "^5.54.0",
|
||||
"@typescript-eslint/parser": "^5.54.0",
|
||||
"codelyzer": "^0.0.28",
|
||||
"eslint": "^8.35.0",
|
||||
"eslint-config-prettier": "^8.6.0",
|
||||
"eslint-plugin-import": "^2.27.5",
|
||||
"jasmine-core": "^4.3.0",
|
||||
"jasmine-spec-reporter": "^7.0.0",
|
||||
"karma": "^6.3.20",
|
||||
"karma-chrome-launcher": "~3.1.0",
|
||||
"karma-coverage-istanbul-reporter": "^3.0.3",
|
||||
"karma-jasmine": "^5.1.0",
|
||||
"karma-jasmine-html-reporter": "^2.0.0",
|
||||
"ng-packagr": "^14.1.0",
|
||||
"protractor": "~7.0.0",
|
||||
"@types/node": "^22.5.4",
|
||||
"@typescript-eslint/eslint-plugin": "8.53.1",
|
||||
"@typescript-eslint/parser": "8.53.1",
|
||||
"@vitest/browser": "4.0.17",
|
||||
"@vitest/browser-playwright": "^4.0.17",
|
||||
"eslint": "9.39.2",
|
||||
"eslint-config-prettier": "10.1.8",
|
||||
"eslint-plugin-import": "2.32.0",
|
||||
"jsdom": "^27.4.0",
|
||||
"ng-packagr": "21.1.0",
|
||||
"ts-node": "^8.8.1",
|
||||
"typescript": "~4.6.4"
|
||||
"typescript": "~5.9.3",
|
||||
"vitest": "4.0.17"
|
||||
},
|
||||
"overrides": {
|
||||
"ngrx-store-localstorage": {
|
||||
"@angular/common": "$@angular/common",
|
||||
"@angular/core": "$@angular/core"
|
||||
},
|
||||
"ngx-avatars": {
|
||||
"@angular/common": "$@angular/common",
|
||||
"@angular/core": "$@angular/core"
|
||||
},
|
||||
"ngx-uploadx": {
|
||||
"@angular/common": "$@angular/common",
|
||||
"@angular/core": "$@angular/core"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
207
projects/common-map/package-lock.json
generated
207
projects/common-map/package-lock.json
generated
@@ -11,20 +11,205 @@
|
||||
"tslib": "^2.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@angular/core": ">=14.0.0",
|
||||
"@ngrx/effects": ">=14.0.0",
|
||||
"@ngrx/router-store": ">=14.0.0",
|
||||
"@ngrx/store": ">=14.0.0",
|
||||
"ngrx-store-localstorage": ">=14.0.0",
|
||||
"ngx-openlayers": ">=1.0.0-next.19",
|
||||
"ol": ">=6.8.1",
|
||||
"tassign": ">=1.0.0"
|
||||
"@angular/core": "20.3.16",
|
||||
"@ngrx/effects": "20.1.0",
|
||||
"@ngrx/router-store": "20.1.0",
|
||||
"@ngrx/store": "20.1.0",
|
||||
"ngrx-store-localstorage": "20.1.0",
|
||||
"tassign": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"../../dist/libs/ng-openlayers": {
|
||||
"version": "18.0.0",
|
||||
"extraneous": true,
|
||||
"license": "MPL-2.0",
|
||||
"dependencies": {
|
||||
"tslib": "^2.3.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@angular/common": "^18.2.3",
|
||||
"@angular/core": "^18.2.3",
|
||||
"ol": "^8.2.0"
|
||||
}
|
||||
},
|
||||
"dist/ng-openlayers": {
|
||||
"extraneous": true
|
||||
},
|
||||
"node_modules/@angular/common": {
|
||||
"version": "20.3.16",
|
||||
"resolved": "https://registry.npmjs.org/@angular/common/-/common-20.3.16.tgz",
|
||||
"integrity": "sha512-GRAziNlntwdnJy3F+8zCOvDdy7id0gITjDnM6P9+n2lXvtDuBLGJKU3DWBbvxcCjtD6JK/g/rEX5fbCxbUHkQQ==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"tslib": "^2.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^20.19.0 || ^22.12.0 || >=24.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@angular/core": "20.3.16",
|
||||
"rxjs": "^6.5.3 || ^7.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@angular/core": {
|
||||
"version": "20.3.16",
|
||||
"resolved": "https://registry.npmjs.org/@angular/core/-/core-20.3.16.tgz",
|
||||
"integrity": "sha512-KSFPKvOmWWLCJBbEO+CuRUXfecX2FRuO0jNi9c54ptXMOPHlK1lIojUnyXmMNzjdHgRug8ci9qDuftvC2B7MKg==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"tslib": "^2.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^20.19.0 || ^22.12.0 || >=24.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@angular/compiler": "20.3.16",
|
||||
"rxjs": "^6.5.3 || ^7.4.0",
|
||||
"zone.js": "~0.15.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@angular/compiler": {
|
||||
"optional": true
|
||||
},
|
||||
"zone.js": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@angular/platform-browser": {
|
||||
"version": "20.3.16",
|
||||
"resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-20.3.16.tgz",
|
||||
"integrity": "sha512-YsrLS6vyS77i4pVHg4gdSBW74qvzHjpQRTVQ5Lv/OxIjJdYYYkMmjNalCNgy1ZuyY6CaLIB11ccxhrNnxfKGOQ==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"tslib": "^2.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^20.19.0 || ^22.12.0 || >=24.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@angular/animations": "20.3.16",
|
||||
"@angular/common": "20.3.16",
|
||||
"@angular/core": "20.3.16"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@angular/animations": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@angular/router": {
|
||||
"version": "20.3.16",
|
||||
"resolved": "https://registry.npmjs.org/@angular/router/-/router-20.3.16.tgz",
|
||||
"integrity": "sha512-e1LiQFZaajKqc00cY5FboIrWJZSMnZ64GDp5R0UejritYrqorQQQNOqP1W85BMuY2owibMmxVfX+dJg/Mc8PuQ==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"tslib": "^2.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^20.19.0 || ^22.12.0 || >=24.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@angular/common": "20.3.16",
|
||||
"@angular/core": "20.3.16",
|
||||
"@angular/platform-browser": "20.3.16",
|
||||
"rxjs": "^6.5.3 || ^7.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@ngrx/effects": {
|
||||
"version": "20.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@ngrx/effects/-/effects-20.1.0.tgz",
|
||||
"integrity": "sha512-wkIu0QnTarBd1zUswk643H5SILO9Be1OeswMe7g4tXlkNLFRPkyu0BUzXT80PsUPP5p0VrdFz3akrn3HHjjTjA==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"tslib": "^2.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@angular/core": "^20.0.0",
|
||||
"@ngrx/store": "20.1.0",
|
||||
"rxjs": "^6.5.3 || ^7.5.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@ngrx/router-store": {
|
||||
"version": "20.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@ngrx/router-store/-/router-store-20.1.0.tgz",
|
||||
"integrity": "sha512-XlpQsgmEc1E9Ogiv6QbJ8g8JzjrJOlr7JX9FngHIDLyXQFCMn5wcXsqhjiBjG9JgJLwlzV+v14i7EM/nqwQCGA==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"tslib": "^2.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@angular/common": "^20.0.0",
|
||||
"@angular/core": "^20.0.0",
|
||||
"@angular/router": "^20.0.0",
|
||||
"@ngrx/store": "20.1.0",
|
||||
"rxjs": "^6.5.3 || ^7.5.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@ngrx/store": {
|
||||
"version": "20.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@ngrx/store/-/store-20.1.0.tgz",
|
||||
"integrity": "sha512-o8j3CGAGedm+BIb+QDhNXrVaU//n9uF0wH0HZWtXHmW1mjRBaQiUA+ZPMUkDwAeN8KuOcoIEC+2QUXxXGVI7ow==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"tslib": "^2.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@angular/core": "^20.0.0",
|
||||
"rxjs": "^6.5.3 || ^7.5.0"
|
||||
}
|
||||
},
|
||||
"node_modules/deepmerge": {
|
||||
"version": "4.3.1",
|
||||
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz",
|
||||
"integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/ngrx-store-localstorage": {
|
||||
"version": "20.1.0",
|
||||
"resolved": "https://registry.npmjs.org/ngrx-store-localstorage/-/ngrx-store-localstorage-20.1.0.tgz",
|
||||
"integrity": "sha512-/5+i5qTxZdE8Q5qdSmj7+9JvriAnHwW7RsXzh1rrQ/UHA9vf12q6mJ6wYTTehUO4Qcl2t/K5MRkooN2eG2ZEvw==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"deepmerge": "^4.2.2",
|
||||
"tslib": "^2.3.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@angular/common": ">=20.0.0",
|
||||
"@angular/core": ">=20.0.0",
|
||||
"@ngrx/store": ">=20.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/rxjs": {
|
||||
"version": "7.8.1",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz",
|
||||
"integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"tslib": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/tassign": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/tassign/-/tassign-1.0.0.tgz",
|
||||
"integrity": "sha512-k0Ti9f+A1R0BRdArEbiUHldd+A40kZ5qsiNSNk4czx61wkAoSZYjqkaQs0jC63AfgPdCXVPstDq2ZW5ZLRTCgw==",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/tslib": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.1.tgz",
|
||||
"integrity": "sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ=="
|
||||
"version": "2.7.0",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz",
|
||||
"integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA=="
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,13 +8,16 @@
|
||||
"tslib": "^2.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@angular/core": ">=14.0.0",
|
||||
"ngrx-store-localstorage": ">=14.0.0",
|
||||
"@ngrx/effects": ">=14.0.0",
|
||||
"@ngrx/router-store":">=14.0.0",
|
||||
"@ngrx/store":">=14.0.0",
|
||||
"tassign": ">=1.0.0",
|
||||
"ngx-openlayers": ">=1.0.0-next.19",
|
||||
"ol": ">=6.8.1"
|
||||
"@angular/core": "21.1.0",
|
||||
"ngrx-store-localstorage": "20.1.0",
|
||||
"@ngrx/effects": "21.0.1",
|
||||
"@ngrx/router-store": "21.0.1",
|
||||
"@ngrx/store": "21.0.1",
|
||||
"tassign": "^1.0.0"
|
||||
},
|
||||
"overrides": {
|
||||
"ngrx-store-localstorage": {
|
||||
"@angular/core": "$@angular/core"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ export const SETPARENT = '[Map] SetParent';
|
||||
export const SETPERIOD = '[Map] SetPeriod';
|
||||
export const STARTSEARCH = '[Map] StartSearch';
|
||||
export const STARTSEARCHSUCCESS = '[Map] StartSearchSuccess';
|
||||
export const CLICKFEATURE = '[Map] ClickFeature';
|
||||
export const SELECTFEATURE = '[Map] SelectFeature';
|
||||
export const SELECTITEM = '[Map] SelectItem';
|
||||
export const SELECTITEMSUCCESS = '[Map] SelectItemSuccess';
|
||||
@@ -56,7 +57,10 @@ export const GETLAYERVALUE = '[Map] GetLayerValue'
|
||||
export const GETLAYERVALUESUCCESS = '[Map] GetLayerValueSuccess'
|
||||
export const TOGGLESHOWDATALAYERSLIDE = '[Map] ToggleShowDataLayerSlide'
|
||||
export const SETVIEWSTATE = '[Map] SetViewState'
|
||||
|
||||
export const CLEARFEATURES = '[Map] ClearFeatures';
|
||||
export const SETPANELEXTRAWIDE = '[Map] SetPanelExtraWide';
|
||||
export const BACKUPFEATURES = '[Map] BackupFeatures';
|
||||
export const RESTOREFEATURES = '[Map] RestoreFeatures';
|
||||
|
||||
export class Clear implements Action {
|
||||
readonly type = CLEAR;
|
||||
@@ -111,6 +115,12 @@ export class StartSearchSuccess implements Action {
|
||||
constructor(public features: Array<Feature<Geometry>>, public query:IQueryState) { }
|
||||
}
|
||||
|
||||
export class ClickFeature implements Action {
|
||||
readonly type = CLICKFEATURE;
|
||||
|
||||
constructor(public feature:Feature<Geometry>) { }
|
||||
}
|
||||
|
||||
export class SelectFeature implements Action {
|
||||
readonly type = SELECTFEATURE;
|
||||
|
||||
@@ -292,7 +302,7 @@ export class SetReplaceUrl implements Action {
|
||||
export class SetFeatures implements Action {
|
||||
readonly type = SETFEATURES;
|
||||
|
||||
constructor(public features: Array<Feature<Geometry>>) { }
|
||||
constructor(public features: Array<Feature<Geometry>>, public zoomToExtent: boolean = true) { }
|
||||
}
|
||||
|
||||
export class SetLayerValuesLocation implements Action {
|
||||
@@ -329,12 +339,33 @@ export class SetViewState implements Action {
|
||||
constructor(public enabled:boolean) {}
|
||||
}
|
||||
|
||||
export class ClearFeatures implements Action {
|
||||
readonly type = CLEARFEATURES;
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
export class SetPanelExtraWide implements Action {
|
||||
readonly type = SETPANELEXTRAWIDE;
|
||||
constructor(public panelExtraWide:boolean) {}
|
||||
}
|
||||
|
||||
export class BackupFeatures implements Action {
|
||||
readonly type = BACKUPFEATURES;
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
export class RestoreFeatures implements Action {
|
||||
readonly type = RESTOREFEATURES;
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
export type Actions = SetMapState
|
||||
| Init
|
||||
| Clear
|
||||
| SetParent
|
||||
| StartSearch
|
||||
| StartSearchSuccess
|
||||
| ClickFeature
|
||||
| SelectFeature
|
||||
| SelectItem
|
||||
| SelectItemSuccess
|
||||
@@ -374,5 +405,9 @@ export type Actions = SetMapState
|
||||
| GetLayerValue
|
||||
| SetPeriod
|
||||
| ToggleShowDataLayerSlide
|
||||
| SetViewState;
|
||||
| SetViewState
|
||||
| ClearFeatures
|
||||
| SetPanelExtraWide
|
||||
| BackupFeatures
|
||||
| RestoreFeatures;
|
||||
|
||||
|
||||
@@ -1,78 +1,79 @@
|
||||
import { NgModule ,ModuleWithProviders} from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
|
||||
//external modules
|
||||
import { AngularOpenlayersModule } from 'ngx-openlayers';
|
||||
import { StoreModule, ActionReducer, MetaReducer } from '@ngrx/store';
|
||||
import { EffectsModule } from '@ngrx/effects';
|
||||
import { NgbModule } from "@ng-bootstrap/ng-bootstrap";
|
||||
import { EffectsModule } from '@ngrx/effects';
|
||||
import { ActionReducer, MetaReducer, StoreModule } from '@ngrx/store';
|
||||
import { AngularOpenlayersModule } from '@farmmaps/ng-openlayers';
|
||||
|
||||
//common modules
|
||||
import { AppCommonModule } from '@farmmaps/common';
|
||||
|
||||
import { MODULE_NAME } from './module-name';
|
||||
import * as mapReducers from './reducers/map.reducer';
|
||||
import * as mapActions from './actions/map.actions';
|
||||
import * as mapEffects from './effects/map.effects';
|
||||
import { MODULE_NAME } from './module-name';
|
||||
import * as mapReducers from './reducers/map.reducer';
|
||||
|
||||
import { IMapState} from './models/map.state';
|
||||
import { ISelectedFeatures } from './models/selected.features';
|
||||
import { IItemLayer,ItemLayer,ITemporalItemLayer,TemporalItemLayer } from './models/item.layer';
|
||||
import { IClickedFeature } from './models/clicked.feature';
|
||||
import { IItemLayer, ItemLayer, ITemporalItemLayer, TemporalItemLayer } from './models/item.layer';
|
||||
import { IMapState } from './models/map.state';
|
||||
import { IPeriodState } from './models/period.state';
|
||||
import { ISelectedFeatures } from './models/selected.features';
|
||||
|
||||
// components
|
||||
import { GpsLocation} from './components/aol/gps-location/gps-location.component';
|
||||
import {FeatureListFeatureCropfieldComponent } from './components/feature-list-feature-cropfield/feature-list-feature-cropfield.component';
|
||||
import { FeatureListFeatureCroppingschemeComponent} from './components/feature-list-feature-croppingscheme/feature-list-feature-croppingscheme.component';
|
||||
import { ItemWidgetListComponent} from './components/item-widget-list/item-widget-list.component';
|
||||
import { AbstractItemListItemComponent, ItemListItemComponent, AbstractItemWidgetComponent } from './components/item-list-item/item-list-item.component';
|
||||
import { ItemListItemContainerComponent } from './components/item-list-item-container/item-list-item-container.component';
|
||||
import { AbstractItemListComponent,ItemListComponent} from './components/item-list/item-list.component';
|
||||
import { AbstractSelectedItemComponent, SelectedItemComponent } from './components/selected-item/selected-item.component';
|
||||
import { SelectedItemCropfieldComponent } from './components/selected-item-cropfield/selected-item-cropfield.component';
|
||||
import { SelectedItemGeotiffComponent } from './components/selected-item-geotiff/selected-item-geotiff.component';
|
||||
import { SelectedItemTemporalComponent} from './components/selected-item-temporal/selected-item-temporal.component';
|
||||
import {SelectedItemShapeComponent } from './components/selected-item-shape/selected-item-shape.component';
|
||||
import { SelectedItemContainerComponent } from './components/selected-item-container/selected-item-container.component';
|
||||
import { AbstractFeatureListFeatureComponent, FeatureListFeatureComponent } from './components/feature-list-feature/feature-list-feature.component';
|
||||
import {FeatureListFeatureContainerComponent } from './components/feature-list-feature-container/feature-list-feature-container.component';
|
||||
import { FeatureListCroppingschemeComponent } from './components/feature-list-croppingscheme/feature-list-croppingscheme.component';
|
||||
import {FeatureListCropfieldComponent } from './components/feature-list-cropfield/feature-list-cropfield.component';
|
||||
import {FeatureListContainerComponent } from './components/feature-list-container/feature-list-container.component';
|
||||
import { WidgetHostDirective} from './components/widget-host/widget-host.directive';
|
||||
import { FeatureListComponent,AbstractFeatureListComponent} from './components/feature-list/feature-list.component';
|
||||
import { MapRoutingModule } from './common-map-routing.module';
|
||||
import { FileDropTargetComponent } from './components/aol/file-drop-target/file-drop-target.component';
|
||||
import { ItemVectorSourceComponent } from './components/aol/item-vector-source/item-vector-source.component';
|
||||
import { GpsLocation } from './components/aol/gps-location/gps-location.component';
|
||||
import { ItemLayersComponent } from './components/aol/item-layers/item-layers.component';
|
||||
import { ZoomToExtentComponent } from './components/aol/zoom-to-extent/zoom-to-extent.component';
|
||||
import { RotationResetComponent } from './components/aol/rotation-reset/rotation-reset.component';
|
||||
import { ItemVectorSourceComponent } from './components/aol/item-vector-source/item-vector-source.component';
|
||||
import { LayerListComponent } from './components/aol/layer-list/layer-list.component';
|
||||
import { LayerValuesComponent } from './components/aol/layer-values/layer-values.component';
|
||||
import { LayerVectorImageComponent } from './components/aol/layer-vector-image/layer-vector-image.component';
|
||||
import { PanToLocation } from './components/aol/pan-to-location/pan-to-location.component';
|
||||
import { RotationResetComponent } from './components/aol/rotation-reset/rotation-reset.component';
|
||||
import { ZoomToExtentComponent } from './components/aol/zoom-to-extent/zoom-to-extent.component';
|
||||
import { FeatureListContainerComponent } from './components/feature-list-container/feature-list-container.component';
|
||||
import { FeatureListCropfieldComponent } from './components/feature-list-cropfield/feature-list-cropfield.component';
|
||||
import { FeatureListObservationComponent } from './components/feature-list-observation/feature-list-observation.component';
|
||||
import { FeatureListCroppingschemeComponent } from './components/feature-list-croppingscheme/feature-list-croppingscheme.component';
|
||||
import { FeatureListFeatureContainerComponent } from './components/feature-list-feature-container/feature-list-feature-container.component';
|
||||
import { FeatureListFeatureCropfieldComponent } from './components/feature-list-feature-cropfield/feature-list-feature-cropfield.component';
|
||||
import { FeatureListFeatureCroppingschemeComponent } from './components/feature-list-feature-croppingscheme/feature-list-feature-croppingscheme.component';
|
||||
import { AbstractFeatureListFeatureComponent, FeatureListFeatureComponent } from './components/feature-list-feature/feature-list-feature.component';
|
||||
import { AbstractFeatureListComponent, FeatureListComponent } from './components/feature-list/feature-list.component';
|
||||
import { GeometryThumbnailComponent } from './components/feature-thumbnail/feature-thumbnail.component';
|
||||
import { ForChild } from './components/for-item/for-child.decorator';
|
||||
import { ForItemType } from './components/for-item/for-itemtype.decorator';
|
||||
import { ForPackage } from './components/for-item/for-package.decorator';
|
||||
import { ForSourceTask } from './components/for-item/for-sourcetask.decorator';
|
||||
import { ifZoomToShowDirective } from './components/if-zoom-to-show/if-zoom-to-show.directive';
|
||||
import { ItemListItemContainerComponent } from './components/item-list-item-container/item-list-item-container.component';
|
||||
import { AbstractItemListItemComponent, AbstractItemWidgetComponent, ItemListItemComponent } from './components/item-list-item/item-list-item.component';
|
||||
import { AbstractItemListComponent, ItemListComponent } from './components/item-list/item-list.component';
|
||||
import { ItemWidgetListComponent } from './components/item-widget-list/item-widget-list.component';
|
||||
import { LayerSwitcher } from './components/layer-switcher/layer-switcher.component';
|
||||
import { HistogramDetailsComponent } from './components/legend/histogram-details/histogram-details.component';
|
||||
import { LegendComponent } from './components/legend/legend.component';
|
||||
import { StatisticsDetailsComponent } from './components/legend/statistics-details/statistics-details.component';
|
||||
import { MapSearchComponent } from './components/map-search/map-search.component';
|
||||
import { MapComponent } from './components/map/map.component';
|
||||
import { MetaDataModalComponent } from './components/meta-data-modal/meta-data-modal.component';
|
||||
import { SelectPeriodModalComponent } from './components/select-period-modal/select-period-modal.component';
|
||||
import { MapComponent } from './components/map/map.component';
|
||||
import { MapSearchComponent } from './components/map-search/map-search.component';
|
||||
import { MapRoutingModule } from './common-map-routing.module';
|
||||
import { LegendComponent } from './components/legend/legend.component';
|
||||
import { LayerVectorImageComponent } from './components/aol/layer-vector-image/layer-vector-image.component';
|
||||
import {FeatureIconService} from './services/feature-icon.service';
|
||||
import { GeolocationService } from './services/geolocation.service';
|
||||
import {DeviceOrientationService} from './services/device-orientation.service';
|
||||
import { TemporalService} from './services/temporal.service';
|
||||
import { SelectedItemContainerComponent } from './components/selected-item-container/selected-item-container.component';
|
||||
import { SelectedItemCropfieldComponent } from './components/selected-item-cropfield/selected-item-cropfield.component';
|
||||
import { SelectedItemGeotiffComponent } from './components/selected-item-geotiff/selected-item-geotiff.component';
|
||||
import { SelectedItemShapeComponent } from './components/selected-item-shape/selected-item-shape.component';
|
||||
import { SelectedItemTemporalComponent } from './components/selected-item-temporal/selected-item-temporal.component';
|
||||
import { AbstractSelectedItemComponent, SelectedItemComponent } from './components/selected-item/selected-item.component';
|
||||
import { WidgetHostDirective } from './components/widget-host/widget-host.directive';
|
||||
import { WidgetStatusComponent } from './components/widget-status/widget-status.component';
|
||||
import { ForChild} from './components/for-item/for-child.decorator';
|
||||
import {ForItemType } from './components/for-item/for-itemtype.decorator';
|
||||
import { ForSourceTask} from './components/for-item/for-sourcetask.decorator';
|
||||
import { ForPackage } from './components/for-item/for-package.decorator';
|
||||
import { PanToLocation} from './components/aol/pan-to-location/pan-to-location.component';
|
||||
import {LayerSwitcher} from './components/layer-switcher/layer-switcher.component';
|
||||
import {HistogramDetailsComponent} from './components/legend/histogram-details/histogram-details.component';
|
||||
import {StatisticsDetailsComponent} from './components/legend/statistics-details/statistics-details.component';
|
||||
import { ifZoomToShowDirective} from './components/if-zoom-to-show/if-zoom-to-show.directive';
|
||||
import { ZoomToShowAlert} from './components/zoom-to-show-alert/zoom-to-show-alert.component';
|
||||
import { LayerValuesComponent } from './components/aol/layer-values/layer-values.component';
|
||||
import { GeometryThumbnailComponent } from './components/feature-thumbnail/feature-thumbnail.component';
|
||||
import { ZoomToShowAlert } from './components/zoom-to-show-alert/zoom-to-show-alert.component';
|
||||
import { DeviceOrientationService } from './services/device-orientation.service';
|
||||
import { FeatureIconService } from './services/feature-icon.service';
|
||||
import { GeolocationService } from './services/geolocation.service';
|
||||
import { TemporalService } from './services/temporal.service';
|
||||
|
||||
export function LocalStorageSync(reducer: ActionReducer<any>): ActionReducer<any> {
|
||||
const r = function(state, action) {
|
||||
@@ -104,184 +105,130 @@ export function LocalStorageSync(reducer: ActionReducer<any>): ActionReducer<any
|
||||
const metaReducers: Array<MetaReducer<any, any>> = [LocalStorageSync];
|
||||
|
||||
export {
|
||||
mapEffects,
|
||||
mapReducers,
|
||||
mapActions,
|
||||
ZoomToExtentComponent,
|
||||
ItemVectorSourceComponent,
|
||||
ItemLayersComponent,
|
||||
FileDropTargetComponent,
|
||||
MapComponent,
|
||||
MetaDataModalComponent,
|
||||
RotationResetComponent,
|
||||
MapSearchComponent,
|
||||
SelectPeriodModalComponent,
|
||||
LayerListComponent,
|
||||
LegendComponent,
|
||||
LayerVectorImageComponent,
|
||||
FeatureListComponent,
|
||||
WidgetHostDirective,
|
||||
FeatureListContainerComponent,
|
||||
FeatureListCroppingschemeComponent,
|
||||
FeatureListCropfieldComponent,
|
||||
FeatureListFeatureContainerComponent,
|
||||
FeatureListFeatureComponent,
|
||||
FeatureListFeatureCroppingschemeComponent,
|
||||
FeatureListFeatureCropfieldComponent,
|
||||
SelectedItemContainerComponent,
|
||||
SelectedItemComponent,
|
||||
SelectedItemCropfieldComponent,
|
||||
SelectedItemGeotiffComponent,
|
||||
SelectedItemTemporalComponent,
|
||||
SelectedItemShapeComponent,
|
||||
ItemListItemComponent,
|
||||
ItemListItemContainerComponent,
|
||||
ItemListComponent,
|
||||
ItemWidgetListComponent,
|
||||
WidgetStatusComponent,
|
||||
GpsLocation,
|
||||
PanToLocation,
|
||||
LayerSwitcher,
|
||||
AbstractFeatureListComponent,
|
||||
AbstractFeatureListFeatureComponent,
|
||||
AbstractSelectedItemComponent,
|
||||
AbstractItemWidgetComponent,
|
||||
AbstractItemListItemComponent,
|
||||
AbstractItemListComponent,
|
||||
FeatureIconService,
|
||||
GeolocationService,
|
||||
DeviceOrientationService,
|
||||
TemporalService,
|
||||
IMapState,
|
||||
ISelectedFeatures,
|
||||
IItemLayer,
|
||||
ItemLayer,
|
||||
IPeriodState,
|
||||
ForChild,
|
||||
ForItemType,
|
||||
ForSourceTask,
|
||||
ForPackage ,
|
||||
ITemporalItemLayer,
|
||||
TemporalItemLayer,
|
||||
ifZoomToShowDirective,
|
||||
ZoomToShowAlert,
|
||||
IClickedFeature,
|
||||
GeometryThumbnailComponent
|
||||
}
|
||||
AbstractFeatureListFeatureComponent, AbstractItemListComponent, AbstractItemListItemComponent, AbstractItemWidgetComponent, AbstractSelectedItemComponent, DeviceOrientationService, FeatureIconService, FeatureListComponent, FeatureListContainerComponent, FeatureListCropfieldComponent, FeatureListObservationComponent, FeatureListCroppingschemeComponent, FeatureListFeatureComponent, FeatureListFeatureContainerComponent, FeatureListFeatureCropfieldComponent, FeatureListFeatureCroppingschemeComponent, FileDropTargetComponent, ForChild,
|
||||
ForItemType, ForPackage, ForSourceTask, GeolocationService, GeometryThumbnailComponent, GpsLocation, IClickedFeature, ifZoomToShowDirective, IItemLayer, IMapState, IPeriodState, ISelectedFeatures, ItemLayer, ItemLayersComponent, ItemListComponent, ItemListItemComponent,
|
||||
ItemListItemContainerComponent, ITemporalItemLayer, ItemVectorSourceComponent, ItemWidgetListComponent, LayerListComponent, LayerSwitcher, LayerVectorImageComponent, LegendComponent, mapActions, MapComponent, mapEffects,
|
||||
mapReducers, MapSearchComponent, MetaDataModalComponent, PanToLocation, RotationResetComponent, SelectedItemComponent, SelectedItemContainerComponent, SelectedItemCropfieldComponent,
|
||||
SelectedItemGeotiffComponent, SelectedItemShapeComponent, SelectedItemTemporalComponent, SelectPeriodModalComponent, TemporalItemLayer, TemporalService, WidgetHostDirective, WidgetStatusComponent, ZoomToExtentComponent, ZoomToShowAlert
|
||||
};
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
AngularOpenlayersModule,
|
||||
MapRoutingModule,
|
||||
StoreModule.forFeature(MODULE_NAME, mapReducers.reducer, { metaReducers: metaReducers }),
|
||||
EffectsModule.forFeature([mapEffects.MapEffects]),
|
||||
NgbModule,
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
AppCommonModule
|
||||
],
|
||||
declarations: [
|
||||
ZoomToExtentComponent,
|
||||
ItemVectorSourceComponent,
|
||||
ItemLayersComponent,
|
||||
FileDropTargetComponent,
|
||||
MapComponent,
|
||||
MetaDataModalComponent,
|
||||
RotationResetComponent,
|
||||
MapSearchComponent,
|
||||
SelectPeriodModalComponent,
|
||||
LayerListComponent,
|
||||
LegendComponent,
|
||||
LayerVectorImageComponent,
|
||||
FeatureListComponent,
|
||||
WidgetHostDirective,
|
||||
FeatureListContainerComponent,
|
||||
FeatureListCroppingschemeComponent,
|
||||
FeatureListCropfieldComponent,
|
||||
FeatureListFeatureContainerComponent,
|
||||
FeatureListFeatureComponent,
|
||||
FeatureListFeatureCroppingschemeComponent,
|
||||
FeatureListFeatureCropfieldComponent,
|
||||
SelectedItemContainerComponent,
|
||||
SelectedItemComponent,
|
||||
SelectedItemCropfieldComponent,
|
||||
SelectedItemGeotiffComponent,
|
||||
SelectedItemTemporalComponent,
|
||||
SelectedItemShapeComponent,
|
||||
ItemListItemComponent,
|
||||
ItemListItemContainerComponent,
|
||||
ItemListComponent,
|
||||
ItemWidgetListComponent,
|
||||
WidgetStatusComponent,
|
||||
GpsLocation,
|
||||
PanToLocation,
|
||||
LayerSwitcher,
|
||||
HistogramDetailsComponent,
|
||||
StatisticsDetailsComponent,
|
||||
ifZoomToShowDirective,
|
||||
ZoomToShowAlert,
|
||||
LayerValuesComponent,
|
||||
GeometryThumbnailComponent
|
||||
],
|
||||
exports: [
|
||||
ItemVectorSourceComponent,
|
||||
ItemLayersComponent,
|
||||
FileDropTargetComponent,
|
||||
MetaDataModalComponent,
|
||||
MapComponent,
|
||||
GpsLocation,
|
||||
PanToLocation,
|
||||
LayerSwitcher,
|
||||
FeatureListFeatureComponent,
|
||||
FeatureListFeatureCropfieldComponent,
|
||||
FeatureListFeatureCroppingschemeComponent,
|
||||
SelectedItemContainerComponent,
|
||||
SelectedItemComponent,
|
||||
SelectedItemCropfieldComponent,
|
||||
SelectedItemGeotiffComponent,
|
||||
SelectedItemTemporalComponent,
|
||||
SelectedItemShapeComponent,
|
||||
ItemListItemComponent,
|
||||
ItemListItemContainerComponent,
|
||||
ItemListComponent,
|
||||
ItemWidgetListComponent,
|
||||
WidgetStatusComponent,
|
||||
RotationResetComponent,
|
||||
MapSearchComponent,
|
||||
SelectPeriodModalComponent,
|
||||
LayerListComponent,
|
||||
LegendComponent,
|
||||
LayerVectorImageComponent,
|
||||
FeatureListComponent,
|
||||
WidgetHostDirective,
|
||||
FeatureListContainerComponent,
|
||||
FeatureListCroppingschemeComponent,
|
||||
FeatureListCropfieldComponent,
|
||||
FeatureListFeatureContainerComponent,
|
||||
ZoomToExtentComponent,
|
||||
ifZoomToShowDirective,
|
||||
ZoomToShowAlert,
|
||||
GeometryThumbnailComponent
|
||||
],
|
||||
providers: [
|
||||
FeatureIconService,
|
||||
GeolocationService,
|
||||
DeviceOrientationService,
|
||||
TemporalService,
|
||||
{ provide: AbstractFeatureListComponent, useClass: FeatureListCroppingschemeComponent, multi: true },
|
||||
{ provide: AbstractFeatureListComponent, useClass: FeatureListCropfieldComponent, multi: true },
|
||||
{ provide: AbstractFeatureListFeatureComponent, useClass: FeatureListFeatureComponent, multi: true },
|
||||
{ provide: AbstractFeatureListFeatureComponent, useClass: FeatureListFeatureCroppingschemeComponent, multi: true },
|
||||
{ provide: AbstractFeatureListFeatureComponent, useClass: FeatureListFeatureCropfieldComponent, multi: true },
|
||||
{ provide: AbstractSelectedItemComponent, useClass: SelectedItemComponent, multi: true },
|
||||
{ provide: AbstractSelectedItemComponent, useClass: SelectedItemCropfieldComponent, multi: true },
|
||||
{ provide: AbstractSelectedItemComponent, useClass: SelectedItemGeotiffComponent, multi: true },
|
||||
{ provide: AbstractSelectedItemComponent, useClass: SelectedItemTemporalComponent, multi: true },
|
||||
{ provide: AbstractSelectedItemComponent, useClass: SelectedItemShapeComponent, multi: true },
|
||||
{ provide: AbstractItemListItemComponent, useClass: ItemListItemComponent, multi: true },
|
||||
{ provide: AbstractItemListComponent, useClass: ItemListComponent, multi: true }
|
||||
]
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
AngularOpenlayersModule,
|
||||
MapRoutingModule,
|
||||
StoreModule.forFeature(MODULE_NAME, mapReducers.reducer, { metaReducers: metaReducers }),
|
||||
EffectsModule.forFeature([mapEffects.MapEffects]),
|
||||
NgbModule,
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
AppCommonModule
|
||||
],
|
||||
declarations: [
|
||||
ZoomToExtentComponent,
|
||||
ItemVectorSourceComponent,
|
||||
ItemLayersComponent,
|
||||
FileDropTargetComponent,
|
||||
MapComponent,
|
||||
MetaDataModalComponent,
|
||||
RotationResetComponent,
|
||||
MapSearchComponent,
|
||||
SelectPeriodModalComponent,
|
||||
LayerListComponent,
|
||||
LegendComponent,
|
||||
LayerVectorImageComponent,
|
||||
FeatureListComponent,
|
||||
WidgetHostDirective,
|
||||
FeatureListContainerComponent,
|
||||
FeatureListCroppingschemeComponent,
|
||||
FeatureListCropfieldComponent,
|
||||
FeatureListObservationComponent,
|
||||
FeatureListFeatureContainerComponent,
|
||||
FeatureListFeatureComponent,
|
||||
FeatureListFeatureCroppingschemeComponent,
|
||||
FeatureListFeatureCropfieldComponent,
|
||||
SelectedItemContainerComponent,
|
||||
SelectedItemComponent,
|
||||
SelectedItemCropfieldComponent,
|
||||
SelectedItemGeotiffComponent,
|
||||
SelectedItemTemporalComponent,
|
||||
SelectedItemShapeComponent,
|
||||
ItemListItemComponent,
|
||||
ItemListItemContainerComponent,
|
||||
ItemListComponent,
|
||||
ItemWidgetListComponent,
|
||||
WidgetStatusComponent,
|
||||
GpsLocation,
|
||||
PanToLocation,
|
||||
LayerSwitcher,
|
||||
HistogramDetailsComponent,
|
||||
StatisticsDetailsComponent,
|
||||
ifZoomToShowDirective,
|
||||
ZoomToShowAlert,
|
||||
LayerValuesComponent,
|
||||
GeometryThumbnailComponent
|
||||
],
|
||||
exports: [
|
||||
ItemVectorSourceComponent,
|
||||
ItemLayersComponent,
|
||||
FileDropTargetComponent,
|
||||
MetaDataModalComponent,
|
||||
MapComponent,
|
||||
GpsLocation,
|
||||
PanToLocation,
|
||||
LayerSwitcher,
|
||||
FeatureListFeatureComponent,
|
||||
FeatureListFeatureCropfieldComponent,
|
||||
FeatureListFeatureCroppingschemeComponent,
|
||||
SelectedItemContainerComponent,
|
||||
SelectedItemComponent,
|
||||
SelectedItemCropfieldComponent,
|
||||
SelectedItemGeotiffComponent,
|
||||
SelectedItemTemporalComponent,
|
||||
SelectedItemShapeComponent,
|
||||
ItemListItemComponent,
|
||||
ItemListItemContainerComponent,
|
||||
ItemListComponent,
|
||||
ItemWidgetListComponent,
|
||||
WidgetStatusComponent,
|
||||
RotationResetComponent,
|
||||
MapSearchComponent,
|
||||
SelectPeriodModalComponent,
|
||||
LayerListComponent,
|
||||
LegendComponent,
|
||||
LayerVectorImageComponent,
|
||||
FeatureListComponent,
|
||||
WidgetHostDirective,
|
||||
FeatureListContainerComponent,
|
||||
FeatureListCroppingschemeComponent,
|
||||
FeatureListCropfieldComponent,
|
||||
FeatureListObservationComponent,
|
||||
FeatureListFeatureContainerComponent,
|
||||
ZoomToExtentComponent,
|
||||
ifZoomToShowDirective,
|
||||
ZoomToShowAlert,
|
||||
GeometryThumbnailComponent
|
||||
],
|
||||
providers: [
|
||||
FeatureIconService,
|
||||
GeolocationService,
|
||||
DeviceOrientationService,
|
||||
TemporalService,
|
||||
{ provide: AbstractFeatureListComponent, useClass: FeatureListCroppingschemeComponent, multi: true },
|
||||
{ provide: AbstractFeatureListComponent, useClass: FeatureListCropfieldComponent, multi: true },
|
||||
{ provide: AbstractFeatureListComponent, useClass: FeatureListObservationComponent, multi: true },
|
||||
{ provide: AbstractFeatureListFeatureComponent, useClass: FeatureListFeatureComponent, multi: true },
|
||||
{ provide: AbstractFeatureListFeatureComponent, useClass: FeatureListFeatureCroppingschemeComponent, multi: true },
|
||||
{ provide: AbstractFeatureListFeatureComponent, useClass: FeatureListFeatureCropfieldComponent, multi: true },
|
||||
{ provide: AbstractSelectedItemComponent, useClass: SelectedItemComponent, multi: true },
|
||||
{ provide: AbstractSelectedItemComponent, useClass: SelectedItemCropfieldComponent, multi: true },
|
||||
{ provide: AbstractSelectedItemComponent, useClass: SelectedItemGeotiffComponent, multi: true },
|
||||
{ provide: AbstractSelectedItemComponent, useClass: SelectedItemTemporalComponent, multi: true },
|
||||
{ provide: AbstractSelectedItemComponent, useClass: SelectedItemShapeComponent, multi: true },
|
||||
{ provide: AbstractItemListItemComponent, useClass: ItemListItemComponent, multi: true },
|
||||
{ provide: AbstractItemListComponent, useClass: ItemListComponent, multi: true }
|
||||
]
|
||||
})
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, Input, OnDestroy, OnInit, EventEmitter, Output, Inject } from '@angular/core';
|
||||
import { MapComponent } from 'ngx-openlayers';
|
||||
import { MapComponent } from '@farmmaps/ng-openlayers';
|
||||
|
||||
import * as proj from 'ol/proj';
|
||||
import {Point,Geometry} from 'ol/geom';
|
||||
@@ -14,8 +14,9 @@ export interface IDroppedFile {
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'fm-map-file-drop-target',
|
||||
template: ''
|
||||
selector: 'fm-map-file-drop-target',
|
||||
template: '',
|
||||
standalone: false
|
||||
})
|
||||
export class FileDropTargetComponent implements OnInit, OnDestroy {
|
||||
element: Element;
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
@import "~bootstrap/scss/bootstrap.scss";
|
||||
|
||||
|
||||
.gps-location {
|
||||
display:none;
|
||||
}
|
||||
@@ -14,7 +11,7 @@
|
||||
}
|
||||
|
||||
.tolerance {
|
||||
fill: $primary;
|
||||
fill: var(--bs-primary);
|
||||
fill-opacity:0.4;
|
||||
}
|
||||
|
||||
@@ -23,20 +20,20 @@
|
||||
}
|
||||
|
||||
.border {
|
||||
fill: $white;
|
||||
fill: var(--bs-white);
|
||||
}
|
||||
|
||||
.center {
|
||||
fill: $primary;
|
||||
fill: var(--bs-primary);
|
||||
}
|
||||
|
||||
.stop1 {
|
||||
stop-color: $primary;
|
||||
stop-color: var(--bs-primary);
|
||||
stop-opacity:1;
|
||||
}
|
||||
|
||||
.stop2 {
|
||||
stop-color:$primary;
|
||||
stop-color:var(--bs-primary);
|
||||
stop-opacity: 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
import { Component, OnInit, Input, ViewChild, ElementRef, OnChanges, SimpleChanges ,Host} from '@angular/core';
|
||||
import { MapComponent } from 'ngx-openlayers';
|
||||
import { MapComponent } from '@farmmaps/ng-openlayers';
|
||||
import Overlay from 'ol/Overlay';
|
||||
import { fromLonLat, toLonLat } from 'ol/proj';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'fm-map-gps-location',
|
||||
templateUrl: './gps-location.component.html',
|
||||
styleUrls: ['./gps-location.component.scss']
|
||||
@Component({
|
||||
selector: 'fm-map-gps-location',
|
||||
templateUrl: './gps-location.component.html',
|
||||
styleUrls: ['./gps-location.component.scss'],
|
||||
standalone: false
|
||||
})
|
||||
export class GpsLocation implements OnInit,OnChanges{
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, Host, Input, Output, EventEmitter,OnDestroy, OnInit, OnChanges, SimpleChanges, forwardRef } from '@angular/core';
|
||||
import { LayerGroupComponent, MapComponent } from 'ngx-openlayers';
|
||||
import { LayerGroupComponent, MapComponent } from '@farmmaps/ng-openlayers';
|
||||
import { ItemService,IItem,AppConfig } from '@farmmaps/common';
|
||||
import { IItemLayer, ITemporalItemLayer} from '../../../models/item.layer';
|
||||
import { ILayerData} from '../../../models/layer.data';
|
||||
@@ -19,13 +19,15 @@ import VectorTileLayer from 'ol/layer/VectorTile';
|
||||
import {GeoJSON,MVT} from 'ol/format';
|
||||
import { Geometry } from 'ol/geom';
|
||||
import BaseLayer from 'ol/layer/Base';
|
||||
import Feature from 'ol/Feature';
|
||||
|
||||
@Component({
|
||||
selector: 'fm-map-item-layers',
|
||||
template: `<ng-content></ng-content>`,
|
||||
providers: [
|
||||
{ provide: LayerGroupComponent, useExisting: forwardRef(() => ItemLayersComponent) }
|
||||
]
|
||||
@Component({
|
||||
selector: 'fm-map-item-layers',
|
||||
template: `<ng-content></ng-content>`,
|
||||
providers: [
|
||||
{ provide: LayerGroupComponent, useExisting: forwardRef(() => ItemLayersComponent) }
|
||||
],
|
||||
standalone: false
|
||||
})
|
||||
|
||||
export class ItemLayersComponent extends LayerGroupComponent implements OnChanges, OnInit,OnDestroy {
|
||||
@@ -180,9 +182,9 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange
|
||||
const source = new VectorSource({
|
||||
strategy: loadingstrategy.bbox,
|
||||
loader: function (extent: Extent, resolution: number, projection: Projection) {
|
||||
const source = this as VectorSource<Geometry>;
|
||||
const source = this as VectorSource<Feature<Geometry>>;
|
||||
__this.itemService.getItemFeatures(item.code, extent, projection.getCode(), layerIndex).subscribe(function (data) {
|
||||
const features = format.readFeatures(data);
|
||||
const features = format.readFeatures(data).filter(feature => feature instanceof Feature) as Feature[];
|
||||
for (const f of features) {
|
||||
if (f.get("code")) {
|
||||
f.setId(f.get("code"));
|
||||
@@ -250,8 +252,8 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange
|
||||
return new style.Style(
|
||||
{
|
||||
stroke: new style.Stroke({
|
||||
color: 'red',
|
||||
width: 2
|
||||
color: '#0d6efd',
|
||||
width: 3
|
||||
})
|
||||
}
|
||||
);
|
||||
@@ -466,7 +468,7 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange
|
||||
mapEventHandler = (event) => {
|
||||
// select only when having observers
|
||||
if(event.type === 'click' && !this.onFeatureSelected.observers.length) return;
|
||||
if(event.type === 'pointermove' && !this.onFeatureHover.observers.length) return;
|
||||
if(event.type === 'pointermove' && !this.onFeatureHover.observers.length) return;
|
||||
const itemLayer= this.getItemlayer(this.itemLayer);
|
||||
if(itemLayer && itemLayer.layer) {
|
||||
this.selectedFeatures = {};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Component, Host, Input, Output, EventEmitter, OnInit, OnChanges, SimpleChanges, forwardRef, Inject, InjectionToken } from '@angular/core';
|
||||
import { LayerVectorComponent, SourceVectorComponent, MapComponent } from 'ngx-openlayers';
|
||||
import { ItemService, ItemTypeService, IItem, IItemType } from '@farmmaps/common';
|
||||
import { Component, Host, Input, Output, EventEmitter, OnInit, OnChanges, SimpleChanges, forwardRef, Inject, InjectionToken, OnDestroy, LOCALE_ID } from '@angular/core';
|
||||
import { LayerVectorComponent, SourceVectorComponent, MapComponent } from '@farmmaps/ng-openlayers';
|
||||
import { ItemService, ItemTypeService, IItem, IItemType, FolderService } from '@farmmaps/common';
|
||||
|
||||
import { Feature } from 'ol';
|
||||
import { Point, Geometry } from 'ol/geom';
|
||||
@@ -17,16 +17,20 @@ import { GeoJSON } from 'ol/format';
|
||||
import { Select } from 'ol/interaction';
|
||||
import { IStyles } from '../../../models/style.cache';
|
||||
import { FeatureIconService } from '../../../services/feature-icon.service';
|
||||
import { Subscription } from 'rxjs';
|
||||
import { getCenter } from 'ol/extent';
|
||||
import { formatNumber } from '@angular/common';
|
||||
|
||||
@Component({
|
||||
selector: 'fm-map-item-source-vector',
|
||||
template: `<ng-content></ng-content>`,
|
||||
providers: [
|
||||
{ provide: SourceVectorComponent, useExisting: forwardRef(() => ItemVectorSourceComponent) }
|
||||
]
|
||||
@Component({
|
||||
selector: 'fm-map-item-source-vector',
|
||||
template: `<ng-content></ng-content>`,
|
||||
providers: [
|
||||
{ provide: SourceVectorComponent, useExisting: forwardRef(() => ItemVectorSourceComponent) }
|
||||
],
|
||||
standalone: false
|
||||
})
|
||||
export class ItemVectorSourceComponent extends SourceVectorComponent implements OnInit, OnChanges {
|
||||
instance: Vector<Geometry>;
|
||||
export class ItemVectorSourceComponent extends SourceVectorComponent implements OnInit, OnDestroy, OnChanges {
|
||||
instance: Vector<Feature<Geometry>>;
|
||||
private _format: GeoJSON;
|
||||
private _select: Select;
|
||||
private _hoverSelect: Select;
|
||||
@@ -38,8 +42,10 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements
|
||||
@Output() onFeatureSelected: EventEmitter<Feature<Geometry>> = new EventEmitter<Feature<Geometry>>();
|
||||
@Output() onFeatureHover: EventEmitter<Feature<Geometry>> = new EventEmitter<Feature<Geometry>>();
|
||||
private stylesCache: IStyles = {};
|
||||
private sub: Subscription;
|
||||
private displayMapFeatureSettings: { [code: string]: string[] } = defaultDisplayMapFeatureSettings();
|
||||
|
||||
constructor(@Host() private layer: LayerVectorComponent, private itemService: ItemService, private map: MapComponent, private itemTypeService: ItemTypeService, private featureIconService$: FeatureIconService) {
|
||||
constructor(@Host() private layer: LayerVectorComponent, private itemService: ItemService, private map: MapComponent, private itemTypeService: ItemTypeService, private featureIconService$: FeatureIconService, private folderService: FolderService, @Inject(LOCALE_ID) private locale: string) {
|
||||
super(layer);
|
||||
this._format = new GeoJSON();
|
||||
}
|
||||
@@ -76,6 +82,18 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.sub = this.folderService.getFolder('my_settings').subscribe(
|
||||
userSettingsRoot => {
|
||||
if (userSettingsRoot == undefined) return;
|
||||
this.itemService.getChildItemList(userSettingsRoot.code, 'vnd.farmmaps.itemtype.settings.general').subscribe(
|
||||
items => {
|
||||
if (items && items.length > 0 && items[0].data?.displayMapFeatureSettings) {
|
||||
this.displayMapFeatureSettings = items[0].data?.displayMapFeatureSettings;
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
);
|
||||
this.strategy = loadingstrategy.bbox;
|
||||
this.format = new GeoJSON();
|
||||
this._select = new Select({
|
||||
@@ -133,7 +151,8 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements
|
||||
fill: new style.Fill({
|
||||
color: fillColor
|
||||
}),
|
||||
geometry: (feature: Feature<Geometry>) => this.geometry(feature)
|
||||
geometry: (feature: Feature<Geometry>) => this.geometry(feature),
|
||||
text: this.getDisplayTextForFeature(feature, this.map.instance.getView().getZoom())
|
||||
});
|
||||
} else {
|
||||
key = 'file';
|
||||
@@ -153,6 +172,10 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements
|
||||
});
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
if (this.sub) this.sub.unsubscribe();
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
if (changes["features"] && this.instance) {
|
||||
this.instance.clear(true);
|
||||
@@ -188,4 +211,51 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
getDisplayTextForFeature(feature: Feature<Geometry>, zoom: number, overrule?: style.Text) {
|
||||
if (!feature) return null;
|
||||
|
||||
const propertiesToShow: string[] = this.displayMapFeatureSettings[feature.get('itemType')];
|
||||
if (!propertiesToShow) return null;
|
||||
if (propertiesToShow.length <= 0) return null;
|
||||
if (zoom < 14) return null;
|
||||
|
||||
let displayText = '';
|
||||
for (let i = 0; i < propertiesToShow.length; i++) {
|
||||
let value = feature.get(propertiesToShow[i]);
|
||||
switch (propertiesToShow[i]) {
|
||||
case "area": value = formatNumber(value, this.locale, '0.1-2') + ' ha'; break;
|
||||
case "centroid": {
|
||||
if (feature.getGeometry()) {
|
||||
const centroid = getCenter(feature.getGeometry().getExtent());
|
||||
value = Math.round(centroid[0]) + ',' + Math.round(centroid[1]);
|
||||
}
|
||||
}
|
||||
if (value) {
|
||||
displayText += value + (i < propertiesToShow.length ? '\n' : '');
|
||||
}
|
||||
}
|
||||
|
||||
const styleText = new style.Text({
|
||||
font: '13px Calibri,sans-serif',
|
||||
fill: new style.Fill({ color: '#ffffff' }),
|
||||
stroke: new style.Stroke({ color: '#000000', width: 2 }),
|
||||
text: displayText
|
||||
});
|
||||
|
||||
if (overrule) {
|
||||
if (overrule.getFont()) styleText.setFont(overrule.getFont());
|
||||
if (overrule.getFill()) styleText.setFill(overrule.getFill());
|
||||
if (overrule.getStroke()) styleText.setStroke(overrule.getStroke());
|
||||
}
|
||||
|
||||
return styleText;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function defaultDisplayMapFeatureSettings() {
|
||||
return {
|
||||
'vnd.farmmaps.itemtype.cropfield': ['name', 'cropTypeName', 'area']
|
||||
};
|
||||
}
|
||||
@@ -1,31 +1,50 @@
|
||||
<div>
|
||||
<div class="layerlist" *ngIf="itemLayers.length > 0;else noLayers">
|
||||
<div class="list-group">
|
||||
<div *ngFor="let itemLayer of itemLayers" class="list-group-item list-group-item-action p-2 text-truncate" [ngClass]="{'active' : selectedLayer==itemLayer}">
|
||||
<div (click)="handleSelectLayer($event,itemLayer)" [title]="itemLayer.item.name">{{itemLayer.item.name}}</div>
|
||||
<div class="mt-1" *ngIf="selectedLayer==itemLayer && !baseLayers">
|
||||
<span class="btn-group">
|
||||
<a title="Toggle visibility"href="#" class="btn btn-light btn-sm" (click)="handleToggleVisibility($event,itemLayer)"><i class="fa" aria-hidden="true" [ngClass]="{'fa-eye':!itemLayer.visible,'fa-eye-slash':itemLayer.visible}"></i></a>
|
||||
<a title="Transparency 25%" *ngIf="itemLayer.visible" href="#" class="btn btn-light btn-sm" (click)="handleSetOpacity($event,itemLayer,0.25)">25%</a>
|
||||
<a title="Transparency 50%" *ngIf="itemLayer.visible" href="#" class="btn btn-light btn-sm" (click)="handleSetOpacity($event,itemLayer,0.5)">50%</a>
|
||||
<a title="Transparency 75%" *ngIf="itemLayer.visible" href="#" class="btn btn-light btn-sm" (click)="handleSetOpacity($event,itemLayer,0.75)">75%</a>
|
||||
<a title="No transparency" *ngIf="itemLayer.visible" href="#" class="btn btn-light btn-sm" (click)="handleSetOpacity($event,itemLayer,1)">100%</a>
|
||||
</span>
|
||||
<a href="#" title="Zoom to extent" class="btn btn-light btn-sm" (click)="handleZoomToExtent($event,itemLayer)"><i class="far fa-search-plus" aria-hidden="true"></i></a>
|
||||
<span *ngIf="firstLayer(itemLayer)"><a href="#" title="Toggle legend" class="btn btn-light btn-sm" (click)="itemLayer.legendVisible=toggleLegend($event,itemLayer.legendVisible)"><i class="far fa-chart-bar" aria-hidden="true"></i></a></span>
|
||||
<span *ngIf="!dataLayers" class="float-end"><a href="#" title="Remove overlay" class="btn btn-light btn-sm" (click)="handleDelete($event,itemLayer)"><i class="fas fa-layer-minus" aria-hidden="true"></i></a></span>
|
||||
</div>
|
||||
<div *ngIf="itemLayer.legendVisible">
|
||||
<div class="card legend">
|
||||
<fm-map-layer-legend [layer]="firstLayer(itemLayer)" (click)="handleLegendClick($event,itemLayer);" [histogramenabled]="true"></fm-map-layer-legend>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ng-template #noLayers>
|
||||
<div class="list-group">
|
||||
<div class="list-group-item" i18n>No layers</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
<div>
|
||||
@if (itemLayers.length > 0) {
|
||||
<div class="layerlist">
|
||||
<div class="list-group">
|
||||
@for (itemLayer of itemLayers; track itemLayer.item.code) {
|
||||
<div class="list-group-item list-group-item-action p-2 text-truncate" [ngClass]="{'active' : selectedLayer==itemLayer}">
|
||||
<div (click)="handleSelectLayer($event,itemLayer)" [title]="itemLayer.item.name">{{itemLayer.item.name}}</div>
|
||||
@if (selectedLayer==itemLayer && !baseLayers) {
|
||||
<div class="mt-1">
|
||||
<span class="btn-group">
|
||||
<a title="Toggle visibility"href="#" class="btn btn-light btn-sm" (click)="handleToggleVisibility($event,itemLayer)"><i class="fa" aria-hidden="true" [ngClass]="{'fa-eye':!itemLayer.visible,'fa-eye-slash':itemLayer.visible}"></i></a>
|
||||
@if (itemLayer.visible) {
|
||||
<a title="Transparency 25%" href="#" class="btn btn-light btn-sm" (click)="handleSetOpacity($event,itemLayer,0.25)">25%</a>
|
||||
}
|
||||
@if (itemLayer.visible) {
|
||||
<a title="Transparency 50%" href="#" class="btn btn-light btn-sm" (click)="handleSetOpacity($event,itemLayer,0.5)">50%</a>
|
||||
}
|
||||
@if (itemLayer.visible) {
|
||||
<a title="Transparency 75%" href="#" class="btn btn-light btn-sm" (click)="handleSetOpacity($event,itemLayer,0.75)">75%</a>
|
||||
}
|
||||
@if (itemLayer.visible) {
|
||||
<a title="No transparency" href="#" class="btn btn-light btn-sm" (click)="handleSetOpacity($event,itemLayer,1)">100%</a>
|
||||
}
|
||||
</span>
|
||||
<a href="#" title="Zoom to extent" class="btn btn-light btn-sm" (click)="handleZoomToExtent($event,itemLayer)"><i class="far fa-search-plus" aria-hidden="true"></i></a>
|
||||
@if (firstLayer(itemLayer)) {
|
||||
<span><a href="#" title="Toggle legend" class="btn btn-light btn-sm" (click)="itemLayer.legendVisible=toggleLegend($event,itemLayer.legendVisible)"><i class="far fa-chart-bar" aria-hidden="true"></i></a></span>
|
||||
}
|
||||
@if (!dataLayers) {
|
||||
<span class="float-end"><a href="#" title="Remove overlay" class="btn btn-light btn-sm" (click)="handleDelete($event,itemLayer)"><i class="fas fa-layer-minus" aria-hidden="true"></i></a></span>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
@if (itemLayer.legendVisible) {
|
||||
<div>
|
||||
<div class="card legend">
|
||||
<fm-map-layer-legend [layer]="firstLayer(itemLayer)" (click)="handleLegendClick($event,itemLayer);" [histogramenabled]="true"></fm-map-layer-legend>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
} @else {
|
||||
<div class="list-group">
|
||||
<div class="list-group-item" i18n>No layers</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { Component,Input,Output,EventEmitter } from '@angular/core';
|
||||
import { IItemLayer } from '../../../models/item.layer';
|
||||
|
||||
@Component({
|
||||
selector: 'fm-map-layer-list',
|
||||
templateUrl: './layer-list.component.html',
|
||||
styleUrls: ['./layer-list.component.scss']
|
||||
@Component({
|
||||
selector: 'fm-map-layer-list',
|
||||
templateUrl: './layer-list.component.html',
|
||||
styleUrls: ['./layer-list.component.scss'],
|
||||
standalone: false
|
||||
})
|
||||
|
||||
export class LayerListComponent {
|
||||
|
||||
@@ -1,18 +1,27 @@
|
||||
<div #layerValues class="layer-values">
|
||||
<div class="cross" *ngIf="enabled$ | async">
|
||||
<div class="pointer"></div>
|
||||
<div class="values-container border border-dark rounded p-2" *ngIf="(layerValues$ | async ) as layers">
|
||||
<div class="lonlat pb-2 "><span class="font-weight-bold">{{lonlat$}}</span><i class="ms-2 fal fa-copy" (click)="copyToClipboard()"></i> </div>
|
||||
<ul class="value-list p-0 mb-0" *ngIf="layers.length>0 ;else no_data">
|
||||
<li class="border-top pt-1 pb-1 value" *ngFor="let layerValue of layers">
|
||||
<div>{{layerValue.layerName}}</div>
|
||||
<div>{{layerValue.date|date}}</div>
|
||||
<div><span *ngIf="layerValue.quantity"><span class="me-1">{{layerValue.quantity}}</span> </span><span class="me-1 font-weight-bold">{{getScaledValue(layerValue)}}</span><span>{{layerValue.unit}}</span></div>
|
||||
</li>
|
||||
</ul>
|
||||
<ng-template #no_data>
|
||||
<div i18n class="border-top pt-1 pb-1">No data at location</div>
|
||||
</ng-template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if (enabled$ | async) {
|
||||
<div class="cross" >
|
||||
<div class="pointer"></div>
|
||||
@if ((layerValues$ | async ); as layers) {
|
||||
<div class="values-container border border-dark rounded p-2">
|
||||
<div class="lonlat pb-2 "><span class="font-weight-bold">{{lonlat$}}</span><i class="ms-2 fal fa-copy" (click)="copyToClipboard()"></i> </div>
|
||||
@if (layers.length>0 ) {
|
||||
<ul class="value-list p-0 mb-0">
|
||||
@for (layerValue of layers; track $index) {
|
||||
<li class="border-top pt-1 pb-1 value">
|
||||
<div>{{layerValue.layerName}}</div>
|
||||
<div>{{layerValue.date|date}}</div>
|
||||
<div>@if (layerValue.quantity) {
|
||||
<span><span class="me-1">{{layerValue.quantity}}</span> </span>
|
||||
}<span class="me-1 font-weight-bold">{{getScaledValue(layerValue)}}</span><span>{{layerValue.unit}}</span></div>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
} @else {
|
||||
<div i18n class="border-top pt-1 pb-1">No data at location</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -3,7 +3,7 @@ import { IItemLayer } from '../../../models/item.layer';
|
||||
import { Store } from '@ngrx/store';
|
||||
import * as mapReducers from '../../../reducers/map.reducer';
|
||||
import * as mapActions from '../../../actions/map.actions';
|
||||
import { MapComponent } from 'ngx-openlayers';
|
||||
import { MapComponent } from '@farmmaps/ng-openlayers';
|
||||
import { ILayervalue } from '../../../models/layer.value';
|
||||
import { Observable, interval, Subject } from 'rxjs';
|
||||
import { debounce, throttle } from 'rxjs/operators';
|
||||
@@ -14,9 +14,10 @@ import { GeoJSON, WKT } from 'ol/format';
|
||||
import { Point } from 'ol/geom';
|
||||
|
||||
@Component({
|
||||
selector: 'fm-map-layer-values',
|
||||
templateUrl: './layer-values.component.html',
|
||||
styleUrls: ['./layer-values.component.scss']
|
||||
selector: 'fm-map-layer-values',
|
||||
templateUrl: './layer-values.component.html',
|
||||
styleUrls: ['./layer-values.component.scss'],
|
||||
standalone: false
|
||||
})
|
||||
export class LayerValuesComponent implements OnInit, AfterViewInit {
|
||||
|
||||
|
||||
@@ -1,20 +1,22 @@
|
||||
import { Component, OnDestroy, OnInit, Input, OnChanges, SimpleChanges } from '@angular/core';
|
||||
import { LayerVectorComponent, MapComponent } from 'ngx-openlayers';
|
||||
import { LayerVectorComponent, MapComponent } from '@farmmaps/ng-openlayers';
|
||||
import RenderType from 'ol/layer/Vector';
|
||||
import { Vector as VectorSource } from 'ol/source';
|
||||
import { Geometry } from 'ol/geom';
|
||||
import Feature from 'ol/Feature';
|
||||
|
||||
@Component({
|
||||
selector: 'fm-map-aol-layer-vector-image',
|
||||
template: `
|
||||
selector: 'fm-map-aol-layer-vector-image',
|
||||
template: `
|
||||
<ng-content></ng-content>
|
||||
`,
|
||||
standalone: false
|
||||
})
|
||||
export class LayerVectorImageComponent extends LayerVectorComponent implements OnInit, OnDestroy, OnChanges {
|
||||
//public source: Vector;
|
||||
|
||||
@Input()
|
||||
renderMode: RenderType<VectorSource<Geometry>> | string = "image";
|
||||
renderMode: RenderType<VectorSource<Feature<Geometry>>> | string = "image";
|
||||
|
||||
constructor(map: MapComponent) {
|
||||
super(map);
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
@import "~bootstrap/scss/bootstrap.scss";
|
||||
|
||||
|
||||
.gps-location {
|
||||
display:block;
|
||||
width:2.5em;
|
||||
height:2.5em;
|
||||
background-color: $body-bg;
|
||||
background-color: var(--bs-body-bg);
|
||||
background-size: contain;
|
||||
margin-top:0.5em;
|
||||
border-radius: 1.75em;
|
||||
@@ -17,15 +14,15 @@
|
||||
}
|
||||
|
||||
.pan-to {
|
||||
fill: $secondary;
|
||||
fill: var(--bs-secondary);
|
||||
}
|
||||
|
||||
div.gps-location:hover .pan-to {
|
||||
fill: $white;
|
||||
fill: var(--bs-white);
|
||||
}
|
||||
|
||||
.pan-to-centered {
|
||||
fill: $primary;
|
||||
fill: var(--bs-primary);
|
||||
}
|
||||
|
||||
div.gps-location:hover .pan-to-centered {
|
||||
@@ -33,5 +30,5 @@ div.gps-location:hover .pan-to-centered {
|
||||
}
|
||||
|
||||
.pan-to.pan-to-disabled {
|
||||
fill: $gray-300;
|
||||
fill: var(--bs-gray-300);
|
||||
}
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
import { Component, OnInit, Input, Host, OnChanges, SimpleChanges,ChangeDetectorRef } from '@angular/core';
|
||||
import { MapComponent } from 'ngx-openlayers';
|
||||
import { MapComponent } from '@farmmaps/ng-openlayers';
|
||||
import {IMapState} from '../../../models/map.state'
|
||||
import {View} from 'ol';
|
||||
import { fromLonLat } from 'ol/proj';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'fm-map-pan-to-location',
|
||||
templateUrl: './pan-to-location.component.html',
|
||||
styleUrls: ['./pan-to-location.component.scss']
|
||||
@Component({
|
||||
selector: 'fm-map-pan-to-location',
|
||||
templateUrl: './pan-to-location.component.html',
|
||||
styleUrls: ['./pan-to-location.component.scss'],
|
||||
standalone: false
|
||||
})
|
||||
export class PanToLocation implements OnInit,OnChanges{
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
@import "~bootstrap/scss/bootstrap.scss";
|
||||
|
||||
.compass {
|
||||
width:2.5em;
|
||||
height:2.5em;
|
||||
@@ -13,7 +11,7 @@
|
||||
|
||||
#north {
|
||||
display: none;
|
||||
fill:$black;
|
||||
fill:var(--bs-black);
|
||||
}
|
||||
|
||||
#top-l {
|
||||
@@ -33,23 +31,23 @@
|
||||
}
|
||||
|
||||
div.compass:hover #top-l {
|
||||
fill:$white;
|
||||
fill:var(--bs-white);
|
||||
}
|
||||
|
||||
div.compass:hover #top-r {
|
||||
fill:$gray-300;
|
||||
fill:var(--bs-gray-300);
|
||||
}
|
||||
|
||||
div.compass:hover #bottom-l {
|
||||
fill:$gray-300;
|
||||
fill:var(--bs-gray-300);
|
||||
}
|
||||
|
||||
div.compass:hover #bottom-r {
|
||||
fill:$white;
|
||||
fill:var(--bs-white);
|
||||
}
|
||||
|
||||
div.compass:hover #north {
|
||||
fill:$white;
|
||||
fill:var(--bs-white);
|
||||
}
|
||||
|
||||
.compass-n {
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
import { Component, Host, Input, OnInit, ChangeDetectorRef } from '@angular/core';
|
||||
import { ViewComponent, MapComponent } from 'ngx-openlayers';
|
||||
import { ViewComponent, MapComponent } from '@farmmaps/ng-openlayers';
|
||||
|
||||
import {View} from 'ol';
|
||||
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'fm-map-rotation-reset',
|
||||
templateUrl: './rotation-reset.component.html',
|
||||
styleUrls: ['./rotation-reset.component.scss']
|
||||
@Component({
|
||||
selector: 'fm-map-rotation-reset',
|
||||
templateUrl: './rotation-reset.component.html',
|
||||
styleUrls: ['./rotation-reset.component.scss'],
|
||||
standalone: false
|
||||
})
|
||||
export class RotationResetComponent implements OnInit {
|
||||
view: View;
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { Component, Host, Input, OnInit, OnChanges, SimpleChanges, forwardRef } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { ViewComponent, MapComponent } from 'ngx-openlayers';
|
||||
import { ViewComponent, MapComponent } from '@farmmaps/ng-openlayers';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'fm-map-zoom-to-extent',
|
||||
template: `<ng-content></ng-content>`
|
||||
@Component({
|
||||
selector: 'fm-map-zoom-to-extent',
|
||||
template: `<ng-content></ng-content>`,
|
||||
standalone: false
|
||||
})
|
||||
export class ZoomToExtentComponent implements OnChanges {
|
||||
view: ViewComponent;
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
@import "~bootstrap/scss/bootstrap.scss";
|
||||
|
||||
|
||||
|
||||
.row {
|
||||
border-bottom: 1px solid $gray-500;
|
||||
border-bottom: 1px solid var(--bs-gray-500);
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.row.selected {
|
||||
background-color: $gray-100;
|
||||
background-color: var(--bs-gray-100);
|
||||
}
|
||||
|
||||
@media screen and (min-width: 44rem) {
|
||||
|
||||
@@ -10,10 +10,11 @@ import { Store } from '@ngrx/store';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'fm-map-feature-list-container',
|
||||
templateUrl: './feature-list-container.component.html',
|
||||
styleUrls: ['./feature-list-container.component.scss']
|
||||
@Component({
|
||||
selector: 'fm-map-feature-list-container',
|
||||
templateUrl: './feature-list-container.component.html',
|
||||
styleUrls: ['./feature-list-container.component.scss'],
|
||||
standalone: false
|
||||
})
|
||||
export class FeatureListContainerComponent {
|
||||
|
||||
@@ -64,9 +65,9 @@ export class FeatureListContainerComponent {
|
||||
viewContainerRef.clear();
|
||||
if(showItem) {
|
||||
this.componentRef = viewContainerRef.createComponent(componentFactory);
|
||||
(<AbstractFeatureListComponent>this.componentRef.instance).features = null;
|
||||
(<AbstractFeatureListComponent>this.componentRef.instance).queryState = queryState;
|
||||
(<AbstractFeatureListComponent>this.componentRef.instance).selectedFeature = null;
|
||||
(<AbstractFeatureListComponent>this.componentRef.instance).features = this.features;
|
||||
(<AbstractFeatureListComponent>this.componentRef.instance).queryState = this.queryState;
|
||||
(<AbstractFeatureListComponent>this.componentRef.instance).selectedFeature = this.selectedFeature;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
<div class="card border-0">
|
||||
<div class="card-body" *ngIf="(schemeItem|async);let schemeItem">
|
||||
<fm-back-button></fm-back-button>
|
||||
<h4 i18n>Farm</h4>
|
||||
<h3>{{schemeItem.name}}</h3>
|
||||
<div *ngIf="features;let features">
|
||||
<div class="cropfields">
|
||||
<div class="row m-0 ps-3 pe-3" *ngFor="let feature of features" [ngClass]="{'selected':isFeatureSelected(feature)}" (click)="handleFeatureClick(feature)" (mouseenter)="handleFeatureMouseEnter(feature)" (mouseleave)="handleFeatureMouseLeave(feature)">
|
||||
<fm-map-feature-list-feature-container [feature]="feature"></fm-map-feature-list-feature-container>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card border-0">
|
||||
@if ((schemeItem|async); as schemeItem) {
|
||||
<div class="card-body">
|
||||
<fm-back-button></fm-back-button>
|
||||
<h4 i18n>Farm</h4>
|
||||
<h3>{{schemeItem.name}}</h3>
|
||||
@if (features; as features) {
|
||||
<div>
|
||||
<div class="cropfields">
|
||||
@for (feature of features; track $index) {
|
||||
<div class="row m-0 ps-3 pe-3" [ngClass]="{'selected':isFeatureSelected(feature)}" (click)="handleFeatureClick(feature)" (mouseenter)="handleFeatureMouseEnter(feature)" (mouseleave)="handleFeatureMouseLeave(feature)">
|
||||
<fm-map-feature-list-feature-container [feature]="feature"></fm-map-feature-list-feature-container>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -1,22 +1,20 @@
|
||||
@import "~bootstrap/scss/bootstrap.scss";
|
||||
|
||||
fm-map-feature-list-feature-container {
|
||||
width:100%;
|
||||
pointer-events:none;
|
||||
}
|
||||
|
||||
.row {
|
||||
border-bottom: 1px solid $gray-500;
|
||||
border-bottom: 1px solid var(--bs-gray-500);
|
||||
user-select: none;
|
||||
padding-left:1.5rem;
|
||||
}
|
||||
|
||||
.row.selected {
|
||||
background-color: $gray-100;
|
||||
background-color: var(--bs-gray-100);
|
||||
}
|
||||
|
||||
.cropfields {
|
||||
border-top: 1px solid $gray-500;
|
||||
border-top: 1px solid var(--bs-gray-500);
|
||||
margin-left: -1.25rem;
|
||||
margin-right: -1.25rem;
|
||||
}
|
||||
|
||||
@@ -11,10 +11,11 @@ import { Observable } from 'rxjs';
|
||||
@ForChild()
|
||||
@ForItemType("vnd.farmmaps.itemtype.cropfield")
|
||||
@Injectable()
|
||||
@Component({
|
||||
selector: 'fm-map-feature-list-cropfield',
|
||||
templateUrl: './feature-list-cropfield.component.html',
|
||||
styleUrls: ['./feature-list-cropfield.component.scss']
|
||||
@Component({
|
||||
selector: 'fm-map-feature-list-cropfield',
|
||||
templateUrl: './feature-list-cropfield.component.html',
|
||||
styleUrls: ['./feature-list-cropfield.component.scss'],
|
||||
standalone: false
|
||||
})
|
||||
export class FeatureListCropfieldComponent extends AbstractFeatureListComponent implements OnInit {
|
||||
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
<div class="card border-0">
|
||||
<div class="card-body">
|
||||
<fm-back-button></fm-back-button>
|
||||
<h3><i class="far fa-farm"></i> <span i18n>Farms</span></h3>
|
||||
<div *ngIf="features;let features">
|
||||
<div class="farms">
|
||||
<div class="row m-0 ps-3 pe-3" *ngFor="let feature of features"[ngClass]="{'selected':isFeatureSelected(feature)}" (click)="handleFeatureClick(feature)" (mouseenter)="handleFeatureMouseEnter(feature)" (mouseleave)="handleFeatureMouseLeave(feature)">
|
||||
<fm-map-feature-list-feature-container [feature]="feature"></fm-map-feature-list-feature-container>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card border-0">
|
||||
<div class="card-body">
|
||||
<fm-back-button></fm-back-button>
|
||||
<h3><i class="far fa-farm"></i> <span i18n>Farms</span></h3>
|
||||
@if (features; as features) {
|
||||
<div>
|
||||
<div class="farms">
|
||||
@for (feature of features; track $index) {
|
||||
<div class="row m-0 ps-3 pe-3"[ngClass]="{'selected':isFeatureSelected(feature)}" (click)="handleFeatureClick(feature)" (mouseenter)="handleFeatureMouseEnter(feature)" (mouseleave)="handleFeatureMouseLeave(feature)">
|
||||
<fm-map-feature-list-feature-container [feature]="feature"></fm-map-feature-list-feature-container>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,22 +1,20 @@
|
||||
@import "~bootstrap/scss/bootstrap.scss";
|
||||
|
||||
fm-map-feature-list-feature-container {
|
||||
width:100%;
|
||||
pointer-events:none;
|
||||
}
|
||||
|
||||
.row {
|
||||
border-bottom: 1px solid $gray-500;
|
||||
border-bottom: 1px solid var(--bs-gray-500);
|
||||
user-select: none;
|
||||
padding-left:1.5rem;
|
||||
}
|
||||
|
||||
.row.selected {
|
||||
background-color: $gray-100;
|
||||
background-color: var(--bs-gray-100);
|
||||
}
|
||||
|
||||
.farms {
|
||||
border-top: 1px solid $gray-500;
|
||||
border-top: 1px solid var(--bs-gray-500);
|
||||
margin-left: -1.25rem;
|
||||
margin-right: -1.25rem;
|
||||
}
|
||||
|
||||
@@ -13,10 +13,11 @@ import { Geometry} from 'ol/geom';
|
||||
|
||||
@ForItemType("vnd.farmmaps.itemtype.croppingscheme")
|
||||
@Injectable()
|
||||
@Component({
|
||||
selector: 'fm-map-feature-list-croppingscheme',
|
||||
templateUrl: './feature-list-croppingscheme.component.html',
|
||||
styleUrls: ['./feature-list-croppingscheme.component.scss']
|
||||
@Component({
|
||||
selector: 'fm-map-feature-list-croppingscheme',
|
||||
templateUrl: './feature-list-croppingscheme.component.html',
|
||||
styleUrls: ['./feature-list-croppingscheme.component.scss'],
|
||||
standalone: false
|
||||
})
|
||||
export class FeatureListCroppingschemeComponent extends AbstractFeatureListComponent {
|
||||
|
||||
|
||||
@@ -5,13 +5,14 @@ import { AbstractFeatureListFeatureComponent,FeatureListFeatureComponent } from
|
||||
import { WidgetHostDirective } from '../widget-host/widget-host.directive';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'fm-map-feature-list-feature-container',
|
||||
template: `
|
||||
@Component({
|
||||
selector: 'fm-map-feature-list-feature-container',
|
||||
template: `
|
||||
<div>
|
||||
<ng-template fm-map-widget-host></ng-template>
|
||||
</div>
|
||||
`
|
||||
`,
|
||||
standalone: false
|
||||
})
|
||||
export class FeatureListFeatureContainerComponent {
|
||||
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
<div *ngIf="feature;let feature" class="d-flex m-0">
|
||||
<div class="p-2">
|
||||
<div class="thumbnail">
|
||||
<fm-map-feature-thumbnail [feature]="feature"></fm-map-feature-thumbnail>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-grow p-2 overflow-hidden">
|
||||
<h1 class="card-title" title="{{feature.get('name')}}">{{feature.get('name')}}</h1>
|
||||
<div class="card-text"><span>{{areaInHa(feature)| number:'1.2-2'}}
|
||||
ha</span> <span>{{feature.get('cropTypeName')}}</span> </div>
|
||||
<div class="card-text"><span>{{feature.get('datadate')|date}}</span> -
|
||||
<span>{{feature.get('dataenddate')|date}}</span> </div>
|
||||
</div>
|
||||
</div>
|
||||
@if (feature; as feature) {
|
||||
<div class="d-flex m-0">
|
||||
<div class="p-2">
|
||||
<div class="thumbnail">
|
||||
<fm-map-feature-thumbnail [feature]="feature"></fm-map-feature-thumbnail>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-grow p-2 overflow-hidden">
|
||||
<h1 class="card-title" title="{{feature.get('name')}}">{{feature.get('name')}}</h1>
|
||||
<div class="card-text"><span>{{areaInHa(feature)| number:'1.2-2'}}
|
||||
ha</span> <span>{{feature.get('cropTypeName')}}</span> </div>
|
||||
<div class="card-text"><span>{{feature.get('datadate')|date}}</span> -
|
||||
<span>{{feature.get('dataenddate')|date}}</span> </div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@@ -1,7 +1,3 @@
|
||||
@import "~bootstrap/scss/bootstrap.scss";
|
||||
|
||||
|
||||
|
||||
.card-title {
|
||||
font-size: 1rem;
|
||||
white-space: nowrap;
|
||||
|
||||
@@ -12,10 +12,11 @@ import {getArea} from 'ol/sphere';
|
||||
|
||||
@ForItemType("vnd.farmmaps.itemtype.cropfield")
|
||||
@Injectable()
|
||||
@Component({
|
||||
selector: 'fm-map-feature-list-feature-cropfield',
|
||||
templateUrl: './feature-list-feature-cropfield.component.html',
|
||||
styleUrls: ['./feature-list-feature-cropfield.component.scss']
|
||||
@Component({
|
||||
selector: 'fm-map-feature-list-feature-cropfield',
|
||||
templateUrl: './feature-list-feature-cropfield.component.html',
|
||||
styleUrls: ['./feature-list-feature-cropfield.component.scss'],
|
||||
standalone: false
|
||||
})
|
||||
export class FeatureListFeatureCropfieldComponent extends AbstractFeatureListFeatureComponent {
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<div *ngIf="feature;let feature" class="row m-0">
|
||||
@if (feature; as feature) {
|
||||
<div class="row m-0">
|
||||
<div class="col p-2">
|
||||
<h1 class="card-title" title="{{feature.get('name')}}">{{feature.get('name')}}</h1>
|
||||
<div class="card-text">{{feature.get('datadate')|date:'shortDate'}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
@import "~bootstrap/scss/bootstrap.scss";
|
||||
|
||||
|
||||
|
||||
.card-title {
|
||||
font-size: 1rem;
|
||||
white-space: nowrap;
|
||||
|
||||
@@ -10,9 +10,10 @@ import { ForItemType } from '../for-item/for-itemtype.decorator';
|
||||
@ForItemType("vnd.farmmaps.itemtype.croppingscheme")
|
||||
@Injectable()
|
||||
@Component({
|
||||
selector: 'fm-map-feature-list-feature-croppingscheme',
|
||||
templateUrl: './feature-list-feature-croppingscheme.component.html',
|
||||
styleUrls: ['./feature-list-feature-croppingscheme.component.scss']
|
||||
selector: 'fm-map-feature-list-feature-croppingscheme',
|
||||
templateUrl: './feature-list-feature-croppingscheme.component.html',
|
||||
styleUrls: ['./feature-list-feature-croppingscheme.component.scss'],
|
||||
standalone: false
|
||||
})
|
||||
export class FeatureListFeatureCroppingschemeComponent extends AbstractFeatureListFeatureComponent {
|
||||
|
||||
|
||||
@@ -1,12 +1,18 @@
|
||||
<div *ngIf="feature;let feature" class="row m-0">
|
||||
@if (feature; as feature) {
|
||||
<div class="row m-0">
|
||||
<div class="col-3 w-25 m-0 p-2 thumbnail">
|
||||
<img *ngIf="feature.get('thumbnail')" [src]="config.getConfig('apiEndPoint') + '/api/v1/items/'+feature.get('code')+'/thumbnail'" />
|
||||
<div *ngIf="!feature.get('thumbnail')" [style.background-color]="itemTypeService.getColor(feature.get('itemType'))">
|
||||
<i [ngClass]="itemTypeService.getIcon(feature.get('itemType'))"></i>
|
||||
</div>
|
||||
@if (feature.get('thumbnail')) {
|
||||
<img [src]="config.getConfig('apiEndPoint') + '/api/v1/items/'+feature.get('code')+'/thumbnail'" />
|
||||
}
|
||||
@if (!feature.get('thumbnail')) {
|
||||
<div [style.background-color]="itemTypeService.getColor(feature.get('itemType'))">
|
||||
<i [ngClass]="itemTypeService.getIcon(feature.get('itemType'))"></i>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="col p-2">
|
||||
<h1 class="card-title" title="{{feature.get('name')}}"><i [ngClass]="itemTypeService.getIcon(feature.get('itemType'))" [style.color]="itemTypeService.getColor(feature.get('itemType'))"></i> {{feature.get('name')}}</h1>
|
||||
<div class="card-text">{{feature.get('datadate')|date:'shortDate'}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
@import "~bootstrap/scss/bootstrap.scss";
|
||||
|
||||
|
||||
|
||||
.card-title {
|
||||
font-size: 1rem;
|
||||
white-space: nowrap;
|
||||
|
||||
@@ -17,10 +17,11 @@ export abstract class AbstractFeatureListFeatureComponent {
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
@Component({
|
||||
selector: 'fm-map-feature-list-feature',
|
||||
templateUrl: './feature-list-feature.component.html',
|
||||
styleUrls: ['./feature-list-feature.component.scss']
|
||||
@Component({
|
||||
selector: 'fm-map-feature-list-feature',
|
||||
templateUrl: './feature-list-feature.component.html',
|
||||
styleUrls: ['./feature-list-feature.component.scss'],
|
||||
standalone: false
|
||||
})
|
||||
export class FeatureListFeatureComponent extends AbstractFeatureListFeatureComponent {
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<div class="card border-0">
|
||||
@if ((schemeItem|async); as schemeItem) {
|
||||
<div class="card-body">
|
||||
<fm-back-button></fm-back-button>
|
||||
<h4 i18n>Farm</h4>
|
||||
<h3>{{schemeItem.name}}</h3>
|
||||
@if (features; as features) {
|
||||
<div>
|
||||
<div class="cropfields">
|
||||
@for (feature of features; track $index) {
|
||||
<div class="row m-0 ps-3 pe-3" [ngClass]="{'selected':isFeatureSelected(feature)}" (click)="handleFeatureClick(feature)" (mouseenter)="handleFeatureMouseEnter(feature)" (mouseleave)="handleFeatureMouseLeave(feature)">
|
||||
<fm-map-feature-list-feature-container [feature]="feature"></fm-map-feature-list-feature-container>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
@@ -0,0 +1,20 @@
|
||||
fm-map-feature-list-feature-container {
|
||||
width:100%;
|
||||
pointer-events:none;
|
||||
}
|
||||
|
||||
.row {
|
||||
border-bottom: 1px solid var(--bs-gray-500);
|
||||
user-select: none;
|
||||
padding-left:1.5rem;
|
||||
}
|
||||
|
||||
.row.selected {
|
||||
background-color: var(--bs-gray-100);
|
||||
}
|
||||
|
||||
.cropfields {
|
||||
border-top: 1px solid var(--bs-gray-500);
|
||||
margin-left: -1.25rem;
|
||||
margin-right: -1.25rem;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
import { Component, Injectable,AfterViewInit, OnInit,SimpleChanges, ChangeDetectorRef} from '@angular/core';
|
||||
import { Location } from '@angular/common';
|
||||
import { AbstractFeatureListComponent } from '../feature-list/feature-list.component';
|
||||
import {ForItemType } from '../for-item/for-itemtype.decorator';
|
||||
import {ForChild } from '../for-item/for-child.decorator';
|
||||
import { Store } from '@ngrx/store';
|
||||
import * as mapReducers from '../../reducers/map.reducer';
|
||||
import { commonReducers, ItemTypeService, IItem,ItemService } from '@farmmaps/common';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
@ForChild()
|
||||
@ForItemType("vnd.farmmaps.itemtype.observation")
|
||||
@Injectable()
|
||||
@Component({
|
||||
selector: 'fm-map-feature-list-observation',
|
||||
templateUrl: './feature-list-observation.component.html',
|
||||
styleUrls: ['./feature-list-observation.component.scss'],
|
||||
standalone: false
|
||||
})
|
||||
export class FeatureListObservationComponent extends AbstractFeatureListComponent implements OnInit {
|
||||
|
||||
constructor(store: Store<mapReducers.State | commonReducers.State>, itemTypeService: ItemTypeService, location: Location, private itemService: ItemService) {
|
||||
super(store, itemTypeService,location);
|
||||
}
|
||||
|
||||
public schemeItem: Observable<IItem>
|
||||
|
||||
ngOnInit() {
|
||||
this.schemeItem = this.itemService.getItem(this.queryState.parentCode);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,10 @@
|
||||
<div *ngIf="features;let features">
|
||||
<fm-back-button></fm-back-button>
|
||||
<div class="row m-0 ps-3 pe-3" *ngFor="let feature of features" [ngClass]="{'selected':isFeatureSelected(feature)}" (click)="handleFeatureClick(feature)" (mouseenter)="handleFeatureMouseEnter(feature)" (mouseleave)="handleFeatureMouseLeave(feature)">
|
||||
<fm-map-feature-list-feature-container [feature]="feature"></fm-map-feature-list-feature-container>
|
||||
</div>
|
||||
</div>
|
||||
@if (features; as features) {
|
||||
<div>
|
||||
<fm-back-button></fm-back-button>
|
||||
@for (feature of features; track $index) {
|
||||
<div class="row m-0 ps-3 pe-3" [ngClass]="{'selected':isFeatureSelected(feature)}" (click)="handleFeatureClick(feature)" (mouseenter)="handleFeatureMouseEnter(feature)" (mouseleave)="handleFeatureMouseLeave(feature)">
|
||||
<fm-map-feature-list-feature-container [feature]="feature"></fm-map-feature-list-feature-container>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
@import "~bootstrap/scss/bootstrap.scss";
|
||||
|
||||
fm-map-feature-list-feature-container {
|
||||
width: 100%;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.row {
|
||||
border-bottom: 1px solid $gray-500;
|
||||
border-bottom: 1px solid var(--bs-gray-500);
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.row.selected {
|
||||
background-color: $gray-100;
|
||||
background-color: var(--bs-gray-100);
|
||||
}
|
||||
|
||||
@@ -23,8 +23,9 @@ export abstract class AbstractFeatureListComponent {
|
||||
|
||||
handleFeatureClick(feature:Feature<Geometry>) {
|
||||
if(feature) {
|
||||
this.store.dispatch(new mapActions.ClickFeature(feature));
|
||||
const action = this.getAction(feature);
|
||||
this.store.dispatch(action);
|
||||
this.store.dispatch(action);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,10 +57,11 @@ export abstract class AbstractFeatureListComponent {
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
@Component({
|
||||
selector: 'fm-map-feature-list',
|
||||
templateUrl: './feature-list.component.html',
|
||||
styleUrls: ['./feature-list.component.scss']
|
||||
@Component({
|
||||
selector: 'fm-map-feature-list',
|
||||
templateUrl: './feature-list.component.html',
|
||||
styleUrls: ['./feature-list.component.scss'],
|
||||
standalone: false
|
||||
})
|
||||
export class FeatureListComponent extends AbstractFeatureListComponent {
|
||||
|
||||
|
||||
@@ -6,9 +6,10 @@ import * as render from 'ol/render';
|
||||
import * as style from 'ol/style';
|
||||
|
||||
@Component({
|
||||
selector: 'fm-map-feature-thumbnail',
|
||||
templateUrl: './feature-thumbnail.component.html',
|
||||
styleUrls: ['./feature-thumbnail.component.scss']
|
||||
selector: 'fm-map-feature-thumbnail',
|
||||
templateUrl: './feature-thumbnail.component.html',
|
||||
styleUrls: ['./feature-thumbnail.component.scss'],
|
||||
standalone: false
|
||||
})
|
||||
export class GeometryThumbnailComponent implements AfterViewInit {
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { Directive, ViewContainerRef,TemplateRef,OnInit,Input, OnChanges } from '@angular/core';
|
||||
import { Layer } from 'ol/layer';
|
||||
import { Source } from 'ol/source';
|
||||
import { MapComponent } from 'ngx-openlayers';
|
||||
import { MapComponent } from '@farmmaps/ng-openlayers';
|
||||
|
||||
@Directive({
|
||||
selector: '[fmMapIfZoomToShow]',
|
||||
@Directive({
|
||||
selector: '[fmMapIfZoomToShow]',
|
||||
standalone: false
|
||||
})
|
||||
export class ifZoomToShowDirective implements OnInit {
|
||||
@Input()
|
||||
|
||||
@@ -4,13 +4,14 @@ import { WidgetHostDirective } from '../widget-host/widget-host.directive';
|
||||
import { IItem, IListItem } from '@farmmaps/common';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'fm-map-item-list-item-container',
|
||||
template: `
|
||||
@Component({
|
||||
selector: 'fm-map-item-list-item-container',
|
||||
template: `
|
||||
<div style="height:100%">
|
||||
<ng-template fm-map-widget-host></ng-template>
|
||||
</div>
|
||||
`
|
||||
`,
|
||||
standalone: false
|
||||
})
|
||||
export class ItemListItemContainerComponent {
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<div *ngIf="item;let item" class="widget" [style.background-color]="itemTypeService.getColor(item.itemType)">
|
||||
<div class="align-middle icon" [ngClass]="itemTypeService.getIcon(item.itemType)"></div>
|
||||
<div class="title">{{item.name}}</div>
|
||||
</div>
|
||||
@if (item; as item) {
|
||||
<div class="widget" [style.background-color]="itemTypeService.getColor(item.itemType)">
|
||||
<div class="align-middle icon" [ngClass]="itemTypeService.getIcon(item.itemType)"></div>
|
||||
<div class="title">{{item.name}}</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
@import "~bootstrap/scss/bootstrap.scss";
|
||||
|
||||
.widget {
|
||||
padding:0.8rem;
|
||||
height:100%;
|
||||
|
||||
@@ -40,10 +40,11 @@ export abstract class AbstractItemWidgetComponent {
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
@Component({
|
||||
selector: 'fm-map-item-list-item',
|
||||
templateUrl: './item-list-item.component.html',
|
||||
styleUrls: ['./item-list-item.component.scss']
|
||||
@Component({
|
||||
selector: 'fm-map-item-list-item',
|
||||
templateUrl: './item-list-item.component.html',
|
||||
styleUrls: ['./item-list-item.component.scss'],
|
||||
standalone: false
|
||||
})
|
||||
export class ItemListItemComponent extends AbstractItemListItemComponent {
|
||||
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
<div *ngIf="items;let items" class="widget-container pt-0">
|
||||
<div class="widget" *ngFor="let item of items" (click)="handleItemClick(item)">
|
||||
<div class="content">
|
||||
<fm-map-item-list-item-container [item]="item" class="item-container"></fm-map-item-list-item-container>
|
||||
</div>
|
||||
@if (items; as items) {
|
||||
<div class="widget-container pt-0">
|
||||
@for (item of items; track item.code) {
|
||||
<div class="widget" (click)="handleItemClick(item)">
|
||||
<div class="content">
|
||||
<fm-map-item-list-item-container [item]="item" class="item-container"></fm-map-item-list-item-container>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
@import "~bootstrap/scss/bootstrap.scss";
|
||||
|
||||
.widget-container {
|
||||
overflow:auto;
|
||||
margin-bottom:1rem;
|
||||
@@ -7,7 +5,7 @@
|
||||
|
||||
.widget {
|
||||
position:relative;
|
||||
border: 1px solid $gray-500;
|
||||
border: 1px solid var(--bs-gray-500);
|
||||
user-select: none;
|
||||
display:inline-block;
|
||||
width:50%;
|
||||
@@ -28,7 +26,7 @@
|
||||
}
|
||||
|
||||
.widget:hover {
|
||||
background-color: $gray-100;
|
||||
background-color: var(--bs-gray-100);
|
||||
}
|
||||
|
||||
.widget-container {
|
||||
|
||||
@@ -28,9 +28,10 @@ export abstract class AbstractItemListComponent {
|
||||
|
||||
@Injectable()
|
||||
@Component({
|
||||
selector: 'fm-map-item-list',
|
||||
templateUrl: './item-list.component.html',
|
||||
styleUrls: ['./item-list.component.scss']
|
||||
selector: 'fm-map-item-list',
|
||||
templateUrl: './item-list.component.html',
|
||||
styleUrls: ['./item-list.component.scss'],
|
||||
standalone: false
|
||||
})
|
||||
export class ItemListComponent extends AbstractItemListComponent {
|
||||
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
<div *ngIf="widgets;let widgets" class="widget-container pt-0">
|
||||
<div class="widget" *ngFor="let widget of widgets">
|
||||
<div class="content">
|
||||
<ng-template #widgetTemplate></ng-template>
|
||||
</div>
|
||||
@if (widgets; as widgets) {
|
||||
<div class="widget-container pt-0">
|
||||
@for (widget of widgets; track widget.item.code) {
|
||||
<div class="widget">
|
||||
<div class="content">
|
||||
<ng-template #widgetTemplate></ng-template>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
@import "~bootstrap/scss/bootstrap.scss";
|
||||
|
||||
.widget-container {
|
||||
overflow:auto;
|
||||
margin-bottom:1rem;
|
||||
@@ -7,7 +5,7 @@
|
||||
|
||||
.widget {
|
||||
position:relative;
|
||||
border: 1px solid $gray-500;
|
||||
border: 1px solid var(--bs-gray-500);
|
||||
user-select: none;
|
||||
display:inline-block;
|
||||
width:50%;
|
||||
@@ -28,7 +26,7 @@
|
||||
}
|
||||
|
||||
.widget:hover {
|
||||
background-color: $gray-100;
|
||||
background-color: var(--bs-gray-100);
|
||||
}
|
||||
|
||||
.widget-container {
|
||||
|
||||
@@ -8,9 +8,10 @@ import { AbstractItemWidgetComponent } from '../item-list-item/item-list-item.co
|
||||
|
||||
@Injectable()
|
||||
@Component({
|
||||
selector: 'fm-map-item-widget-list',
|
||||
templateUrl: './item-widget-list.component.html',
|
||||
styleUrls: ['./item-widget-list.component.scss']
|
||||
selector: 'fm-map-item-widget-list',
|
||||
templateUrl: './item-widget-list.component.html',
|
||||
styleUrls: ['./item-widget-list.component.scss'],
|
||||
standalone: false
|
||||
})
|
||||
export class ItemWidgetListComponent implements AfterViewInit {
|
||||
|
||||
|
||||
@@ -1,32 +1,39 @@
|
||||
<div class="btn btn-outline-primary layer-switcher" (click)="handleClick($event)">
|
||||
<i class="fal fa-layer-group"></i>
|
||||
<div class="layers hidden" [ngClass]="{'hidden':!(showLayerSwitcher|async)}" (click)="$event.stopPropagation();">
|
||||
<div class="card layers-card m-1">
|
||||
<div class="card-header">
|
||||
<span i18n>Layers</span>
|
||||
<i class="float-end fas fa-times" (click)="close($event)"></i>
|
||||
</div>
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item py-0">
|
||||
<span><i class="fal fa-layer-group" aria-hidden="true"></i> <span i18n>Base maps</span></span>
|
||||
<div class="mb-4">
|
||||
<fm-map-layer-list [baseLayers]="true" [itemLayers]="baseLayers|async" [selectedLayer]="selectedBaseLayer|async" (onSelectLayer)="handleSelectBaseLayer($event)"></fm-map-layer-list>
|
||||
</div>
|
||||
</li>
|
||||
<li class="nav-item py-0">
|
||||
<span><i class="fal fa-layer-group" aria-hidden="true"></i> <span i18n>Overlays</span></span>
|
||||
<div class="mb-4">
|
||||
<fm-map-layer-list [itemLayers]="overlayLayers|async" [selectedLayer]="selectedOverlayLayer|async" (onDelete)="handleOnDelete($event)" (onToggleVisibility)="handleOnToggleVisibility($event)" (onSetOpacity)="handleOnSetOpacity($event)" (onZoomToExtent)="handleZoomToExtent($event)" (onSelectLayer)="handleSelectOverlayLayer($event)"></fm-map-layer-list>
|
||||
</div>
|
||||
</li>
|
||||
<li class="nav-item py-0" *ngIf="selectedItemLayer$ | async as selectedItemLayer">
|
||||
<span><i class="fal fa-layer-group" aria-hidden="true"></i> <span i18n>Data</span><span class="slideButton"><a href="#" title="Compare" class="btn btn-light btn-sm" (click)="handleToggleShowDatalayerSlide($event)"><i class="fal fa-sliders-h-square"></i></a></span></span>
|
||||
<div class="mb-4">
|
||||
<fm-map-layer-list [dataLayers]="true" [itemLayers]="[selectedItemLayer]" [selectedLayer]="selectedItemLayer" (onToggleVisibility)="handleOnToggleVisibility($event)" (onSetOpacity)="handleOnSetOpacity($event)" (onZoomToExtent)="handleZoomToExtent($event)" (onSelectLayer)="handleSelectOverlayLayer($event)"></fm-map-layer-list>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn btn-outline-primary layer-switcher" (click)="handleClick($event)">
|
||||
<i class="fal fa-layer-group"></i>
|
||||
<div class="layers hidden" [ngClass]="{'hidden':!(showLayerSwitcher|async)}" (click)="$event.stopPropagation();">
|
||||
<div class="card layers-card m-1">
|
||||
<div class="card-header">
|
||||
<span i18n>Layers</span>
|
||||
<i class="float-end fas fa-times" (click)="close($event)"></i>
|
||||
</div>
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item py-0">
|
||||
<span><i class="fal fa-layer-group" aria-hidden="true"></i> <span i18n>Base maps</span></span>
|
||||
<div class="mb-4">
|
||||
<fm-map-layer-list [baseLayers]="true" [itemLayers]="baseMaps|async" [selectedLayer]="selectedBaseLayer|async" (onSelectLayer)="handleSelectBaseLayer($event)"></fm-map-layer-list>
|
||||
</div>
|
||||
</li>
|
||||
<li class="nav-item py-0">
|
||||
<span><i class="fal fa-layer-group" aria-hidden="true"></i> <span i18n>Overlays</span></span>
|
||||
<div class="mb-4">
|
||||
<fm-map-layer-list [itemLayers]="overlayLayers|async" [selectedLayer]="selectedOverlayLayer|async" (onDelete)="handleOnDelete($event)" (onToggleVisibility)="handleOnToggleVisibility($event)" (onSetOpacity)="handleOnSetOpacity($event)" (onZoomToExtent)="handleZoomToExtent($event)" (onSelectLayer)="handleSelectOverlayLayer($event)"></fm-map-layer-list>
|
||||
</div>
|
||||
</li>
|
||||
@if (selectedItemLayer$ | async; as selectedItemLayer) {
|
||||
<li class="nav-item py-0">
|
||||
<span><i class="fal fa-layer-group" aria-hidden="true"></i> <span i18n>Overlay slider</span><span class="slideButton"><a href="#" title="Compare" class="btn btn-light btn-sm" (click)="handleToggleShowDatalayerSlide($event)"><i class="fal fa-sliders-h-square"></i></a></span></span>
|
||||
<div class="mb-4">
|
||||
<fm-map-layer-list [dataLayers]="true" [itemLayers]="[selectedItemLayer]" [selectedLayer]="selectedItemLayer" (onToggleVisibility)="handleOnToggleVisibility($event)" (onSetOpacity)="handleOnSetOpacity($event)" (onZoomToExtent)="handleZoomToExtent($event)" (onSelectLayer)="handleSelectOverlayLayer($event)"></fm-map-layer-list>
|
||||
</div>
|
||||
</li>
|
||||
}
|
||||
<li class="nav-item py-0">
|
||||
<span><i class="fal fa-layer-group" aria-hidden="true"></i> <span i18n>Aerial photos</span></span>
|
||||
<div class="mb-4">
|
||||
<fm-map-layer-list [baseLayers]="true" [itemLayers]="aerialMaps|async" [selectedLayer]="selectedBaseLayer|async" (onSelectLayer)="handleSelectBaseLayer($event)"></fm-map-layer-list>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,18 +1,15 @@
|
||||
@import "~bootstrap/scss/bootstrap.scss";
|
||||
|
||||
|
||||
.layer-switcher {
|
||||
display:block;
|
||||
width:2.5em;
|
||||
height:2.5em;
|
||||
background-color: $body-bg;
|
||||
background-color: var(--bs-body-bg);
|
||||
background-size: contain;
|
||||
margin-top:0.5em;
|
||||
text-align: center;
|
||||
line-height: 2.5em;
|
||||
border-radius: 1.75em;
|
||||
padding: 0;
|
||||
color: $secondary;
|
||||
color: var(--bs-secondary);
|
||||
}
|
||||
|
||||
.layer-switcher i {
|
||||
@@ -24,7 +21,7 @@
|
||||
}
|
||||
|
||||
.layers {
|
||||
color:$secondary;
|
||||
color:var(--bs-secondary);
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
bottom: -1em;
|
||||
|
||||
@@ -4,12 +4,13 @@ import { Store } from '@ngrx/store';
|
||||
import * as mapReducers from '../../reducers/map.reducer';
|
||||
import * as mapActions from '../../actions/map.actions';
|
||||
import {createEmpty,extend } from 'ol/extent';
|
||||
import { Observable } from 'rxjs';
|
||||
import { filter, map, Observable } from 'rxjs';
|
||||
|
||||
@Component({
|
||||
selector: 'fm-map-layer-switcher',
|
||||
templateUrl: './layer-switcher.component.html',
|
||||
styleUrls: ['./layer-switcher.component.scss']
|
||||
@Component({
|
||||
selector: 'fm-map-layer-switcher',
|
||||
templateUrl: './layer-switcher.component.html',
|
||||
styleUrls: ['./layer-switcher.component.scss'],
|
||||
standalone: false
|
||||
})
|
||||
export class LayerSwitcher implements OnInit,OnChanges{
|
||||
|
||||
@@ -17,7 +18,8 @@ export class LayerSwitcher implements OnInit,OnChanges{
|
||||
public overlayLayers: Observable<Array<IItemLayer>>;
|
||||
public selectedOverlayLayer: Observable<IItemLayer>;
|
||||
public selectedItemLayer$: Observable<IItemLayer>;
|
||||
public baseLayers: Observable<Array<IItemLayer>>;
|
||||
public baseMaps: Observable<Array<IItemLayer>>;
|
||||
public aerialMaps: Observable<Array<IItemLayer>>;
|
||||
public selectedBaseLayer: Observable<IItemLayer>;
|
||||
|
||||
constructor( private store: Store<mapReducers.State>) {
|
||||
@@ -26,7 +28,8 @@ export class LayerSwitcher implements OnInit,OnChanges{
|
||||
ngOnInit() {
|
||||
this.overlayLayers = this.store.select(mapReducers.selectGetOverlayLayers);
|
||||
this.selectedOverlayLayer = this.store.select(mapReducers.selectGetSelectedOverlayLayer);
|
||||
this.baseLayers = this.store.select(mapReducers.selectGetBaseLayers);
|
||||
this.baseMaps = this.store.select(mapReducers.selectGetBaseMaps);
|
||||
this.aerialMaps = this.store.select(mapReducers.selectGetArealMaps);
|
||||
this.selectedBaseLayer = this.store.select(mapReducers.selectGetSelectedBaseLayer);
|
||||
this.selectedItemLayer$ = this.store.select(mapReducers.selectGetSelectedItemLayer)
|
||||
this.showLayerSwitcher = this.store.select(mapReducers.selectGetShowLayerSwitcher);
|
||||
@@ -83,3 +86,4 @@ export class LayerSwitcher implements OnInit,OnChanges{
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
<div class="row ps-3">
|
||||
<div class="col-8 nopadding"><span i18n>Average</span>:</div>
|
||||
<div class="col-4 pull-left nopadding">{{histogram.mean| number:'1.0-2'}}</div>
|
||||
<div class="col-4 pull-left nopadding">{{ getScaledValue(histogram.mean)| number:'1.0-2'}}</div>
|
||||
<div class="col-8 nopadding"><span i18n>Standard deviation</span>:</div>
|
||||
<div class="col-4 pull-left nopadding">{{histogram.stddev| number:'1.0-2'}}</div>
|
||||
<div class="col-4 pull-left nopadding">{{ getScaledValue(histogram.stddev)| number:'1.0-2'}}</div>
|
||||
<div class="col-8 nopadding"><span i18n>Min</span>:</div>
|
||||
<div class="col-4 pull-left nopadding">{{histogram.min| number:'1.0-2'}}</div>
|
||||
<div class="col-4 pull-left nopadding">{{ getScaledValue(histogram.min)| number:'1.0-2'}}</div>
|
||||
<div class="col-8 nopadding" ><span i18n>Max</span>:</div>
|
||||
<div class="col-4 pull-left nopadding">{{histogram.max| number:'1.0-2'}}</div>
|
||||
<div class="col-4 pull-left nopadding">{{ getScaledValue(histogram.max)| number:'1.0-2'}}</div>
|
||||
|
||||
<ng-container *ngIf="showConfidenceInterval()">
|
||||
@if (showConfidenceInterval()) {
|
||||
<div class="col-8 nopadding"><span i18n>Confidence interval</span>:</div>
|
||||
<div class="col-4 pull-left nopadding">{{histogram.confidence * 100| number:'1.0-0'}}%</div>
|
||||
</ng-container>
|
||||
<div class="col-4 pull-left nopadding">{{ getScaledValue(histogram.confidence * 100)| number:'1.0-0'}}%</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -2,18 +2,30 @@ import {Component, Input} from '@angular/core';
|
||||
import {IHistogram, ILayer} from '../../../models/color.map';
|
||||
|
||||
@Component({
|
||||
selector: 'fm-map-histogram-details',
|
||||
templateUrl: './histogram-details.component.html',
|
||||
styles: ['.nopadding{\n' +
|
||||
' padding: 0 !important;\n' +
|
||||
' margin: 0 !important;\n' +
|
||||
'}']
|
||||
selector: 'fm-map-histogram-details',
|
||||
templateUrl: './histogram-details.component.html',
|
||||
styles: ['.nopadding{\n' +
|
||||
' padding: 0 !important;\n' +
|
||||
' margin: 0 !important;\n' +
|
||||
'}'],
|
||||
standalone: false
|
||||
})
|
||||
export class HistogramDetailsComponent {
|
||||
|
||||
@Input()
|
||||
histogram: IHistogram;
|
||||
|
||||
@Input()
|
||||
scale: number | null;
|
||||
|
||||
public getScaledValue(value: number): number {
|
||||
let v = value;
|
||||
if (this.scale && this.scale != 0) {
|
||||
v = this.scale * value;
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
showConfidenceInterval(): boolean {
|
||||
return this.histogram.confidence != null && this.histogram.confidence !== 1;
|
||||
}
|
||||
|
||||
@@ -1,48 +1,68 @@
|
||||
<table class="container" *ngIf="showLegend()">
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<div class="title">
|
||||
<h4 *ngIf="showTitle">{{layer.name}}</h4>
|
||||
<b *ngIf="layer.unit">({{layer.unit}})</b>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<a i18n-title title="more info"><i class="fal fa-info-circle text-primary" (click)="hideHistogramDetails = !hideHistogramDetails"></i></a>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<div class="title" *ngIf="histogramenabled">
|
||||
<h4>{{histogram}}</h4>
|
||||
<b *ngIf="histogramunit">({{histogramunit}})</b>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr *ngFor="let entry of layer.renderer.colorMap.entries; let i = index ">
|
||||
<td class="legend-items"><span [style.background-color]="getAlphaHex(entry.color)" [style.border-color]="getHex(entry.color)"class="color"></span></td>
|
||||
<td class="legend-items-text"><span *ngIf="!entry.label">{{getScaledValue(entry.value,layer.scale) | number:'1.0-2'}} {{legendunit}}</span><span *ngIf="entry.label">{{entry.label}}</span></td>
|
||||
<td class="histogram-items">
|
||||
<div *ngIf="showHistogram()">
|
||||
<span class="bar" [style.background-color]="getHex(entry.color)" [style.width]="getPart(layer.renderer, i)">
|
||||
</span>
|
||||
<span *ngIf="getPercentage(layer.renderer,i) as percentage" class="bar-label">{{percentage | number:'1.0-2'}} %</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr *ngIf="showHistogram()">
|
||||
<td colspan="4" class="pb-1 pt-1">
|
||||
<div class="info" [ngbCollapse]="hideHistogramDetails">
|
||||
<ng-container *ngIf="bandContainsStatistics(); else histogram">
|
||||
<fm-map-statistics-details [statistics]="layer.renderer.band.statistics" [scale]="layer.scale"></fm-map-statistics-details>
|
||||
</ng-container>
|
||||
|
||||
<ng-template #histogram>
|
||||
<fm-map-histogram-details [histogram]="layer.renderer.band.histogram"></fm-map-histogram-details>
|
||||
</ng-template>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@if (showLegend()) {
|
||||
<table class="container">
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<div class="title">
|
||||
@if (showTitle) {
|
||||
<h4>{{layer.name}}</h4>
|
||||
}
|
||||
@if (layer.unit) {
|
||||
<b>({{layer.unit}})</b>
|
||||
}
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<a i18n-title title="more info"><i class="fal fa-info-circle text-primary" (click)="hideHistogramDetails = !hideHistogramDetails"></i></a>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
@if (histogramenabled) {
|
||||
<div class="title">
|
||||
<h4>{{histogram}}</h4>
|
||||
@if (histogramunit) {
|
||||
<b>({{histogramunit}})</b>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
@for (entry of layer.renderer.colorMap.entries; track $index; let i = $index) {
|
||||
<tr>
|
||||
<td class="legend-items"><span [style.background-color]="getAlphaHex(entry.color)" [style.border-color]="getHex(entry.color)"class="color"></span></td>
|
||||
<td class="legend-items-text">@if (!entry.label) {
|
||||
<span>{{getScaledValue(entry.value,layer.scale) | number:'1.0-2'}} {{legendunit}}</span>
|
||||
}@if (entry.label) {
|
||||
<span>{{entry.label}}</span>
|
||||
}</td>
|
||||
<td class="histogram-items">
|
||||
@if (showHistogram()) {
|
||||
<div>
|
||||
<span class="bar" [style.background-color]="getHex(entry.color)" [style.width]="getPart(layer.renderer, i)">
|
||||
</span>
|
||||
@if (getPercentage(layer.renderer,i); as percentage) {
|
||||
<span class="bar-label">{{percentage | number:'1.0-2'}} %</span>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
@if (showHistogram()) {
|
||||
<tr>
|
||||
<td colspan="4" class="pb-1 pt-1">
|
||||
<div class="info" [ngbCollapse]="hideHistogramDetails">
|
||||
@if (bandContainsStatistics()) {
|
||||
<fm-map-statistics-details [statistics]="layer.renderer.band.statistics" [scale]="layer.scale"></fm-map-statistics-details>
|
||||
} @else {
|
||||
<fm-map-histogram-details [histogram]="layer.renderer.band.histogram" [scale]="layer.scale"></fm-map-histogram-details>
|
||||
}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2,10 +2,11 @@ import { Component, OnInit, Input,AfterViewInit } from '@angular/core';
|
||||
import { IColorMap, IColor, IColorEntry,ILayer, IRenderer } from '../../models/color.map';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'fm-map-layer-legend',
|
||||
templateUrl: './legend.component.html',
|
||||
styleUrls: ['./legend.component.scss']
|
||||
@Component({
|
||||
selector: 'fm-map-layer-legend',
|
||||
templateUrl: './legend.component.html',
|
||||
styleUrls: ['./legend.component.scss'],
|
||||
standalone: false
|
||||
})
|
||||
export class LegendComponent implements OnInit,AfterViewInit {
|
||||
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
<div class="col-4 pull-left nopadding">{{getSquaredScaledValue(statistics.variance)| number:'1.0-2'}}</div>
|
||||
<div class="col-8 nopadding"><span i18n>Coefficient of variation</span>:</div>
|
||||
<div class="col-4 pull-left nopadding">{{statistics.variationCoefficient | number:'1.0-2'}}</div>
|
||||
<ng-container *ngIf="statistics.confidenceIntervalLow !== undefined">
|
||||
@if (statistics.confidenceIntervalLow !== undefined) {
|
||||
<div class="col-8 nopadding">90% <span i18n>Confidence interval</span>:</div>
|
||||
<div class="col-4 pull-left nopadding">{{getScaledValue(statistics.confidenceIntervalLow) | number:'1.0-2'}} - {{getScaledValue(statistics.confidenceIntervalHigh) | number:'1.0-2'}}</div>
|
||||
</ng-container>
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -2,12 +2,13 @@ import { Component, Input } from '@angular/core';
|
||||
import { IStatistics } from '../../../models/color.map';
|
||||
|
||||
@Component({
|
||||
selector: 'fm-map-statistics-details',
|
||||
templateUrl: './statistics-details.component.html',
|
||||
styles: ['.nopadding{\n' +
|
||||
' padding: 0 !important;\n' +
|
||||
' margin: 0 !important;\n' +
|
||||
'}']
|
||||
selector: 'fm-map-statistics-details',
|
||||
templateUrl: './statistics-details.component.html',
|
||||
styles: ['.nopadding{\n' +
|
||||
' padding: 0 !important;\n' +
|
||||
' margin: 0 !important;\n' +
|
||||
'}'],
|
||||
standalone: false
|
||||
})
|
||||
export class StatisticsDetailsComponent {
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
@import "~bootstrap/scss/bootstrap.scss";
|
||||
|
||||
div.map-search {
|
||||
position: absolute;
|
||||
top: 0.5rem;
|
||||
@@ -16,7 +14,7 @@ div.map-search {
|
||||
}
|
||||
|
||||
.disabled {
|
||||
color:lighten(#000000,80%);
|
||||
color:adjust(#000000,80%);
|
||||
}
|
||||
|
||||
:host ::ng-deep ngb-typeahead-window.dropdown-menu {
|
||||
@@ -106,7 +104,7 @@ div.map-search.searchcollapsed button[type="submit"] {
|
||||
}
|
||||
|
||||
.form-control, .form-control:focus {
|
||||
border-color: $secondary;
|
||||
border-color: var(--bs-secondary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -6,10 +6,11 @@ import { IQueryState } from '@farmmaps/common';
|
||||
import { IPeriodState } from '../../models/period.state';
|
||||
import { tassign } from 'tassign';
|
||||
|
||||
@Component({
|
||||
selector: 'fm-map-map-search',
|
||||
templateUrl: './map-search.component.html',
|
||||
styleUrls: ['./map-search.component.scss']
|
||||
@Component({
|
||||
selector: 'fm-map-map-search',
|
||||
templateUrl: './map-search.component.html',
|
||||
styleUrls: ['./map-search.component.scss'],
|
||||
standalone: false
|
||||
})
|
||||
export class MapSearchComponent {
|
||||
|
||||
|
||||
@@ -1,94 +1,109 @@
|
||||
<ng-container *ngIf="{
|
||||
mapState:mapState$|async,
|
||||
extent:extent$|async,
|
||||
baseLayers:baseLayers$|async,
|
||||
overlayLayers:overlayLayers$|async,
|
||||
selectedItemLayer:selectedItemLayer$|async,
|
||||
features:features$|async,
|
||||
position:position$|async,
|
||||
parentCode:parentCode$|async,
|
||||
panelVisible:panelVisible$|async,
|
||||
openedModalName:openedModalName$|async,
|
||||
panelCollapsed:panelCollapsed$|async,
|
||||
searchMinified:searchMinified$|async,
|
||||
selectedItem:selectedItem$|async,
|
||||
parentItem:parentItem$|async,
|
||||
queryState:queryState$|async,
|
||||
searchCollapsed:searchCollapsed$|async,
|
||||
clearEnabled:clearEnabled$|async,
|
||||
period:period$|async,
|
||||
compassHeading:compassHeading$|async,
|
||||
styles:styles$|async,
|
||||
selectedFeature:selectedFeature$|async,
|
||||
fullscreen:fullscreen$|async,
|
||||
showDataLayerSlide:showDataLayerSlide$|async
|
||||
} as state">
|
||||
<aol-map #map (moveEnd)="handleOnMoveEnd($event)" (click)="handleOnMouseDown($event)" (dblClick)="handleShowLayerValues($event)" [ngClass]="{'panel-visible':state.panelVisible,'fullscreen':state.fullscreen }" class="map">
|
||||
<div>
|
||||
|
||||
</div>
|
||||
|
||||
<aol-view [zoom]="state.mapState.zoom" [rotation]="state.mapState.rotation">
|
||||
<aol-coordinate [x]="state.mapState.xCenter" [y]="state.mapState.yCenter" [srid]="'EPSG:4326'"></aol-coordinate>
|
||||
<fm-map-zoom-to-extent [extent]="state.extent" [animate]="true"></fm-map-zoom-to-extent>
|
||||
</aol-view>
|
||||
|
||||
<aol-interaction-default></aol-interaction-default>
|
||||
<aol-interaction-dragrotateandzoom></aol-interaction-dragrotateandzoom>
|
||||
<fm-map-item-layers [itemLayers]="state.baseLayers"></fm-map-item-layers>
|
||||
<fm-map-item-layers *ngIf="!overrideOverlayLayers" [itemLayers]="state.overlayLayers"></fm-map-item-layers>
|
||||
<fm-map-item-layers *ngIf="!overrideSelectedItemLayer" [itemLayer]="state.selectedItemLayer" (onPrerender)="handlePrerender($event)"></fm-map-item-layers>
|
||||
<aol-layer-vector>
|
||||
<fm-map-item-source-vector [styles]="state.styles" [features]="state.features" (onFeatureSelected)="handleFeatureClick($event)" (onFeatureHover)="handleFeatureHover($event)" [selectedFeature]="state.selectedFeature" [selectedItem]="state.selectedItem"></fm-map-item-source-vector>
|
||||
</aol-layer-vector>
|
||||
<router-outlet name="map-layers"></router-outlet>
|
||||
<fm-map-gps-location [position]="state.position" [headingTolerance]="20" [showHeading]="devicesService.IsMobile()" [showTolerance]="devicesService.IsMobile()" [heading]="state.compassHeading"></fm-map-gps-location>
|
||||
<fm-map-layer-values></fm-map-layer-values>
|
||||
<div class="viewport-container" [ngStyle]="{'bottom': bottom(state.panelVisible)}">
|
||||
<div class="control-container">
|
||||
<router-outlet name="map-controls"></router-outlet>
|
||||
<fm-map-layer-switcher></fm-map-layer-switcher>
|
||||
<fm-map-pan-to-location [position]="state.position" [mapState]="state.mapState" [animate]="true"></fm-map-pan-to-location>
|
||||
<fm-map-rotation-reset></fm-map-rotation-reset>
|
||||
</div>
|
||||
<div class="slide-container" [ngClass]="{'showDataLayerSlide':state.showDataLayerSlide}">
|
||||
<form>
|
||||
<input class="dataLayerSlide" (input)="handleSlideChange($event)" type="range" style="width: 100%" value="{{dataLayerSlideValue}}"/>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<fm-map-file-drop-target [parentCode]="state.parentCode" (onFileDropped)="handleFileDropped($event)"></fm-map-file-drop-target>
|
||||
|
||||
<div *ngIf="noContent">
|
||||
<fm-map-map-search #mapSearch [openedModalName]="state.openedModalName" (onOpenModal)="handleOpenModal($event)" (onCloseModal)="handleCloseModal()" [ngClass]="{'menuVisible':state.menuVisible}" (onToggleMenu)="handleToggleMenu($event)" (onSearchCollapse)="handleSearchCollapse($event)" (onSearchExpand)="handleSearchExpand($event)" [collapsed]="state.searchCollapsed" [searchMinified]="state.searchMinified" (onSearch)="handleSearch($event)" (onClear)="handleClearSearch($event)" [filterOptions]="state.queryState" [clearEnabled]="state.clearEnabled" [period]="state.period" (onPeriodChange)="handlePeriodChange($event)" (onCitySearch)="handleCitySearch($event)"></fm-map-map-search>
|
||||
</div>
|
||||
<div class="side-panel-container">
|
||||
|
||||
<fm-side-panel [resizeable]="true" (onResize)="handlePanelResize($event)" [visible]="state.panelVisible && noContent" [collapsed]="state.panelCollapsed" [collapsable]="false">
|
||||
<div class="panel-wrapper" *ngIf="noContent">
|
||||
<div class="panel-top bg-secondary" *ngIf="!(state.searchMinified)">
|
||||
</div>
|
||||
<div class="panel-bottom">
|
||||
|
||||
<div *ngIf="!(state.selectedItem)">
|
||||
<fm-map-feature-list-container [features]="state.features" [selectedFeature]="state.selectedFeature" [queryState]="state.queryState" [clickedFeature]="clickedFeature"></fm-map-feature-list-container>
|
||||
</div>
|
||||
|
||||
<div *ngIf="state.selectedItem;let item">
|
||||
<fm-map-selected-item-container [item]="item" [parentItem]="state.parentItem" [itemLayer]="state.selectedItemLayer" [overlayLayers]="state.overlayLayers"></fm-map-selected-item-container>
|
||||
</div>
|
||||
<div *ngIf="state.features.length == 0" class="no-results m-2">
|
||||
<div *ngIf="state.queryState.query">Cannot find <span>{{state.queryState?.query}}</span></div>
|
||||
<div *ngIf="state.queryState?.tags">Cannot find tag <span>{{state.queryState?.tags}}</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</fm-side-panel>
|
||||
<fm-side-panel [resizeable]="true" [visible]="!noContent">
|
||||
<router-outlet (activate)="handleSidepaneloutletActivate($event)" (deactivate)="handleSidepaneloutletDeactivate($event)"></router-outlet>
|
||||
</fm-side-panel>
|
||||
</div>
|
||||
</aol-map>
|
||||
</ng-container>
|
||||
|
||||
|
||||
@if ({
|
||||
mapState:mapState$|async,
|
||||
extent:extent$|async,
|
||||
baseLayers:baseLayers$|async,
|
||||
overlayLayers:overlayLayers$|async,
|
||||
selectedItemLayer:selectedItemLayer$|async,
|
||||
features:features$|async,
|
||||
position:position$|async,
|
||||
parentCode:parentCode$|async,
|
||||
panelVisible:panelVisible$|async,
|
||||
openedModalName:openedModalName$|async,
|
||||
panelCollapsed:panelCollapsed$|async,
|
||||
panelExtraWide:panelExtraWide$|async,
|
||||
searchMinified:searchMinified$|async,
|
||||
selectedItem:selectedItem$|async,
|
||||
parentItem:parentItem$|async,
|
||||
queryState:queryState$|async,
|
||||
searchCollapsed:searchCollapsed$|async,
|
||||
clearEnabled:clearEnabled$|async,
|
||||
period:period$|async,
|
||||
compassHeading:compassHeading$|async,
|
||||
styles:styles$|async,
|
||||
selectedFeature:selectedFeature$|async,
|
||||
fullscreen:fullscreen$|async,
|
||||
showDataLayerSlide:showDataLayerSlide$|async,
|
||||
menuVisible:menuVisible$|async,
|
||||
}; as state) {
|
||||
<aol-map #map (moveEnd)="handleOnMoveEnd($event)" (click)="handleOnMouseDown($event)" (dblClick)="handleShowLayerValues($event)" [ngClass]="{'panel-visible':state.panelVisible,'fullscreen':state.fullscreen }" class="map">
|
||||
<div>
|
||||
</div>
|
||||
<aol-view [zoom]="state.mapState.zoom" [rotation]="state.mapState.rotation">
|
||||
<aol-coordinate [x]="state.mapState.xCenter" [y]="state.mapState.yCenter" [srid]="'EPSG:4326'"></aol-coordinate>
|
||||
<fm-map-zoom-to-extent [extent]="state.extent" [animate]="true"></fm-map-zoom-to-extent>
|
||||
</aol-view>
|
||||
<aol-interaction-default></aol-interaction-default>
|
||||
<aol-interaction-dragrotateandzoom></aol-interaction-dragrotateandzoom>
|
||||
<fm-map-item-layers [itemLayers]="state.baseLayers"></fm-map-item-layers>
|
||||
@if (!overrideOverlayLayers) {
|
||||
<fm-map-item-layers [itemLayers]="state.overlayLayers"></fm-map-item-layers>
|
||||
}
|
||||
@if (!overrideSelectedItemLayer) {
|
||||
<fm-map-item-layers [itemLayer]="state.selectedItemLayer" (onPrerender)="handlePrerender($event)"></fm-map-item-layers>
|
||||
}
|
||||
<aol-layer-vector>
|
||||
<fm-map-item-source-vector [styles]="state.styles" [features]="state.features" (onFeatureSelected)="handleFeatureClick($event)" (onFeatureHover)="handleFeatureHover($event)" [selectedFeature]="state.selectedFeature" [selectedItem]="state.selectedItem"></fm-map-item-source-vector>
|
||||
</aol-layer-vector>
|
||||
<router-outlet name="map-layers"></router-outlet>
|
||||
<fm-map-gps-location [position]="state.position" [headingTolerance]="20" [showHeading]="devicesService.IsMobile()" [showTolerance]="devicesService.IsMobile()" [heading]="state.compassHeading"></fm-map-gps-location>
|
||||
<fm-map-layer-values></fm-map-layer-values>
|
||||
<div class="viewport-container" [ngStyle]="{'bottom': bottom(state.panelVisible)}">
|
||||
<div class="control-container">
|
||||
<router-outlet name="map-controls"></router-outlet>
|
||||
<fm-map-layer-switcher></fm-map-layer-switcher>
|
||||
<fm-map-pan-to-location [position]="state.position" [mapState]="state.mapState" [animate]="true"></fm-map-pan-to-location>
|
||||
<fm-map-rotation-reset></fm-map-rotation-reset>
|
||||
</div>
|
||||
<div class="slide-container" [ngClass]="{'showDataLayerSlide':state.showDataLayerSlide}">
|
||||
<form>
|
||||
<input class="dataLayerSlide" (input)="handleSlideChange($event)" type="range" style="width: 100%" value="{{dataLayerSlideValue}}"/>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<fm-map-file-drop-target [parentCode]="state.parentCode" (onFileDropped)="handleFileDropped($event)"></fm-map-file-drop-target>
|
||||
@if (noContent) {
|
||||
<div>
|
||||
<fm-map-map-search #mapSearch [openedModalName]="state.openedModalName" (onOpenModal)="handleOpenModal($event)" (onCloseModal)="handleCloseModal()" [ngClass]="{'menuVisible':state.menuVisible}" (onToggleMenu)="handleToggleMenu($event)" (onSearchCollapse)="handleSearchCollapse($event)" (onSearchExpand)="handleSearchExpand($event)" [collapsed]="state.searchCollapsed" [searchMinified]="state.searchMinified" (onSearch)="handleSearch($event)" (onClear)="handleClearSearch($event)" [filterOptions]="state.queryState" [clearEnabled]="state.clearEnabled" [period]="state.period" (onPeriodChange)="handlePeriodChange($event)" (onCitySearch)="handleCitySearch($event)"></fm-map-map-search>
|
||||
</div>
|
||||
}
|
||||
<div class="side-panel-container">
|
||||
<fm-side-panel [resizeable]="true" (onResize)="handlePanelResize($event)" [visible]="state.panelVisible && noContent" [collapsed]="state.panelCollapsed" [collapsable]="false" [extrawide]="state.panelExtraWide">
|
||||
@if (noContent) {
|
||||
<div class="panel-wrapper">
|
||||
@if (!(state.searchMinified)) {
|
||||
<div class="panel-top bg-secondary">
|
||||
</div>
|
||||
}
|
||||
<div class="panel-bottom">
|
||||
@if (!(state.selectedItem)) {
|
||||
<div>
|
||||
<fm-map-feature-list-container [features]="state.features" [selectedFeature]="state.selectedFeature" [queryState]="state.queryState" [clickedFeature]="clickedFeature"></fm-map-feature-list-container>
|
||||
</div>
|
||||
}
|
||||
@if (state.selectedItem; as item) {
|
||||
<div>
|
||||
<fm-map-selected-item-container [item]="item" [parentItem]="state.parentItem" [itemLayer]="state.selectedItemLayer" [overlayLayers]="state.overlayLayers"></fm-map-selected-item-container>
|
||||
</div>
|
||||
}
|
||||
@if (state.features.length == 0) {
|
||||
<div class="no-results m-2">
|
||||
@if (state.queryState.query) {
|
||||
<div>Cannot find <span>{{state.queryState?.query}}</span></div>
|
||||
}
|
||||
@if (state.queryState?.tags) {
|
||||
<div>Cannot find tag <span>{{state.queryState?.tags}}</span></div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</fm-side-panel>
|
||||
<fm-side-panel [resizeable]="true" [visible]="!noContent" [extrawide]="state.panelExtraWide">
|
||||
<router-outlet (activate)="handleSidepaneloutletActivate($event)" (deactivate)="handleSidepaneloutletDeactivate($event)"></router-outlet>
|
||||
</fm-side-panel>
|
||||
</div>
|
||||
</aol-map>
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
@import "~bootstrap/scss/bootstrap.scss";
|
||||
|
||||
aol-map { position:absolute;width:100%;height:calc( 100vh );}
|
||||
|
||||
.arrow {
|
||||
@@ -54,11 +52,20 @@ aol-map { position:absolute;width:100%;height:calc( 100vh );}
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 768px) {
|
||||
.control-container {
|
||||
margin-left: 1em;
|
||||
margin-right: 1em;
|
||||
pointer-events: all;
|
||||
}
|
||||
}
|
||||
|
||||
.control-container {
|
||||
float:right;
|
||||
margin-right: 1em;
|
||||
pointer-events: all;
|
||||
@media screen and (min-width: 768px) {
|
||||
.control-container {
|
||||
float: right;
|
||||
margin-right: 1em;
|
||||
pointer-events: all;
|
||||
}
|
||||
}
|
||||
|
||||
.fullscreen .viewport-container {
|
||||
@@ -195,7 +202,7 @@ timespan.menuVisible {
|
||||
width: 4rem;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
color: $primary;
|
||||
color: var(--bs-primary);
|
||||
}
|
||||
|
||||
.shortcut-icon > .farm-icon {
|
||||
|
||||
@@ -1,50 +1,51 @@
|
||||
import { Component, OnInit, OnDestroy, HostListener, ViewChild, AfterViewInit,NgZone,ElementRef } from '@angular/core';
|
||||
import { Component, OnInit, OnDestroy, HostListener, ViewChild, AfterViewInit, NgZone, ElementRef } from '@angular/core';
|
||||
import { Location } from '@angular/common';
|
||||
import { Observable, Subject, Subscription, from,of ,EMPTY } from 'rxjs';
|
||||
import { withLatestFrom, switchMap,skip } from 'rxjs/operators';
|
||||
import { Observable, Subject, Subscription, from, of, EMPTY } from 'rxjs';
|
||||
import { withLatestFrom, switchMap, skip } from 'rxjs/operators';
|
||||
import { Router, ActivatedRoute, ParamMap } from '@angular/router';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { DeviceService } from '@farmmaps/common';
|
||||
import {getRenderPixel} from 'ol/render';
|
||||
import { getRenderPixel } from 'ol/render';
|
||||
|
||||
// Map
|
||||
import * as mapReducers from '../../reducers/map.reducer';
|
||||
import * as mapActions from '../../actions/map.actions';
|
||||
import { IMapState} from '../../models/map.state';
|
||||
import { IClickedFeature} from '../../models/clicked.feature';
|
||||
import { IMapState } from '../../models/map.state';
|
||||
import { IClickedFeature } from '../../models/clicked.feature';
|
||||
import { IQuery } from '../../reducers/map.reducer'
|
||||
import { ISelectedFeatures } from '../../models/selected.features';
|
||||
import { IItemLayer } from '../../models/item.layer';
|
||||
import { IListItem, IQueryState } from '@farmmaps/common';
|
||||
import { IPeriodState } from '../../models/period.state';
|
||||
import {IStyles} from '../../models/style.cache';
|
||||
import { IStyles } from '../../models/style.cache';
|
||||
import { IDroppedFile } from '../aol/file-drop-target/file-drop-target.component';
|
||||
import { StateSerializerService } from '@farmmaps/common';
|
||||
import { GeolocationService} from '../../services/geolocation.service';
|
||||
import { GeolocationService } from '../../services/geolocation.service';
|
||||
import { GeolocatorService } from '@farmmaps/common';
|
||||
import {DeviceOrientationService} from '../../services/device-orientation.service';
|
||||
import { DeviceOrientationService } from '../../services/device-orientation.service';
|
||||
|
||||
// AppCommon
|
||||
import { ResumableFileUploadService, ItemTypeService } from '@farmmaps/common';
|
||||
import { IItemType, IItem } from '@farmmaps/common';
|
||||
import {commonReducers} from '@farmmaps/common';
|
||||
import {commonActions} from '@farmmaps/common';
|
||||
import { commonReducers } from '@farmmaps/common';
|
||||
import { commonActions } from '@farmmaps/common';
|
||||
|
||||
import {Feature} from 'ol';
|
||||
import {Geometry,Point,Circle} from 'ol/geom';
|
||||
import {Extent,createEmpty,extend } from 'ol/extent';
|
||||
import {transform} from 'ol/proj';
|
||||
import { Feature } from 'ol';
|
||||
import { Geometry, Point, Circle } from 'ol/geom';
|
||||
import { Extent, createEmpty, extend } from 'ol/extent';
|
||||
import { transform } from 'ol/proj';
|
||||
import { tassign } from 'tassign';
|
||||
import * as style from 'ol/style';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'fm-map-map',
|
||||
templateUrl: './map.component.html',
|
||||
styleUrls: ['./map.component.scss']
|
||||
@Component({
|
||||
selector: 'fm-map-map',
|
||||
templateUrl: './map.component.html',
|
||||
styleUrls: ['./map.component.scss'],
|
||||
standalone: false
|
||||
})
|
||||
|
||||
export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
|
||||
export class MapComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||
title = 'Map';
|
||||
public openedModalName$: Observable<string> = this.store.select(commonReducers.selectOpenedModalName);
|
||||
public itemTypes$: Observable<{ [id: string]: IItemType }>;
|
||||
@@ -54,48 +55,51 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
|
||||
public selectedOverlayLayer$: Observable<IItemLayer> = this.store.select(mapReducers.selectGetSelectedOverlayLayer);
|
||||
public selectedItemLayer$: Observable<IItemLayer> = this.store.select(mapReducers.selectGetSelectedItemLayer);
|
||||
public baseLayers$: Observable<Array<IItemLayer>> = this.store.select(mapReducers.selectGetBaseLayers);
|
||||
public selectedBaseLayer$: Observable<IItemLayer> = this.store.select(mapReducers.selectGetSelectedBaseLayer);
|
||||
public selectedBaseLayer$: Observable<IItemLayer> = this.store.select(mapReducers.selectGetSelectedBaseLayer);
|
||||
public projection$: Observable<string> = this.store.select(mapReducers.selectGetProjection);
|
||||
public selectedFeatures$: Subject<ISelectedFeatures> = new Subject<ISelectedFeatures>();
|
||||
public droppedFile$: Subject<IDroppedFile> = new Subject<IDroppedFile>();
|
||||
public droppedFile$: Subject<IDroppedFile> = new Subject<IDroppedFile>();
|
||||
private paramSub: Subscription;
|
||||
private itemTypeSub: Subscription;
|
||||
private stateSub: Subscription;
|
||||
private queryStateSub: Subscription;
|
||||
private querySub: Subscription;
|
||||
public parentCode$: Observable<string> =this.store.select(mapReducers.selectGetParentCode);
|
||||
public parentCode$: Observable<string> = this.store.select(mapReducers.selectGetParentCode);
|
||||
public panelVisible$: Observable<boolean> = this.store.select(mapReducers.selectGetPanelVisible);
|
||||
public panelCollapsed$: Observable<boolean> = this.store.select(mapReducers.selectGetPanelCollapsed);
|
||||
public panelExtraWide$: Observable<boolean> = this.store.select(mapReducers.selectGetPanelExtraWide);
|
||||
public selectedFeature$: Observable<Feature<Geometry>> = this.store.select(mapReducers.selectGetSelectedFeature);
|
||||
public clickedFeature: Subject<Feature<Geometry>> = new Subject<Feature<Geometry>>();
|
||||
public selectedItem$: Observable<IItem> = this.store.select(mapReducers.selectGetSelectedItem);
|
||||
public parentItem$: Observable<IItem> =this.store.select(mapReducers.selectGetParentItem);
|
||||
public parentItem$: Observable<IItem> = this.store.select(mapReducers.selectGetParentItem);
|
||||
public queryState$: Observable<IQueryState> = this.store.select(mapReducers.selectGetQueryState);
|
||||
public state$:Observable<{mapState:IMapState,queryState:IQueryState}> = this.store.select(mapReducers.selectGetState);
|
||||
public state$: Observable<{ mapState: IMapState, queryState: IQueryState }> = this.store.select(mapReducers.selectGetState);
|
||||
public period$: Observable<IPeriodState> = this.store.select(mapReducers.selectGetPeriod);
|
||||
public clearEnabled$: Observable<boolean> = this.store.select(mapReducers.selectGetClearEnabled);
|
||||
public searchCollapsed$: Observable<boolean> = this.store.select(mapReducers.selectGetSearchCollapsed);
|
||||
public searchMinified$: Observable<boolean> = this.store.select(mapReducers.selectGetSearchMinified);
|
||||
public showDataLayerSlide$: Observable<boolean> = this.store.select(mapReducers.selectGetShowdataLayerSlide);
|
||||
public menuVisible$: Observable<boolean>;
|
||||
public query$: Observable<IQuery> = this.store.select(mapReducers.selectGetQuery);
|
||||
public query$: Observable<IQuery> = this.store.select(mapReducers.selectGetQuery);
|
||||
public position$: Observable<GeolocationPosition> = this.geolocationService.getCurrentPosition();
|
||||
public compassHeading$: Observable<number> = this.deviceorientationService.getCurrentCompassHeading();
|
||||
public baseLayersCollapsed = true;
|
||||
public overlayLayersCollapsed = true;
|
||||
public extent$: Observable<Extent> = this.store.select(mapReducers.selectGetExtent);
|
||||
public styles$:Observable<IStyles> = this.store.select(mapReducers.selectGetStyles);
|
||||
public styles$: Observable<IStyles> = this.store.select(mapReducers.selectGetStyles);
|
||||
public fullscreen$: Observable<boolean> = this.store.select(commonReducers.selectGetFullScreen);
|
||||
private lastUrl = "";
|
||||
private initialized = false;
|
||||
public noContent = false;
|
||||
public overrideSelectedItemLayer = false;
|
||||
public overrideOverlayLayers = false;
|
||||
public hideShowLayerValues = false;
|
||||
public const
|
||||
public dataLayerSlideValue = 50;
|
||||
public dataLayerSlideEnabled = false;
|
||||
private visibleAreaBottom = 0;
|
||||
private viewEnabled = true;
|
||||
|
||||
|
||||
@ViewChild('map') map;
|
||||
@ViewChild('contentDiv') contentDiv: ElementRef;
|
||||
|
||||
@@ -109,47 +113,48 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
|
||||
private geolocationService: GeolocationService,
|
||||
private geolocaterService: GeolocatorService,
|
||||
private zone: NgZone,
|
||||
private deviceorientationService:DeviceOrientationService,
|
||||
public devicesService:DeviceService) {
|
||||
if(route && route.snapshot && route.snapshot.data && route.snapshot.data["fm-map-map"]) {
|
||||
const params = route.snapshot.data["fm-map-map"];
|
||||
this.overrideSelectedItemLayer = params["overrideSelectedItemlayer"] ? params["overrideSelectedItemlayer"] : false;
|
||||
this.overrideOverlayLayers = params["overrideOverlayLayers"] ? params["overrideOverlayLayers"] : false;
|
||||
}
|
||||
this.querySub = this.query$.pipe(skip(1), withLatestFrom(this.mapState$)).subscribe(([query,mapState]) =>{
|
||||
if(query && query.querystate) {
|
||||
let newQueryState = tassign(mapReducers.initialQueryState);
|
||||
console.debug(`Do Query`);
|
||||
const urlparts=[];
|
||||
if (query.querystate.itemCode && query.querystate.itemCode != "") {
|
||||
if(query.querystate.itemType && query.querystate.itemType!= "") {
|
||||
const itemType = this.itemTypeService.itemTypes[query.querystate.itemType];
|
||||
if (itemType && itemType.viewer && itemType.viewer == "edit_in_editor" && itemType.editor) {
|
||||
urlparts.push('/editor');
|
||||
urlparts.push(itemType.editor);
|
||||
urlparts.push('item');
|
||||
urlparts.push(query.querystate.itemCode);
|
||||
}
|
||||
private deviceorientationService: DeviceOrientationService,
|
||||
public devicesService: DeviceService) {
|
||||
if (route && route.snapshot && route.snapshot.data && route.snapshot.data["fm-map-map"]) {
|
||||
const params = route.snapshot.data["fm-map-map"];
|
||||
this.overrideSelectedItemLayer = params["overrideSelectedItemlayer"] ? params["overrideSelectedItemlayer"] : false;
|
||||
this.overrideOverlayLayers = params["overrideOverlayLayers"] ? params["overrideOverlayLayers"] : false;
|
||||
this.hideShowLayerValues = params["hideShowLayerValues"] ? params["hideShowLayerValues"] : false;
|
||||
}
|
||||
this.querySub = this.query$.pipe(skip(1), withLatestFrom(this.mapState$)).subscribe(([query, mapState]) => {
|
||||
if (query && query.querystate) {
|
||||
let newQueryState = tassign(mapReducers.initialQueryState);
|
||||
//console.debug(`Do Query`);
|
||||
const urlparts = [];
|
||||
if (query.querystate.itemCode && query.querystate.itemCode != "") {
|
||||
if (query.querystate.itemType && query.querystate.itemType != "") {
|
||||
const itemType = this.itemTypeService.itemTypes[query.querystate.itemType];
|
||||
if (itemType && itemType.viewer && itemType.viewer == "edit_in_editor" && itemType.editor) {
|
||||
urlparts.push('/editor');
|
||||
urlparts.push(itemType.editor);
|
||||
urlparts.push('item');
|
||||
urlparts.push(query.querystate.itemCode);
|
||||
}
|
||||
} else {
|
||||
newQueryState= query.querystate;
|
||||
}
|
||||
if(urlparts.length==0 ) {
|
||||
newQueryState.itemCode = query.querystate.itemCode;
|
||||
this.zone.run(() => {
|
||||
this.replaceUrl(mapState,newQueryState,query.replace);
|
||||
})
|
||||
} else {
|
||||
this.router.navigate(urlparts);
|
||||
}
|
||||
} else {
|
||||
newQueryState = query.querystate;
|
||||
}
|
||||
});
|
||||
this.store.dispatch(new mapActions.Init());
|
||||
// this.store.select(commonReducers.getRootItems).subscribe((l) => {
|
||||
// if(l && l.length>0) {
|
||||
// this.store.dispatch(new mapActions.Init());
|
||||
// }
|
||||
// });
|
||||
if (urlparts.length == 0) {
|
||||
newQueryState.itemCode = query.querystate.itemCode;
|
||||
this.zone.run(() => {
|
||||
this.replaceUrl(mapState, newQueryState, query.replace);
|
||||
})
|
||||
} else {
|
||||
this.router.navigate(urlparts);
|
||||
}
|
||||
}
|
||||
});
|
||||
this.store.dispatch(new mapActions.Init());
|
||||
// this.store.select(commonReducers.getRootItems).subscribe((l) => {
|
||||
// if(l && l.length>0) {
|
||||
// this.store.dispatch(new mapActions.Init());
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
@HostListener('document:keyup', ['$event'])
|
||||
@@ -160,27 +165,27 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
|
||||
}
|
||||
}
|
||||
|
||||
handlePanelResize(resizeTop:number) {
|
||||
if(resizeTop==100 || !this.devicesService.IsMobile() ) {
|
||||
this.visibleAreaBottom=0;
|
||||
handlePanelResize(resizeTop: number) {
|
||||
if (resizeTop == 100 || !this.devicesService.IsMobile()) {
|
||||
this.visibleAreaBottom = 0;
|
||||
} else {
|
||||
this.visibleAreaBottom=100-resizeTop;
|
||||
if(this.visibleAreaBottom>60) {
|
||||
this.visibleAreaBottom=60;
|
||||
this.visibleAreaBottom = 100 - resizeTop;
|
||||
if (this.visibleAreaBottom > 60) {
|
||||
this.visibleAreaBottom = 60;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bottom(panelVisible:boolean) {
|
||||
if(panelVisible) {
|
||||
return this.visibleAreaBottom + '%';
|
||||
bottom(panelVisible: boolean) {
|
||||
if (panelVisible) {
|
||||
return this.visibleAreaBottom + '%';
|
||||
} else {
|
||||
return "0%";
|
||||
}
|
||||
}
|
||||
|
||||
handleOpenModal(modalName: string) {
|
||||
this.store.dispatch(new commonActions.OpenModal(modalName));
|
||||
this.store.dispatch(new commonActions.OpenModal(modalName));
|
||||
}
|
||||
|
||||
handleCloseModal() {
|
||||
@@ -188,10 +193,11 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
|
||||
}
|
||||
|
||||
handleFileDropped(droppedFile: IDroppedFile) {
|
||||
this.uploadService.addFiles(droppedFile.files, droppedFile.event, { parentCode:droppedFile.parentCode, geometry:droppedFile.geometry });
|
||||
this.uploadService.addFiles(droppedFile.files, droppedFile.event, { parentCode: droppedFile.parentCode, geometry: droppedFile.geometry });
|
||||
}
|
||||
|
||||
handleFeatureClick(feature: Feature<Geometry>) {
|
||||
this.store.dispatch(new mapActions.ClickFeature(feature));
|
||||
this.clickedFeature.next(feature);
|
||||
}
|
||||
|
||||
@@ -203,20 +209,26 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
|
||||
this.store.dispatch(new mapActions.DoQuery(queryState));
|
||||
}
|
||||
|
||||
handleSidepaneloutletActivate(component:any) {
|
||||
if(component && component.hasOwnProperty('clickedFeature')) {
|
||||
(component as IClickedFeature).clickedFeature = this.clickedFeature;
|
||||
}
|
||||
}
|
||||
|
||||
handleSidepaneloutletDeactivate(component:any) {
|
||||
if(component && component.hasOwnProperty('clickedFeature')) {
|
||||
(component as IClickedFeature).clickedFeature = null;
|
||||
handleSidepaneloutletActivate(component: any) {
|
||||
if (component && component.hasOwnProperty('clickedFeature')) {
|
||||
(component as IClickedFeature).clickedFeature = this.clickedFeature;
|
||||
}
|
||||
if (component && component.hasOwnProperty('extrawide')) {
|
||||
this.store.dispatch(new mapActions.SetPanelExtraWide(true));
|
||||
}
|
||||
}
|
||||
|
||||
handlePrerender(event:any) {
|
||||
if(!this.dataLayerSlideEnabled) return;
|
||||
handleSidepaneloutletDeactivate(component: any) {
|
||||
if (component && component.hasOwnProperty('clickedFeature')) {
|
||||
(component as IClickedFeature).clickedFeature = null;
|
||||
}
|
||||
if (component && component.hasOwnProperty('extrawide')) {
|
||||
this.store.dispatch(new mapActions.SetPanelExtraWide(false));
|
||||
}
|
||||
}
|
||||
|
||||
handlePrerender(event: any) {
|
||||
if (!this.dataLayerSlideEnabled) return;
|
||||
const ctx = event.context;
|
||||
const mapSize = this.map.instance.getSize();
|
||||
const width = mapSize[0] * (this.dataLayerSlideValue / 100);
|
||||
@@ -235,72 +247,74 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
|
||||
ctx.clip();
|
||||
}
|
||||
|
||||
handleSlideChange(event:any) {
|
||||
this.dataLayerSlideValue = event.target.value;
|
||||
this.map.instance.render();
|
||||
handleSlideChange(event: any) {
|
||||
this.dataLayerSlideValue = event.target.value;
|
||||
this.map.instance.render();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
ngOnInit() {
|
||||
this.initialized = false;
|
||||
console.debug("Init");
|
||||
//console.debug("Init");
|
||||
this.store.dispatch(new mapActions.Clear());
|
||||
this.selectedFeatures$.next({x:0,y:0,features:[]});
|
||||
this.selectedFeatures$.next({ x: 0, y: 0, features: [] });
|
||||
this.selectedFeatures$.next(null);
|
||||
}
|
||||
|
||||
initCustomStyles() {
|
||||
this.store.dispatch(new mapActions.SetStyle('vnd.farmmaps.itemtype.layer',new style.Style({
|
||||
this.store.dispatch(new mapActions.SetStyle('vnd.farmmaps.itemtype.layer', new style.Style({
|
||||
stroke: new style.Stroke({
|
||||
color: 'red',
|
||||
lineDash: [ 5,5],
|
||||
lineDash: [5, 5],
|
||||
width: 1
|
||||
}),
|
||||
geometry:(feature) =>feature.getGeometry()
|
||||
geometry: (feature) => feature.getGeometry()
|
||||
})));
|
||||
this.store.dispatch(new mapActions.SetStyle('vnd.farmmaps.itemtype.layer_selected',new style.Style({
|
||||
this.store.dispatch(new mapActions.SetStyle('vnd.farmmaps.itemtype.layer_selected', new style.Style({
|
||||
stroke: new style.Stroke({
|
||||
color: 'red',
|
||||
lineDash: [ 5,5],
|
||||
lineDash: [5, 5],
|
||||
width: 3
|
||||
}),
|
||||
geometry:(feature) =>feature.getGeometry()
|
||||
geometry: (feature) => feature.getGeometry()
|
||||
})));
|
||||
}
|
||||
|
||||
round(value:number,decimals:number):number {
|
||||
round(value: number, decimals: number): number {
|
||||
const d = Math.pow(10, decimals);
|
||||
return Math.round((value + Number.EPSILON)*d)/d;
|
||||
return Math.round((value + Number.EPSILON) * d) / d;
|
||||
}
|
||||
|
||||
getMapStateFromUrl(params:ParamMap):IMapState {
|
||||
getMapStateFromUrl(params: ParamMap): IMapState {
|
||||
const hasUrlmapState = params.has("xCenter") && params.has("yCenter");
|
||||
if (hasUrlmapState) {
|
||||
const xCenter = parseFloat(params.get("xCenter"));
|
||||
const yCenter = parseFloat(params.get("yCenter"));
|
||||
const zoom = parseFloat(params.get("zoom"));
|
||||
const rotation = parseFloat(params.get("rotation"));
|
||||
const baseLayer = params.get("baseLayer")?params.get("baseLayer"):"";
|
||||
const newMapState = {zoom: zoom, rotation: rotation, xCenter: xCenter, yCenter: yCenter, baseLayerCode: baseLayer };
|
||||
const baseLayer = params.get("baseLayer") ? params.get("baseLayer") : "";
|
||||
const newMapState = { zoom: zoom, rotation: rotation, xCenter: xCenter, yCenter: yCenter, baseLayerCode: baseLayer };
|
||||
return newMapState;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
normalizeMapState(mapState:IMapState):IMapState {
|
||||
if(!mapState) return null;
|
||||
return {zoom: this.round(mapState.zoom,0),
|
||||
rotation: this.round(mapState.rotation,2),
|
||||
xCenter: this.round(mapState.xCenter,5),
|
||||
yCenter: this.round(mapState.yCenter,5),
|
||||
baseLayerCode: mapState.baseLayerCode };
|
||||
normalizeMapState(mapState: IMapState): IMapState {
|
||||
if (!mapState) return null;
|
||||
return {
|
||||
zoom: this.round(mapState.zoom, 0),
|
||||
rotation: this.round(mapState.rotation, 2),
|
||||
xCenter: this.round(mapState.xCenter, 5),
|
||||
yCenter: this.round(mapState.yCenter, 5),
|
||||
baseLayerCode: mapState.baseLayerCode
|
||||
};
|
||||
}
|
||||
|
||||
serializeMapState(mapState:IMapState):string {
|
||||
serializeMapState(mapState: IMapState): string {
|
||||
return JSON.stringify(this.normalizeMapState(mapState));
|
||||
}
|
||||
|
||||
getQueryStateFromUrl(params:ParamMap):IQueryState {
|
||||
getQueryStateFromUrl(params: ParamMap): IQueryState {
|
||||
if (params.has("queryState")) {
|
||||
const queryState = params.get("queryState");
|
||||
let newQueryState = tassign(mapReducers.initialQueryState);
|
||||
@@ -314,66 +328,66 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
|
||||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
console.debug("View init");
|
||||
this.noContent=true;
|
||||
//console.debug("View init");
|
||||
this.noContent = true;
|
||||
this.route.children.forEach((entry) => {
|
||||
if(entry.outlet=="primary") {
|
||||
this.noContent=false;
|
||||
if (entry.outlet == "primary") {
|
||||
this.noContent = false;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
this.initCustomStyles();
|
||||
|
||||
// url to state
|
||||
|
||||
const urlMapState = this.getMapStateFromUrl(this.route.snapshot.paramMap);
|
||||
const urlQueryState = this.getQueryStateFromUrl(this.route.snapshot.paramMap);
|
||||
if(urlQueryState && urlMapState && this.noContent) {
|
||||
this.store.dispatch(new mapActions.SetState(urlMapState,urlQueryState));
|
||||
window.localStorage.setItem("FarmMapsCommonMap_mapState",this.serializeMapState(urlMapState));
|
||||
} else if(urlQueryState && this.noContent) {
|
||||
this.store.dispatch(new mapActions.SetQueryState(urlQueryState));
|
||||
} else {
|
||||
this.store.dispatch(new mapActions.SetReplaceUrl(true));
|
||||
}
|
||||
const urlMapState = this.getMapStateFromUrl(this.route.snapshot.paramMap);
|
||||
const urlQueryState = this.getQueryStateFromUrl(this.route.snapshot.paramMap);
|
||||
if (urlQueryState && urlMapState && this.noContent) {
|
||||
this.store.dispatch(new mapActions.SetState(urlMapState, urlQueryState));
|
||||
window.localStorage.setItem("FarmMapsCommonMap_mapState", this.serializeMapState(urlMapState));
|
||||
} else if (urlQueryState && this.noContent) {
|
||||
this.store.dispatch(new mapActions.SetQueryState(urlQueryState));
|
||||
} else {
|
||||
this.store.dispatch(new mapActions.SetReplaceUrl(true));
|
||||
}
|
||||
|
||||
this.paramSub = this.route.paramMap.pipe(withLatestFrom(this.state$),switchMap(([params,state]) => {
|
||||
if(this.initialized && this.noContent) {
|
||||
const urlQueryState = this.getQueryStateFromUrl(params);
|
||||
if( this.serializeService.serialize(state.queryState) != this.serializeService.serialize(urlQueryState)) {
|
||||
return of(new mapActions.SetState(state.mapState,urlQueryState));
|
||||
}
|
||||
}
|
||||
return EMPTY;
|
||||
})).subscribe((action) => {
|
||||
if(action) {
|
||||
this.zone.run(() => {
|
||||
console.debug("Url to state");
|
||||
this.store.dispatch(action);
|
||||
});
|
||||
this.paramSub = this.route.paramMap.pipe(withLatestFrom(this.state$), switchMap(([params, state]) => {
|
||||
if (this.initialized && this.noContent) {
|
||||
const urlQueryState = this.getQueryStateFromUrl(params);
|
||||
if (this.serializeService.serialize(state.queryState) != this.serializeService.serialize(urlQueryState)) {
|
||||
return of(new mapActions.SetState(state.mapState, urlQueryState));
|
||||
}
|
||||
});
|
||||
}
|
||||
return EMPTY;
|
||||
})).subscribe((action) => {
|
||||
if (action) {
|
||||
this.zone.run(() => {
|
||||
//console.debug("Url to state");
|
||||
this.store.dispatch(action);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// state to url
|
||||
|
||||
this.stateSub = this.state$.pipe(switchMap((state) => {
|
||||
const newUrl = this.serializeMapState(state.mapState) + "_" + this.serializeService.serialize(state.queryState);
|
||||
if(this.lastUrl!=newUrl) {
|
||||
this.lastUrl=newUrl;
|
||||
if (this.lastUrl != newUrl) {
|
||||
this.lastUrl = newUrl;
|
||||
return of(state);
|
||||
}
|
||||
else {
|
||||
return of(null);
|
||||
}
|
||||
})).subscribe((newUrlState) =>{
|
||||
if(newUrlState) {
|
||||
console.debug(`State to url`);
|
||||
this.replaceUrl(newUrlState.mapState,newUrlState.queryState,newUrlState.replaceUrl);
|
||||
}
|
||||
});
|
||||
this.initialized = true;
|
||||
})).subscribe((newUrlState: any) => {
|
||||
if (newUrlState) {
|
||||
//console.debug(`State to url`);
|
||||
this.replaceUrl(newUrlState.mapState, newUrlState.queryState, newUrlState.replaceUrl);
|
||||
}
|
||||
});
|
||||
this.initialized = true;
|
||||
this.showDataLayerSlide$.subscribe((v) => {
|
||||
this.dataLayerSlideEnabled=v;
|
||||
this.dataLayerSlideEnabled = v;
|
||||
this.map.instance.render();
|
||||
});
|
||||
this.store.select(mapReducers.selectGetViewEnabled).subscribe((v) => {
|
||||
@@ -393,7 +407,7 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
|
||||
this.store.dispatch(new commonActions.ToggleMenu());
|
||||
}
|
||||
|
||||
handleToggleBaseLayers(event:MouseEvent) {
|
||||
handleToggleBaseLayers(event: MouseEvent) {
|
||||
this.baseLayersCollapsed = !this.baseLayersCollapsed;
|
||||
event.preventDefault();
|
||||
}
|
||||
@@ -410,31 +424,31 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
|
||||
}
|
||||
|
||||
replaceUrl(mapState: IMapState, queryState: IQueryState, replace = true) {
|
||||
if(this.noContent) {
|
||||
const newMapState = this.serializeMapState(mapState);
|
||||
const newQueryState = this.serializeService.serialize(queryState);
|
||||
const currentMapState = this.serializeMapState(this.getMapStateFromUrl(this.route.snapshot.paramMap));
|
||||
const urlQueryState = this.getQueryStateFromUrl(this.route.snapshot.paramMap);
|
||||
const currentQueryState = urlQueryState==null?"":this.serializeService.serialize(urlQueryState);
|
||||
if(mapState.baseLayerCode!="" && ((newMapState!= currentMapState) || (newQueryState!=currentQueryState))) {
|
||||
const parts =["."];
|
||||
parts.push(mapState.xCenter.toFixed(5));
|
||||
parts.push(mapState.yCenter.toFixed(5));
|
||||
parts.push( mapState.zoom.toFixed(0));
|
||||
parts.push( mapState.rotation.toFixed(2));
|
||||
parts.push(mapState.baseLayerCode);
|
||||
parts.push( this.serializeService.serialize(queryState));
|
||||
|
||||
console.debug("Replace url",parts);
|
||||
this.router.navigate(parts, { replaceUrl: replace,relativeTo:this.route.parent });
|
||||
}
|
||||
}
|
||||
if (this.noContent) {
|
||||
const newMapState = this.serializeMapState(mapState);
|
||||
const newQueryState = this.serializeService.serialize(queryState);
|
||||
const currentMapState = this.serializeMapState(this.getMapStateFromUrl(this.route.snapshot.paramMap));
|
||||
const urlQueryState = this.getQueryStateFromUrl(this.route.snapshot.paramMap);
|
||||
const currentQueryState = urlQueryState == null ? "" : this.serializeService.serialize(urlQueryState);
|
||||
if (mapState.baseLayerCode != "" && ((newMapState != currentMapState) || (newQueryState != currentQueryState))) {
|
||||
const parts = ["."];
|
||||
parts.push(mapState.xCenter.toFixed(5));
|
||||
parts.push(mapState.yCenter.toFixed(5));
|
||||
parts.push(mapState.zoom.toFixed(0));
|
||||
parts.push(mapState.rotation.toFixed(2));
|
||||
parts.push(mapState.baseLayerCode);
|
||||
parts.push(this.serializeService.serialize(queryState));
|
||||
|
||||
//console.debug("Replace url",parts);
|
||||
this.router.navigate(parts, { replaceUrl: replace, relativeTo: this.route.parent });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
handleOnMoveEnd(event) {
|
||||
if(this.initialized && this.viewEnabled) {
|
||||
this.zone.run(() =>{
|
||||
console.debug("Move end");
|
||||
handleOnMoveEnd(event) {
|
||||
if (this.initialized && this.viewEnabled) {
|
||||
this.zone.run(() => {
|
||||
//console.debug("Move end");
|
||||
const map = event.map;
|
||||
const view = map.getView();
|
||||
const rotation = view.getRotation();
|
||||
@@ -443,7 +457,7 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
|
||||
const viewExtent = view.calculateExtent(this.map.instance.getSize());
|
||||
const mapState: IMapState = { xCenter: center[0], yCenter: center[1], zoom: zoom, rotation: rotation, baseLayerCode: null };
|
||||
const state = { mapState: mapState, viewExtent: viewExtent };
|
||||
console.debug("Center: ",center[0],center[1] );
|
||||
//console.debug("Center: ",center[0],center[1] );
|
||||
const source = from([state]);
|
||||
source.pipe(withLatestFrom(this.selectedBaseLayer$)).subscribe(([state, baselayer]) => {
|
||||
if (mapState && baselayer) { // do not react on first move
|
||||
@@ -453,21 +467,23 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
handleOnMouseDown(event: MouseEvent) {
|
||||
event.stopPropagation();
|
||||
this.zone.run(() =>{
|
||||
this.zone.run(() => {
|
||||
this.store.dispatch(new commonActions.CloseAll());
|
||||
});
|
||||
}
|
||||
|
||||
handleShowLayerValues(event: MouseEvent) {
|
||||
event.stopPropagation();
|
||||
this.zone.run(() =>{
|
||||
this.store.dispatch(new mapActions.ToggleLayerValuesEnabled());
|
||||
});
|
||||
if (!this.hideShowLayerValues) {
|
||||
event.stopPropagation();
|
||||
this.zone.run(() => {
|
||||
this.store.dispatch(new mapActions.ToggleLayerValuesEnabled());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
handleOnDownload(event) {
|
||||
@@ -483,15 +499,15 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
|
||||
}
|
||||
|
||||
handleOnToggleVisibility(itemLayer: IItemLayer) {
|
||||
this.store.dispatch(new mapActions.SetVisibility(itemLayer,!itemLayer.visible));
|
||||
this.store.dispatch(new mapActions.SetVisibility(itemLayer, !itemLayer.visible));
|
||||
}
|
||||
|
||||
handleOnSetOpacity(event:{ layer: IItemLayer,opacity:number }) {
|
||||
handleOnSetOpacity(event: { layer: IItemLayer, opacity: number }) {
|
||||
this.store.dispatch(new mapActions.SetOpacity(event.layer, event.opacity));
|
||||
}
|
||||
|
||||
handleZoomToExtent(itemLayer: IItemLayer) {
|
||||
const extent = createEmpty();
|
||||
const extent = createEmpty();
|
||||
extend(extent, itemLayer.layer.getExtent());
|
||||
if (extent) {
|
||||
this.store.dispatch(new mapActions.SetExtent(extent));
|
||||
@@ -506,21 +522,21 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
|
||||
this.store.dispatch(new mapActions.SelectOverlayLayer(itemLayer));
|
||||
}
|
||||
|
||||
handlePeriodChange(period:IPeriodState) {
|
||||
handlePeriodChange(period: IPeriodState) {
|
||||
this.store.dispatch(new mapActions.SetPeriod(period));
|
||||
}
|
||||
|
||||
handleCitySearch(location:string) {
|
||||
handleCitySearch(location: string) {
|
||||
this.geolocaterService.geocode(location).subscribe(locations => {
|
||||
if( locations.length > 0) {
|
||||
const point = new Point([locations[0].coordinates.lon,locations[0].coordinates.lat]);
|
||||
if (locations.length > 0) {
|
||||
const point = new Point([locations[0].coordinates.lon, locations[0].coordinates.lat]);
|
||||
point.transform('EPSG:4326', 'EPSG:3857');
|
||||
const circle = new Circle(point.getCoordinates(),5000);//
|
||||
const circle = new Circle(point.getCoordinates(), 5000);//
|
||||
const extent = createEmpty();
|
||||
extend(extent, circle.getExtent());
|
||||
this.store.dispatch(new mapActions.SetExtent(extent))
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
|
||||
@@ -9,9 +9,10 @@ export interface IMetaData {
|
||||
attributes: any
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'fm-map-meta-data-modal',
|
||||
templateUrl: 'meta-data-modal.component.html'
|
||||
@Component({
|
||||
selector: 'fm-map-meta-data-modal',
|
||||
templateUrl: 'meta-data-modal.component.html',
|
||||
standalone: false
|
||||
})
|
||||
export class MetaDataModalComponent {
|
||||
|
||||
|
||||
@@ -15,10 +15,11 @@ const after = (one: NgbDateStruct, two: NgbDateStruct) =>
|
||||
!one || !two ? false : one.year === two.year ? one.month === two.month ? one.day === two.day
|
||||
? false : one.day > two.day : one.month > two.month : one.year > two.year;
|
||||
|
||||
@Component({
|
||||
selector: 'fm-map-select-period-modal',
|
||||
templateUrl: 'select-period-modal.component.html',
|
||||
styleUrls: ['select-period-modal.component.scss']
|
||||
@Component({
|
||||
selector: 'fm-map-select-period-modal',
|
||||
templateUrl: 'select-period-modal.component.html',
|
||||
styleUrls: ['select-period-modal.component.scss'],
|
||||
standalone: false
|
||||
})
|
||||
export class SelectPeriodModalComponent {
|
||||
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
@import "~bootstrap/scss/bootstrap.scss";
|
||||
|
||||
|
||||
|
||||
.row {
|
||||
border-bottom: 1px solid $gray-500;
|
||||
border-bottom: 1px solid var(--bs-gray-500);
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.row:hover {
|
||||
background-color: $gray-100;
|
||||
background-color: var(--bs-gray-100);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,10 +5,11 @@ import { WidgetHostDirective } from '../widget-host/widget-host.directive';
|
||||
import { IItemLayer } from '../../models/item.layer';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'fm-map-selected-item-container',
|
||||
templateUrl: './selected-item-container.component.html',
|
||||
styleUrls: ['./selected-item-container.component.scss']
|
||||
@Component({
|
||||
selector: 'fm-map-selected-item-container',
|
||||
templateUrl: './selected-item-container.component.html',
|
||||
styleUrls: ['./selected-item-container.component.scss'],
|
||||
standalone: false
|
||||
})
|
||||
export class SelectedItemContainerComponent {
|
||||
|
||||
|
||||
@@ -1,19 +1,23 @@
|
||||
<div class="spacer"></div>
|
||||
<div *ngIf="item;let item">
|
||||
<div class="card border-0">
|
||||
<div class="card-body">
|
||||
<fm-back-button></fm-back-button>
|
||||
<div class="card menu-card">
|
||||
<h1>Cropfield</h1>
|
||||
<h4>{{item.name}}</h4>
|
||||
<div class="card-text"><span>{{areaInHa(item)| number:'1.2-2'}} ha</span> <span>{{item.data.cropTypeName}}</span></div>
|
||||
<div class="card-text"><span>{{item.data.startDate|date}}</span> - <span>{{item.data.endDate|date}}</span> </div>
|
||||
<ul class="p-0 mt-2">
|
||||
<li *ngIf="item.isEditable"><a href="#" (click)="handleOnEdit(item)"><i class="fal fa-pencil" aria-hidden="true" i18n-title title="Edit"></i> <span i18n>Edit</span></a></li>
|
||||
</ul>
|
||||
@if (item; as item) {
|
||||
<div>
|
||||
<div class="card border-0">
|
||||
<div class="card-body">
|
||||
<fm-back-button></fm-back-button>
|
||||
<div class="card menu-card">
|
||||
<h1>Cropfield</h1>
|
||||
<h4>{{item.name}}</h4>
|
||||
<div class="card-text"><span>{{areaInHa(item)| number:'1.2-2'}} ha</span> <span>{{item.data.cropTypeName}}</span></div>
|
||||
<div class="card-text"><span>{{item.data.startDate|date}}</span> - <span>{{item.data.endDate|date}}</span> </div>
|
||||
<ul class="p-0 mt-2">
|
||||
@if (item.isEditable) {
|
||||
<li><a href="#" (click)="handleOnEdit(item)"><i class="fal fa-pencil" aria-hidden="true" i18n-title title="Edit"></i> <span i18n>Edit</span></a></li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<fm-map-item-list [items]="(items|async)"></fm-map-item-list>
|
||||
<fm-map-item-widget-list [item]="item"></fm-map-item-widget-list>
|
||||
</div>
|
||||
<fm-map-item-list [items]="(items|async)"></fm-map-item-list>
|
||||
<fm-map-item-widget-list [item]="item"></fm-map-item-widget-list>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
@import "~bootstrap/scss/bootstrap.scss";
|
||||
|
||||
.big-icon {
|
||||
width: 100%;
|
||||
color: white;
|
||||
|
||||
@@ -15,17 +15,18 @@ import { withLatestFrom,switchMap,combineLatest } from 'rxjs/operators';
|
||||
|
||||
@ForItemType("vnd.farmmaps.itemtype.cropfield")
|
||||
@Injectable()
|
||||
@Component({
|
||||
selector: 'fm-map-selected-item-cropfield',
|
||||
templateUrl: './selected-item-cropfield.component.html',
|
||||
styleUrls: ['./selected-item-cropfield.component.scss']
|
||||
@Component({
|
||||
selector: 'fm-map-selected-item-cropfield',
|
||||
templateUrl: './selected-item-cropfield.component.html',
|
||||
styleUrls: ['./selected-item-cropfield.component.scss'],
|
||||
standalone: false
|
||||
})
|
||||
export class SelectedItemCropfieldComponent extends AbstractSelectedItemComponent implements OnInit{
|
||||
|
||||
public items: Observable<IListItem[]>;
|
||||
|
||||
constructor(store: Store<mapReducers.State | commonReducers.State>, itemTypeService: ItemTypeService, location: Location, router: Router, private itemService$: ItemService,private folderService$: FolderService) {
|
||||
super(store, itemTypeService,location,router);
|
||||
super(store, itemTypeService, itemService$, location,router);
|
||||
}
|
||||
|
||||
areaInHa(item:IItem):number {
|
||||
|
||||
@@ -1,33 +1,51 @@
|
||||
<div class="spacer"></div>
|
||||
<div *ngIf="item;let item">
|
||||
<div class="card border-0">
|
||||
<div class="card-body">
|
||||
<fm-back-button></fm-back-button>
|
||||
<div class="card menu-card">
|
||||
<h2 *ngIf="parentOfItemType('vnd.farmmaps.itemtype.cropfield')">{{parentItem.name}}</h2>
|
||||
<h1>{{item.name}}</h1>
|
||||
</div>
|
||||
<div class="legend-container" *ngIf="item?.data.layers;let layers">
|
||||
<div class="card menu-card">
|
||||
<div *ngIf="layers.length>1">
|
||||
<select (change)="onLayerChanged($event.target.value)">
|
||||
<option *ngFor="let l of layers;" [value]="l.index" [selected]="itemLayer.layerIndex == l.index">{{l.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<fm-map-layer-legend [showTitle]="layers.length == 1"
|
||||
[layer]="layer(layers,itemLayer.layerIndex)" [histogramenabled]="true"></fm-map-layer-legend>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card menu-card">
|
||||
<ul class="p-0 mt-2">
|
||||
<li *ngIf="item.isEditable"><a href="#" class="ms-1 me-1" (click)="handleOnEdit(item)"><i class="fal fa-pencil" aria-hidden="true" i18n-title title="Edit"></i> <span i18n>Edit</span></a></li>
|
||||
<ng-container *ngIf="itemTypeService.isLayer(item)">
|
||||
<li *ngIf="!getItemLayer(item,itemLayer.layerIndex)"><a href="#" (click)="handleAddAsLayer(item,itemLayer.layerIndex)"><i class="fas fa-layer-plus" aria-hidden="true" i18n-title title="Add as layer"></i> <span i18n>Add as overlay</span></a></li>
|
||||
<li *ngIf="getItemLayer(item,itemLayer.layerIndex)"><a href="#" (click)="handleRemoveLayer(item,itemLayer.layerIndex)"><i class="fas fa-layer-minus" aria-hidden="true" i18n-title title="Remove overlay"></i> <span i18n>Remove overlay</span></a></li>
|
||||
</ng-container>
|
||||
</ul>
|
||||
</div>
|
||||
<fm-map-zoom-to-show-alert [layer]="itemLayer?.layer"></fm-map-zoom-to-show-alert>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="spacer"></div>
|
||||
@if (item; as item) {
|
||||
<div>
|
||||
<div class="card border-0">
|
||||
<div class="card-body">
|
||||
<fm-back-button></fm-back-button>
|
||||
<div class="card menu-card">
|
||||
@if (parentOfItemType('vnd.farmmaps.itemtype.cropfield')) {
|
||||
<h2>{{parentItem.name}}</h2>
|
||||
}
|
||||
<h1>{{item.name}}</h1>
|
||||
</div>
|
||||
@if (item?.data.layers; as layers) {
|
||||
<div class="legend-container">
|
||||
<div class="card menu-card">
|
||||
@if (layers.length>1) {
|
||||
<div>
|
||||
<select (change)="onLayerChanged($event.target.value)">
|
||||
@for (l of layers; track l.index) {
|
||||
<option [value]="l.index" [selected]="itemLayer.layerIndex == l.index">{{l.name}}</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
}
|
||||
<fm-map-layer-legend [showTitle]="layers.length == 1"
|
||||
[layer]="layer(layers,itemLayer.layerIndex)" [histogramenabled]="true"></fm-map-layer-legend>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card menu-card">
|
||||
<ul class="p-0 mt-2">
|
||||
@if (item.isEditable) {
|
||||
<li><a href="#" class="ms-1 me-1" (click)="handleOnEdit(item)"><i class="fal fa-pencil" aria-hidden="true" i18n-title title="Edit"></i> <span i18n>Edit</span></a></li>
|
||||
}
|
||||
@if (itemTypeService.isLayer(item)) {
|
||||
@if (!getItemLayer(item,itemLayer.layerIndex)) {
|
||||
<li><a href="#" (click)="handleAddAsLayer(item,itemLayer.layerIndex)"><i class="fas fa-layer-plus" aria-hidden="true" i18n-title title="Add as layer"></i> <span i18n>Add as overlay</span></a></li>
|
||||
}
|
||||
@if (getItemLayer(item,itemLayer.layerIndex)) {
|
||||
<li><a href="#" (click)="handleRemoveLayer(item,itemLayer.layerIndex)"><i class="fas fa-layer-minus" aria-hidden="true" i18n-title title="Remove overlay"></i> <span i18n>Remove overlay</span></a></li>
|
||||
}
|
||||
}
|
||||
<li><fm-item-link class="text-primary p-0" [itemCode]="item.code" pathSuffix="data" [showText]="true"></fm-item-link></li>
|
||||
<li><a href="#" (click)="download($event,item,layers,itemLayer.layerIndex)"><i class="fal fa-download" aria-hidden="true" i18n-title title="Download"></i> <span i18n>Download</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<fm-map-zoom-to-show-alert [layer]="itemLayer?.layer"></fm-map-zoom-to-show-alert>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
@import "~bootstrap/scss/bootstrap.scss";
|
||||
|
||||
.big-icon {
|
||||
width: 100%;
|
||||
color: white;
|
||||
|
||||
@@ -1,25 +1,32 @@
|
||||
import { Component, Injectable } from '@angular/core';
|
||||
import { Location } from '@angular/common';
|
||||
import { Store } from '@ngrx/store';
|
||||
import * as mapReducers from '../../reducers/map.reducer';
|
||||
import { commonReducers, ItemTypeService, ItemService, FolderService } from '@farmmaps/common';
|
||||
import { Component, Injectable, OnDestroy } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { commonReducers, FolderService, IItem, IItemLinkType, ItemService, ItemTypeService, IUrlType } from '@farmmaps/common';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { Subscription } from 'rxjs';
|
||||
import * as mapActions from '../../actions/map.actions';
|
||||
import * as mapReducers from '../../reducers/map.reducer';
|
||||
import { ForItemType } from '../for-item/for-itemtype.decorator';
|
||||
import { AbstractSelectedItemComponent } from '../selected-item/selected-item.component';
|
||||
import * as mapActions from '../../actions/map.actions';
|
||||
|
||||
|
||||
@ForItemType("vnd.farmmaps.itemtype.geotiff.processed")
|
||||
@Injectable()
|
||||
@Component({
|
||||
selector: 'fm-map-selected-item-geotiff',
|
||||
templateUrl: './selected-item-geotiff.component.html',
|
||||
styleUrls: ['./selected-item-geotiff.component.scss']
|
||||
@Component({
|
||||
selector: 'fm-map-selected-item-geotiff',
|
||||
templateUrl: './selected-item-geotiff.component.html',
|
||||
styleUrls: ['./selected-item-geotiff.component.scss'],
|
||||
standalone: false
|
||||
})
|
||||
export class SelectedItemGeotiffComponent extends AbstractSelectedItemComponent {
|
||||
export class SelectedItemGeotiffComponent extends AbstractSelectedItemComponent implements OnDestroy {
|
||||
sub: Subscription;
|
||||
|
||||
constructor(store: Store<mapReducers.State | commonReducers.State>, itemTypeService: ItemTypeService, location: Location, router: Router, private itemService$: ItemService,private folderService$: FolderService) {
|
||||
super(store, itemTypeService,location,router);
|
||||
constructor(store: Store<mapReducers.State | commonReducers.State>, public itemService: ItemService, itemTypeService: ItemTypeService, location: Location, router: Router, private itemService$: ItemService,private folderService$: FolderService) {
|
||||
super(store, itemTypeService,itemService,location,router);
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
if (this.sub) this.sub.unsubscribe();
|
||||
}
|
||||
|
||||
onLayerChanged(layerIndex: number) {
|
||||
@@ -29,4 +36,13 @@ export class SelectedItemGeotiffComponent extends AbstractSelectedItemComponent
|
||||
layer(layers:any,layerIndex:number) {
|
||||
return layers.find(l => l.index == layerIndex);
|
||||
}
|
||||
|
||||
download(event:MouseEvent,item:IItem,layers:any,layerIndex:number) {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
const itemLink : IItemLinkType = {itemcode:item.code,query:`layer=${this.layer(layers,layerIndex).name}`,pathsuffix:"download", validminutes:10}
|
||||
this.sub = this.itemService.getItemLink(itemLink).subscribe((itemLinkUrl:IUrlType) => {
|
||||
window.location.href = itemLinkUrl.url;
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,32 +1,49 @@
|
||||
<div class="spacer"></div>
|
||||
<div *ngIf="item;let item">
|
||||
<div class="card border-0">
|
||||
<div class="card-body">
|
||||
<fm-back-button></fm-back-button>
|
||||
<div class="card menu-card">
|
||||
<h2 *ngIf="parentOfItemType('vnd.farmmaps.itemtype.cropfield')">{{parentItem.name}}</h2>
|
||||
<h1>{{item.name}}</h1>
|
||||
</div>
|
||||
<div class="legend-container" *ngIf="item?.data.layers;let layers">
|
||||
@if (item; as item) {
|
||||
<div>
|
||||
<div class="card border-0">
|
||||
<div class="card-body">
|
||||
<fm-back-button></fm-back-button>
|
||||
<div class="card menu-card">
|
||||
<div *ngIf="layers.length>1">
|
||||
<select (change)="onLayerChanged($event.target.value)">
|
||||
<option *ngFor="let l of layers;" [value]="l.index" [selected]="itemLayer.layerIndex == l.index">{{l.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<fm-map-layer-legend [showTitle]="layers.length==1" [layer]="layer(layers,itemLayer.layerIndex)" [histogramenabled]="true"></fm-map-layer-legend>
|
||||
@if (parentOfItemType('vnd.farmmaps.itemtype.cropfield')) {
|
||||
<h2>{{parentItem.name}}</h2>
|
||||
}
|
||||
<h1>{{item.name}}</h1>
|
||||
</div>
|
||||
@if (item?.data.layers; as layers) {
|
||||
<div class="legend-container">
|
||||
<div class="card menu-card">
|
||||
@if (layers.length>1) {
|
||||
<div>
|
||||
<select (change)="onLayerChanged($event.target.value)">
|
||||
@for (l of layers; track l.index) {
|
||||
<option [value]="l.index" [selected]="itemLayer.layerIndex == l.index">{{l.name}}</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
}
|
||||
<fm-map-layer-legend [showTitle]="layers.length==1" [layer]="layer(layers,itemLayer.layerIndex)" [histogramenabled]="true"></fm-map-layer-legend>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card menu-card">
|
||||
<ul class="p-0 mt-2">
|
||||
@if (item.isEditable) {
|
||||
<li><a href="#" class="mt-1 me-1" (click)="handleOnEdit(item)" ><i class="fal fa-pencil" aria-hidden="true" i18n-title title="Edit"></i> <span i18n>Edit</span></a></li>
|
||||
}
|
||||
@if (itemTypeService.isLayer(item)) {
|
||||
@if (!getItemLayer(item,itemLayer.layerIndex)) {
|
||||
<li><a href="#" (click)="handleAddAsLayer(item,itemLayer.layerIndex)" ><i class="fas fa-layer-olus" aria-hidden="true" i18n-title title="Add as layer"></i> <span i18n>Add as overlay</span></a></li>
|
||||
}
|
||||
@if (getItemLayer(item,itemLayer.layerIndex)) {
|
||||
<li><a href="#" (click)="handleRemoveLayer(item,itemLayer.layerIndex)" ><i class="fas fa-layer-minus" aria-hidden="true" i18n-title title="Remove overlay"></i> <span i18n>Remove overlay</span></a></li>
|
||||
}
|
||||
}
|
||||
<li><a href="#" (click)="download($event,item,layers,itemLayer.layerIndex)"><i class="fal fa-download" aria-hidden="true" i18n-title title="Download"></i> <span i18n>Download</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
}
|
||||
<fm-map-zoom-to-show-alert [layer]="itemLayer?.layer"></fm-map-zoom-to-show-alert>
|
||||
</div>
|
||||
<div class="card menu-card">
|
||||
<ul class="p-0 mt-2">
|
||||
<li *ngIf="item.isEditable"><a href="#" class="mt-1 me-1" (click)="handleOnEdit(item)" ><i class="fal fa-pencil" aria-hidden="true" i18n-title title="Edit"></i> <span i18n>Edit</span></a></li>
|
||||
<ng-container *ngIf="itemTypeService.isLayer(item)">
|
||||
<li *ngIf="!getItemLayer(item,itemLayer.layerIndex)"><a href="#" (click)="handleAddAsLayer(item,itemLayer.layerIndex)" ><i class="fas fa-layer-olus" aria-hidden="true" i18n-title title="Add as layer"></i> <span i18n>Add as overlay</span></a></li>
|
||||
<li *ngIf="getItemLayer(item,itemLayer.layerIndex)"><a href="#" (click)="handleRemoveLayer(item,itemLayer.layerIndex)" ><i class="fas fa-layer-minus" aria-hidden="true" i18n-title title="Remove overlay"></i> <span i18n>Remove overlay</span></a></li>
|
||||
</ng-container>
|
||||
</ul>
|
||||
</div>
|
||||
<fm-map-zoom-to-show-alert [layer]="itemLayer?.layer"></fm-map-zoom-to-show-alert>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
@import "~bootstrap/scss/bootstrap.scss";
|
||||
|
||||
.big-icon {
|
||||
width: 100%;
|
||||
color: white;
|
||||
|
||||
@@ -1,30 +1,35 @@
|
||||
import { Component, Input, Injectable, OnInit } from '@angular/core';
|
||||
import { Location } from '@angular/common';
|
||||
import { Feature } from 'ol';
|
||||
import { Component, Injectable, OnDestroy } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { commonReducers, FolderService, IItem, IItemLinkType, ItemService, ItemTypeService, IUrlType } from '@farmmaps/common';
|
||||
import { Store } from '@ngrx/store';
|
||||
import * as mapReducers from '../../reducers/map.reducer';
|
||||
import { commonReducers, ItemTypeService, IItem, Item, ItemService, FolderService, IListItem} from '@farmmaps/common';
|
||||
import * as mapActions from '../../actions/map.actions';
|
||||
import { Router, ActivatedRoute, ParamMap, Event } from '@angular/router';
|
||||
import * as mapReducers from '../../reducers/map.reducer';
|
||||
import { ForItemType } from '../for-item/for-itemtype.decorator';
|
||||
import { AbstractSelectedItemComponent } from '../selected-item/selected-item.component';
|
||||
import { Observable } from 'rxjs';
|
||||
import { Subscription } from 'rxjs';
|
||||
|
||||
|
||||
@ForItemType("vnd.farmmaps.itemtype.shape.processed")
|
||||
@Injectable()
|
||||
@Component({
|
||||
selector: 'fm-map-selected-item-shape',
|
||||
templateUrl: './selected-item-shape.component.html',
|
||||
styleUrls: ['./selected-item-shape.component.scss']
|
||||
@Component({
|
||||
selector: 'fm-map-selected-item-shape',
|
||||
templateUrl: './selected-item-shape.component.html',
|
||||
styleUrls: ['./selected-item-shape.component.scss'],
|
||||
standalone: false
|
||||
})
|
||||
export class SelectedItemShapeComponent extends AbstractSelectedItemComponent {
|
||||
|
||||
constructor(store: Store<mapReducers.State | commonReducers.State>, itemTypeService: ItemTypeService, location: Location, router: Router, private itemService$: ItemService,private folderService$: FolderService) {
|
||||
super(store, itemTypeService,location,router);
|
||||
}
|
||||
export class SelectedItemShapeComponent extends AbstractSelectedItemComponent implements OnDestroy {
|
||||
public selectedLayer = 0;
|
||||
|
||||
sub: Subscription;
|
||||
|
||||
constructor(store: Store<mapReducers.State | commonReducers.State>, public itemService: ItemService, itemTypeService: ItemTypeService, location: Location, router: Router, private itemService$: ItemService,private folderService$: FolderService) {
|
||||
super(store, itemTypeService,itemService,location,router);
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
if (this.sub) this.sub.unsubscribe();
|
||||
}
|
||||
|
||||
onLayerChanged(layerIndex: number) {
|
||||
this.store.dispatch(new mapActions.SetLayerIndex(layerIndex));
|
||||
}
|
||||
@@ -32,4 +37,13 @@ export class SelectedItemShapeComponent extends AbstractSelectedItemComponent {
|
||||
layer(layers:any,layerIndex:number) {
|
||||
return layers.find(l => l.index == layerIndex);
|
||||
}
|
||||
|
||||
download(event:MouseEvent,item:IItem,layers:any,layerIndex:number) {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
const itemLink : IItemLinkType = {itemcode:item.code,query:`layer=${this.layer(layers,layerIndex).name}`,pathsuffix:"download", validminutes:10}
|
||||
this.sub = this.itemService.getItemLink(itemLink).subscribe((itemLinkUrl:IUrlType) => {
|
||||
window.location.href = itemLinkUrl.url;
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,49 +1,70 @@
|
||||
<div class="spacer"></div>
|
||||
<div *ngIf="selectedItem();let item">
|
||||
<div class="card border-0">
|
||||
<div class="card-body">
|
||||
<fm-back-button></fm-back-button>
|
||||
<div class="card menu-card">
|
||||
<h2 *ngIf="parentOfItemType('vnd.farmmaps.itemtype.cropfield')">{{parentItem.name}}</h2>
|
||||
<h1>{{item.name}}</h1>
|
||||
</div>
|
||||
<div class="legend-container" *ngIf="item?.data.layers;let layers">
|
||||
<div class="card menu-card">
|
||||
<h5><span i18n>Date</span>: {{temporalService.selectedDate(itemLayer)}}</h5>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<button *ngIf="temporalService.hasPrevious(itemLayer)" type="button" class="btn btn-link p-0" (click)="handlePreviousTemporal($event)">
|
||||
<i class="fal fa-arrow-circle-left" aria-hidden="true" i18n-title title="Previous"></i> {{ temporalService.previousDate(itemLayer) }}
|
||||
</button>
|
||||
</div>
|
||||
<div>
|
||||
<button *ngIf="temporalService.hasNext(itemLayer)" type="button" class="btn btn-link p-0" (click)="handleNextTemporal($event)">
|
||||
{{ temporalService.nextDate(itemLayer)}} <i class="fal fa-arrow-circle-right" aria-hidden="true" i18n-title title="Next"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<fm-map-zoom-to-show-alert [layer]="currentItemLayer()?.layer"></fm-map-zoom-to-show-alert>
|
||||
</div>
|
||||
<div class="card menu-card pt-2">
|
||||
<div *ngIf="layers.length>1">
|
||||
<select (change)="onLayerChanged($event.target.value)">
|
||||
<option *ngFor="let l of layers;" [value]="l.index" [selected]="itemLayer.layerIndex == l.index">{{l.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<fm-map-layer-legend [showTitle]="layers.length == 1"
|
||||
[layer]="layer(layers,itemLayer.layerIndex)" [histogramenabled]="true"></fm-map-layer-legend>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card menu-card">
|
||||
<ul class="p-0 mt-2">
|
||||
<li *ngIf="item.isEditable"><a href="#" class="mt-1 me-1" (click)="handleOnEdit(item)"><i class="fal fa-pencil" aria-hidden="true" i18n-title title="Edit"></i> <span i18n>Edit</span></a></li>
|
||||
<ng-container *ngIf="itemTypeService.isLayer(item)">
|
||||
<li *ngIf="!getItemLayer(item,itemLayer.layerIndex)"><a href="#" (click)="handleAddAsLayer(item,itemLayer.layerIndex)"><i class="fas fa-layer-plus" aria-hidden="true" i18n-title title="Add as layer"></i> <span i18n>Add as overlay</span></a></li>
|
||||
<li *ngIf="getItemLayer(item,itemLayer.layerIndex)"><a href="#" (click)="handleRemoveLayer(item,itemLayer.layerIndex)"><i class="fas fa-layer-minus" aria-hidden="true" i18n-title title="Remove overlay"></i> <span i18n>Remove overlay</span></a></li>
|
||||
</ng-container>
|
||||
<li><a href="#" (click)="handleGoToChart(item)"><i class="fal fa-line-chart" aria-hidden="true" i18m-title title="Show chart"></i> <span i18n>Show chart</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="spacer"></div>
|
||||
@if (selectedItem(); as item) {
|
||||
<div>
|
||||
<div class="card border-0">
|
||||
<div class="card-body">
|
||||
<fm-back-button></fm-back-button>
|
||||
<div class="card menu-card">
|
||||
@if (parentOfItemType('vnd.farmmaps.itemtype.cropfield')) {
|
||||
<h2>{{parentItem.name}}</h2>
|
||||
}
|
||||
<h1>{{item.name}}</h1>
|
||||
</div>
|
||||
@if (item?.data.layers; as layers) {
|
||||
<div class="legend-container">
|
||||
<div class="card menu-card">
|
||||
<h5><span i18n>Date</span>: {{temporalService.selectedDate(itemLayer)}}</h5>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div>
|
||||
@if (temporalService.hasPrevious(itemLayer)) {
|
||||
<button type="button" class="btn btn-link p-0" (click)="handlePreviousTemporal($event)">
|
||||
<i class="fal fa-arrow-circle-left" aria-hidden="true" i18n-title title="Previous"></i> {{ temporalService.previousDate(itemLayer) }}
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
<div>
|
||||
@if (temporalService.hasNext(itemLayer)) {
|
||||
<button type="button" class="btn btn-link p-0" (click)="handleNextTemporal($event)">
|
||||
{{ temporalService.nextDate(itemLayer)}} <i class="fal fa-arrow-circle-right" aria-hidden="true" i18n-title title="Next"></i>
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<fm-map-zoom-to-show-alert [layer]="currentItemLayer()?.layer"></fm-map-zoom-to-show-alert>
|
||||
</div>
|
||||
<div class="card menu-card pt-2">
|
||||
@if (layers.length>1) {
|
||||
<div>
|
||||
<select (change)="onLayerChanged($event.target.value)">
|
||||
@for (l of layers; track l.index) {
|
||||
<option [value]="l.index" [selected]="itemLayer.layerIndex == l.index">{{l.name}}</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
}
|
||||
<fm-map-layer-legend [showTitle]="layers.length == 1"
|
||||
[layer]="layer(layers,itemLayer.layerIndex)" [histogramenabled]="true"></fm-map-layer-legend>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card menu-card">
|
||||
<ul class="p-0 mt-2">
|
||||
@if (item.isEditable) {
|
||||
<li><a href="#" class="mt-1 me-1" (click)="handleOnEdit(item)"><i class="fal fa-pencil" aria-hidden="true" i18n-title title="Edit"></i> <span i18n>Edit</span></a></li>
|
||||
}
|
||||
@if (itemTypeService.isLayer(item)) {
|
||||
@if (!getItemLayer(item,itemLayer.layerIndex)) {
|
||||
<li><a href="#" (click)="handleAddAsLayer(item,itemLayer.layerIndex)"><i class="fas fa-layer-plus" aria-hidden="true" i18n-title title="Add as layer"></i> <span i18n>Add as overlay</span></a></li>
|
||||
}
|
||||
@if (getItemLayer(item,itemLayer.layerIndex)) {
|
||||
<li><a href="#" (click)="handleRemoveLayer(item,itemLayer.layerIndex)"><i class="fas fa-layer-minus" aria-hidden="true" i18n-title title="Remove overlay"></i> <span i18n>Remove overlay</span></a></li>
|
||||
}
|
||||
}
|
||||
<li><a href="#" (click)="handleGoToChart(item)"><i class="fal fa-line-chart" aria-hidden="true" i18m-title title="Show chart"></i> <span i18n>Show chart</span></a></li>
|
||||
<li><a href="#" (click)="download($event,item,layers,itemLayer.layerIndex)"><i class="fal fa-download" aria-hidden="true" i18n-title title="Download"></i> <span i18n>Download</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
@import "~bootstrap/scss/bootstrap.scss";
|
||||
|
||||
.big-icon {
|
||||
width: 100%;
|
||||
color: white;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user