Compare commits

...

302 Commits

Author SHA1 Message Date
Francesco Mangiacrapa 52ea4f5130 reverted to v3.6.0 2024-04-30 11:20:02 +02:00
Francesco Mangiacrapa 66d1baa4ee just to rebuild v3.6.0-SNAPSHOT 2024-04-30 11:13:10 +02:00
Francesco Mangiacrapa 8a3c4437a0 just to rebuild the SNAPSHOT 2024-04-30 11:10:54 +02:00
Francesco Mangiacrapa 8cf6d178b1 geoportal-data-mapper range updated at [1.0.1-SNAPSHOT, 2.0.0-SNAPSHOT) 2023-09-14 16:41:58 +02:00
Francesco Mangiacrapa 0733a62801 removed -SNAPSHOT 2023-09-11 15:08:50 +02:00
Francesco Mangiacrapa dea11a7b95 Merge pull request 'feature_25598' (!17) from feature_25598 into master
Reviewed-on: #17
2023-09-11 15:06:52 +02:00
Francesco Mangiacrapa b3555f4d98 improved CSS 2023-09-11 11:21:02 +02:00
Francesco Mangiacrapa eb92bc685c added -SNAPSHOT 2023-09-11 10:55:34 +02:00
Francesco Mangiacrapa 3099a31e32 Showing basic statistics (i.e. "X project published") via
'countByPhase'method [#25598]
2023-09-11 10:48:34 +02:00
Francesco Mangiacrapa 5cef21b4f0 Update README 2023-09-06 17:15:42 +02:00
Francesco Mangiacrapa e94532f04f removed -SNAPSHOT to be released 2023-09-05 15:20:17 +02:00
Francesco Mangiacrapa b57091278e Merge pull request 'gui_optimization_25461' (!16) from gui_optimization_25461 into master
Reviewed-on: #16
2023-09-05 15:16:50 +02:00
Francesco Mangiacrapa 5cde386089 moved details-panel at z-index: 950. Required for screen < 900px in
width (e.g. tablet)
2023-09-04 11:16:40 +02:00
Francesco Mangiacrapa ba9c8aee78 Using the latest libraries version: gwt-ol.v8.4.1 (with
openlayers.v6.6.1) and gwt.v2.10
2023-08-31 17:21:15 +02:00
Francesco Mangiacrapa 8967184d3c Optimized the UI for screen size 1200x1200 2023-08-31 15:17:21 +02:00
Francesco Mangiacrapa 6338792427 UI optimized for less than 1600w screen resolution 2023-08-29 14:41:32 +02:00
Francesco Mangiacrapa 34f2ba4c7e Media with max-width 2048px the details-panel has width 530px 2023-07-31 12:37:31 +02:00
Francesco Mangiacrapa 6c5c584c0f bug fixing #25293 2023-07-31 12:15:06 +02:00
Francesco Mangiacrapa 4d87eaf5a2 Updated README 2023-07-25 11:36:59 +02:00
Francesco Mangiacrapa 1781488971 Update 'README.md' 2023-07-12 23:43:33 +02:00
Francesco Mangiacrapa a399dbb912 Updated README 2023-07-08 18:38:23 +02:00
Francesco Mangiacrapa dd056fdc9e Updated README 2023-07-08 18:37:50 +02:00
Francesco Mangiacrapa d0271d662c Updated README 2023-07-08 18:36:28 +02:00
Francesco Mangiacrapa d5f2bf9a67 Updated README 2023-07-08 18:35:59 +02:00
Francesco Mangiacrapa a6ac952994 removed -SNAPSHOT to be released 2023-06-15 11:57:14 +02:00
Francesco Mangiacrapa 7383b01aa9 Fixed an issue regarding the set Layer Style facility, #25066?#note-7.
Moved to -SNAPSHOT
2023-06-15 11:56:46 +02:00
Francesco Mangiacrapa 9d92b14378 removed -SNAPSHOT to be released 2023-06-09 13:55:13 +02:00
Francesco Mangiacrapa 23feb1a3c8 Setting initial layer opacity at 0.8 2023-06-09 13:54:45 +02:00
Francesco Mangiacrapa b7885b3b72 removed -SNAPSHOT to be released 2023-06-09 11:08:42 +02:00
Francesco Mangiacrapa 0093af4cdf Added -SNAPSHOT and maven-parent 1.2.0 2023-06-09 11:07:43 +02:00
Francesco Mangiacrapa 412878f323 Removed -SNAPSHOT to be released 2023-06-09 10:45:05 +02:00
Francesco Mangiacrapa bb33754558 Merge pull request 'task_25066' (!15) from task_25066 into master
Reviewed-on: #15
2023-06-09 10:37:45 +02:00
Francesco Mangiacrapa 3644685fe5 Improved search facility 2023-06-09 10:28:46 +02:00
Francesco Mangiacrapa 6361c1c0b9 #25074 cross-filtering completed 2023-06-08 17:03:42 +02:00
Francesco Mangiacrapa a7680ffb46 Added "Fit map to Extent" facility 2023-06-07 14:26:57 +02:00
Francesco Mangiacrapa 1002111ca8 Fixing label 2023-06-06 14:50:06 +02:00
Francesco Mangiacrapa f3e3ca5eb9 Updated label and css 2023-06-06 14:38:30 +02:00
Francesco Mangiacrapa e76448d10a Updated border radius 2023-06-06 12:04:25 +02:00
Francesco Mangiacrapa e73c3a0202 Improved CQL filtering. Now is working in combination with SEARCH and
CROSS_Filtering
2023-06-06 11:49:31 +02:00
Francesco Mangiacrapa a28d2433a0 Passing WFS requests from the servlet due to CORS issue, see
#25074?#note-7
2023-06-05 16:54:40 +02:00
Francesco Mangiacrapa 36bfcd2b9e Added WFS cross filtering results 2023-06-01 16:26:34 +02:00
Francesco Mangiacrapa dcca1afba1 fixed cross filtering select 2023-05-31 17:15:04 +02:00
Francesco Mangiacrapa 33d6dbc89f Applied CQL_Filter for cross filtering 2023-05-31 17:02:03 +02:00
Francesco Mangiacrapa 9d48e78fac in progress cross filtering 2023-05-26 17:49:59 +02:00
Francesco Mangiacrapa a208b37791 in progress cross-filtering 2023-05-26 14:45:47 +02:00
Francesco Mangiacrapa 16d9feffe0 Implement generic method to load grouped configured layers for Overlay
and Cross-Filtering facilities
2023-05-25 11:28:25 +02:00
Francesco Mangiacrapa d1ec08c70f added comments 2023-05-19 15:12:46 +02:00
Francesco Mangiacrapa b3dd9126b9 Fixing layer order 2023-05-19 14:59:55 +02:00
Francesco Mangiacrapa f86988f8c7 Improved Overlay Custom Layer Panel and CSS 2023-05-15 17:11:37 +02:00
Francesco Mangiacrapa 7dc1343f1b Supported the grouped custom layers [#25110] 2023-05-15 16:19:40 +02:00
Francesco Mangiacrapa 647ddfb2d8 Added constant 2023-05-12 11:12:39 +02:00
Francesco Mangiacrapa 16eb79cf32 Updated README 2023-05-12 10:45:44 +02:00
Francesco Mangiacrapa f104c100d8 removed -SNAPSHOT to be released 2023-05-11 15:55:46 +02:00
Francesco Mangiacrapa 2cdc97e70d Merge pull request 'task_24166' (!14) from task_24166 into master
Reviewed-on: #14
2023-05-11 15:53:48 +02:00
Francesco Mangiacrapa 18fe9c40ea Added -SNAPSHOT 2023-05-11 15:53:08 +02:00
Francesco Mangiacrapa c4e9ca93b6 removed -SNAPSHOT to be released 2023-05-11 15:16:28 +02:00
Francesco Mangiacrapa 293bfabfa8 Removed unused cache. Updated pom 2023-05-08 11:37:27 +02:00
Francesco Mangiacrapa d0be59234a Updated README. Fixed pom 2023-05-05 17:40:55 +02:00
Francesco Mangiacrapa 9d059ca4e9 Passed to the geoportal-data-mapper component [#24978] 2023-05-05 17:23:11 +02:00
Francesco Mangiacrapa 2d4bfbee38 Starting integration of the geoportal-data-mapper library 2023-04-13 11:46:17 +02:00
Francesco Mangiacrapa 031ba50a03 Upgraded maven-portal-bom version at 3.7.0 2023-04-04 14:56:37 +02:00
Francesco Mangiacrapa ad7de9f7dc removed -SNAPSHOT to be released 2023-03-30 16:36:19 +02:00
Francesco Mangiacrapa e09bb18614 Improved css 2023-03-30 16:21:49 +02:00
Francesco Mangiacrapa 60f4569518 updated css 2023-03-30 15:13:22 +02:00
Francesco Mangiacrapa 675f23d1ac updated css 2023-03-30 12:43:45 +02:00
Francesco Mangiacrapa 4a44835356 Just including new dependencies 2023-03-30 12:10:29 +02:00
Francesco Mangiacrapa 5ec86d1a8d removed -SNAPSHOT to be released 2023-02-20 15:39:04 +01:00
Francesco Mangiacrapa 9581d3ce73 fixing issues #24632 2023-02-20 15:22:51 +01:00
Francesco Mangiacrapa 2b6272dd60 Fixed fit to Extent on features loaded end 2023-02-07 15:25:53 +01:00
Francesco Mangiacrapa 003590f46e removed -SNAPSHOT to be released 2023-02-03 15:25:28 +01:00
Francesco Mangiacrapa f1fde26359 Merge pull request 'task_24532' (!13) from task_24532 into master
Reviewed-on: #13
2023-02-03 15:24:09 +01:00
Francesco Mangiacrapa 872caa7137 updated CHANGELOG 2023-02-03 15:23:33 +01:00
Francesco Mangiacrapa ff3a7461df Added warning message on broken link 2023-02-03 14:19:33 +01:00
Francesco Mangiacrapa 1a6c9b074d Set Highlight to Light yellow4 2023-02-03 12:28:26 +01:00
Francesco Mangiacrapa 88c986a478 Updated 2023-02-03 11:54:40 +01:00
Francesco Mangiacrapa 06d88b4033 #24432 Done 2023-02-03 11:53:37 +01:00
Francesco Mangiacrapa b5e6afb6ce Moved to red highlight 2023-01-31 15:59:32 +01:00
Francesco Mangiacrapa 657da72da6 Done #24506. Removed -SNAPSHOT to be released 2023-01-31 15:35:37 +01:00
Francesco Mangiacrapa 14bb068b2e Added images 2023-01-31 15:34:04 +01:00
Francesco Mangiacrapa d81ca374dc Merged with branch `locate_layer_geometry` 2023-01-31 15:24:45 +01:00
Francesco Mangiacrapa 5221d2a6b5 Displaying an Alert if an error occurs on adding a layer to Map (#24471) 2023-01-25 10:46:17 +01:00
Francesco Mangiacrapa 69e5216645 commented console.log. Added MaxLenght to CQL Filter 2023-01-24 10:23:37 +01:00
Francesco Mangiacrapa 0d4428e341 Made the code "more robust" (adding some try/catch and checking null
value)
2023-01-19 11:35:50 +01:00
Francesco Mangiacrapa 3c12d6a841 Fixing #24432 GWT serialization 2023-01-17 17:02:23 +01:00
Francesco Mangiacrapa 9a7edeada1 Added Comparable for sorting the UCD names 2023-01-16 14:08:23 +01:00
Francesco Mangiacrapa f9ea07ee00 Merge pull request 'Added Layer Style and Show Legend facilities' (!11) from layer_style_and_legend into master
Reviewed-on: #11
2023-01-16 11:37:58 +01:00
Francesco Mangiacrapa 5a5178c459 Added Layer Style and Show Legend facilities 2023-01-16 11:37:06 +01:00
Francesco Mangiacrapa 8d47db8e83 Fixing issue - files/images duplicated reading the section 2023-01-12 16:56:26 +01:00
Francesco Mangiacrapa dc439a2637 removed -SNAPSHOT to be released 2023-01-12 11:54:42 +01:00
Francesco Mangiacrapa f46fff44ba Merge pull request 'animated_map' (!10) from animated_map into master
Reviewed-on: #10
2023-01-12 11:40:23 +01:00
Francesco Mangiacrapa 268a5eb614 #24404, done 2023-01-12 11:00:09 +01:00
Francesco Mangiacrapa 047db1e848 Added access policy filtering on reading layers for project ID 2023-01-11 17:12:19 +01:00
Francesco Mangiacrapa acc6be29d8 #24390 workaround applied on checking the access policy 2023-01-11 12:21:32 +01:00
Francesco Mangiacrapa 5e45322051 On init - centering the map on the project without centroid feature 2023-01-10 14:36:37 +01:00
Francesco Mangiacrapa cef3b61800 Renamed "Go to Layers" to "Zoom to Layers" 2023-01-09 15:29:01 +01:00
Francesco Mangiacrapa cb99242958 Managing visibility of "Go to Layers" 2022-12-22 16:38:43 +01:00
Francesco Mangiacrapa 67b93db8af Improved UI experience adding several animations on interaction with the
map
2022-12-22 11:59:07 +01:00
Francesco Mangiacrapa 78e939c787 Updated the release date 2022-12-21 11:14:51 +01:00
Francesco Mangiacrapa 307c1245b8 Removed -SNAPSHOT to be RELEASED 2022-12-21 11:12:48 +01:00
Francesco Mangiacrapa c8ad962dfe improved behaviour on searching stage 2022-12-21 11:00:12 +01:00
Francesco Mangiacrapa 474832a663 Updated README 2022-12-15 17:51:02 +01:00
Francesco Mangiacrapa 7211ddaeaf bug fixing issue on displaying automatically the layers 2022-12-15 17:47:44 +01:00
Francesco Mangiacrapa 143e79388d Reduced the bounding box when resolving share link 2022-12-15 15:54:54 +01:00
Francesco Mangiacrapa b53fe20a6f Fix - reduced the bounding boxing when resolving a project by share link 2022-12-15 15:39:08 +01:00
Francesco Mangiacrapa b797a9fd8d #24300 Done. Improved the GUI of the search functionality when multiple
collections are available.
2022-12-14 15:46:20 +01:00
Francesco Mangiacrapa 78cc536f54 Bug fixing pagination on start index (but it is not used at the moment) 2022-11-29 15:46:43 +01:00
Francesco Mangiacrapa 491e9a258b moved two logs at DEBUG 2022-11-29 12:35:30 +01:00
Francesco Mangiacrapa b1a09b39e3 revisited the searching result phrase 2022-11-29 10:46:07 +01:00
Francesco Mangiacrapa 4b13d849a5 Added earth spinner with transparent background 2022-11-29 09:45:35 +01:00
Francesco Mangiacrapa 4b838b2263 commented Tests 2022-11-28 17:52:09 +01:00
Francesco Mangiacrapa 0233bf73ab Updated settings 2022-11-28 17:47:51 +01:00
Francesco Mangiacrapa c9ac22c74e Merge pull request 'update_facility' (!9) from update_facility into master
Reviewed-on: #9
2022-11-28 17:45:17 +01:00
Francesco Mangiacrapa 62c02216af copied from master 2022-11-28 17:44:54 +01:00
Francesco Mangiacrapa 9f8421b6df Updated 2022-11-28 17:40:23 +01:00
Francesco Mangiacrapa 5ebab16836 Moved one log to DEBUG 2022-11-28 15:44:58 +01:00
Francesco Mangiacrapa a55d771e6d Refactored title and short-title 2022-11-28 15:35:03 +01:00
Francesco Mangiacrapa 0b16d37c1b Refactored the GeoPortalDataViewerAppPortlet to GeoPortalDataViewerApp 2022-11-28 15:32:14 +01:00
Francesco Mangiacrapa 189dc36f75 #24195 Integrated the temporal query. Fixing CQL on WFS during searching
enabled
2022-11-28 15:20:21 +01:00
Francesco Mangiacrapa 0764d0770c Integrated temporal query for YEAR 2022-11-28 09:49:46 +01:00
Francesco Mangiacrapa 6b3ceadec5 Merge pull request 'update_facility' (!8) from update_facility into master
Reviewed-on: #8
2022-11-21 16:45:28 +01:00
Francesco Mangiacrapa c4ebdcf003 Synchronized the Timeline selected project with the showing popoup on
centroid
2022-11-21 15:16:36 +01:00
Francesco Mangiacrapa 2e2ecfa41d setTocContent visibility 2022-11-18 17:07:13 +01:00
Francesco Mangiacrapa 1f3b3c2be1 Improved GUI. Added Temporal Comparator 2022-11-18 16:50:01 +01:00
Francesco Mangiacrapa 20c4da197e Added Table Of Contents (TOC) and "Go to Top" 2022-11-18 11:06:47 +01:00
Francesco Mangiacrapa 1555018334 removed -SNAPSHOT to be released 2022-11-17 12:29:41 +01:00
Francesco Mangiacrapa 643562bc26 Merge pull request '#24136 Integrated the temporal dimension on the front-end side' (!7) from update_facility into master
Reviewed-on: #7
2022-11-17 12:02:31 +01:00
Francesco Mangiacrapa 67e975df6a update settings 2022-11-17 12:01:29 +01:00
Francesco Mangiacrapa 08529f2206 #24136 Integrated the temporal dimension on the front-end side 2022-11-16 16:42:12 +01:00
Francesco Mangiacrapa 88c6a831d4 removed unused code 2022-11-15 14:25:30 +01:00
Francesco Mangiacrapa 98e8c19be8 Updated description 2022-11-15 11:39:03 +01:00
Francesco Mangiacrapa f314fd74e6 updated settings 2022-11-15 11:33:23 +01:00
Francesco Mangiacrapa f63960aaf6 Improved layers already displayed 2022-11-15 10:08:02 +01:00
Francesco Mangiacrapa 0216e43423 revisited the "Geoportal-DataViewer-Configs" discovery. Removed unused
RPC
2022-11-14 17:01:28 +01:00
Francesco Mangiacrapa 942744cf05 Performed several improvements 2022-11-14 16:24:49 +01:00
Francesco Mangiacrapa 84fcc7dbb3 Added Application Notifier. Improved Modal Expand 2022-11-14 14:12:50 +01:00
Francesco Mangiacrapa 430d28ce03 Improved ImageGallery. LayerSectionViewer, ProjectViewer etc. 2022-11-11 16:30:20 +01:00
Francesco Mangiacrapa 6ab7c60643 Removed old model "Concessioni". Updated CHANGELOG 2022-11-09 15:25:00 +01:00
Francesco Mangiacrapa 6950ce8c2f Added code to opening the collection in input or all the collections 2022-11-09 14:35:37 +01:00
Francesco Mangiacrapa 59fcd5db9d improved css 2022-11-09 12:12:24 +01:00
Francesco Mangiacrapa 36db7c417f fixing ContextRequest 2022-11-09 12:09:39 +01:00
Francesco Mangiacrapa 0c481c63c2 fixed css 2022-11-09 12:00:49 +01:00
Francesco Mangiacrapa 8298b2f93e Removed old concessione. Added "Add layers to Map" facility 2022-11-09 11:42:44 +01:00
Francesco Mangiacrapa 62dc1bad6c Integrated with timeline config 2022-11-08 17:56:36 +01:00
Francesco Mangiacrapa fec3f26c0a Fixing timeline status 2022-11-08 14:50:48 +01:00
Francesco Mangiacrapa 7c646b3ead minor fixes 2022-11-08 13:55:52 +01:00
Francesco Mangiacrapa 42f52dfa50 fixed Tests 2022-11-08 12:15:11 +01:00
Francesco Mangiacrapa 79a040d0a3 added responsive CSS 2022-11-08 12:13:14 +01:00
Francesco Mangiacrapa 744aebcf2c #23955 timeline facility first release 2022-11-08 10:45:39 +01:00
Francesco Mangiacrapa b9f73817f8 in progress timeline 2022-11-07 17:58:06 +01:00
Francesco Mangiacrapa ed93c13434 in progress on timeline 2022-11-04 17:16:37 +01:00
Francesco Mangiacrapa a3b5045ef7 in progress on #24028 2022-11-03 17:03:15 +01:00
Francesco Mangiacrapa ed4f9bd204 Trying to integrate vis-timeline 2022-11-02 18:05:38 +01:00
Francesco Mangiacrapa 819032fb13 Remove collection from Map, implemented. 2022-10-27 17:40:04 +02:00
Francesco Mangiacrapa 941805a596 Fixing search facility 2022-10-27 16:18:54 +02:00
Francesco Mangiacrapa b3345a4b5f Integrated with spatialReference. Setting the IndexFlag according to
user logged-in or not
2022-10-27 15:09:07 +02:00
Francesco Mangiacrapa 56f3c29d6d added com.google.code.gson dependency 2022-10-26 09:20:25 +02:00
Francesco Mangiacrapa bd5a9d14e5 fixed tests 2022-10-25 17:04:05 +02:00
Francesco Mangiacrapa 4dff83b63f Fixing DD layers and Open Details popup 2022-10-25 17:01:24 +02:00
Francesco Mangiacrapa 05196b2294 Fixed WFS on layers 2022-10-25 14:53:56 +02:00
Francesco Mangiacrapa 0900cd46c5 in progress 2022-10-25 11:35:03 +02:00
Francesco Mangiacrapa 0a5cd91c55 Migrated the Search facility 2022-10-24 12:23:52 +02:00
Francesco Mangiacrapa 0fb238f0b4 In progress 2022-10-20 18:01:54 +02:00
Francesco Mangiacrapa 18d3548c09 in progress 2022-10-19 17:51:13 +02:00
Francesco Mangiacrapa 9b0d36f232 refactored 2022-10-18 17:32:12 +02:00
Francesco Mangiacrapa a3c10d1b18 Ported getLayersForId 2022-10-18 14:17:41 +02:00
Francesco Mangiacrapa 51a44a3e54 Created the ItemFieldsResponse 2022-10-17 16:52:22 +02:00
Francesco Mangiacrapa 6986aa493d Starting LayerSectionViewer 2022-10-14 17:19:40 +02:00
Francesco Mangiacrapa 4a17360a18 Deserialized List of sdi-layers 2022-10-14 15:31:32 +02:00
Francesco Mangiacrapa 079bf39843 removed package 2022-10-13 17:20:36 +02:00
Francesco Mangiacrapa 5b7ae7de86 refactoring 2022-10-13 17:19:53 +02:00
Francesco Mangiacrapa 5298fb95f7 fixing test 2022-10-13 16:54:38 +02:00
Francesco Mangiacrapa 1a7ecf78fc merged in part with the branch cms-projects-support 2022-10-13 16:53:33 +02:00
Francesco Mangiacrapa 8e51d51460 Added GcubeProfilesPerUCDIdCache and Updated SearchFacilityUI 2022-10-12 17:12:09 +02:00
Francesco Mangiacrapa 7647628716 Added Guava Cache for gcubeProfiles Per UCD_ID 2022-10-12 11:13:40 +02:00
Francesco Mangiacrapa aba4e0dca0 Rendering list of files 2022-10-11 16:10:46 +02:00
Francesco Mangiacrapa 6363c2ea5e Starting migration to UCD 2022-10-11 15:00:39 +02:00
Francesco Mangiacrapa 0065ff35f1 Added lombok v.1.18.4 REQUIRED FOR JDK_11 2022-09-28 13:54:53 +02:00
Francesco Mangiacrapa 81c65937ee Testing building on jenkins with JDK_11 2022-09-28 13:50:12 +02:00
Francesco Mangiacrapa 549086b448 removed -SNAPSHOT to be released 2022-09-06 15:18:27 +02:00
Francesco Mangiacrapa 70056e06b8 Merge pull request '#23819 Enhancement implemented' (!6) from feature_23819 into master
Reviewed-on: #6
2022-09-06 15:16:37 +02:00
Francesco Mangiacrapa bf5265bd63 #23819 Enhancement implemented 2022-09-06 14:53:19 +02:00
Francesco Mangiacrapa 3c64fd79f3 Removed -SNAPSHOT to be released 2022-08-29 15:32:40 +02:00
Francesco Mangiacrapa 815d73cd92 #23770 OpenLayers CDN URLs updated also in the .jsp 2022-08-29 15:14:01 +02:00
Francesco Mangiacrapa 0870eceb5e Updated OL CDN URLs, see #23770 2022-08-29 15:04:12 +02:00
Francesco Mangiacrapa 052aa44675 Removed -SNAPSHOT to be released. Moved to maven-portal-bom.3.6.4 2022-07-27 12:16:57 +02:00
Francesco Mangiacrapa cded2a5254 Used new maven range for geoportal-client 2022-07-27 11:08:23 +02:00
Francesco Mangiacrapa 15437a94a5 added a check on empty/null images 2022-07-26 16:52:29 +02:00
Francesco Mangiacrapa 42bf373251 #23689 Fixed the search facility is buggy when used from public access 2022-07-26 16:28:25 +02:00
Francesco Mangiacrapa 03702b7148 removed -SNAPSHOT to be released 2022-01-13 17:15:22 +01:00
Francesco Mangiacrapa dfbadcb502 Merge pull request 'feature_22518' (!5) from feature_22518 into master
Reviewed-on: #5
2022-01-13 17:09:10 +01:00
Francesco Mangiacrapa e819f34267 New icons added for layer (in)visible 2021-12-22 15:40:45 +01:00
Francesco Mangiacrapa 736264ddf1 removed comments 2021-12-22 12:24:03 +01:00
Francesco Mangiacrapa 5d59c9dcbc ported to GNADataViewerConfigProfile 2021-12-21 16:52:35 +01:00
Francesco Mangiacrapa 98349ac121 improved error message 2021-12-17 10:51:22 +01:00
Francesco Mangiacrapa d739fbee4d improved css 2021-12-17 10:50:13 +01:00
Francesco Mangiacrapa 99984fcd2c integrated with WhereClause. Updated icons 2021-12-15 15:44:31 +01:00
Francesco Mangiacrapa 342d40fdf9 Searching facility integrated with CQL filter 2021-12-14 15:26:09 +01:00
Francesco Mangiacrapa fb827a6913 fixed labels 2021-12-13 11:58:35 +01:00
Francesco Mangiacrapa 479ee9f7a7 Changed display name for item fields 2021-12-13 11:28:47 +01:00
Francesco Mangiacrapa 54e0d0de01 removing toLowerCase 2021-12-10 16:59:31 +01:00
Francesco Mangiacrapa 0e97a234ce #22518 Added the search facility 2021-12-10 16:19:33 +01:00
Francesco Mangiacrapa 5daa568c44 In progress #22518 2021-12-07 17:13:20 +01:00
Francesco Mangiacrapa 50ac34dddb Merge pull request 'task_22027' (!4) from task_22027 into master
Reviewed-on: #4
2021-12-07 09:50:57 +01:00
Francesco Mangiacrapa 987ae24ae6 improved css 2021-11-22 11:30:35 +01:00
Francesco Mangiacrapa 709270015b Added link "Open Project" in the pop-up of WFS feature 2021-11-22 10:25:09 +01:00
Francesco Mangiacrapa 74e21e9962 Added Application Loader 2021-11-19 15:02:48 +01:00
Francesco Mangiacrapa 846a303ff2 fixed css rules 2021-11-19 11:20:42 +01:00
Francesco Mangiacrapa bb64769b51 integrated Base Maps into GNABaseMaps Runtime Resource 2021-11-18 15:55:05 +01:00
Francesco Mangiacrapa bba75e70b8 improved css 2021-11-16 17:05:58 +01:00
Francesco Mangiacrapa bec8e3afc6 updated map icon and css 2021-11-16 14:49:59 +01:00
Francesco Mangiacrapa 4ae0c39983 Added new set of icons 2021-11-16 14:07:59 +01:00
Francesco Mangiacrapa 002d6d2301 MapBox Satellite integrated in the principal Map 2021-11-12 16:57:57 +01:00
Francesco Mangiacrapa 2846ba6e2f refactored 2021-11-12 14:54:54 +01:00
Francesco Mangiacrapa db9ff853bc Added Layer offset manager 2021-11-12 14:48:12 +01:00
Francesco Mangiacrapa 6197d40fae implemented Base Map layers switching 2021-11-12 12:37:15 +01:00
Francesco Mangiacrapa 143fed7c79 moved to gwt-ol3 v8.1.0-gwt2_9. Implementing Map credits (it is buggy in
the gwt-ol3)
2021-11-11 16:32:49 +01:00
Francesco Mangiacrapa c36754a7b3 replaced * with - 2021-11-10 15:01:11 +01:00
Francesco Mangiacrapa baf5777f72 removed -SNAPSHOT to be released 2021-11-10 14:38:00 +01:00
Francesco Mangiacrapa 05e271a162 cass class ".ol-popup img" updated 2021-11-10 14:29:45 +01:00
Francesco Mangiacrapa e8e60f6608 #22370 Use a max-height for preview image shown in the pop-up 2021-11-10 14:16:27 +01:00
Francesco Mangiacrapa 17099e9a8f details-panel z-index moved to 100 2021-10-22 11:32:49 +02:00
Francesco Mangiacrapa 8f6a140481 only setting maxHeight of OverlayPanel relative to mapPanel height 2021-10-18 17:35:00 +02:00
Francesco Mangiacrapa 24eb503821 only changed the window title 2021-10-18 10:11:21 +02:00
Francesco Mangiacrapa 2030798e1c bug fixed the Layer Switcher #22170#note-10 and improved pop-up 2021-10-15 17:51:09 +02:00
Francesco Mangiacrapa dba98bfd0f merged manually with branch 'layer_switcher' #21991 2021-10-14 11:34:04 +02:00
Francesco Mangiacrapa 834f48431d removed -SNAPSHOT to be released 2021-10-08 15:19:13 +02:00
Francesco Mangiacrapa f5c36bf92a Merge pull request 'task_21890: enhancements' (!2) from task_21890 into master
Reviewed-on: #2
2021-10-08 15:14:16 +02:00
Francesco Mangiacrapa bbc38bc2df moved to 2.0.0-SNAPSHOT 2021-10-06 16:56:57 +02:00
Francesco Mangiacrapa 1ef815eddc increased the MAX_RETRY 2021-10-06 16:03:41 +02:00
Francesco Mangiacrapa 8095db9d7e just a refactor 2021-09-27 14:45:18 +02:00
Francesco Mangiacrapa 7dff2451a3 updated CHANGELOG 2021-09-24 17:28:03 +02:00
Francesco Mangiacrapa 6224dd7f7c #22040 Revisited the "Abstract e Relazione di Scavo". Removed commented
code
2021-09-24 13:14:02 +02:00
Francesco Mangiacrapa 46ae55e8dd refactoring 2021-09-24 11:13:25 +02:00
Francesco Mangiacrapa 85230de9bb #22042 Implemented the public access 2021-09-23 18:18:02 +02:00
Francesco Mangiacrapa eba361389e #21976 Access Policies now are applied also on retrieving layers for id 2021-09-22 12:18:58 +02:00
Francesco Mangiacrapa 97ab51e415 completed README 2021-09-16 12:14:38 +02:00
Francesco Mangiacrapa bea4f8dc0a changed config 2021-09-15 11:20:00 +02:00
Francesco Mangiacrapa e10b0cec44 added optional shorting of URL 2021-09-14 13:09:35 +02:00
Francesco Mangiacrapa fb1ee8456f improvement display features 2021-09-09 15:55:33 +02:00
Francesco Mangiacrapa b6af6ad299 added refersTo BaseConcessione 2021-09-09 11:38:25 +02:00
Francesco Mangiacrapa 35c5ede770 bug fixing and improvements 2021-09-08 17:13:59 +02:00
Francesco Mangiacrapa 3d003a7429 increasing max zoom level and min resolution 2021-09-08 16:15:36 +02:00
Francesco Mangiacrapa 035b71be37 working on #21976 2021-09-08 15:59:29 +02:00
Francesco Mangiacrapa 66d3bd0c0b bug fixing on showing details 2021-09-08 14:40:36 +02:00
Francesco Mangiacrapa 0c5085ca62 optimized popup-info for detail layers 2021-09-07 17:29:56 +02:00
Francesco Mangiacrapa 2af0252338 fixed css. managing popup info separately 2021-09-06 17:15:38 +02:00
Francesco Mangiacrapa 0e082c0c37 removed PointsPath and passed to Geometry JSON string 2021-09-06 16:39:12 +02:00
Francesco Mangiacrapa ad71d45158 fixed the Export Map as 2021-09-06 12:17:01 +02:00
Francesco Mangiacrapa c471f39d50 completed download of map image 2021-09-06 11:05:43 +02:00
Francesco Mangiacrapa 6f3b2e258f fixed CORS issue vs Geoserver 2021-09-03 18:22:42 +02:00
Francesco Mangiacrapa 30ab1b9185 added download layer 2021-09-02 18:15:15 +02:00
Francesco Mangiacrapa 6900a988f2 #21946 managed detail layer with min/max resolution 2021-09-02 12:54:39 +02:00
Francesco Mangiacrapa 94d1ffbe05 removed unused import 2021-09-01 17:39:15 +02:00
Francesco Mangiacrapa 6230560af7 added download layer 2021-09-01 17:37:05 +02:00
Francesco Mangiacrapa 5a84d3a990 added "Extent To" facility 2021-09-01 16:26:07 +02:00
Francesco Mangiacrapa b337955f71 added MAP_PROJECTION object 2021-09-01 12:51:06 +02:00
Francesco Mangiacrapa b2e6830bbe implementing task #21946 2021-08-31 18:21:17 +02:00
Francesco Mangiacrapa 97db5d2c12 using java.util.Date 2021-08-04 16:10:11 +02:00
Francesco Mangiacrapa fea98c837d added loading icon 2021-08-02 17:05:01 +02:00
Francesco Mangiacrapa a2131b7bf1 bug fixing data point selection 2021-08-02 16:45:05 +02:00
Francesco Mangiacrapa 9158437b2f #20595 Porting and using the model view provided by geoportal-common 2021-08-02 15:20:01 +02:00
Francesco Mangiacrapa 4b1071226c fixed css for image gallery 2021-08-02 11:31:59 +02:00
Francesco Mangiacrapa 1c3184fd0b added a method 2021-07-30 15:57:25 +02:00
Francesco Mangiacrapa c7683e1245 fixed css 2021-07-30 15:08:03 +02:00
Francesco Mangiacrapa 44134a4860 Moved to MongoConcessione-Client and mongoID 2021-07-30 14:57:08 +02:00
Francesco Mangiacrapa 4f3c299d11 Merge pull request 'task_21847' (!1) from task_21847 into master
Reviewed-on: #1
2021-07-30 10:36:29 +02:00
Francesco Mangiacrapa 436eca0797 fixing nanogallery2 css import 2021-07-23 19:02:24 +02:00
Francesco Mangiacrapa 3939cddf73 Using the cdnjs.cloudflare.com/ajax/libs/nanogallery2 2021-07-21 17:08:45 +02:00
Francesco Mangiacrapa 260aca4036 updated changelog 2021-07-21 14:27:59 +02:00
Francesco Mangiacrapa 9717b5917a image gallery has been integrated 2021-07-21 12:13:24 +02:00
Francesco Mangiacrapa ad5b11d587 updated changelog 2021-07-20 16:04:12 +02:00
Francesco Mangiacrapa 99c7266c4f updated css and nanogallery options 2021-07-20 15:18:33 +02:00
Francesco Mangiacrapa e806c20462 integrated with nanogallery 2021-07-19 18:04:14 +02:00
Francesco Mangiacrapa 0ad1937951 fixed to work with "Run with GWT Development mode" 2021-07-16 17:43:44 +02:00
Francesco Mangiacrapa 23be72d69f Bug fix Ita/Eng button description 2021-01-27 14:31:49 +01:00
Francesco Mangiacrapa c8f8f2f24e removed -SNAPSHOT to be released 2021-01-15 16:11:11 +01:00
Francesco Mangiacrapa f0b2995d46 merged with branch #20357 2021-01-15 15:12:03 +01:00
Francesco Mangiacrapa 75eab15aa5 added some checks 2020-12-18 11:54:35 +01:00
Francesco Mangiacrapa e9fff02e29 added check to skip coordinates of centroid on null 2020-12-11 09:51:20 +01:00
Francesco Mangiacrapa adba2f1973 commented Window.alert 2020-12-10 10:42:10 +01:00
Francesco Mangiacrapa 5def7389c2 merged with branch 1.0.0-SNAPSHOT 2020-12-09 14:28:32 +01:00
Francesco Mangiacrapa 34215b424b removed -SNAPSHOT 2020-12-04 15:24:07 +01:00
Francesco Mangiacrapa cb2c0eb3c4 minor fixes on Date etc. 2020-12-04 15:06:32 +01:00
Francesco Mangiacrapa 4e02aa7931 removed -SNAPSHOT to be released 2020-12-03 14:47:39 +01:00
Francesco Mangiacrapa 74c53bc688 updated changelog 2020-12-03 14:28:09 +01:00
Francesco Mangiacrapa f3f98ee632 added a timer to display the popup 2020-12-02 18:48:12 +01:00
Francesco Mangiacrapa 34ebb8d648 added js logs. Commented common maps 2020-12-02 17:52:06 +01:00
Francesco Mangiacrapa ccb506fa3b fixed import 2020-12-02 14:43:08 +01:00
Francesco Mangiacrapa 24541715f3 integrated with geoportal-data-common. updated according to task #20210 2020-12-02 14:39:52 +01:00
Francesco Mangiacrapa d052fd535c added ic-client dependency 2020-11-27 12:04:06 +01:00
Francesco Mangiacrapa f4e877a0b3 commented authorization-client and common-scope-maps 2020-11-27 11:56:56 +01:00
Francesco Mangiacrapa 8034248799 add some LOGs 2020-11-27 11:12:53 +01:00
Francesco Mangiacrapa e2034659f2 added the recordId for the QueryDataEvent 2020-11-25 18:44:09 +01:00
Francesco Mangiacrapa a4b38a3dfc starting integration with geoportal-client 2020-11-24 17:24:41 +01:00
Francesco Mangiacrapa c5e03bbd1a fixing issue on client-side 2020-11-24 14:24:59 +01:00
Francesco Mangiacrapa 95a1656d27 set PRETTY as gwt.compiler.style for debugging 2020-11-24 14:19:54 +01:00
Francesco Mangiacrapa 6119f81969 to debug 2020-11-24 12:58:13 +01:00
Francesco Mangiacrapa 8564db4079 added console.log to debug 2020-11-24 12:26:38 +01:00
Francesco Mangiacrapa 609f38678e improved the interactions on Map and the view with details 2020-11-24 11:26:05 +01:00
Francesco Mangiacrapa ca5a5dbb00 improved GUI 2020-11-20 18:10:43 +01:00
Francesco Mangiacrapa dfac6a38f8 removed setUserInSession 2020-11-19 15:56:43 +01:00
Francesco Mangiacrapa e6c32701c5 merged with branch 'task_20004' 2020-11-19 15:19:27 +01:00
207 changed files with 20896 additions and 4439 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/geoportal-data-viewer-app-1.0.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<classpathentry kind="src" output="target/geoportal-data-viewer-app-3.6.0/WEB-INF/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
@ -8,13 +8,8 @@
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/geoportal-data-viewer-app-1.0.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
@ -24,16 +19,16 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="output" path="target/geoportal-data-viewer-app-1.0.0-SNAPSHOT/WEB-INF/classes"/>
<classpathentry kind="output" path="target/geoportal-data-viewer-app-3.6.0/WEB-INF/classes"/>
</classpath>

View File

@ -1,4 +1,4 @@
eclipse.preferences.version=1
lastWarOutDir=/home/francesco/git/geoportal-data-viewer-app/target/geoportal-data-viewer-app-1.0.0-SNAPSHOT
lastWarOutDir=/home/francescomangiacrapa/git/geoportal-data-viewer-app/target/geoportal-data-viewer-app-3.6.0
warSrcDir=src/main/webapp
warSrcDirIsOutput=false

View File

@ -0,0 +1,2 @@
eclipse.preferences.version=1
gwtSyncCodeServer=true

View File

@ -6,6 +6,6 @@ org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8

View File

@ -1,49 +1,924 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="geoportal-data-viewer-app-1.0.0-SNAPSHOT">
<wb-module deploy-name="geoportal-data-viewer-app-3.6.0">
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/gwt"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<dependent-module archiveName="geoportal-data-mapper-1.1.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/geoportal-data-mapper/geoportal-data-mapper">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="uri-resolver-manager-1.8.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/uri-resolver-manager/uri-resolver-manager">
<dependency-type>uses</dependency-type>
</dependent-module>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/test/java"/>
<property name="java-output-path" value="/geoportal-data-viewer-app/target/geoportal-data-viewer-app-0.0.1-SNAPSHOT/WEB-INF/classes"/>
<property name="context-root" value="geoportal-data-viewer-app"/>
</wb-module>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<installed facet="java" version="1.8"/>
<installed facet="jst.web" version="2.3"/>
<installed facet="com.gwtplugins.gwt.facet" version="1.0"/>
<installed facet="jst.jaxrs" version="2.0"/>
<installed facet="java" version="1.8"/>
<installed facet="jst.web" version="3.0"/>
</faceted-project>

View File

@ -4,6 +4,144 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [v1.0.0-SNAPSHOT] - 2020-10-07
## [v3.6.0]
[#20004] First release
- GUI optimization [#25461]
- Using the latest libraries version: gwt-ol.v8.4.1 (with openlayers.v6.6.1) and gwt.v2.10
- Showing basic statistics (i.e. "X project published") via 'countByPhase' method [#25598]
## [v3.5.0]
- Supported the cross-filtering [#25074]
- Supported the grouped custom layers [#25110]
- Managed the (WMS) Layer Style facility [#25066]
## [v3.4.0] - 2023-05-11
- Integrated the geoportal-data-mapper component [#24978]
## [v3.3.1] - 2023-03-30
- Just including new dependencies
- Improved css
## [v3.3.0] - 2023-02-20
#### Fixes
- [#24632] Returning the public layer index if the private is missing
- [#24632] No temporal info shown if the temporal extent is missing
## [v3.2.1] - 2023-02-03
#### Fixes
- [#24432] Reverting serialization LinkedHashMap<String, String> to LinkedHashMap<String, Object>.
- Improved Alert UX in case of broken shared link
- Moved to gwt 2.9.0
## [v3.2.0] - 2023-01-31
#### Enhancements
- [#24506] Added facility: Locate/Highlight the Layer on the Map
## [v3.1.0] - 2023-01-12
#### Enhancements
- [#24300] Improved the GUI of the search functionality when multiple collections are available
- [#24404] Improved the handlers of events: Search, Locate
- Improved the user experience providing an animated map and zoom to layers facility
#### Fixes
- Reduced the BBOX when resolving a project by share link
- GNA Project binding with automatically adding of the layers to Map
- [#24390] Read the access policy from the fileset json section
- [#24432] Fixing serialization issue using LinkedHashMap<String, String> instead of LinkedHashMap<String, Object>
## [v3.0.0] - 2022-11-28
- [#23940] Passed to CMS-UCD
- [#23941] Implemented and integrated the DTO Project/Document per UCD config and gCube Metadata Profiles
- [#23953] Passed the 'Search facility' to CMS-UCD model
- [#23954] Passed the 'Details Panel facility' to CMS-UCD model
- [#23955] Implemented the Temporal facility to navigate temporal relations among (JSON) Projects
- [#24028] Passed the spatial dimension to CMS-Project model
- [#24136] Integrated the temporal dimension on the front-end side
- [#24195] Integrated the temporal query
## [v2.4.1-SNAPSHOT] - 2022-09-28
- [#23906] Tested building on jenkins with JDK_11
## [v2.4.0] - 2022-09-07
#### Enhancement
- [#23819] Adding layers to principal map belonging to more centroids with the same spatial position
## [v2.3.1] - 2022-08-29
#### Bug fixed
- [#23770] OpenLayers CDN URLs updated (github relative URL changed from "master/en/vX.Y.Z/" to "main/dist/en/vX.Y.Z/")
## [v2.3.0] - 2022-07-26
#### Bug fixed
- [#23689] Fixed the search facility is buggy when used from public access
- [#23704] Used new maven range for geoportal-client
- Moved to 3.6.4
## [v2.2.0] - 2021-12-07
#### Enhancements
- [#22518] Added the search for fields facility
## [v2.1.0-SNAPSHOT] - 2021-11-10
#### Enhancements
- [#22518] Added the search for name facility
- [#22027] Integrated with MapBox Satellite
- Added link "Open Project" in the pop-up of WFS details
- Moved to gwt-ol3 v8.1.0-gwt2_9
## [v2.0.1] - 2021-11-10
#### Fixes
- [#22370] Use a max-height for preview image shown in the pop-up
## [v2.0.0] - 2021-07-30
#### Enhancements
- [#21890] Porting to ConcessioniManagerI and pass to mongoID
- [#20595] Porting and using the model view provided by geoportal-common
- [#21946] Show layers of a concessione automatically on map according to zoom level
- [#21976] Access policies checked on server-side
- [#22042] Implemented the public access
- [#22040] Revisited the "Abstract and Relazione di Scavo"
- [#22041] Files have been ported to FileSet model
- [#21991] Implemented the Layer Switcher
## [v1.2.0] - 2021-07-19
#### Enhancements
- [#21847] Integrated with an Image and LighBox gallery for images
- Moved to maven-portal-bom 3.6.3
## [v1.1.0] - 2020-12-21
#### Enhancements
- [#20357] Improvements feedback-driven
## [v1.0.0] - 2020-12-09
- [#20004] First release

View File

@ -1,15 +1,52 @@
# GeoPortal Data Viewer App
The GeoPortal Data Viewer App is an application to access, discovery and navigate the GeoNa products by a Gis GUI
The "Geoportal data-viewer" technology allows users to access and search for spatio-temporal documents through a web GIS which allows them to: (i) navigate and select the projects published in the system by "geographical map" (spatial dimension) , (ii) navigate and select the relationships between projects (evolution of over time) via "timeline" (temporal dimension), (iii) view metadata and resources (images, layers, etc. .) of documents via the "project view detail", (iv) export a view of the map with the layer of interest or add the layers of a project to the main map, (v) manage the order and overlapping of the layers, (vi) execute spatial queries on the layers and view the results, (vii) search through metadata or temporal dimension queries for the projects of interest, (vii) apply spatial filters for cross-layer.
## Built With
* [OpenJDK](https://openjdk.java.net/) - The JDK used
* [Maven](https://maven.apache.org/) - Dependency Management
**Uses**
* GWT v.2.9.0. [GWT](http://www.gwtproject.org) is licensed under [Apache License 2.0](http://www.gwtproject.org/terms.html)
* GWT-Bootstrap v.2.3.2.0. [GWT-Bootstrap](https://github.com/gwtbootstrap) is licensed under [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0)
* GWT-OpenLayers 3+ v.8.1.0-gwt2_9. [GWT-OL3](https://github.com/TDesjardins/gwt-ol)
* OpenLayers v.6.x [OpenLayers](https://openlayers.org/) is licensed under [BSD 2-Clause "Simplified"](https://github.com/openlayers/openlayers/blob/main/LICENSE.md)
* NanoGallery v2.X [NanoGallery2](https://github.com/nanostudio-org/nanogallery2) is licensed under [GNU General Public License "gplv3"](https://www.gnu.org/licenses/gpl-3.0.html)
* Vis-Timeline v7.x [VisTimeline](https://github.com/visjs/vis-timeline) is licensed under [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0) and MIT
* Handlebarsjs v4.x [Handlebarsjs](https://handlebarsjs.com/) is licensed under MIT
## Architecture
<img src="https://gcube.wiki.gcube-system.org/images_gcube/8/82/GeoPortalDataViewer_Architecture.png" style="max-width:800px;" alt="GeoPortal Data-Viewer - Architecture" />
## Showcase
##### D4GNA instance of Geoportal D4Science
see at [Dataset per il Geoportale Nazionale per lArcheologia (D4GNA)](https://gna.d4science.org/)
**D4GNA Viewer - OSM**
<img src="https://gcube.wiki.gcube-system.org/images_gcube/0/06/D4GNA_Viewer_OSM.png" style="max-width:800px;" alt="Data_Viewer_OSM" />
**D4GNA Viewer - MapBox**
<img src="https://gcube.wiki.gcube-system.org/images_gcube/9/9c/D4GNA_Viewer_MapBox.png" style="max-width:800px;" alt="Data_Viewer_MapBox" />
**D4GNA Viewer - Discovering...**
<img src="https://gcube.wiki.gcube-system.org/images_gcube/8/85/D4GNA_ERCIM_3.png" style="max-width:800px;" alt="D4GNA_ERCIM_3" />
<br />
<br />
<img src="https://gcube.wiki.gcube-system.org/images_gcube/9/9c/D4GNA_ERCIM_2.png" style="max-width:800px;" alt="D4GNA_ERCIM_2" />
## Documentation
N/A
Geoportal Service Documentation is available at [gCube CMS Suite](https://geoportal.d4science.org/geoportal-service/docs/index.html)
User Guide (DRAFT ITA) is available at [Guida al DataViewer D4GNA (DRAFT-ITA)](https://gcube.wiki.gcube-system.org/images_gcube/b/b3/D4science_Guida_al_DataViewer_D4GNA_bozza.pdf)
## Change log

140
pom.xml
View File

@ -7,20 +7,23 @@
<parent>
<artifactId>maven-parent</artifactId>
<groupId>org.gcube.tools</groupId>
<version>1.1.0</version>
<version>1.2.0</version>
<relativePath />
</parent>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>geoportal-data-viewer-app</artifactId>
<packaging>war</packaging>
<version>1.0.0-SNAPSHOT</version>
<version>3.6.0</version>
<name>GeoPortal Data Viewer App</name>
<description>The GeoPortal Data Viewer App is an application to access, discovery and navigate the GeoNa products by a Gis GUI</description>
<description>The GeoPortal Data Viewer App is an application to access, discovery and navigate the Geoportal projects/documents by a Web-Map Interface</description>
<properties>
<!-- Convenience property to set the GWT version -->
<gwt.version>2.9.0</gwt.version>
<gwt.version>2.10.0</gwt.version>
<gwt.compiler.style>PRETTY</gwt.compiler.style>
<gson.version>2.6.2</gson.version>
<gwt.ol.version>8.4.1</gwt.ol.version>
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
<!-- GWT 2.9 support 8, 9 and 11 -->
<maven.compiler.source>1.8</maven.compiler.source>
@ -49,32 +52,26 @@
</developers>
<dependencyManagement>
<!-- <dependencies> -->
<!-- <dependency> -->
<!-- <groupId>org.gcube.distribution</groupId> -->
<!-- <artifactId>maven-portal-bom</artifactId> -->
<!-- <version>3.6.0</version> -->
<!-- <type>pom</type> -->
<!-- <scope>import</scope> -->
<!-- <exclusions> -->
<!-- <exclusion> -->
<!-- <groupId>com.google.gwt</groupId> -->
<!-- <artifactId>gwt-user</artifactId> -->
<!-- </exclusion> -->
<!-- <exclusion> -->
<!-- <groupId>com.google.gwt</groupId> -->
<!-- <artifactId>gwt-servlet</artifactId> -->
<!-- </exclusion> -->
<!-- <exclusion> -->
<!-- <groupId>com.google.gwt</groupId> -->
<!-- <artifactId>gwt-dev</artifactId> -->
<!-- </exclusion> -->
<!-- </exclusions> -->
<!-- </dependency> -->
<!-- </dependencies> -->
<dependencies>
<dependency>
<groupId>org.gcube.distribution</groupId>
<artifactId>maven-portal-bom</artifactId>
<version>3.7.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
<version>1.4.01</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
@ -93,10 +90,20 @@
<version>${gwt.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.portal</groupId>
<artifactId>oidc-library-portal</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>oidc-library</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.tdesjardins</groupId>
<artifactId>gwt-ol3</artifactId>
<version>8.0.0-gwt2_9</version>
<version>${gwt.ol.version}</version>
</dependency>
<dependency>
<groupId>com.github.gwtbootstrap</groupId>
@ -109,84 +116,102 @@
<artifactId>geo-utility</artifactId>
<version>[1.0.0,2.0.0-SNAPSHOT)</version>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>authorization-client</artifactId>
<version>[2.0.0, 3.0.0-SNAPSHOT)</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.resources.discovery</groupId>
<artifactId>ic-client</artifactId>
<version>[1.0.0, 2.0.0-SNAPSHOT)</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.core</groupId>
<artifactId>common-scope-maps</artifactId>
<version>[1.1.0, 2.0.0-SNAPSHOT)</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.gcube.common.portal</groupId>
<artifactId>portal-manager</artifactId>
<version>[2.4.1,3.0.0-SNAPSHOT)</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.dvos</groupId>
<artifactId>usermanagement-core</artifactId>
<version>[2.4.1,3.0.0-SNAPSHOT)</version>
<scope>provided</scope>
</dependency>
<!-- REQUIRED FOR JDK_11 -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.4</version>
<scope>provided</scope>
</dependency>
<!-- END -->
<dependency>
<groupId>org.gcube.application</groupId>
<artifactId>geoportal-data-mapper</artifactId>
<version>[1.0.1-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.gcube.application</groupId>
<artifactId>geoportal-logic</artifactId>
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
<artifactId>geoportal-data-common</artifactId>
<version>[2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<version>2.7.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>${gson.version}</version>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>keycloak-client</artifactId>
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
</dependency>
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>portal-service</artifactId>
<version>6.2.5</version>
<!-- <version>6.2.5</version> -->
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.portlet</groupId>
<artifactId>portlet-api</artifactId>
<version>2.0</version>
<!-- <version>2.0</version> -->
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.4</version>
<!-- <version>1.6.4</version> -->
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.4</version>
<!-- <version>1.6.4</version> -->
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<!-- Output classes directly into the webapp, so that IDEs and "mvn process-classes"
update them in DevMode -->
<!-- <outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory> -->
<!-- Output classes directly into the webapp, so that IDEs and "mvn process-classes"
update them in DevMode -->
@ -201,9 +226,12 @@
<version>${gwt.version}</version>
<executions>
<execution>
<!-- <configuration> -->
<!-- <style>${gwt.compiler.style}</style> -->
<!-- </configuration> -->
<goals>
<goal>compile</goal>
<!-- <goal>test</goal> -->
<!-- <goal>test</goal> -->
<!-- <goal>generateAsync</goal> -->
</goals>
</execution>
@ -238,6 +266,10 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
<!-- SA Plugin -->
<plugin>

View File

@ -6,12 +6,17 @@
<!-- Inherit the default GWT style sheet. You can change -->
<!-- the theme of your GWT application by uncommenting -->
<!-- any one of the following lines. -->
<!-- <inherits name='com.google.gwt.user.theme.standard.Standard' /> -->
<inherits name='com.google.gwt.user.theme.standard.Standard' />
<inherits name='ol.GwtOL' />
<inherits name="com.github.gwtbootstrap.Bootstrap" />
<inherits
name='org.gcube.application.geoportalcommon.GeoportalDataCommon' />
<inherits name="com.google.gwt.json.JSON" />
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->

View File

@ -1,23 +1,213 @@
package org.gcube.portlets.user.geoportaldataviewer.client;
import org.gcube.application.geoportalcommon.ConvertToDataViewModel;
import org.gcube.portlets.user.geoportaldataviewer.client.gis.OpenLayersMapParameters;
public class GeoportalDataViewerConstants {
import com.google.gwt.dom.client.Element;
import com.google.gwt.i18n.client.DateTimeFormat;
public static final String EPSG_4326 = "EPSG:4326";
public static final String EPSG_3857 = "EPSG:3857";
/**
* The Class GeoportalDataViewerConstants.
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
*
* Nov 24, 2020
*/
public class GeoportalDataViewerConstants {
public static final int TABLET_WIDTH = 1601;
public static final String MAP_DIV = "map";
public static final String GET_WMS_PARAMETER = "wmsrequest";
public static final String GET_GEONA_ITEM_TYPE = "git";
public static final String GET_GEONA_ITEM_ID = "gid";
public static final String GET_UUID_PARAMETER = "uuid";
public static final String GET_LAYER_TITLE = "layertitle";
public static final String GET_MAX_ZOOM_LEVEL = OpenLayersMapParameters.OL_MAP_PARAM.maxzoomlevel.name();
public static final String GET_ZOOM = OpenLayersMapParameters.OL_MAP_PARAM.zoom.name();
public static final String GET_CENTER_MAP_TO_LONG_LAT = OpenLayersMapParameters.OL_MAP_PARAM.centermap.name();
public enum LayerType {RASTER_BASELAYER, FEATURE_TYPE};
public static final int MAX_WFS_FEATURES = 5; // zero for no limit
public static final Double INITIAL_LAYER_OPACITY = 0.8;
public static final int SEARCH_LIMIT_RESULTS_TO_MAXIMUM = 50;
public static final DateTimeFormat DATE_TIME_FORMAT = DateTimeFormat.getFormat("dd MMMM yyyy");
public static enum MapEventType {
MOUSE_CLICK, MAP_ZOOM_END, MOVE_END, ADDED_CENTROID_LAYER_TO_MAP
}
public static final String PROJECT_ID_KEY_FEATURE = "projectid";
public static enum GisToolbarFacilities {
COLLECTION("Collection", "Open the collections"),
MAP("Map", "Select the base Map"),
OVERLAY("Overlay", "Add overlay layers"),
SEARCH("Search", "Search in the collections"),
FILTER("Filter", "Apply spatial filtering"),
LAYERS("Layers", "Layers added to Map"),
PRESET_LOCATION("Preset Location", "Center the Map to Location");
String name;
String tooltip;
GisToolbarFacilities(String name, String tooltip) {
this.name = name;
this.tooltip = tooltip;
}
public String getName() {
return name;
}
public String getTooltip() {
return tooltip;
}
}
/**
* The Enum LayerType.
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
*
* Nov 24, 2020
*/
public enum LayerType {
RASTER_BASELAYER, FEATURE_TYPE
};
public static DateTimeFormat DT_FORMAT = DateTimeFormat.getFormat(ConvertToDataViewModel.DATE_FORMAT);
public static final int MAX_WFS_FEATURES = 10; // zero for no limit
public static final String NEW_LINE_BR = "<br/>";
public static enum MAP_PROJECTION {
EPSG_4326("4326", "EPSG:4326"), EPSG_3857("3857", "EPSG:3857");
String id;
String name;
MAP_PROJECTION(String id, String name) {
this.id = id;
this.name = name;
}
public String getId() {
return id;
}
public String getName() {
return name;
}
}
public static final double ITALY_CENTER_LONG = 12.45;
public static final double ITALY_CENTER_LAT = 42.98;
public static final int LIGHT_MAP_ITALY_FIT_ZOOM_ON = 5;
public static final int MAP_ITALY_FIT_ZOOM_ON = 5;
/**
* Prints the.
*
* @param msg the msg
*/
public static native void printJs(String msg)/*-{
//console.log("js console: " + msg);
}-*/;
/**
* Prints the.
*
* @param msg the msg
*/
public static native void printJsObj(Object object)/*-{
//console.log("js obj: " + JSON.stringify(object, null, 4));
}-*/;
/**
* Prints the.
*
* @param msg the msg
*/
public static native String toJsonObj(Object object)/*-{
return JSON.stringify(object);
}-*/;
/**
* Json to HTML.
*
* @param jsonTxt the json txt
* @return the string
*/
public static native String jsonToTableHTML(String jsonTxt)/*-{
try {
var jsonObj = JSON.parse(jsonTxt);
if (jsonObj.length == undefined)
jsonObj = [ jsonObj ]
//console.log(jsonObj.length)
// EXTRACT VALUE FOR HTML HEADER.
var col = [];
for (var i = 0; i < jsonObj.length; i++) {
for ( var key in jsonObj[i]) {
//console.log('key json' +key)
if (col.indexOf(key) === -1) {
col.push(key);
}
}
}
// CREATE DYNAMIC TABLE.
var table = document.createElement("table");
try {
table.classList.add("my-html-table");
} catch (e) {
console.log('invalid css add', e);
}
// ADD JSON DATA TO THE TABLE AS ROWS.
for (var i = 0; i < col.length; i++) {
tr = table.insertRow(-1);
var firstCell = tr.insertCell(-1);
//firstCell.style.cssText="font-weight: bold; text-align: center; vertical-align: middle;";
firstCell.innerHTML = col[i];
for (var j = 0; j < jsonObj.length; j++) {
var tabCell = tr.insertCell(-1);
var theValue = jsonObj[j][col[i]];
//console.log("the value: "+theValue);
if (theValue !== null
&& Object.prototype.toString.call(theValue) === '[object Array]') {
var formattedValueArray = "";
for (var k = 0; k < theValue.length; k++) {
var theValueArray = theValue[k];
//console.log(theValueArray);
formattedValueArray += theValueArray + "<br>";
}
tabCell.innerHTML = formattedValueArray;
} else {
tabCell.innerHTML = theValue;
}
}
}
return table.outerHTML;
} catch (e) {
console.log('invalid json', e);
return jsonTxt;
}
}-*/;
public static native void clickElement(Element elem) /*-{
elem.click();
}-*/;
}

View File

@ -1,27 +1,232 @@
package org.gcube.portlets.user.geoportaldataviewer.client;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.gcube.portlets.user.geoportaldataviewer.shared.GeoNaDataObject;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BoundsMap;
import org.gcube.application.geoportalcommon.shared.GNADataViewerConfigProfile;
import org.gcube.application.geoportalcommon.shared.GeoportalItemReferences;
import org.gcube.application.geoportalcommon.shared.SearchingFilter;
import org.gcube.application.geoportalcommon.shared.geoportal.config.GroupedLayersDV;
import org.gcube.application.geoportalcommon.shared.geoportal.config.layers.LayerIDV;
import org.gcube.application.geoportalcommon.shared.geoportal.geojson.GeoJSON;
import org.gcube.application.geoportalcommon.shared.geoportal.materialization.GCubeSDIViewerLayerDV;
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.GEOPORTAL_DATA_HANDLER;
import org.gcube.application.geoportalcommon.shared.geoportal.view.ProjectView;
import org.gcube.application.geoportalcommon.shared.gis.BoundsMap;
import org.gcube.portlets.user.geoportaldataviewer.shared.GeoNaSpatialQueryResult;
import org.gcube.portlets.user.geoportaldataviewer.shared.ItemFieldsResponse;
import org.gcube.portlets.user.geoportaldataviewer.shared.ResultSetPaginatedDataIDs;
import org.gcube.portlets.user.geoportaldataviewer.shared.ViewerConfiguration;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BaseMapLayer;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerObject;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wms.GeoInformationForWMSRequest;
import org.gcube.portlets.user.geoportaldataviewer.shared.products.ConcessioneDV;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
/**
* The client side stub for the RPC service.
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
*
* Nov 17, 2020
*/
@RemoteServiceRelativePath("geoportaldataviewerservice")
public interface GeoportalDataViewerService extends RemoteService {
/**
* Parses the wms request.
*
* @param wmsRequest the wms request
* @param layerName the layer name
* @return the geo information for WMS request
* @throws Exception the exception
*/
GeoInformationForWMSRequest parseWmsRequest(String wmsRequest, String layerName) throws Exception;
List<GeoNaDataObject> getDataResult(List<LayerItem> layerItems, String mapSrsName, BoundsMap mapBBOX,
int maxWFSFeature, double zoomLevel);
/**
* Gets the data result.
*
* @param layerObjects the layer objects
* @param mapSrsName the map srs name
* @param mapBBOX the map BBOX
* @param maxWFSFeature the max WFS feature
* @param zoomLevel the zoom level
* @return the data result
* @throws Exception the exception
*/
List<GeoNaSpatialQueryResult> getDataResult(List<LayerObject> layerObjects, String mapSrsName, BoundsMap mapBBOX,
int maxWFSFeature, double zoomLevel) throws Exception;
ConcessioneDV getConcessioneForId(Long id) throws Exception;
/**
* Gets the my login.
*
* @return the my login
*/
String getMyLogin();
/**
* Gets the geo na data view profile.
*
* @return the geo na data view profile
* @throws Exception the exception
*/
GNADataViewerConfigProfile getGeoNaDataViewProfile() throws Exception;
/**
* Gets the public links for.
*
* @param item the item
* @return the public links for
* @throws Exception the exception
*/
GeoportalItemReferences getPublicLinksFor(GeoportalItemReferences item) throws Exception;
/**
* Gets the layers for id.
*
* @param theProfileID the the profile ID
* @param theProductID the the product ID
* @return the layers for id
* @throws Exception the exception
*/
List<GCubeSDIViewerLayerDV> getLayersForId(String theProfileID, String theProductID) throws Exception;
/**
* Gets the WFS features.
*
* @param layerObjects the layer objects
* @param mapSrsName the map srs name
* @param selectBBOX the select BBOX
* @param maxWFSFeature the max WFS feature
* @param zoomLevel the zoom level
* @return the WFS features
*/
List<GeoNaSpatialQueryResult> getWFSFeatures(List<LayerObject> layerObjects, String mapSrsName,
BoundsMap selectBBOX, int maxWFSFeature, double zoomLevel);
/**
* Gets the list base layers.
*
* @return the list base layers
*/
List<BaseMapLayer> getListBaseLayers();
/**
* List of fields for searching.
*
* @return the list
* @throws Exception the exception
*/
List<ItemFieldsResponse> getConfigListOfFieldsForSearching() throws Exception;
/**
* Gets the project view for id.
*
* @param profileID the profile ID
* @param projectID the project ID
* @return the project view for id
* @throws Exception the exception
*/
ProjectView getProjectViewForId(String profileID, String projectID) throws Exception;
/**
* Gets the list projects.
*
* @param theProfileID the the profile ID
* @param start the start
* @param limit the limit
* @param filter the filter
* @param reloadFromService the reload from service
* @return the list projects
* @throws Exception the exception
*/
ResultSetPaginatedDataIDs getListProjects(String theProfileID, Integer start, Integer limit, SearchingFilter filter,
boolean reloadFromService) throws Exception;
/**
* NEW CODE HERE.
*
* @return the initial configuration
* @throws Exception the exception
*/
ViewerConfiguration getInitialConfiguration() throws Exception;
/**
* Gets the entry sets document for project ID.
*
* @param profileID the profile ID
* @param projectID the project ID
* @param limit the limit
* @return the entry sets document for project ID
*/
LinkedHashMap<String, Object> getEntrySetsDocumentForProjectID(String profileID, String projectID, int limit);
/**
* Gets the relationships for timeline.
*
* @param profileID the profile ID
* @param projectID the project ID
* @return the relationships for timeline
* @throws Exception the exception
*/
List<String> getRelationshipsForTimeline(String profileID, String projectID) throws Exception;
/**
* Gets the spatial reference.
*
* @param profileID the profile ID
* @param projectID the project ID
* @return the spatial reference
*/
GeoJSON getSpatialReference(String profileID, String projectID);
/**
* Gets the WFS request.
*
* @param layerItem the layer item
* @param mapSrsName the map srs name
* @param mapBBOX the map BBOX
* @param maxFeatures the max features. If 0 means all feature
* @param outputFormat the output format
* @return the WFS request
*/
String getWFSRequest(LayerItem layerItem, String mapSrsName, BoundsMap mapBBOX, int maxFeatures,
String outputFormat);
/**
* Gets the WFS response.
*
* @param layerItem the layer item
* @param mapSrsName the map srs name
* @param mapBBOX the map BBOX
* @param maxFeatures the max features
* @param outputFormat the output format
* @return the WFS response
*/
String getWFSResponse(LayerItem layerItem, String mapSrsName, BoundsMap mapBBOX, int maxFeatures,
String outputFormat);
/**
* Gets the avaiable custom grouped layers for UCD.
*
* @param theHandler the the handler
* @return the avaiable custom grouped layers for UCD
*/
Map<String, List<GroupedLayersDV<? extends LayerIDV>>> getAvaiableCustomGroupedLayersForUCD(
GEOPORTAL_DATA_HANDLER theHandler);
/**
* Gets the HTTP response for URL.
*
* @param url the url
* @return the HTTP response for URL
*/
String getHTTPResponseForURL(String url);
Integer getCountFor(String profileID, String phase, String status);
}

View File

@ -1,12 +1,27 @@
package org.gcube.portlets.user.geoportaldataviewer.client;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.gcube.portlets.user.geoportaldataviewer.shared.GeoNaDataObject;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BoundsMap;
import org.gcube.application.geoportalcommon.shared.GNADataViewerConfigProfile;
import org.gcube.application.geoportalcommon.shared.GeoportalItemReferences;
import org.gcube.application.geoportalcommon.shared.SearchingFilter;
import org.gcube.application.geoportalcommon.shared.geoportal.config.GroupedLayersDV;
import org.gcube.application.geoportalcommon.shared.geoportal.config.layers.LayerIDV;
import org.gcube.application.geoportalcommon.shared.geoportal.geojson.GeoJSON;
import org.gcube.application.geoportalcommon.shared.geoportal.materialization.GCubeSDIViewerLayerDV;
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.GEOPORTAL_DATA_HANDLER;
import org.gcube.application.geoportalcommon.shared.geoportal.view.ProjectView;
import org.gcube.application.geoportalcommon.shared.gis.BoundsMap;
import org.gcube.portlets.user.geoportaldataviewer.shared.GeoNaSpatialQueryResult;
import org.gcube.portlets.user.geoportaldataviewer.shared.ItemFieldsResponse;
import org.gcube.portlets.user.geoportaldataviewer.shared.ResultSetPaginatedDataIDs;
import org.gcube.portlets.user.geoportaldataviewer.shared.ViewerConfiguration;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BaseMapLayer;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerObject;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wms.GeoInformationForWMSRequest;
import org.gcube.portlets.user.geoportaldataviewer.shared.products.ConcessioneDV;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;
@ -32,8 +47,50 @@ public interface GeoportalDataViewerServiceAsync {
void parseWmsRequest(String wmsRequest, String layerName, AsyncCallback<GeoInformationForWMSRequest> callback);
void getDataResult(List<LayerItem> layerItems, String mapSrsName, BoundsMap mapBBOX, int maxWFSFeature, double zoomLevel,
AsyncCallback<List<GeoNaDataObject>> callback);
void getDataResult(List<LayerObject> layerObjects, String mapSrsName, BoundsMap mapBBOX, int maxWFSFeature,
double zoomLevel, AsyncCallback<List<GeoNaSpatialQueryResult>> callback);
void getMyLogin(AsyncCallback<String> callback);
void getGeoNaDataViewProfile(AsyncCallback<GNADataViewerConfigProfile> callback);
void getPublicLinksFor(GeoportalItemReferences item, AsyncCallback<GeoportalItemReferences> asyncCallback);
void getLayersForId(String theProfileID, String theProductID,
AsyncCallback<List<GCubeSDIViewerLayerDV>> asyncCallback);
void getWFSFeatures(List<LayerObject> layerObjects, String mapSrsName, BoundsMap selectBBOX, int maxWFSFeature,
double zoomLevel, AsyncCallback<List<GeoNaSpatialQueryResult>> callback);
void getListBaseLayers(AsyncCallback<List<BaseMapLayer>> callback);
void getConfigListOfFieldsForSearching(AsyncCallback<List<ItemFieldsResponse>> callback);
void getProjectViewForId(String profileID, String projectID, AsyncCallback<ProjectView> callback);
void getListProjects(String theProfileID, Integer start, Integer limit, SearchingFilter filter,
boolean reloadFromService, AsyncCallback<ResultSetPaginatedDataIDs> callback);
void getInitialConfiguration(AsyncCallback<ViewerConfiguration> callback);
void getEntrySetsDocumentForProjectID(String profileID, String projectID, int limit,
AsyncCallback<LinkedHashMap<String, Object>> callback);
void getRelationshipsForTimeline(String profileID, String projectID, AsyncCallback<List<String>> callback);
void getSpatialReference(String profileID, String projectID, AsyncCallback<GeoJSON> callback);
void getWFSRequest(LayerItem layerItem, String mapSrsName, BoundsMap mapBBOX, int maxFeatures, String outputFormat,
AsyncCallback<String> callback);
void getWFSResponse(LayerItem layerItem, String mapSrsName, BoundsMap mapBBOX, int maxFeatures, String outputFormat,
AsyncCallback<String> callback);
void getAvaiableCustomGroupedLayersForUCD(GEOPORTAL_DATA_HANDLER theHandler,
AsyncCallback<Map<String, List<GroupedLayersDV<? extends LayerIDV>>>> callback);
void getHTTPResponseForURL(String url, AsyncCallback<String> callback);
void getCountFor(String profileID, String phase, String status, AsyncCallback<Integer> callback);
void getConcessioneForId(Long id, AsyncCallback<ConcessioneDV> callback);
}

View File

@ -0,0 +1,266 @@
package org.gcube.portlets.user.geoportaldataviewer.client;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.MAP_PROJECTION;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.MapEventType;
import org.gcube.portlets.user.geoportaldataviewer.client.events.QueryDataEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.events.ZoomOutOverMinimumEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.gis.ExtentWrapped;
import org.gcube.portlets.user.geoportaldataviewer.client.gis.MapUtils;
import org.gcube.portlets.user.geoportaldataviewer.client.gis.OpenLayerMap;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.map.ExtentMapUtil;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.map.ExtentMapUtil.Location;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.map.ExtentMapUtil.PLACE;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BaseMapLayer;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.GeoQuery;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.GeoQuery.TYPE;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.shared.HandlerManager;
import ol.Coordinate;
import ol.MapBrowserEvent;
import ol.MapEvent;
/**
* The Class OLMapManager.
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
*
* Nov 19, 2020
*/
public class OLMapManager {
private String targetId;
private HandlerManager layerManagerBus;
private OpenLayerMap olMap;
private ol.Extent dragStartExtent = null;
private Double zoomStart = null;
private Double zoomEnd = null;
private ol.Extent dragEndExtent = null;
public static final int QUERY_MIN_ZOOM_LEVEL = 13;
public static final Double LAYER_DETAIL_MIN_RESOLUTION = 0.01;
public static final Double LAYER_DETAIL_MAX_RESOLUTION = 18.5;
/**
* Instantiates a new OL map manager.
*
* @param targetId the target id
* @param layerManagerBus the layer manager bus
* @param baseMapLayer the base map layer
*/
public OLMapManager(String targetId, HandlerManager layerManagerBus, BaseMapLayer baseMapLayer) {
this.targetId = targetId;
this.layerManagerBus = layerManagerBus;
instanceOLMap(baseMapLayer);
}
/**
* Instance OL map.
*
* @param baseMapLayer the base map layer
*/
public void instanceOLMap(BaseMapLayer baseMapLayer) {
olMap = new OpenLayerMap(targetId, layerManagerBus, baseMapLayer) {
@Override
public void clickListener(MapBrowserEvent event) {
Coordinate coordinate = event.getCoordinate();
if (!olMap.mapInstancied())
return;
// if (olMap.isQueryPointActive()) {
// GeoQuery select = toDataPointQuery(coordinate);
// layerManagerBus.fireEvent(new QueryDataEvent(select, coordinate));
//
// }
ExtentWrapped toExt = new ExtentWrapped(coordinate.getX(), coordinate.getY(), coordinate.getX(),
coordinate.getY());
GeoQuery select = toDataPointQuery(coordinate, true);
layerManagerBus.fireEvent(new QueryDataEvent(select, toExt, null, true, MapEventType.MOUSE_CLICK));
}
@Override
public void moveEndListener(MapEvent event) {
// onInit
if (!olMap.mapInstancied())
return;
checkSelectQuery(MapEventType.MOVE_END);
}
@Override
public void moveStartListener(MapEvent event) {
// onInit
if (!olMap.mapInstancied())
return;
setDragStart();
}
@Override
public void mapZoomListener(MapEvent event) {
// onInit
if (!olMap.mapInstancied())
return;
setDragStart();
zoomStart = olMap.getCurrentZoomLevel();
GWT.log("zoomStart: " + zoomStart);
}
@Override
public void mapZoomEndListener(MapEvent event) {
// onInit
if (!olMap.mapInstancied())
return;
setDragStart();
zoomEnd = olMap.getCurrentZoomLevel();
GWT.log("zoomEnd: " + zoomEnd);
checkSelectQuery(MapEventType.MAP_ZOOM_END);
}
};
Location italyLocation = ExtentMapUtil.getLocation(PLACE.ITALY);
Coordinate transformedCenterCoordinate = italyLocation.getCoordinate(MAP_PROJECTION.EPSG_3857);
olMap.setCenter(transformedCenterCoordinate);
olMap.setZoom(italyLocation.getZoomLevel());
}
/**
* To data point query.
*
* @param coordinate the coordinate
* @param manualClick the manual click
* @return the geo query
*/
public GeoQuery toDataPointQuery(Coordinate coordinate, boolean manualClick) {
double lon = coordinate.getX();
double lat = coordinate.getY();
GWT.log("To quey DP: " + coordinate);
int w = (int) olMap.getSize().getWidth();
int h = (int) olMap.getSize().getHeight();
// handler.clickOnMap(x, y, w, h);
// ratio - mapPixelWeight : bboxWeight = 20px : geoRectangleWidth
// where 10px is the pixel diameter dimension of the clicked point
double bboxWidth = Math.abs(olMap.getExtent().getLowerLeftX() - olMap.getExtent().getUpperRightX());
double geoWidth = 0;
// adding a tolerance in case of manual click
if (manualClick) {
// adding a tolerance for clicking
// geoWidth = (bboxWidth / w) * (14 / 2);
geoWidth = (bboxWidth / w) * (16 / 2);
} else {
// data point selection for coordinate loaded from the centroid
geoWidth = (bboxWidth / w) / 60;
GWT.log("geo width: "+geoWidth);
}
double x1 = Math.min(lon + geoWidth, lon - geoWidth);
double x2 = Math.max(lon + geoWidth, lon - geoWidth);
double y1 = Math.min(lat + geoWidth, lat - geoWidth);
double y2 = Math.max(lat + geoWidth, lat - geoWidth);
//GWT.log("("+x1+","+y1+")("+x2+","+y2+")");
GeoQuery select = new GeoQuery(x1, y1, x2, y2, TYPE.POINT);
return select;
}
/**
* Gets the OL map.
*
* @return the OL map
*/
public OpenLayerMap getOLMap() {
return olMap;
}
/**
* Check select query.
*
* @param mapEventType the map event type
*/
private void checkSelectQuery(MapEventType mapEventType) {
GWT.log("Zoom is:" + olMap.getCurrentZoomLevel());
GWT.log("Resolution is:" + olMap.getCurrentResolution());
if (dragStartExtent != null && olMap.getCurrentZoomLevel() > QUERY_MIN_ZOOM_LEVEL) {
dragEndExtent = olMap.getExtent();
// GWT.log("Drag end is: "+dragEndExtent);
ExtentWrapped startExt = new ExtentWrapped(dragStartExtent.getLowerLeftX(), dragStartExtent.getLowerLeftY(),
dragStartExtent.getUpperRightX(), dragStartExtent.getUpperRightY());
ExtentWrapped endExt = new ExtentWrapped(dragEndExtent.getLowerLeftX(), dragEndExtent.getLowerLeftY(),
dragEndExtent.getUpperRightX(), dragEndExtent.getUpperRightY());
// GWT.log("start Ext: "+startExt);
// GWT.log("endExt Ext: "+endExt);
long dist = MapUtils.distanceBetweenCentroid(startExt, endExt);
GWT.log("the distance is: " + dist);
if (dist > 5000 || startExt.containsExtent(endExt)) {
GeoQuery select = toDataBoxQuery(dragEndExtent);
// TODO THE AUTOMATICALLY SHOWING POP-UP ACCORDING TO ZOOM IS BUGGY
layerManagerBus.fireEvent(new QueryDataEvent(select, endExt, null, false, mapEventType));
}
} else if (zoomStart != null && zoomEnd != null) {
if (zoomEnd < QUERY_MIN_ZOOM_LEVEL) {
layerManagerBus.fireEvent(new ZoomOutOverMinimumEvent(zoomStart, zoomEnd, QUERY_MIN_ZOOM_LEVEL));
}
}
}
/**
* Sets the drag start.
*/
private void setDragStart() {
if (olMap.getCurrentZoomLevel() > QUERY_MIN_ZOOM_LEVEL) {
dragStartExtent = olMap.getExtent();
GWT.log("Drag Start is: " + dragStartExtent);
}
}
/**
* To data point query.
*
* @param extent the extent
* @return the geo query
*/
private GeoQuery toDataBoxQuery(ol.Extent extent) {
return new GeoQuery(extent.getLowerLeftX(), extent.getLowerLeftY(), extent.getUpperRightX(),
extent.getUpperRightY(), TYPE.BOX);
}
/**
* Checks if is query point active.
*
* @return true, if is query point active
*/
public boolean isQueryPointActive() {
return olMap.isQueryPointActive();
}
/**
* Hide pop info.
*/
public void hidePopInfo() {
olMap.hidePopup();
}
}

View File

@ -0,0 +1,70 @@
package org.gcube.portlets.user.geoportaldataviewer.client;
import java.util.ArrayList;
import java.util.HashMap;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.dandd.DragDropLayer;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerObject;
import com.github.gwtbootstrap.client.ui.Label;
import com.github.gwtbootstrap.client.ui.constants.LabelType;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.user.client.ui.FlowPanel;
public class OverlayLayerManager {
// private ArrayList<LayerObject> layers = new ArrayList<LayerObject>();
// private FlowPanel fp = new FlowPanel();
private FlowPanel clusterCollectionsMainPanel = new FlowPanel();
private HashMap<String, ArrayList<DragDropLayer>> mapCollectionsPerProfileID = new HashMap<String, ArrayList<DragDropLayer>>();
private HashMap<String, FlowPanel> mapCollectionsContainersPerProfileID = new HashMap<String, FlowPanel>();
private HandlerManager applicationBus;
public OverlayLayerManager(HandlerManager applicationBus) {
this.applicationBus = applicationBus;
}
public void addLayerItem(LayerObject lo) {
GWT.log("Adding LayerObject having project: "+lo.getProjectDV());
GWT.log("Adding LayerObject having project id: "+lo.getProjectDV().getId());
ArrayList<DragDropLayer> listDDLayers = mapCollectionsPerProfileID.get(lo.getProfileID());
if (listDDLayers == null) {
String collectionName = lo.getProjectDV() != null && lo.getProjectDV().getProfileName() != null
? lo.getProjectDV().getProfileName()
: lo.getProfileID();
Label labelCollectionName = new Label(collectionName);
labelCollectionName.setType(LabelType.WARNING);
clusterCollectionsMainPanel.add(labelCollectionName);
listDDLayers = new ArrayList<DragDropLayer>();
}
FlowPanel fp = new FlowPanel();
fp.getElement().getStyle().setMarginLeft(10, Unit.PX);
DragDropLayer dandd = new DragDropLayer(applicationBus, lo, true, true);
listDDLayers.add(dandd);
fp.add(dandd);
mapCollectionsContainersPerProfileID.put(lo.getProfileID(), fp);
mapCollectionsPerProfileID.put(lo.getProfileID(), listDDLayers);
clusterCollectionsMainPanel.add(fp);
}
public void resetLayers() {
clusterCollectionsMainPanel.clear();
mapCollectionsContainersPerProfileID.clear();
mapCollectionsPerProfileID.clear();
}
public FlowPanel getPanel() {
return clusterCollectionsMainPanel;
}
}

View File

@ -0,0 +1,18 @@
package org.gcube.portlets.user.geoportaldataviewer.client;
import org.gcube.portlets.user.geoportaldataviewer.shared.ViewerConfiguration;
public class ViewerStatus {
private ViewerConfiguration viewerConfig;
public void setConfig(ViewerConfiguration result) {
this.viewerConfig = result;
}
public ViewerConfiguration getViewerConfig() {
return viewerConfig;
}
}

View File

@ -0,0 +1,69 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events;
import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV;
import com.google.gwt.event.shared.GwtEvent;
/**
* The Class AddedLayerToMapEvent.
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
*
* Nov 18, 2020
*/
public class AddLayerToMapEvent extends GwtEvent<AddLayerToMapEventHandler> {
public static Type<AddLayerToMapEventHandler> TYPE = new Type<AddLayerToMapEventHandler>();
private ProjectDV theProjectDV;
private boolean notifyClashing;
/**
* Instantiates a new adds the layer to map event.
*
* @param theProjectDV the the project DV
* @param notifyClashing the notify clashing
*/
public AddLayerToMapEvent(ProjectDV theProjectDV, boolean notifyClashing) {
this.theProjectDV = theProjectDV;
this.notifyClashing = notifyClashing;
}
/**
* Gets the associated type.
*
* @return the associated type
*/
@Override
public Type<AddLayerToMapEventHandler> getAssociatedType() {
return TYPE;
}
/**
* Dispatch.
*
* @param handler the handler
*/
@Override
protected void dispatch(AddLayerToMapEventHandler handler) {
handler.onAddingLayerForProject(this);
}
/**
* Gets the the project DV.
*
* @return the the project DV
*/
public ProjectDV getTheProjectDV() {
return theProjectDV;
}
/**
* Checks if is notify clashing.
*
* @return true, if is notify clashing
*/
public boolean isNotifyClashing() {
return notifyClashing;
}
}

View File

@ -0,0 +1,21 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events;
import com.google.gwt.event.shared.EventHandler;
/**
* The Interface AddLayerToMapEventHandler.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Nov 9, 2022
*/
public interface AddLayerToMapEventHandler extends EventHandler {
/**
* On adding layer for project.
*
* @param addLayerToMapEvent the add layer to map event
*/
void onAddingLayerForProject(AddLayerToMapEvent addLayerToMapEvent);
}

View File

@ -0,0 +1,80 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem;
import com.google.gwt.event.shared.GwtEvent;
/**
* The Class AddedLayerToMapEvent.
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
*
* Nov 18, 2020
*/
public class AddedLayerToMapEvent extends GwtEvent<AddedLayerToMapEventHandler> {
public static Type<AddedLayerToMapEventHandler> TYPE = new Type<AddedLayerToMapEventHandler>();
private LayerItem layerItem;
private LAYER_TYPE layerType;
/**
* The Enum LAYER_TYPE.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Oct 11, 2021
*/
public enum LAYER_TYPE {
BASE, OVERLAY
}
/**
* Instantiates a new added layer to map event.
*
* @param layerItem the layer item
* @param layerType the layer type
*/
public AddedLayerToMapEvent(LayerItem layerItem, LAYER_TYPE layerType) {
this.layerItem = layerItem;
this.layerType = layerType;
}
/**
* Gets the associated type.
*
* @return the associated type
*/
@Override
public Type<AddedLayerToMapEventHandler> getAssociatedType() {
return TYPE;
}
/**
* Dispatch.
*
* @param handler the handler
*/
@Override
protected void dispatch(AddedLayerToMapEventHandler handler) {
handler.onLayerRendered(this);
}
/**
* Gets the layer item.
*
* @return the layer item
*/
public LayerItem getLayerItem() {
return layerItem;
}
/**
* Gets the layer type.
*
* @return the layer type
*/
public LAYER_TYPE getLayerType() {
return layerType;
}
}

View File

@ -0,0 +1,20 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events;
import com.google.gwt.event.shared.EventHandler;
/**
* The Interface AddedLayerToMapEventHandler.
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
*
* Nov 18, 2020
*/
public interface AddedLayerToMapEventHandler extends EventHandler {
/**
* On layer rendered.
*
* @param addedLayerToMapEvent the added layer to map event
*/
void onLayerRendered(AddedLayerToMapEvent addedLayerToMapEvent);
}

View File

@ -0,0 +1,72 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events;
import org.gcube.application.geoportalcommon.shared.geoportal.materialization.IndexLayerDV;
import com.google.gwt.event.shared.GwtEvent;
/**
* The Class AddedLayerToMapEvent.
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
*
* Nov 18, 2020
*/
public class ApplyCQLToLayerOnMapEvent extends GwtEvent<ApplyCQLToLayerOnMapEventHandler> {
public static Type<ApplyCQLToLayerOnMapEventHandler> TYPE = new Type<ApplyCQLToLayerOnMapEventHandler>();
private IndexLayerDV theIndeLayer;
private String cqlFilterValue;
/**
* Instantiates a new apply CQL to layer map event.
*
* @param theIndeLayer the the inde layer
* @param cqlFilter the cql filter
*/
public ApplyCQLToLayerOnMapEvent(IndexLayerDV theIndeLayer, String cqlFilterValue) {
this.theIndeLayer = theIndeLayer;
this.cqlFilterValue = cqlFilterValue;
}
/**
* Gets the associated type.
*
* @return the associated type
*/
@Override
public Type<ApplyCQLToLayerOnMapEventHandler> getAssociatedType() {
return TYPE;
}
/**
* Dispatch.
*
* @param handler the handler
*/
@Override
protected void dispatch(ApplyCQLToLayerOnMapEventHandler handler) {
handler.onApplyCQL(this);
}
public IndexLayerDV getTheIndeLayer() {
return theIndeLayer;
}
public String getCqlFilterValue() {
return cqlFilterValue;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("ApplyCQLToLayerOnMapEvent [theIndeLayer=");
builder.append(theIndeLayer);
builder.append(", cqlFilterValue=");
builder.append(cqlFilterValue);
builder.append("]");
return builder.toString();
}
}

View File

@ -0,0 +1,20 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events;
import com.google.gwt.event.shared.EventHandler;
/**
* The Interface ApplyCQLToLayerOnMapEventHandler.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* May 31, 2023
*/
public interface ApplyCQLToLayerOnMapEventHandler extends EventHandler {
/**
* On apply CQL.
*
* @param applyCQLToLayerMapEvent the apply CQL to layer map event
*/
void onApplyCQL(ApplyCQLToLayerOnMapEvent applyCQLToLayerMapEvent);
}

View File

@ -0,0 +1,57 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BaseMapLayer;
import com.google.gwt.event.shared.GwtEvent;
/**
* The Class ChangeMapLayerEvent.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Nov 12, 2021
*/
public class ChangeMapLayerEvent extends GwtEvent<ChangeMapLayerEventHandler> {
public static Type<ChangeMapLayerEventHandler> TYPE = new Type<ChangeMapLayerEventHandler>();
private BaseMapLayer baseMapLayer;
/**
* Instantiates a new change map layer event.
*
* @param baseMapLayer the base map layer
*/
public ChangeMapLayerEvent(BaseMapLayer baseMapLayer) {
this.baseMapLayer = baseMapLayer;
}
/**
* Gets the associated type.
*
* @return the associated type
*/
@Override
public Type<ChangeMapLayerEventHandler> getAssociatedType() {
return TYPE;
}
/**
* Dispatch.
*
* @param handler the handler
*/
@Override
protected void dispatch(ChangeMapLayerEventHandler handler) {
handler.onChangeBaseMapLayer(this);
}
/**
* Gets the base map layer.
*
* @return the base map layer
*/
public BaseMapLayer getBaseMapLayer() {
return baseMapLayer;
}
}

View File

@ -0,0 +1,20 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events;
import com.google.gwt.event.shared.EventHandler;
/**
* The Interface ChangeMapLayerEventHandler.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Nov 12, 2021
*/
public interface ChangeMapLayerEventHandler extends EventHandler {
/**
* On change base map layer.
*
* @param changeMapLayerEvent the change map layer event
*/
void onChangeBaseMapLayer(ChangeMapLayerEvent changeMapLayerEvent);
}

View File

@ -0,0 +1,41 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events;
import com.google.gwt.event.shared.GwtEvent;
/**
* The Class ClosedViewDetailsEvent.
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
*
* Nov 19, 2020
*/
public class ClosedViewDetailsEvent extends GwtEvent<ClosedViewDetailsEventHandler> {
public static Type<ClosedViewDetailsEventHandler> TYPE = new Type<ClosedViewDetailsEventHandler>();
public ClosedViewDetailsEvent() {
}
/**
* Gets the associated type.
*
* @return the associated type
*/
@Override
public Type<ClosedViewDetailsEventHandler> getAssociatedType() {
return TYPE;
}
/**
* Dispatch.
*
* @param handler the handler
*/
@Override
protected void dispatch(ClosedViewDetailsEventHandler handler) {
handler.onClosed(this);
}
}

View File

@ -0,0 +1,21 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events;
import com.google.gwt.event.shared.EventHandler;
/**
* The Interface ClosedViewDetailsEventHandler.
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
*
* Nov 19, 2020
*/
public interface ClosedViewDetailsEventHandler extends EventHandler {
/**
* On closed.
*
* @param closedViewDetailsEvent the closed view details event
*/
void onClosed(ClosedViewDetailsEvent closedViewDetailsEvent);
}

View File

@ -0,0 +1,260 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.dandd.DragDropLayer;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerObject;
import com.google.gwt.event.shared.GwtEvent;
/**
* The Class DoActionOnDetailLayersEvent.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Oct 12, 2021
*/
public class DoActionOnDetailLayersEvent extends GwtEvent<DoActionOnDetailLayersEventHandler> {
public static Type<DoActionOnDetailLayersEventHandler> TYPE = new Type<DoActionOnDetailLayersEventHandler>();
/**
* The Enum DO_LAYER_ACTION.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Oct 12, 2021
*/
public static enum DO_LAYER_ACTION {
VISIBILITY, SWAP, OPACITY, LOCATE_LAYER
}
private DO_LAYER_ACTION doAction;
private LayerItem layerItem;
private double opacity;
private boolean visibility;
private SwapLayer sourceLayerSwap;
private SwapLayer targetLayerSwap;
private LayerObject layerObject;
private DragDropLayer sourceEventUI;
/**
* The Class SwapLayer.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Oct 15, 2021
*/
public static class SwapLayer {
private LayerItem layerItem;
private int position;
/**
* Instantiates a new swap layer.
*
* @param layerItem the layer item
* @param position the position
*/
public SwapLayer(LayerItem layerItem, int position) {
this.layerItem = layerItem;
this.position = position;
}
/**
* Gets the layer item.
*
* @return the layer item
*/
public LayerItem getLayerItem() {
return layerItem;
}
/**
* Gets the position.
*
* @return the position
*/
public int getPosition() {
return position;
}
}
/**
* Instantiates a new do action on detail layers event.
*
* @param action the action
* @param layerItem the layer item
* @param layerObject the layer object
* @param layerObject the layer object
*/
public DoActionOnDetailLayersEvent(DO_LAYER_ACTION action, LayerItem layerItem, LayerObject layerObject) {
this.layerItem = layerItem;
this.layerObject = layerObject;
this.doAction = action;
}
/**
* Sets the swap layers.
*
* @param sourceLayerItem the source layer item
* @param targetLayerItem the target layer item
*/
public void setSwapLayers(SwapLayer sourceLayerItem, SwapLayer targetLayerItem) {
this.sourceLayerSwap = sourceLayerItem;
this.targetLayerSwap = targetLayerItem;
}
/**
* Sets the opacity.
*
* @param opacity the new opacity
*/
public void setOpacity(double opacity) {
this.opacity = opacity;
}
/**
* Sets the visibility.
*
* @param visibility the new visibility
*/
public void setVisibility(boolean visibility) {
this.visibility = visibility;
}
/**
* Gets the associated type.
*
* @return the associated type
*/
@Override
public Type<DoActionOnDetailLayersEventHandler> getAssociatedType() {
return TYPE;
}
/**
* Dispatch.
*
* @param handler the handler
*/
@Override
protected void dispatch(DoActionOnDetailLayersEventHandler handler) {
handler.onDoActionOnDetailLayers(this);
}
/**
* Gets the layer object.
*
* @return the layer object
*/
public LayerObject getLayerObject() {
return layerObject;
}
/**
* Sets the layer object.
*
* @param layerObject the new layer object
*/
public void setLayerObject(LayerObject layerObject) {
this.layerObject = layerObject;
}
/**
* Gets the do action.
*
* @return the do action
*/
public DO_LAYER_ACTION getDoAction() {
return doAction;
}
/**
* Gets the layer item.
*
* @return the layer item
*/
public LayerItem getLayerItem() {
return layerItem;
}
/**
* Gets the source layer swap.
*
* @return the source layer swap
*/
public SwapLayer getSourceLayerSwap() {
return sourceLayerSwap;
}
/**
* Gets the target layer swap.
*
* @return the target layer swap
*/
public SwapLayer getTargetLayerSwap() {
return targetLayerSwap;
}
/**
* Gets the opacity.
*
* @return the opacity
*/
public double getOpacity() {
return opacity;
}
/**
* Gets the visibility.
*
* @return the visibility
*/
public boolean getVisibility() {
return visibility;
}
/**
* Sets the UI event source.
*
* @param sourceEventUI the new UI event source
*/
public void setUIEventSource(DragDropLayer sourceEventUI) {
this.sourceEventUI = sourceEventUI;
}
/**
* Gets the source event UI.
*
* @return the source event UI
*/
public DragDropLayer getSourceEventUI() {
return sourceEventUI;
}
/**
* To string.
*
* @return the string
*/
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("DoActionOnDetailLayersEvent [doAction=");
builder.append(doAction);
builder.append(", layerItem=");
builder.append(layerItem);
builder.append(", opacity=");
builder.append(opacity);
builder.append(", visibility=");
builder.append(visibility);
builder.append(", sourceLayerSwap=");
builder.append(sourceLayerSwap);
builder.append(", targetLayerSwap=");
builder.append(targetLayerSwap);
builder.append("]");
return builder.toString();
}
}

View File

@ -0,0 +1,21 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events;
import com.google.gwt.event.shared.EventHandler;
/**
* The Interface DoActionOnDetailLayersEventHandler.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Oct 8, 2021
*/
public interface DoActionOnDetailLayersEventHandler extends EventHandler {
/**
* On do action on detail layers.
*
* @param doActionOnDetailLayersEvent the do action on detail layers event
*/
void onDoActionOnDetailLayers(DoActionOnDetailLayersEvent doActionOnDetailLayersEvent);
}

View File

@ -0,0 +1,52 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events;
import com.google.gwt.event.shared.GwtEvent;
import ol.Extent;
/**
* The Class FitMapToExtentEvent.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Jun 6, 2023
*/
public class FitMapToExtentEvent extends GwtEvent<FitMapToExtentEventHandler> {
public static Type<FitMapToExtentEventHandler> TYPE = new Type<FitMapToExtentEventHandler>();
private Extent extent;
/**
* Instantiates a new fit map to extent event.
*
* @param extent the extent
*/
public FitMapToExtentEvent(Extent extent) {
this.extent = extent;
}
/**
* Gets the associated type.
*
* @return the associated type
*/
@Override
public Type<FitMapToExtentEventHandler> getAssociatedType() {
return TYPE;
}
/**
* Dispatch.
*
* @param handler the handler
*/
@Override
protected void dispatch(FitMapToExtentEventHandler handler) {
handler.onFitToMap(this);
}
public Extent getExtent() {
return extent;
}
}

View File

@ -0,0 +1,20 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events;
import com.google.gwt.event.shared.EventHandler;
/**
* The Interface FitMapToExtentEventHandler.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Jun 6, 2023
*/
public interface FitMapToExtentEventHandler extends EventHandler {
/**
* On fit to map.
*
* @param fitMapToExtentEvent the fit map to extent event
*/
void onFitToMap(FitMapToExtentEvent fitMapToExtentEvent);
}

View File

@ -0,0 +1,83 @@
//package org.gcube.portlets.user.geoportaldataviewer.client.events;
//
//import org.gcube.application.geoportalcommon.shared.SearchingFilter;
//import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.RECORD_TYPE;
//
//import com.google.gwt.event.shared.GwtEvent;
//
///**
// * The Class GetListOfRecordsEvent.
// *
// * @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
// *
// * Dec 7, 2021
// */
//public class GetListOfRecordsEvent extends GwtEvent<GetListOfRecordsEventHandler> {
//
// /** The type. */
// public static Type<GetListOfRecordsEventHandler> TYPE = new Type<GetListOfRecordsEventHandler>();
// private RECORD_TYPE recordType;
// private SearchingFilter sortFilter;
//
// /**
// * Instantiates a new cancel upload event.
// *
// * @param recordType the record type
// * @param sortFilter the sort filter
// */
// public GetListOfRecordsEvent(RECORD_TYPE recordType, SearchingFilter sortFilter) {
// this.recordType = recordType;
// this.sortFilter = sortFilter;
// }
//
// /**
// * Gets the associated type.
// *
// * @return the associated type
// */
// /*
// * (non-Javadoc)
// *
// * @see com.google.gwt.event.shared.GwtEvent#getAssociatedType()
// */
// @Override
// public Type<GetListOfRecordsEventHandler> getAssociatedType() {
// return TYPE;
// }
//
// /**
// * Dispatch.
// *
// * @param handler the handler
// */
// /*
// * (non-Javadoc)
// *
// * @see
// * com.google.gwt.event.shared.GwtEvent#dispatch(com.google.gwt.event.shared.
// * EventHandler)
// */
// @Override
// protected void dispatch(GetListOfRecordsEventHandler handler) {
// handler.onGetList(this);
// }
//
// /**
// * Gets the record type.
// *
// * @return the record type
// */
// public RECORD_TYPE getRecordType() {
// return recordType;
// }
//
// /**
// * Gets the sort filter.
// *
// * @return the sort filter
// */
// public SearchingFilter getSortFilter() {
// return sortFilter;
// }
//
//}

View File

@ -0,0 +1,22 @@
//package org.gcube.portlets.user.geoportaldataviewer.client.events;
//
//import com.google.gwt.event.shared.EventHandler;
//
//
///**
// * The Interface GetListOfRecordsEventHandler.
// *
// * @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
// *
// * Aug 4, 2021
// */
//public interface GetListOfRecordsEventHandler extends EventHandler {
//
//
// /**
// * On get list.
// *
// * @param getListOfRecordsEvent the get list of records event
// */
// void onGetList(GetListOfRecordsEvent getListOfRecordsEvent);
//}

View File

@ -0,0 +1,52 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.map.ExtentMapUtil.Location;
import com.google.gwt.event.shared.GwtEvent;
/**
* The Class MapExtentToEvent.
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
*
* Sep 1, 2021
*/
public class MapExtentToEvent extends GwtEvent<MapExtentToEventHandler> {
public static Type<MapExtentToEventHandler> TYPE = new Type<MapExtentToEventHandler>();
private Location location;
/**
* Instantiates a new map extent to event.
*
* @param layerItem the layer item
*/
public MapExtentToEvent(Location location) {
this.location = location;
}
/**
* Gets the associated type.
*
* @return the associated type
*/
@Override
public Type<MapExtentToEventHandler> getAssociatedType() {
return TYPE;
}
/**
* Dispatch.
*
* @param handler the handler
*/
@Override
protected void dispatch(MapExtentToEventHandler handler) {
handler.onExtentEvent(this);
}
public Location getLocation() {
return location;
}
}

View File

@ -0,0 +1,20 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events;
import com.google.gwt.event.shared.EventHandler;
/**
* The Interface MapExtentToEventHandler.
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
*
* Sep 1, 2021
*/
public interface MapExtentToEventHandler extends EventHandler {
/**
* On extent event.
*
* @param mapExtentToEvent the map extent to event
*/
void onExtentEvent(MapExtentToEvent mapExtentToEvent);
}

View File

@ -0,0 +1,92 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem;
import com.google.gwt.event.shared.GwtEvent;
/**
* The Class OverlayCustomLayerToMapEvent.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* May 15, 2023
*/
public class OverlayCustomLayerToMapEvent extends GwtEvent<OverlayCustomLayerToMapEventHandler> {
public static Type<OverlayCustomLayerToMapEventHandler> TYPE = new Type<OverlayCustomLayerToMapEventHandler>();
private LayerItem layerItem;
private ACTION_TYPE actionType;
private boolean enabled;
/**
* The Enum ACTION_TYPE.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* May 15, 2023
*/
public enum ACTION_TYPE {
VISIBILITY
}
/**
* Instantiates a new overlay custom layer to map event.
*
* @param layerItem the layer item
* @param actionType the action type
* @param enabled the enabled
*/
public OverlayCustomLayerToMapEvent(LayerItem layerItem, ACTION_TYPE actionType, boolean enabled) {
this.layerItem = layerItem;
this.actionType = actionType;
this.enabled = enabled;
}
/**
* Gets the associated type.
*
* @return the associated type
*/
@Override
public Type<OverlayCustomLayerToMapEventHandler> getAssociatedType() {
return TYPE;
}
/**
* Dispatch.
*
* @param handler the handler
*/
@Override
protected void dispatch(OverlayCustomLayerToMapEventHandler handler) {
handler.onCustomOverlayLayerAction(this);
}
/**
* Gets the layer item.
*
* @return the layer item
*/
public LayerItem getLayerItem() {
return layerItem;
}
/**
* Gets the action type.
*
* @return the action type
*/
public ACTION_TYPE getActionType() {
return actionType;
}
/**
* Checks if is enabled.
*
* @return true, if is enabled
*/
public boolean isEnabled() {
return enabled;
}
}

View File

@ -0,0 +1,20 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events;
import com.google.gwt.event.shared.EventHandler;
/**
* The Interface OverlayCustomLayerToMapEventHandler.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* May 15, 2023
*/
public interface OverlayCustomLayerToMapEventHandler extends EventHandler {
/**
* On custom overlay layer action.
*
* @param customOverLayerToMapEvent the custom over layer to map event
*/
void onCustomOverlayLayerAction(OverlayCustomLayerToMapEvent customOverLayerToMapEvent);
}

View File

@ -1,31 +1,42 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.MapEventType;
import org.gcube.portlets.user.geoportaldataviewer.client.gis.ExtentWrapped;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.GeoQuery;
import com.google.gwt.event.shared.GwtEvent;
import ol.Coordinate;
/**
* The Class QueryDataEvent.
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Oct 29, 2020
* Aug 31, 2021
*/
public class QueryDataEvent extends GwtEvent<QueryDataEventHandler> {
public static Type<QueryDataEventHandler> TYPE = new Type<QueryDataEventHandler>();
private GeoQuery select;
private Coordinate oLCoordinate;
private ExtentWrapped queryClickExtent;
private String productID;
private boolean onInit;
private MapEventType sourceMapEventType;
/**
* Instantiates a new table row selected event.
* @param coordinate
* Instantiates a new query data event.
*
* @param select the select
* @param onFailureCenterTo the on failure center to
* @param productID the mongo item id
* @param onInit the on init
* @param mapEventType the map event type
*/
public QueryDataEvent(GeoQuery select, Coordinate coordinate) {
public QueryDataEvent(GeoQuery select, ExtentWrapped queryClickExtent, String productID, boolean onInit,
MapEventType mapEventType) {
this.select = select;
this.oLCoordinate = coordinate;
this.queryClickExtent = queryClickExtent;
this.productID = productID;
this.onInit = onInit;
this.sourceMapEventType = mapEventType;
}
/**
@ -38,6 +49,19 @@ public class QueryDataEvent extends GwtEvent<QueryDataEventHandler> {
return TYPE;
}
public String getProductID() {
return productID;
}
/**
* Checks if is on init.
*
* @return true, if is on init
*/
public boolean isOnInit() {
return onInit;
}
/**
* Dispatch.
*
@ -48,12 +72,44 @@ public class QueryDataEvent extends GwtEvent<QueryDataEventHandler> {
handler.onQueryInteraction(this);
}
/**
* Gets the geo query.
*
* @return the geo query
*/
public GeoQuery getGeoQuery() {
return select;
}
public Coordinate getoLCoordinate() {
return oLCoordinate;
public ExtentWrapped getQueryClickExtent() {
return queryClickExtent;
}
/**
* Gets the source map event type.
*
* @return the source map event type
*/
public MapEventType getSourceMapEventType() {
return sourceMapEventType;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("QueryDataEvent [select=");
builder.append(select);
builder.append(", queryClickExtent=");
builder.append(queryClickExtent);
builder.append(", productID=");
builder.append(productID);
builder.append(", onInit=");
builder.append(onInit);
builder.append(", sourceMapEventType=");
builder.append(sourceMapEventType);
builder.append("]");
return builder.toString();
}
}

View File

@ -0,0 +1,81 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events;
import java.util.List;
import com.google.gwt.event.shared.GwtEvent;
/**
* The Class SearchPerformedEvent.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Dec 14, 2021
*/
public class SearchPerformedEvent extends GwtEvent<SearchPerformedEventHandler> {
public static Type<SearchPerformedEventHandler> TYPE = new Type<SearchPerformedEventHandler>();
private List<String> listProjectIDs;
private boolean searchReset;
private String profileID;
/**
* Instantiates a new search performed event.
*
* @param profileID the profile ID
* @param listProjectIds the list project ids
* @param searchReset the search reset
*/
public SearchPerformedEvent(String profileID, List<String> listProjectIds, boolean searchReset) {
this.profileID = profileID;
this.listProjectIDs = listProjectIds;
this.searchReset = searchReset;
}
/**
* Gets the associated type.
*
* @return the associated type
*/
@Override
public Type<SearchPerformedEventHandler> getAssociatedType() {
return TYPE;
}
/**
* Dispatch.
*
* @param handler the handler
*/
@Override
protected void dispatch(SearchPerformedEventHandler handler) {
handler.onSearchDone(this);
}
/**
* Gets the profile ID. It is equal to collectionID
*
* @return the profile ID
*/
public String getProfileID() {
return profileID;
}
/**
* Gets the list project Ids.
*
* @return the list project Ids
*/
public List<String> getListProjectIDs() {
return listProjectIDs;
}
/**
* Checks if is search reset.
*
* @return true, if is search reset
*/
public boolean isSearchReset() {
return searchReset;
}
}

View File

@ -0,0 +1,20 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events;
import com.google.gwt.event.shared.EventHandler;
/**
* The Interface SearchPerformedEventHandler.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Dec 14, 2021
*/
public interface SearchPerformedEventHandler extends EventHandler {
/**
* On search done.
*
* @param searchPerformedEvent the search performed event
*/
void onSearchDone(SearchPerformedEvent searchPerformedEvent);
}

View File

@ -1,30 +1,138 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events;
import org.gcube.portlets.user.geoportaldataviewer.shared.ProductType;
import org.gcube.application.geoportalcommon.shared.GeoportalItemReferences;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wfs.FeatureRow;
import com.google.gwt.event.shared.GwtEvent;
/**
* The Class QueryDataEvent.
* The Class ShowDetailsEvent.
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Oct 29, 2020
* Nov 14, 2022
*/
public class ShowDetailsEvent extends GwtEvent<ShowDetailsEventHandler> {
public static Type<ShowDetailsEventHandler> TYPE = new Type<ShowDetailsEventHandler>();
private ProductType productType;
private String layerObjectType;
private FeatureRow featureRow;
private String itemName;
private String profileID;
private String projectID;
private boolean loadTimelineRelationships;
private boolean isEventFromTimeline;
private EVENT_SOURCE sourceEvent;
/**
* Instantiates a new table row selected event.
* @param coordinate
* The Enum EVENT_SOURCE.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Dec 22, 2022
*/
public ShowDetailsEvent(ProductType productType, FeatureRow row) {
this.productType = productType;
this.featureRow = row;
public static enum EVENT_SOURCE {
LOCATE_ON_INIT, OPEN_DETAILS, OPEN_PROJECTS, LOCATE_SEARCHED, LOCATE_FROM_TIMELINE, GO_TO_LAYERS
}
/**
* Instantiates a new show details event.
*
* @param layerObjectType the layer object type
* @param profileID the profile ID
* @param projectID the project ID
* @param featureRow the feature row
* @param loadTimelineRelationships the load timeline relationships
* @param sourceEvent the source event
*/
public ShowDetailsEvent(String layerObjectType, String profileID, String projectID, FeatureRow featureRow,
boolean loadTimelineRelationships, EVENT_SOURCE sourceEvent) {
this.layerObjectType = layerObjectType;
this.profileID = profileID;
this.projectID = projectID;
this.featureRow = featureRow;
this.loadTimelineRelationships = loadTimelineRelationships;
this.sourceEvent = sourceEvent;
}
/**
* Instantiates a new show details event.
*
* @param gir the gir
* @param featureRow the feature row
* @param loadTimelineRelationships the load timeline relationships
* @param sourceEvent the source event
*/
public ShowDetailsEvent(GeoportalItemReferences gir, FeatureRow featureRow, boolean loadTimelineRelationships,
boolean goToLayers, EVENT_SOURCE sourceEvent) {
this.layerObjectType = gir.getLayerObjectType();
this.profileID = gir.getProfileID();
this.projectID = gir.getProjectID();
this.featureRow = featureRow;
this.loadTimelineRelationships = loadTimelineRelationships;
this.sourceEvent = sourceEvent;
}
/**
* Event from timeline.
*
* @param bool the bool
*/
public void setEventFromTimeline(boolean bool) {
this.isEventFromTimeline = bool;
}
/**
* Checks if is event from timeline.
*
* @return true, if is event from timeline
*/
public boolean isEventFromTimeline() {
return isEventFromTimeline;
}
/**
* Gets the source event.
*
* @return the source event
*/
public EVENT_SOURCE getSourceEvent() {
return sourceEvent;
}
/**
* Gets the type.
*
* @return the type
*/
public static Type<ShowDetailsEventHandler> getTYPE() {
return TYPE;
}
/**
* Gets the layer object type.
*
* @return the layer object type
*/
public String getLayerObjectType() {
return layerObjectType;
}
/**
* Gets the profile ID.
*
* @return the profile ID
*/
public String getProfileID() {
return profileID;
}
/**
* Gets the project ID.
*
* @return the project ID
*/
public String getProjectID() {
return projectID;
}
/**
@ -47,12 +155,55 @@ public class ShowDetailsEvent extends GwtEvent<ShowDetailsEventHandler> {
handler.onShowDetails(this);
}
public ProductType getProductType() {
return productType;
}
/**
* Gets the feature row.
*
* @return the feature row
*/
public FeatureRow getFeatureRow() {
return featureRow;
}
/**
* Checks if is load timeline relationships.
*
* @return true, if is load timeline relationships
*/
public boolean isLoadTimelineRelationships() {
return loadTimelineRelationships;
}
/**
* Gets the geona item ref.
*
* @return the geona item ref
*/
public GeoportalItemReferences getGeonaItemRef() {
return new GeoportalItemReferences(projectID, profileID, layerObjectType);
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("ShowDetailsEvent [layerObjectType=");
builder.append(layerObjectType);
builder.append(", featureRow=");
builder.append(featureRow);
builder.append(", itemName=");
builder.append(itemName);
builder.append(", profileID=");
builder.append(profileID);
builder.append(", projectID=");
builder.append(projectID);
builder.append(", loadTimelineRelationships=");
builder.append(loadTimelineRelationships);
builder.append(", isEventFromTimeline=");
builder.append(isEventFromTimeline);
builder.append(", sourceEvent=");
builder.append(sourceEvent);
builder.append("]");
return builder.toString();
}
}

View File

@ -0,0 +1,122 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events;
import org.gcube.application.geoportalcommon.shared.geoportal.geojson.GeoJSON;
import org.gcube.application.geoportalcommon.shared.geoportal.view.ProjectView;
import com.google.gwt.event.shared.GwtEvent;
/**
* The Class ShowPopupOnCentroidEvent.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Jan 12, 2023
*/
public class ShowPopupOnCentroidEvent extends GwtEvent<ShowPopupOnCentroidEventHandler> {
public static Type<ShowPopupOnCentroidEventHandler> TYPE = new Type<ShowPopupOnCentroidEventHandler>();
private String profileID;
private String projectID;
private GeoJSON spatialReference;
private ProjectView projectView;
/**
* Instantiates a new show popup on centroid event.
*
* @param profileID the profile ID
* @param projectID the project ID
* @param spatialReference the spatial reference
*/
public ShowPopupOnCentroidEvent(String profileID, String projectID, GeoJSON spatialReference) {
this.profileID = profileID;
this.projectID = projectID;
this.spatialReference = spatialReference;
}
/**
* Instantiates a new show popup on centroid event.
*
* @param projectView the project view
*/
public ShowPopupOnCentroidEvent(ProjectView projectView) {
this.projectView = projectView;
}
/**
* Gets the associated type.
*
* @return the associated type
*/
@Override
public Type<ShowPopupOnCentroidEventHandler> getAssociatedType() {
return TYPE;
}
/**
* Dispatch.
*
* @param handler the handler
*/
@Override
protected void dispatch(ShowPopupOnCentroidEventHandler handler) {
handler.onShowPopup(this);
}
/**
* Gets the profile ID.
*
* @return the profile ID
*/
public String getProfileID() {
return profileID;
}
/**
* Gets the project ID.
*
* @return the project ID
*/
public String getProjectID() {
return projectID;
}
/**
* Gets the spatial reference.
*
* @return the spatial reference
*/
public GeoJSON getSpatialReference() {
return spatialReference;
}
/**
* Gets the project view.
*
* @return the project view
*/
public ProjectView getProjectView() {
return projectView;
}
/**
* To string.
*
* @return the string
*/
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("ShowPopupOnCentroidEvent [profileID=");
builder.append(profileID);
builder.append(", projectID=");
builder.append(projectID);
builder.append(", spatialReference=");
builder.append(spatialReference);
builder.append(", projectView=");
builder.append(projectView);
builder.append("]");
return builder.toString();
}
}

View File

@ -0,0 +1,20 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events;
import com.google.gwt.event.shared.EventHandler;
/**
* The Interface ShowPopupOnCentroidEventHandler.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Jan 12, 2023
*/
public interface ShowPopupOnCentroidEventHandler extends EventHandler {
/**
* On show popup.
*
* @param showPopupOnCentroiEvent the show popup on centroi event
*/
void onShowPopup(ShowPopupOnCentroidEvent showPopupOnCentroiEvent);
}

View File

@ -0,0 +1,80 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events;
import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV;
import com.google.gwt.event.shared.GwtEvent;
/**
* The Class TimelineProjectRelationsEvent.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Nov 3, 2022
*/
public class TimelineProjectRelationsEvent extends GwtEvent<TimelineProjectRelationsEventHandler> {
public static Type<TimelineProjectRelationsEventHandler> TYPE = new Type<TimelineProjectRelationsEventHandler>();
private EVENT_TYPE eventType = EVENT_TYPE.HIDE; //default
private ProjectDV theProjectDV;
/**
* The Enum EVENT_TYPE.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Nov 3, 2022
*/
public enum EVENT_TYPE {
SHOW, HIDE
}
/**
* Instantiates a new timeline project relations event.
*
* @param theProjectDV the the project DV
* @param eventType the event type
*/
public TimelineProjectRelationsEvent(ProjectDV theProjectDV, EVENT_TYPE eventType) {
this.theProjectDV = theProjectDV;
this.eventType = eventType;
}
/**
* Gets the associated type.
*
* @return the associated type
*/
@Override
public Type<TimelineProjectRelationsEventHandler> getAssociatedType() {
return TYPE;
}
/**
* Dispatch.
*
* @param handler the handler
*/
@Override
protected void dispatch(TimelineProjectRelationsEventHandler handler) {
handler.onTimelineRelationEvent(this);
}
/**
* Gets the event type.
*
* @return the event type
*/
public EVENT_TYPE getEventType() {
return eventType;
}
/**
* Gets the the project DV.
*
* @return the the project DV
*/
public ProjectDV getTheProjectDV() {
return theProjectDV;
}
}

View File

@ -0,0 +1,20 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events;
import com.google.gwt.event.shared.EventHandler;
/**
* The Interface TimelineProjectRelationsEventHandler.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Nov 3, 2022
*/
public interface TimelineProjectRelationsEventHandler extends EventHandler {
/**
* On timeline relation event.
*
* @param timelineProjectRelationsEvent the timeline project relations event
*/
void onTimelineRelationEvent(TimelineProjectRelationsEvent timelineProjectRelationsEvent);
}

View File

@ -0,0 +1,134 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events;
import org.gcube.portlets.user.geoportaldataviewer.shared.GCubeCollection;
import com.google.gwt.event.shared.GwtEvent;
/**
* The Class UpdateLayerToMapEvent.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Jun 15, 2023
*/
public class UpdateLayerToMapEvent extends GwtEvent<UpdateLayerToMapEventHandler> {
public static Type<UpdateLayerToMapEventHandler> TYPE = new Type<UpdateLayerToMapEventHandler>();
private GCubeCollection collection;
private String layerName;
private REQUEST_PARAMETER operation;
private String value;
private LAYER_TYPE layerType;
/**
* The Enum REQUEST_PARAMETER.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Jun 15, 2023
*/
public static enum REQUEST_PARAMETER {
STYLE
}
/**
* The Enum LAYER_TYPE.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Jun 15, 2023
*/
public static enum LAYER_TYPE {
INDEX, DETAILS
}
/**
* Instantiates a new adds the layer to map event.
*
* @param collection the collection
* @param layerName the layer name
* @param type the type
*/
public UpdateLayerToMapEvent(GCubeCollection collection, String layerName, LAYER_TYPE type) {
this.collection = collection;
this.layerName = layerName;
this.layerType = type;
}
/**
* Gets the associated type.
*
* @return the associated type
*/
@Override
public Type<UpdateLayerToMapEventHandler> getAssociatedType() {
return TYPE;
}
/**
* Sets the operation.
*
* @param operation the operation
* @param value the value
*/
public void setOperation(REQUEST_PARAMETER operation, String value) {
this.operation = operation;
this.value = value;
}
/**
* Gets the value.
*
* @return the value
*/
public String getValue() {
return value;
}
/**
* Gets the layer type.
*
* @return the layer type
*/
public LAYER_TYPE getLayerType() {
return layerType;
}
/**
* Gets the operation.
*
* @return the operation
*/
public REQUEST_PARAMETER getOperation() {
return operation;
}
/**
* Gets the layer name.
*
* @return the layer name
*/
public String getLayerName() {
return layerName;
}
/**
* Gets the collection.
*
* @return the collection
*/
public GCubeCollection getCollection() {
return collection;
}
/**
* Dispatch.
*
* @param handler the handler
*/
@Override
protected void dispatch(UpdateLayerToMapEventHandler handler) {
handler.onUpdateLayer(this);
}
}

View File

@ -0,0 +1,20 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events;
import com.google.gwt.event.shared.EventHandler;
/**
* The Interface UpdateLayerToMapEventHandler.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Jun 15, 2023
*/
public interface UpdateLayerToMapEventHandler extends EventHandler {
/**
* On update layer.
*
* @param updateLayerToMapEvent the update layer to map event
*/
void onUpdateLayer(UpdateLayerToMapEvent updateLayerToMapEvent);
}

View File

@ -0,0 +1,67 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events;
import com.google.gwt.event.shared.GwtEvent;
/**
* The Class ZoomOutEvent.
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
*
* Nov 19, 2020
*/
public class ZoomOutOverMinimumEvent extends GwtEvent<ZoomOutOverMinimumEventHandler> {
public static Type<ZoomOutOverMinimumEventHandler> TYPE = new Type<ZoomOutOverMinimumEventHandler>();
private double startZoom;
private double endZoom;
private double minimum;
/**
* Instantiates a new zoom out event.
*
* @param startZoom the start zoom
* @param endZoom the end zoom
* @param minimum the minimum
*/
public ZoomOutOverMinimumEvent(double startZoom, double endZoom, double minimum) {
this.startZoom = startZoom;
this.endZoom = endZoom;
this.minimum = minimum;
}
/**
* Gets the associated type.
*
* @return the associated type
*/
@Override
public Type<ZoomOutOverMinimumEventHandler> getAssociatedType() {
return TYPE;
}
/**
* Dispatch.
*
* @param handler the handler
*/
@Override
protected void dispatch(ZoomOutOverMinimumEventHandler handler) {
handler.onZoomOut(this);
}
public double getStartZoom() {
return startZoom;
}
public double getEndZoom() {
return endZoom;
}
public double getMinimum() {
return minimum;
}
}

View File

@ -0,0 +1,22 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events;
import com.google.gwt.event.shared.EventHandler;
/**
* The Interface ZoomOutEventHandler.
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
*
* Nov 19, 2020
*/
public interface ZoomOutOverMinimumEventHandler extends EventHandler {
/**
* On zoom out.
*
* @param zoomOutEvent the zoom out event
*/
void onZoomOut(ZoomOutOverMinimumEvent zoomOutEvent);
}

View File

@ -0,0 +1,30 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events.collections;
import com.google.gwt.event.shared.GwtEvent;
public class CloseCollectionEvent extends GwtEvent<CloseCollectionEventHandler> {
private String collectionId = null;
public static Type<CloseCollectionEventHandler> TYPE = new Type<CloseCollectionEventHandler>();
@Override
public Type<CloseCollectionEventHandler> getAssociatedType() {
return TYPE;
}
@Override
protected void dispatch(CloseCollectionEventHandler handler) {
handler.onCloseCollection(this);
}
public CloseCollectionEvent(String collectionId) {
this.collectionId=collectionId;
}
public String getCollectionId() {
return collectionId;
}
}

View File

@ -0,0 +1,9 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events.collections;
import com.google.gwt.event.shared.EventHandler;
public interface CloseCollectionEventHandler extends EventHandler{
void onCloseCollection(CloseCollectionEvent closeCollectionEvent);
}

View File

@ -0,0 +1,40 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events.collections;
import com.google.gwt.event.shared.GwtEvent;
public class OpenCollectionEvent extends GwtEvent<OpenCollectionEventHandler> {
private String collectionId = null;
public static Type<OpenCollectionEventHandler> TYPE = new Type<OpenCollectionEventHandler>();
/**
* Gets the associated type.
*
* @return the associated type
*/
@Override
public Type<OpenCollectionEventHandler> getAssociatedType() {
return TYPE;
}
/**
* Dispatch.
*
* @param handler the handler
*/
@Override
protected void dispatch(OpenCollectionEventHandler handler) {
handler.onOpenCollection(this);
}
public OpenCollectionEvent(String collectionId) {
this.collectionId = collectionId;
}
public String getCollectionId() {
return collectionId;
}
}

View File

@ -0,0 +1,10 @@
package org.gcube.portlets.user.geoportaldataviewer.client.events.collections;
import com.google.gwt.event.shared.EventHandler;
public interface OpenCollectionEventHandler extends EventHandler {
void onOpenCollection(OpenCollectionEvent event);
}

View File

@ -1,119 +0,0 @@
package org.gcube.portlets.user.geoportaldataviewer.client.gis;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants;
import com.google.gwt.dom.client.Document;
import com.google.gwt.dom.client.LinkElement;
import com.google.gwt.dom.client.Style.Display;
import com.google.gwt.dom.client.Style.Overflow;
import com.google.gwt.dom.client.Style.Position;
import com.google.gwt.dom.client.Style.Unit;
import ol.Collection;
import ol.Coordinate;
import ol.OLFactory;
import ol.OLUtil;
import ol.control.Control;
import ol.control.ControlOptions;
import ol.control.FullScreen;
import ol.control.MousePosition;
import ol.control.ZoomSlider;
import ol.geom.Polygon;
import ol.layer.Base;
import ol.layer.LayerOptions;
import ol.layer.Tile;
import ol.source.Osm;
import ol.source.XyzOptions;
/**
*
* @author Tino Desjardins
*
*/
public final class DemoUtils {
private DemoUtils() {
throw new AssertionError();
}
/**
* Creates some default controls and adds it to the collection.
*
* @param controls collection with controls
*/
public static void addDefaultControls(final Collection<Control> controls) {
controls.push(new FullScreen());
controls.push(new ZoomSlider());
MousePosition mousePosition = new MousePosition();
mousePosition.setCoordinateFormat(Coordinate.createStringXY(5));
controls.push(mousePosition);
//controls.push(new ZoomToExtent());
}
/**
* Create a MapBox logo.
*
* @return MapBox logo
*/
public static Control createMapboxLogo() {
ControlOptions controlOptions = new ControlOptions();
LinkElement mapboxLogo = Document.get().createLinkElement();
mapboxLogo.setHref("https://mapbox.com/about/maps");
mapboxLogo.setTarget("_blank");
mapboxLogo.getStyle().setPosition(Position.ABSOLUTE);
mapboxLogo.getStyle().setLeft(2, Unit.PX);
mapboxLogo.getStyle().setBottom(5, Unit.PX);
mapboxLogo.getStyle().setWidth(126, Unit.PX);
mapboxLogo.getStyle().setHeight(40, Unit.PX);
mapboxLogo.getStyle().setDisplay(Display.BLOCK);
mapboxLogo.getStyle().setOverflow(Overflow.HIDDEN);
mapboxLogo.getStyle().setBackgroundImage("url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIIAAAAoCAMAAAAFWtJHAAAAwFBMVEUAAAAAAAAAAABtbW0AAAAAAAAAAAAAAAAAAAAAAAClpaUAAADp6ekAAAD5+fna2toAAAAMDAzv7+/Nzc0AAAA2Njb8/Pz9/f3T09MAAAAAAAD7+/sAAAArKyuxsbH39/fs7OwbGxuIiIjz8/N8fHyenp7u7u74+PgAAAC8vLxWVlbx8fF1dXXl5eVcXFyUlJTQ0NDFxcVCQkLAwMC4uLj19fXo6OjW1tarq6ve3t77+/vi4uL6+vrKysrNzc3///8w7gSSAAAAP3RSTlMAOQNdPSYBPywKexLLGPCxNEHXnzFL+v2nGwf1IEiE6dBFad9jd9PuLo1V2mDDV3Cjl06SiuXIq4C3973ym6BQMVUPAAAEXElEQVR4Ae2WCVP6OBiH05L0l1IqrVbkKHJ54I0oHn+PfP9vtUle0z/YdhbH2XVnd58ZnRJIeHiPJOx//mH4vQSAN+8FjAhFxgHIaPvJeZ99hxwEElon5iAQbj85Y98g8ODwjEOMAvGFyeE3FEKgodTBqj0BJGN9DhyNd5Ta3ean9QEopfaA+LsKhnEKRExqg4FSP6Og7oEkAjBWnxSCgBX4xF+kcLoPcOBQrSv0e5kH7s1j37jECQieCTPiFGxL5VHw2zQWCeeJiPt6kjRQw0XSkIdVChf67xGa4alSnZlT6HEQ8CK9ANbhvXUF9xlDkBfTuHDWScgC9+z5FQpPI12TlwC6+sV7ixR8CUMKiwjm2GQeOQWHMGuHGdbnObJAwCEqFJpNU5H6uaPUaEIKiQfg+PHk1+u4OwW9PlWW2ctbA4BHCtp+cNK+H8Jos4gDmC5ar4Nx9waaG/2B13NgDqS7+vm2RgEtEws82P+kwIHhs/pgkQKcFIhfd7CogtGNjYMHTLpurD0ERbYFw4JaD3GlQuNAL/JEsSAF4HqlCnaHACk4WhOn4OgCkMD5hSpYNYDJTD8Y46n+jsE1kPhVCuR6QBXhFK7MUOu9O6b1SWF3b+/9ZVWMGOlu93E8UDaAhgc7bfH+0DHqKXCkHzoNDFfU+zxiVQrUC9QXTuHYtKpN59OA3IxCG4b7jh6ZFuVockaNTW09mkJzOaPU49a6mE9cAchZpQJNpUWcwgV9r6FJswsFKrITp2B5pMBMdnS0z2HZNy2+BNKxSZxZfglkrFYBJxQnpzA5sN/HheR2aFQoZBLAi149dQoyAYYjW0hHlHguBAdMcR0DuDZ5omevX6+AI8qcU7ikKT3GBHCnXwydgmCC0tRwCnGQ2Wp6Be71yNIWfQSkOl9vAI1SBCNWrwC01RROgX7BuT2HI4r7tFAw086p/NwZEdOEa7R1uAFuNmQPuKAEAjYNQ0CyeoUEWHYBnpQVQgpvc0Ph+gsKlAnKg1+vEHsw5LKciLKCAJobiWBzYFGbCKpHqkZZrxBFHEASyFI59vJPCskcwNVGOWZAOqsrR+pKbaNeAMT1CixMEtlnsqopNxUMzVJT3tY35aXZm6a6Y9QhwMN6BUJWbE1lhbMO1WehkO7poO0sK7em9MJGxp1XSbC1gtugzzSLQmGsX7VntJGSwsPZ2d2z3bIPKzdoOp3Wzqt8G4XyMVUoFIxLx1S7+piaHtCvR3FeRVsq0GFdp9C5TbGpcNqsPqyHKxcfd14h21KhuLKUFU4f3osrC7F6uV3WXFnadL7wyAPeKDXw2RoJCO5GY4DouYvb/gepVXheLoewzPseQG9N/vzilrMIjoStE3++zvle4eSurw7XEe76ynI4aq+v7lEyt1x5awiFlFLQbHKIpabnM3eJLym4Szzzc/du7SU+zOXv9UNpECH7IoH/gecURPlN9vdQpeD47yhIFNX0U0QgvID9nENm+yxk/xb+AGAjNfRZuk9qAAAAAElFTkSuQmCC)");
controlOptions.setElement(mapboxLogo);
return new Control(controlOptions);
}
/**
* Creates a test polygon geometry (triangle).
*
* @return test polygon geometry (EPSG:3857)
*/
public static Polygon createTestPolygon() {
Coordinate[][] coordinates = new Coordinate[1][4];
Coordinate point1 = new Coordinate(13.36, 52.53);
Coordinate point2 = new Coordinate(13.36, 52.51);
Coordinate point3 = new Coordinate(13.37, 52.52);
Coordinate point4 = new Coordinate(13.36, 52.53);
coordinates[0][0] = point1;
coordinates[0][1] = point2;
coordinates[0][2] = point3;
coordinates[0][3] = point4;
Coordinate[][] tranformedCoordinates = new Coordinate[coordinates.length][];
tranformedCoordinates[0] = OLUtil.transform(coordinates[0], GeoportalDataViewerConstants.EPSG_4326, GeoportalDataViewerConstants.EPSG_3857);
return OLFactory.createPolygon(tranformedCoordinates);
}
public static Base createOsmLayer() {
XyzOptions osmSourceOptions = OLFactory.createOptions();
Osm osmSource = new Osm(osmSourceOptions);
LayerOptions osmLayerOptions = OLFactory.createOptions();
osmLayerOptions.setSource(osmSource);
return new Tile(osmLayerOptions);
}
}

View File

@ -0,0 +1,48 @@
package org.gcube.portlets.user.geoportaldataviewer.client.gis;
import jsinterop.annotations.JsMethod;
import jsinterop.annotations.JsOverlay;
import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsType;
import ol.Coordinate;
import ol.Extent;
/**
* The Class ExtentWrapped.
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
*
* Nov 11, 2020
*/
@JsType(isNative = true, name = "Array", namespace = JsPackage.GLOBAL)
public class ExtentWrapped extends ol.Extent {
@JsOverlay
private static final String PACKAGE_EXTENT = "ol.extent";
/**
* Instantiates a new extent wrapped.
*
* @param minX the min X
* @param minY the min Y
* @param maxX the max X
* @param maxY the max Y
*/
public ExtentWrapped(double minX, double minY, double maxX, double maxY) {
super(minX, minY, maxX, maxY);
}
// /**
// * @param coordinate coordinate to check.
// * @return true if the passed coordinate is contained or on the edge of the
// * extent.
// */
// @JsOverlay
// public final Coordinate getCenter() {
// return getCenter((ol.Extent) this);
// }
@JsMethod(name = "getCenter", namespace = PACKAGE_EXTENT)
private static native Coordinate getCenter(Extent extent);
}

View File

@ -0,0 +1,52 @@
package org.gcube.portlets.user.geoportaldataviewer.client.gis;
import java.util.HashMap;
/**
* The Class LayerOrder.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Nov 12, 2021
*/
public class LayerOrder {
/**
* The Enum LAYER_TYPE.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Nov 12, 2021
*/
public static enum LAYER_TYPE {
BASE_MAP, CUSTOM_WMS_DETAIL, BASE_WMS, WMS_DETAIL, VECTOR
}
public static final HashMap<LAYER_TYPE, Integer> LAYER_OFFSET = new HashMap<LAYER_TYPE, Integer>(5);
static {
LAYER_OFFSET.put(LAYER_TYPE.BASE_MAP, 0); //Base OL or MapBox
LAYER_OFFSET.put(LAYER_TYPE.CUSTOM_WMS_DETAIL, 70); //WMS custom Overlay. Es. Layer "Limiti Amministrativi"
LAYER_OFFSET.put(LAYER_TYPE.BASE_WMS, 210); // Index layers (i.e. centroids for UCD)
LAYER_OFFSET.put(LAYER_TYPE.WMS_DETAIL, 140); //Layer/s belonging to a Project (materialized layers. Ex. "Posizionamento Scavo")
LAYER_OFFSET.put(LAYER_TYPE.VECTOR, 320); //Vector layer to show other info. Ex. Pointer with coordinates (x,y) in the Light OL Map.
}
/**
* Instantiates a new layer order.
*/
public LayerOrder() {
}
/**
* Gets the offset.
*
* @param layerType the layer type
* @return the offset
*/
public Integer getOffset(LAYER_TYPE layerType) {
return LAYER_OFFSET.get(layerType);
}
}

View File

@ -0,0 +1,496 @@
package org.gcube.portlets.user.geoportaldataviewer.client.gis;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.gcube.application.geoportalcommon.shared.gis.BoundsMap;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewer;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.MAP_PROJECTION;
import org.gcube.portlets.user.geoportaldataviewer.client.resources.GNAImages;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BaseMapLayer;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.GeoQuery;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.GeoQuery.TYPE;
import com.google.gwt.core.client.GWT;
import com.google.gwt.i18n.client.NumberFormat;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONParser;
import com.google.gwt.json.client.JSONString;
import com.google.gwt.json.client.JSONValue;
import ol.Collection;
import ol.Coordinate;
import ol.Feature;
import ol.Map;
import ol.MapBrowserEvent;
import ol.MapOptions;
import ol.OLFactory;
import ol.View;
import ol.ViewOptions;
import ol.color.Color;
import ol.control.Attribution;
import ol.event.EventListener;
import ol.geom.Point;
import ol.interaction.KeyboardPan;
import ol.interaction.KeyboardZoom;
import ol.layer.Base;
import ol.layer.Image;
import ol.layer.Layer;
import ol.layer.LayerOptions;
import ol.layer.Tile;
import ol.layer.VectorLayerOptions;
import ol.proj.Projection;
import ol.proj.ProjectionOptions;
import ol.source.ImageWms;
import ol.source.ImageWmsOptions;
import ol.source.ImageWmsParams;
import ol.source.Osm;
import ol.source.Source;
import ol.source.Xyz;
import ol.source.XyzOptions;
import ol.style.Fill;
import ol.style.FillOptions;
import ol.style.Icon;
import ol.style.IconOptions;
import ol.style.Stroke;
import ol.style.StrokeOptions;
import ol.style.Style;
import ol.style.Text;
import ol.style.TextOptions;
/**
* The Class LightOpenLayerMap.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Nov 12, 2021
*/
public class LightOpenLayerMap {
public static final int MAX_ZOOM = 20;
/** The map. */
private Map map;
/** The view. */
private View view;
/** The view options. */
private ViewOptions viewOptions = OLFactory.createOptions();
/** The projection options. */
private ProjectionOptions projectionOptions = OLFactory.createOptions();
private boolean isQueryPointActive;
private ol.layer.Vector geometryLayer;
private String markerURL = GNAImages.ICONS.mapMarkerIcon().getURL();
private LayerOrder layerOrder = new LayerOrder();
private Layer baseLayerTile;
/**
* Instantiates a new light open layer map.
*
* @param divTargetId the div target id
*/
public LightOpenLayerMap(String divTargetId) {
// create a projection
projectionOptions.setCode(MAP_PROJECTION.EPSG_3857.getName());
projectionOptions.setUnits("m");
Projection projection = new Projection(projectionOptions);
viewOptions.setProjection(projection);
viewOptions.setMaxZoom(20);
// create a view
view = new View(viewOptions);
// create the map
MapOptions mapOptions = OLFactory.createOptions();
mapOptions.setTarget(divTargetId);
mapOptions.setView(view);
map = new Map(mapOptions);
//map.addLayer(osmLayer);
// map.addLayer(tileDebugLayer);
Attribution attribution = new Attribution();
attribution.setCollapsed(true);
map.addClickListener(new EventListener<MapBrowserEvent>() {
@Override
public void onEvent(MapBrowserEvent event) {
// TODO Auto-generated method stub
Coordinate coordinate = event.getCoordinate();
if (isQueryPointActive) {
double lon = coordinate.getX();
double lat = coordinate.getY();
int w = (int) map.getSize().getWidth();
int h = (int) map.getSize().getHeight();
// handler.clickOnMap(x, y, w, h);
// ratio - mapPixelWeight : bboxWeight = 10px : geoRectangleWidth
// where 10px is the pixel diameter dimension of the clicked point
double bboxWidth = Math.abs(getExtent().getLowerLeftX() - getExtent().getUpperRightX());
double geoWidth = (bboxWidth / w) * (20 / 2);
double x1 = Math.min(lon + geoWidth, lon - geoWidth);
double x2 = Math.max(lon + geoWidth, lon - geoWidth);
double y1 = Math.min(lat + geoWidth, lat - geoWidth);
double y2 = Math.max(lat + geoWidth, lat - geoWidth);
// GWT.log("("+x1+","+y1+")("+x2+","+y2+")");
// Point pt = new Point(coordinate);
// ol.Extent extent = pt.getExtent();
// //new ClickDataInfo(x1, y1, x2, y2)
// SelectDataInfo selectDataInfo
// selectBox(new GeoQuery(x1, y1, x2, y2, GeoQuery.TYPE.POINT));
GeoQuery select = new GeoQuery(x1, y1, x2, y2, TYPE.POINT);
}
}
});
map.addControl(attribution);
// add some interactions
map.addInteraction(new KeyboardPan());
map.addInteraction(new KeyboardZoom());
List<BaseMapLayer> listBaseMapLayers = GeoportalDataViewer.getListBaseMapLayers();
BaseMapLayer bml = null;
if(listBaseMapLayers!=null)
bml = listBaseMapLayers.get(0);
changeBaseMap(bml);
}
/**
* Change base map.
*
* @param baseLayer the base layer
*/
public void changeBaseMap(BaseMapLayer baseLayer) {
BaseMapLayer.OL_BASE_MAP baseMap = baseLayer.getType() == null ? BaseMapLayer.OL_BASE_MAP.OSM
: baseLayer.getType();
try {
if (baseLayerTile != null)
map.removeLayer(baseLayerTile);
} catch (Exception e) {
}
switch (baseMap) {
case MAPBOX:
case OTHER:
XyzOptions xyzOptions2 = OLFactory.createOptions();
xyzOptions2.setCrossOrigin("Anonymous");
Xyz xyz = new Xyz(xyzOptions2);
//setAttributions is buggy
//xyz.setAttributions(baseLayer.getAttribution());
xyz.setUrl(baseLayer.getUrl());
LayerOptions layerOptions2 = OLFactory.createOptions();
layerOptions2.setSource(xyz);
int zIndex = layerOrder.getOffset(LayerOrder.LAYER_TYPE.BASE_MAP)+1;
layerOptions2.setZIndex(zIndex);
baseLayerTile = new Tile(layerOptions2);
break;
case OSM:
default:
XyzOptions osmSourceOptions = OLFactory.createOptions();
osmSourceOptions.setCrossOrigin("Anonymous");
Osm osmSource = new Osm(osmSourceOptions);
//osmSource.setUrl(baseLayer.getUrl());
//setAttributions is buggy
//osmSource.setAttributions(baseLayer.getAttribution());
LayerOptions layerOptions = OLFactory.createOptions();
layerOptions.setSource(osmSource);
zIndex = layerOrder.getOffset(LayerOrder.LAYER_TYPE.BASE_MAP)+1;
layerOptions.setZIndex(zIndex);
baseLayerTile = new Tile(layerOptions);
break;
}
// map == null at init time
if (map != null) {
map.addLayer(baseLayerTile);
}
}
/**
* Sets the center.
*
* @param centerCoordinate the new center
*/
public void setCenter(Coordinate centerCoordinate) {
view.setCenter(centerCoordinate);
}
/**
* Sets the center.
*
* @param zoom the new zoom
*/
public void setZoom(int zoom) {
view.setZoom(zoom);
}
/**
* Adds the WMS layer.
*
* @param mapServerHost the map server host
* @param layerName the layer name
* @param bbox the bbox
* @return the image
*/
public Image addWMSLayer(String mapServerHost, String layerName, BoundsMap bbox) {
GWT.log("Adding wmsLayer with mapServerHost: " + mapServerHost + ", layerName: " + layerName);
ImageWmsParams imageWMSParams = OLFactory.createOptions();
imageWMSParams.setLayers(layerName);
// imageWMSParams.setSize(new Size(400,400));
// imageWMSParams.setVersion("1.1.0");
// if(bbox!=null)
// imageWMSParams.set("BBOX", bbox.getLowerLeftX()+","+bbox.getLowerLeftY()+","+bbox.getUpperRightX()+","+bbox.getUpperRightY());
ImageWmsOptions imageWMSOptions = OLFactory.createOptions();
imageWMSOptions.setCrossOrigin("Anonymous");
imageWMSOptions.setUrl(mapServerHost);
imageWMSOptions.setParams(imageWMSParams);
// imageWMSOptions.setRatio(1.5f);
ImageWms imageWMSSource = new ImageWms(imageWMSOptions);
LayerOptions layerOptions = OLFactory.createOptions();
layerOptions.setSource(imageWMSSource);
ol.layer.Image wmsLayer = new ol.layer.Image(layerOptions);
int zIndex = layerOrder.getOffset(LayerOrder.LAYER_TYPE.WMS_DETAIL)+1;
wmsLayer.setZIndex(zIndex);
// visibleLayerItems
map.addLayer(wmsLayer);
return wmsLayer;
}
/**
* Gets the first layer.
*
* @return the first layer
*/
public Image getFirstLayer() {
if (map.getLayers() != null) {
return (Image) map.getLayers().getArray()[0];
}
return null;
}
/**
* Gets the layers.
*
* @return the layers
*/
public List<String> getLayers() {
Collection<Base> layers = map.getLayers();
List<String> layerNames = null;
if (layers != null) {
Base[] layersArr = layers.getArray();
layerNames = new ArrayList<String>(layersArr.length);
for (int i = 0; i < layersArr.length; i++) {
Base layer = layersArr[i];
if (layer instanceof Image) {
Image layerImage = (Image) layer;
Source source = layerImage.getSource();
// GWT.log("source: "+source.toString());
GeoportalDataViewerConstants.printJsObj(source);
String sorceRootObj = GeoportalDataViewerConstants.toJsonObj(source);
JSONValue jsonObj = JSONParser.parseStrict(sorceRootObj);
// GWT.log("jsonObj: " + jsonObj.toString());
JSONObject jsonSourceObj = (JSONObject) jsonObj;
JSONObject jsonParamsObj = (JSONObject) jsonSourceObj.get("params_");
// GWT.log("jsonParamsObj is: "+jsonParamsObj);
JSONValue jsonLayers = jsonParamsObj.get("LAYERS");
GWT.log("theLayerName name is: " + jsonLayers);
layerNames.add(jsonLayers.toString());
}
}
}
return layerNames;
}
/**
* Gets the layer UR ls property.
*
* @return the layer UR ls property
*/
public java.util.Map<String, String> getLayerURLsProperty() {
Collection<Base> layers = map.getLayerGroup().getLayers();
java.util.Map<String, String> mapLayerNameURL = new HashMap<String, String>();
if (layers != null) {
Base[] layersArr = layers.getArray();
for (int i = 0; i < layersArr.length; i++) {
Base layer = layersArr[i];
// GeoportalDataViewerConstants.printJs(layer.toString());
if (layer instanceof Image) {
Image layerImage = (Image) layer;
Source source = layerImage.getSource();
// GWT.log("source: "+source.toString());
// GeoportalDataViewerConstants.printJsObj(source);
String sorceRootObj = GeoportalDataViewerConstants.toJsonObj(source);
JSONValue jsonObj = JSONParser.parseStrict(sorceRootObj);
// GWT.log("jsonObj: " + jsonObj.toString());
JSONObject jsonSourceObj = (JSONObject) jsonObj;
JSONObject jsonParamsObj = (JSONObject) jsonSourceObj.get("params_");
// GWT.log("jsonParamsObj is: "+jsonParamsObj);
JSONString jsonLayers = (JSONString) jsonParamsObj.get("LAYERS");
String layerName = jsonLayers.stringValue();
GWT.log("jsonLayers is: " + layerName);
// GWT.log("theLayerName name is: " + jsonLayers);
JSONValue jsonImage = jsonSourceObj.get("image_");
// GWT.log("jsonImage: " + jsonImage.toString());
JSONObject jsonImageObj = (JSONObject) jsonImage;
JSONString jsonSrc = (JSONString) jsonImageObj.get("src_");
String layerURL = jsonSrc.stringValue();
GWT.log("jsonSrc: " + layerURL);
mapLayerNameURL.put(layerName, layerURL);
}
}
}
GWT.log("returning mapLayerNameURL: " + mapLayerNameURL);
return mapLayerNameURL;
}
/**
* Adds the point.
*
* @param coordinate the coordinate
* @param showCoordinateText the show coordinate text
* @param asMarker the as marker
*/
public void addPoint(Coordinate coordinate, boolean showCoordinateText, boolean asMarker) {
if (geometryLayer != null) {
map.removeLayer(geometryLayer);
} else {
}
Style style = new Style();
if (asMarker) {
IconOptions iconOptions = new IconOptions();
iconOptions.setSrc(markerURL);
Icon icon = new Icon(iconOptions);
style.setImage(icon);
}
if (showCoordinateText) {
TextOptions textOptions = new TextOptions();
textOptions.setOffsetY(-25);
StrokeOptions strokeOptions = new StrokeOptions();
strokeOptions.setColor(new Color(255, 255, 255, 1.0));
strokeOptions.setWidth(4);
Stroke stroke = new Stroke(strokeOptions);
stroke.setWidth(5);
textOptions.setStroke(stroke);
FillOptions fillOptions = new FillOptions();
fillOptions.setColor(new Color(0, 0, 255, 1.0));
textOptions.setFill(new Fill(fillOptions));
Coordinate transfCoord = MapUtils.transformCoordiante(coordinate, MAP_PROJECTION.EPSG_3857.getName(),
MAP_PROJECTION.EPSG_4326.getName());
// DecimalFormat df = new DecimalFormat("#.####");
NumberFormat fmt = NumberFormat.getFormat("#.####");
textOptions.setText("Long: " + fmt.format(transfCoord.getX()) + ", Lat: " + fmt.format(transfCoord.getY()));
Text text = new Text(textOptions);
// FillOptions fillOptions = new FillOptions();
// Color color = new Color(217, 217, 223, 0.0);
// fillOptions.setColor(color);
// Fill fill = new Fill(fillOptions);
// style.setFill(fill);
style.setText(text);
}
Point thePoint = new Point(coordinate);
Feature vf = new Feature(thePoint);
vf.setStyle(style);
ol.source.Vector vector = new ol.source.Vector();
vector.addFeature(vf);
VectorLayerOptions vectorLayerOptions = new VectorLayerOptions();
vectorLayerOptions.setSource(vector);
geometryLayer = new ol.layer.Vector(vectorLayerOptions);
int zIndex = layerOrder.getOffset(LayerOrder.LAYER_TYPE.VECTOR)+1;
geometryLayer.setZIndex(zIndex);
map.addLayer(geometryLayer);
}
/**
* Gets the map.
*
* @return the map
*/
public Map getMap() {
return map;
}
/**
* Gets the projection code.
*
* @return the projection code
*/
public String getProjectionCode() {
return map.getView().getProjection().getCode();
}
/**
* Gets the current zoom level.
*
* @return the current zoom level
*/
public double getCurrentZoomLevel() {
return map.getView().getZoom();
}
/**
* Gets the bbox.
*
* @return the bbox
*/
public ol.Extent getBBOX() {
return getExtent();
}
/**
* Gets the extent.
*
* @return the extent
*/
public ol.Extent getExtent() {
return this.map.getView().calculateExtent(map.getSize());
}
}

View File

@ -0,0 +1,138 @@
package org.gcube.portlets.user.geoportaldataviewer.client.gis;
import org.gcube.application.geoportalcommon.shared.geoportal.geojson.GeoJSON;
import com.google.gwt.core.client.GWT;
import ol.Collection;
import ol.Coordinate;
import ol.Extent;
import ol.control.Attribution;
import ol.control.Control;
import ol.control.FullScreen;
import ol.control.MousePosition;
import ol.control.ZoomSlider;
import ol.geom.LineString;
import ol.proj.Projection;
/**
* The Class MapUtils.
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
*
* Nov 12, 2020
*/
public final class MapUtils {
/**
* Creates some default controls and adds it to the collection.
*
* @param controls collection with controls
*/
public static void addDefaultControls(final Collection<Control> controls) {
controls.push(new FullScreen());
controls.push(new ZoomSlider());
MousePosition mousePosition = new MousePosition();
mousePosition.setCoordinateFormat(Coordinate.createStringXY(5));
controls.push(mousePosition);
Attribution attribution = new Attribution();
attribution.setCollapsed(true);
controls.push(attribution);
// controls.push(new ZoomToExtent());
}
/**
* Transform coordiante.
*
* @param centerCoordinate the center coordinate
* @param source the source
* @param target the target
* @return the coordinate
*/
public static Coordinate transformCoordiante(Coordinate centerCoordinate, String source, String target) {
return Projection.transform(centerCoordinate, source, target);
}
/**
* Transform extent.
*
* @param extent the extent
* @param source the source
* @param target the target
* @return the extent
*/
public static Extent transformExtent(Extent extent, String source, String target) {
return Projection.transformExtent(extent, source, target);
}
/**
* Distance between centroid.
*
* @param ex1 the ex 1
* @param ex2 the ex 2
* @return the long
*/
public static long distanceBetweenCentroid(ExtentWrapped ex1, ExtentWrapped ex2) {
return distanceBetween(ex1.getCenter(), ex2.getCenter());
}
/**
* Distance between.
*
* @param c1 the c 1
* @param c2 the c 2
* @return the long
*/
public static long distanceBetween(Coordinate c1, Coordinate c2) {
Coordinate[] arrayCoordinate = new Coordinate[2];
arrayCoordinate[0] = c1;
arrayCoordinate[1] = c2;
LineString ls = new LineString(arrayCoordinate);
// GWT.log("Line length is: "+ls);
return Math.round(ls.getLength() * 100) / 100;
}
/**
* Reverse coordinate.
*
* @param coord the coord
* @return the coordinate
*/
public static Coordinate reverseCoordinate(Coordinate coord) {
return new Coordinate(coord.getY(), coord.getX());
}
/**
* Geo JSON to B box center.
*
* @param spatialReference the spatial reference
* @param transforFrom the transfor from
* @param transformTo the transform to
* @return the coordinate
*/
public static Coordinate geoJSONToBBOXCenter(GeoJSON spatialReference, String transforFrom, String transformTo) {
try {
if (spatialReference != null) {
ExtentWrapped ew = new ExtentWrapped(spatialReference.getBbox().getMinX(),
spatialReference.getBbox().getMinY(), spatialReference.getBbox().getMaxX(),
spatialReference.getBbox().getMaxY());
Coordinate center = ew.getCenter();
if (transforFrom != null && transformTo != null)
center = transformCoordiante(center, transforFrom, transformTo);
return center;
}
} catch (Exception e) {
GWT.log("geoJSONTToBBoxCenter error: " + e.getMessage());
}
return null;
}
}

View File

@ -1,428 +0,0 @@
package org.gcube.portlets.user.geoportaldataviewer.client.gis;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants;
import org.gcube.portlets.user.geoportaldataviewer.client.events.QueryDataEvent;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.GeoQuery;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.GeoQuery.TYPE;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.Event;
import ol.Collection;
import ol.Coordinate;
import ol.Map;
import ol.MapBrowserEvent;
import ol.MapOptions;
import ol.OLFactory;
import ol.Overlay;
import ol.OverlayOptions;
import ol.View;
import ol.ViewOptions;
import ol.control.Attribution;
import ol.event.EventListener;
import ol.interaction.Draw;
import ol.interaction.DrawOptions;
import ol.interaction.Extent;
import ol.interaction.ExtentOptions;
import ol.interaction.Interaction;
import ol.interaction.KeyboardPan;
import ol.interaction.KeyboardZoom;
import ol.layer.Base;
import ol.layer.Image;
import ol.layer.LayerOptions;
import ol.layer.Tile;
import ol.proj.Projection;
import ol.proj.ProjectionOptions;
import ol.source.ImageWms;
import ol.source.ImageWmsOptions;
import ol.source.ImageWmsParams;
import ol.source.Osm;
import ol.source.Vector;
import ol.source.XyzOptions;
// TODO: Auto-generated Javadoc
/**
* The Class OpenLayerOSM.
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
*
* Oct 27, 2020
*/
public class OpenLayerOSM {
/** The map. */
private Map map;
/** The view. */
private View view;
/** The view options. */
private ViewOptions viewOptions = OLFactory.createOptions();
/** The projection options. */
private ProjectionOptions projectionOptions = OLFactory.createOptions();
/** The point draw. */
private Draw queryPoint;
private Extent queryBox;
/** The popup overlay. */
private Overlay popupOverlay;
private HandlerManager eventBus;
private boolean isQueryBoxActive;
private boolean isQueryPointActive;
/**
* Instantiates a new open layer OSM.
*
* @param divTargetId the div target id
* @param eventBus the event bus
*/
/* (non-Javadoc)
* @see de.desjardins.ol3.demo.client.example.Example#show()
*/
public OpenLayerOSM(String divTargetId, HandlerManager eventBus) {
this.eventBus = eventBus;
// create a OSM-layer
XyzOptions osmSourceOptions = OLFactory.createOptions();
Osm osmSource = new Osm(osmSourceOptions);
LayerOptions osmLayerOptions = OLFactory.createOptions();
osmLayerOptions.setSource(osmSource);
Tile osmLayer = new Tile(osmLayerOptions);
// create a projection
projectionOptions.setCode(GeoportalDataViewerConstants.EPSG_3857);
projectionOptions.setUnits("m");
Projection projection = new Projection(projectionOptions);
viewOptions.setProjection(projection);
viewOptions.setMaxZoom(19);
//viewOptions.setExtent(new Extent(-180, -90, 180, 90));
// create a view
view = new View(viewOptions);
//EPSG_4326_TO_ITALY
Coordinate centerCoordinate = OLFactory.createCoordinate(12.45, 42.98);
Coordinate transformedCenterCoordinate = Projection.transform(centerCoordinate, GeoportalDataViewerConstants.EPSG_4326, GeoportalDataViewerConstants.EPSG_3857);
view.setCenter(transformedCenterCoordinate);
view.setZoom(5);
// create the map
MapOptions mapOptions = OLFactory.createOptions();
mapOptions.setTarget(divTargetId);
mapOptions.setView(view);
map = new Map(mapOptions);
map.addLayer(osmLayer);
//map.addLayer(tileDebugLayer);
// add some controls
map.addControl(OLFactory.createScaleLine());
DemoUtils.addDefaultControls(map.getControls());
Attribution attribution = new Attribution();
attribution.setCollapsed(true);
map.addClickListener(new EventListener<MapBrowserEvent>() {
@Override
public void onEvent(MapBrowserEvent event) {
// TODO Auto-generated method stub
Coordinate coordinate = event.getCoordinate();
if(isQueryPointActive) {
double lon = coordinate.getX();
double lat = coordinate.getY();
int w = (int) map.getSize().getWidth();
int h = (int) map.getSize().getHeight();
// handler.clickOnMap(x, y, w, h);
// ratio - mapPixelWeight : bboxWeight = 10px : geoRectangleWidth
// where 10px is the pixel diameter dimension of the clicked point
double bboxWidth = Math.abs(getExtent().getLowerLeftX() - getExtent().getUpperRightX());
double geoWidth = (bboxWidth / w) * (20 / 2);
double x1 = Math.min(lon+geoWidth, lon-geoWidth);
double x2 = Math.max(lon+geoWidth, lon-geoWidth);
double y1 = Math.min(lat+geoWidth, lat-geoWidth);
double y2 = Math.max(lat+geoWidth, lat-geoWidth);
//GWT.log("("+x1+","+y1+")("+x2+","+y2+")");
// Point pt = new Point(coordinate);
// ol.Extent extent = pt.getExtent();
// //new ClickDataInfo(x1, y1, x2, y2)
// SelectDataInfo selectDataInfo
//selectBox(new GeoQuery(x1, y1, x2, y2, GeoQuery.TYPE.POINT));
GeoQuery select = new GeoQuery(x1, y1, x2, y2, TYPE.POINT);
eventBus.fireEvent(new QueryDataEvent(select,coordinate));
}
}
});
map.addControl(attribution);
// add some interactions
map.addInteraction(new KeyboardPan());
map.addInteraction(new KeyboardZoom());
}
public void showPopup(String html, Coordinate coordinate) {
if(popupOverlay==null) {
Element elPopup = DOM.getElementById("popup");
popupOverlay = addOverlay(elPopup);
addPopupCloserHandelr(popupOverlay);
}
Element popContent = DOM.getElementById("popup-content");
popContent.setInnerHTML(html);
popupOverlay.setPosition(coordinate);
}
/**
* Adds the popup closer handelr.
*
* @param popupOverlay the popup overlay
*/
private void addPopupCloserHandelr(Overlay popupOverlay) {
Element elPopupCloser = DOM.getElementById("popup-closer");
Event.sinkEvents(elPopupCloser, Event.ONCLICK);
Event.setEventListener(elPopupCloser, new com.google.gwt.user.client.EventListener() {
@Override
public void onBrowserEvent(Event event) {
if (Event.ONCLICK == event.getTypeInt()) {
popupOverlay.setPosition(null);
}
}
});
}
/**
* Handler popu closer.
*
* @param divId the div id
* @param overlayId the overlay id
*/
public static native void handlerPopuCloser(String divId, String overlayId) /*-{
var closer = $doc.getElementById(divId);
var overlay = $doc.getElementById(overlayId);
closer.onclick = function() {
overlay.setPosition(undefined);
closer.blur();
return false;
};
}-*/;
/**
* Adds the WMS layer.
*
* @param mapServerHost the map server host
* @param layerName the layer name
*/
public void addWMSLayer(String mapServerHost, String layerName) {
ImageWmsParams imageWMSParams = OLFactory.createOptions();
imageWMSParams.setLayers(layerName);
ImageWmsOptions imageWMSOptions = OLFactory.createOptions();
imageWMSOptions.setUrl(mapServerHost);
imageWMSOptions.setParams(imageWMSParams);
//imageWMSOptions.setRatio(1.5f);
ImageWms imageWMSSource = new ImageWms(imageWMSOptions);
LayerOptions layerOptions = OLFactory.createOptions();
layerOptions.setSource(imageWMSSource);
Image wmsLayer = new Image(layerOptions);
//visibleLayerItems
map.addLayer(wmsLayer);
}
/**
* Adds the point vector source.
*
* @return the draw
*/
public Draw addPointVectorSource() {
if(queryPoint==null)
initPointInteraction();
map.addInteraction(queryPoint);
isQueryPointActive = true;
return queryPoint;
}
/**
* Inits the point interaction.
*/
private void initPointInteraction() {
Vector vectorSource = new Vector();
DrawOptions drawOptions = new DrawOptions();
drawOptions.setSource(vectorSource);
drawOptions.setType("Point");
drawOptions.setMaxPoints(1);
drawOptions.setMinPoints(1);
drawOptions.setWrapX(false);
queryPoint = new Draw(drawOptions);
queryPoint.addChangeListener(new EventListener<ol.events.Event>() {
@Override
public void onEvent(ol.events.Event event) {
GWT.log(event.getType());
}
});
}
/**
* Removes the interaction.
*
* @param interaction the interaction
*/
public void removeInteraction(Interaction interaction) {
map.removeInteraction(interaction);
}
/**
* Removes the interactions.
*/
public void removeQueryInteractions() {
Collection<Interaction> interactions = map.getInteractions();
if(interactions!=null) {
map.removeInteraction(queryBox);
map.removeInteraction(queryPoint);
isQueryBoxActive = false;
isQueryPointActive = false;
}
}
/**
* Adds the extent interaction.
*
* @return the extent
*/
public Extent addExtentInteraction() {
ExtentOptions extentOptions = new ExtentOptions();
extentOptions.setWrapX(false);
//StyleOptions styleOptions = new StyleOptions();
//styleOptions.setStroke(stroke);
//styleOptions.set
//extentOptions.setBoxStyle(new ol.style.Style(styleOptions));
queryBox = new Extent(extentOptions);
map.addInteraction(queryBox);
isQueryBoxActive = true;
return queryBox;
}
/**
* Adds the overlay.
*
* @param element the element
* @return the overlay
*/
private Overlay addOverlay(Element element) {
/**
* Create an overlay to anchor the popup to the map.
*/
OverlayOptions overlayOptions = new OverlayOptions();
overlayOptions.setAutoPan(true);
Overlay overlay = new Overlay(overlayOptions);
overlay.setElement(element);
map.addOverlay(overlay);
return overlay;
}
/**
* Checks if is layer visible.
*
* @param layerName the layer name
* @return true, if is layer visible
*/
public boolean isLayerVisible(String layerName) {
Collection<Base> layers = map.getLayers();
if(layers!=null) {
Base[] layersArr = layers.getArray();
for (int i = 0; i < layersArr.length; i++) {
Base layer = layersArr[i];
String theLayerName = (String) layer.get("name");
GWT.log("The Layer name is: "+layerName);
if(theLayerName!=null && theLayerName.equals(layerName))
return true;
}
}
return false;
}
/**
* Gets the projection code.
*
* @return the projection code
*/
public String getProjectionCode() {
return map.getView().getProjection().getCode();
}
/**
* Gets the current zoom level.
*
* @return the current zoom level
*/
public double getCurrentZoomLevel() {
return map.getView().getZoom();
}
/**
* Gets the bbox.
*
* @return the bbox
*/
public ol.Extent getBBOX() {
return getExtent();
}
/**
* Gets the extent.
*
* @return the extent
*/
public ol.Extent getExtent() {
return this.map.getView().calculateExtent(map.getSize());
}
public Coordinate transform (Coordinate centerCoordinate, String source, String target){
return Projection.transform(centerCoordinate, source, target);
}
}

View File

@ -0,0 +1,37 @@
package org.gcube.portlets.user.geoportaldataviewer.client.resources;
import com.github.gwtbootstrap.client.ui.constants.BaseIconType;
import com.google.gwt.core.client.GWT;
import com.google.gwt.resources.client.ClientBundle;
public interface GNAIcons extends ClientBundle {
/** My custom base icon collection */
public enum CustomIconType implements BaseIconType {
MAP("map"),
PRESET_LOCATION("preset_location"),
LAYERS("layers");
/** Inject the icon's css once at first usage */
static {
GNAImages icons = GWT.create(GNAImages.class);
icons.css().ensureInjected();
}
private static final String PREFIX = "myBaseIcon_";
private String className;
private CustomIconType(String className) {
this.className = className;
}
/**
* {@inheritDoc}
*/
@Override
public String get() {
return PREFIX + className;
}
}
}

View File

@ -0,0 +1,68 @@
package org.gcube.portlets.user.geoportaldataviewer.client.resources;
import com.google.gwt.core.client.GWT;
import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.resources.client.CssResource;
import com.google.gwt.resources.client.ImageResource;
public interface GNAImages extends ClientBundle {
/** Get access to the css resource during gwt compilation */
@Source("baseIcons.css")
CssResource css();
public static final GNAImages ICONS = GWT.create(GNAImages.class);
/**
* Our sample image icon. Makes the image resource for the gwt-compiler's css
* composer accessible
*/
@Source("map1.png")
ImageResource map();
@Source("preset_location.png")
ImageResource preset_location();
@Source("layers.png")
ImageResource layers();
@Source("loading.gif")
ImageResource loading();
@Source("map-marker-icon.png")
ImageResource mapMarkerIcon();
@Source("icon_share.png")
ImageResource shareIcon();
@Source("italy.png")
ImageResource italyIcon();
@Source("world.png")
ImageResource worldIcon();
@Source("layer_visible.png")
ImageResource layerVisible();
@Source("layer_invisible.png")
ImageResource layerInvisible();
@Source("locate.png")
ImageResource locate();
@Source("locate_none.png")
ImageResource locateNone();
@Source("spinner_earth.gif")
ImageResource spinnerEarth();
@Source("spinner_clock.gif")
ImageResource spinnerClock();
@Source("geoportal_error.png")
ImageResource geoportaServiceError();
@Source("warning_error.png")
ImageResource warningError();
}

View File

@ -1,13 +0,0 @@
package org.gcube.portlets.user.geoportaldataviewer.client.resources;
import com.google.gwt.core.client.GWT;
import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.resources.client.ImageResource;
public interface Images extends ClientBundle {
public static final Images ICONS = GWT.create(Images.class);
@Source("loading.gif")
ImageResource loading();
}

View File

@ -0,0 +1,25 @@
/* Prevent our icons from css obfuscation */
@external .myBaseIcon_*; /* Do some css stuff */
@sprite .myBaseIcon_map {
gwt-image: "map";
display: inline-block;
vertical-align: middle;
width: 17px !important;
height: 17px !important;
}
@sprite .myBaseIcon_preset_location {
gwt-image: "preset_location";
display: inline-block;
vertical-align: middle;
width: 17px !important;
height: 17px !important;
}
@sprite .myBaseIcon_layers {
gwt-image: "layers";
display: inline-block;
vertical-align: middle;
width: 17px !important;
height: 17px !important;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 403 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 731 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 650 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 810 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 465 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 693 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 705 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 744 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 581 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 599 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@ -0,0 +1,91 @@
package org.gcube.portlets.user.geoportaldataviewer.client.ui;
import org.gcube.application.geoportalcommon.shared.GeoportalItemReferences;
import org.gcube.application.geoportalcommon.shared.geoportal.view.ProjectView;
import org.gcube.portlets.user.geoportaldataviewer.client.events.ClosedViewDetailsEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.cms.project.ProjectViewer;
import com.github.gwtbootstrap.client.ui.Button;
import com.github.gwtbootstrap.client.ui.constants.ButtonType;
import com.github.gwtbootstrap.client.ui.constants.IconSize;
import com.github.gwtbootstrap.client.ui.constants.IconType;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.Widget;
public class DetailsPanel extends Composite {
private static DetailsPanelUiBinder uiBinder = GWT.create(DetailsPanelUiBinder.class);
@UiField
Button closeButton;
@UiField
HTMLPanel datailsContainerPanel;
@UiField
HTMLPanel detailsHTMLPanel;
private ProjectView displayedProject = null;
private HandlerManager applicationBus;
interface DetailsPanelUiBinder extends UiBinder<Widget, DetailsPanel> {
}
public DetailsPanel() {
initWidget(uiBinder.createAndBindUi(this));
closeButton.setType(ButtonType.LINK);
closeButton.setIcon(IconType.REMOVE);
closeButton.setIconSize(IconSize.LARGE);
closeButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
hidePanelDetails();
applicationBus.fireEvent(new ClosedViewDetailsEvent());
}
});
}
public void setApplicationBus(HandlerManager applicationBus) {
this.applicationBus = applicationBus;
}
public void showDetailsFor(ProjectView result, GeoportalItemReferences geonaItemRef) {
this.displayedProject = result;
datailsContainerPanel.clear();
if(detailsHTMLPanel.getParent()!=null) {
detailsHTMLPanel.getParent().getElement().setScrollTop(0);
}
datailsContainerPanel.add(new ProjectViewer(applicationBus, geonaItemRef, result));
showPanelDetails();
}
private void showPanelDetails() {
detailsHTMLPanel.setVisible(true);
}
public void hidePanelDetails() {
this.displayedProject = null;
datailsContainerPanel.clear();
detailsHTMLPanel.setVisible(false);
}
public ProjectView getDisplayedProject() {
return displayedProject;
}
}

View File

@ -0,0 +1,30 @@
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
xmlns:g="urn:import:com.google.gwt.user.client.ui"
xmlns:b="urn:import:com.github.gwtbootstrap.client.ui">
<ui:style>
.important {
font-weight: bold;
}
.to-align-right{
position: absolute;
top: 50px;
right: 10px;
}
.to-align-left {
position: absolute;
top: 5px;
color: white !important;
text-decoration: none !important;
}
.to-align-left :hover {
color: #F5F5F5;
}
</ui:style>
<g:HTMLPanel ui:field="detailsHTMLPanel" visible="false">
<b:Button ui:field="closeButton" addStyleNames="{style.to-align-left}"></b:Button>
<g:HTMLPanel ui:field="datailsContainerPanel"></g:HTMLPanel>
</g:HTMLPanel>
</ui:UiBinder>

View File

@ -1,87 +1,434 @@
package org.gcube.portlets.user.geoportaldataviewer.client.ui;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.gcube.portlets.user.geoportaldataviewer.client.gis.OpenLayerOSM;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.products.ConcessioneView;
import org.gcube.portlets.user.geoportaldataviewer.client.util.LoaderIcon;
import org.gcube.portlets.user.geoportaldataviewer.shared.products.ConcessioneDV;
import org.gcube.application.geoportalcommon.shared.GeoportalItemReferences;
import org.gcube.application.geoportalcommon.shared.SearchingFilter;
import org.gcube.application.geoportalcommon.shared.SearchingFilter.ORDER;
import org.gcube.application.geoportalcommon.shared.geoportal.config.GroupedLayersDV;
import org.gcube.application.geoportalcommon.shared.geoportal.config.ItemFieldDV;
import org.gcube.application.geoportalcommon.shared.geoportal.config.layers.ConfiguredLayerDV;
import org.gcube.application.geoportalcommon.shared.geoportal.config.layers.LayerIDV;
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV;
import org.gcube.application.geoportalcommon.shared.geoportal.view.ProjectView;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewer;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.GisToolbarFacilities;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.MAP_PROJECTION;
import org.gcube.portlets.user.geoportaldataviewer.client.events.ChangeMapLayerEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.events.MapExtentToEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.events.collections.OpenCollectionEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.gis.OpenLayerMap;
import org.gcube.portlets.user.geoportaldataviewer.client.resources.GNAIcons;
import org.gcube.portlets.user.geoportaldataviewer.client.resources.GNAImages;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.cms.search.SearchFacilityUI;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.crossfiltering.CrossFilteringLayerPanel;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.customoverlays.OverlayCustomLayerPanel;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.layercollection.LayerCollectionPanel;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.map.ExtentMapUtil;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.map.ExtentMapUtil.Location;
import org.gcube.portlets.user.geoportaldataviewer.client.util.URLUtil;
import org.gcube.portlets.user.geoportaldataviewer.shared.GCubeCollection;
import org.gcube.portlets.user.geoportaldataviewer.shared.ItemFieldsResponse;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BaseMapLayer;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem;
import com.github.gwtbootstrap.client.ui.Button;
import com.github.gwtbootstrap.client.ui.CheckBox;
import com.github.gwtbootstrap.client.ui.DropdownButton;
import com.github.gwtbootstrap.client.ui.ListBox;
import com.github.gwtbootstrap.client.ui.NavLink;
import com.github.gwtbootstrap.client.ui.Tab;
import com.github.gwtbootstrap.client.ui.TabPanel;
import com.github.gwtbootstrap.client.ui.Paragraph;
import com.github.gwtbootstrap.client.ui.constants.IconType;
import com.github.gwtbootstrap.client.ui.constants.LabelType;
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.event.dom.client.ChangeEvent;
import com.google.gwt.event.dom.client.ChangeHandler;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.LayoutPanel;
import com.google.gwt.user.client.ui.RadioButton;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.ScrollPanel;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.Widget;
/**
* The Class GeonaDataViewMainPanel.
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
*
* Nov 19, 2020
*/
public class GeonaDataViewMainPanel extends Composite {
private static final String PLACEHOLDER_SELECT_SEARCH_IN = "Select Collection...";
private static GeonaDataViewMainPanelUiBinder uiBinder = GWT.create(GeonaDataViewMainPanelUiBinder.class);
/**
* The Interface GeonaDataViewMainPanelUiBinder.
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
*
* Nov 19, 2020
*/
interface GeonaDataViewMainPanelUiBinder extends UiBinder<Widget, GeonaDataViewMainPanel> {
}
@UiField
Tab mapTabPanel;
HTMLPanel mainContainerPanel;
@UiField
HTMLPanel mainToolBar;
@UiField
NavLink dataPointSelection;
@UiField
NavLink dataBoxSelection;
@UiField
Button removeQuery;
@UiField
TabPanel mainTabPanel;
DetailsPanel detailsPanel;
@UiField
Button extentToItaly;
@UiField
Button extentToEarth;
@UiField
Button linkLayers;
@UiField
DropdownButton openCollectionDropDown;
@UiField
DropdownButton linkCustomOverlayLayers;
@UiField
DropdownButton linkCrossFilteringLayers;
@UiField
HTMLPanel panelCustomOverlayLayers;
@UiField
HTMLPanel panelCrossFilteringLayers;
@UiField
HTMLPanel openCollectionPanel;
@UiField
DropdownButton searchFacilityButton;
@UiField
ListBox navListSearch;
//@UiField
//ScrollPanel overlayLayersPanel;
private List<Tab> listTabs = new ArrayList<Tab>();
RootPanel overlayLayersPanel = RootPanel.get(GeoportalDataViewer.DIV_LAYER_VIEW);
@UiField
ScrollPanel searchFacilityPanel;
@UiField
HTMLPanel panelAttribution;
@UiField
HTMLPanel panelBaseLayers;
@UiField
DropdownButton linkMap;
@UiField
DropdownButton linkPresetLocation;
private MapPanel mapPanel;
private OpenLayerOSM map;
private OpenLayerMap map;
private HandlerManager eventBus;
private Map<Long, Tab> mapProducts = new HashMap<Long, Tab>();
private HandlerManager applicationBus;
public GeonaDataViewMainPanel(HandlerManager eventBus) {
private HashMap<String, List<CheckBox>> mapCollectionCheckBoxes;
private SearchFacilityUI currentSearchFacility;
private HashMap<String, ItemFieldsResponse> mapItemFieldsForUCD = new HashMap<String, ItemFieldsResponse>();
public GeonaDataViewMainPanel(HandlerManager applicationBus, int mapHeight,
List<ItemFieldsResponse> itemFieldsReponse) {
initWidget(uiBinder.createAndBindUi(this));
this.eventBus = eventBus;
mapPanel = new MapPanel("600px");
mapTabPanel.add(mapPanel);
this.applicationBus = applicationBus;
mapPanel = new MapPanel(mapHeight + "px");
detailsPanel.setHeight(mapHeight + "px");
detailsPanel.setApplicationBus(applicationBus);
overlayLayersPanel.setVisible(false);
mainContainerPanel.add(mapPanel);
bindHandlers();
dataPointSelection.setIcon(IconType.SCREENSHOT);
dataBoxSelection.setIcon(IconType.BOOKMARK);
removeQuery.setIcon(IconType.REMOVE);
Image italyImg = new Image(GNAImages.ICONS.italyIcon());
italyImg.getElement().getStyle().setPaddingLeft(20, Unit.PX);
extentToItaly.getElement().appendChild(italyImg.getElement());
extentToItaly.setWidth("140px");
Image worldImg = new Image(GNAImages.ICONS.worldIcon());
worldImg.getElement().getStyle().setPaddingLeft(20, Unit.PX);
extentToEarth.getElement().appendChild(worldImg.getElement());
extentToEarth.setWidth("140px");
// linkMap.setCustomIconStyle(GNAIcons.CustomIconType.MAP.get());
linkPresetLocation.setCustomIconStyle(GNAIcons.CustomIconType.PRESET_LOCATION.get());
linkLayers.setCustomIconStyle(GNAIcons.CustomIconType.LAYERS.get());
openCollectionDropDown.setIcon(IconType.COMPASS);
mapItemFieldsForUCD.clear();
SearchingFilter initialSortFilter = new SearchingFilter();
initialSortFilter.setOrder(ORDER.ASC);
navListSearch.addItem(PLACEHOLDER_SELECT_SEARCH_IN, PLACEHOLDER_SELECT_SEARCH_IN);
navListSearch.getElement().getFirstChildElement().setAttribute("disabled", "disabled");
for (final ItemFieldsResponse itemFieldResp : itemFieldsReponse) {
UseCaseDescriptorDV ucd = itemFieldResp.getUseCaseDescriptorDV();
mapItemFieldsForUCD.put(ucd.getId(), itemFieldResp);
GWT.log("Added navLink for: " + ucd.getName());
navListSearch.addItem(ucd.getName(), ucd.getProfileID());
}
navListSearch.addChangeHandler(new ChangeHandler() {
private SearchFacilityUI currentSearchFacility;
@Override
public void onChange(ChangeEvent event) {
if (this.currentSearchFacility != null)
this.currentSearchFacility.resetCurrentSearch();
String ucdProfileID = navListSearch.getValue(navListSearch.getSelectedIndex());
GWT.log("UCD ProfileID selected: " + ucdProfileID);
if (ucdProfileID.compareTo(PLACEHOLDER_SELECT_SEARCH_IN) != 0) {
searchFacilityPanel.clear();
ItemFieldsResponse itemFieldResp = mapItemFieldsForUCD.get(ucdProfileID);
List<ItemFieldDV> result = itemFieldResp.getListItemFields();
List<ItemFieldDV> displayFields = new ArrayList<ItemFieldDV>();
List<ItemFieldDV> searchByFields = new ArrayList<ItemFieldDV>();
List<ItemFieldDV> sortByFields = new ArrayList<ItemFieldDV>();
for (ItemFieldDV itemField : result) {
if (itemField.isDisplayAsResult()) {
displayFields.add(itemField);
}
if (itemField.isSearchable()) {
searchByFields.add(itemField);
}
if (itemField.isSortable()) {
sortByFields.add(itemField);
}
}
this.currentSearchFacility = new SearchFacilityUI(ucdProfileID, applicationBus, displayFields,
sortByFields, searchByFields, initialSortFilter);
searchFacilityPanel.add(currentSearchFacility);
currentSearchFacility.setSearchButton(searchFacilityButton);
}
}
});
searchFacilityButton.setIcon(IconType.SEARCH);
if (itemFieldsReponse.size() == 0) {
searchFacilityPanel.setVisible(false);
searchFacilityButton.setVisible(false);
}
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
searchFacilityPanel.getElement().getParentElement().addClassName("opacity-09");
panelCustomOverlayLayers.getElement().getParentElement().addClassName("opacity-09");
panelCrossFilteringLayers.getElement().getParentElement().addClassName("opacity-09");
}
});
openCollectionDropDown.setTitle(GisToolbarFacilities.COLLECTION.getTooltip());
linkCustomOverlayLayers.setTitle(GisToolbarFacilities.OVERLAY.getTooltip());
linkCrossFilteringLayers.setTitle(GisToolbarFacilities.FILTER.getTooltip());
searchFacilityButton.setTitle(GisToolbarFacilities.SEARCH.getTooltip());
linkLayers.setTitle(GisToolbarFacilities.LAYERS.getTooltip());
linkMap.setTitle(GisToolbarFacilities.MAP.getTooltip());
linkPresetLocation.setTitle(GisToolbarFacilities.PRESET_LOCATION.getTooltip());
// layersDDB.setToggle(true);
bindEvents();
}
public void setMapHeight(int height) {
mapPanel.setHeight(height + "px");
/**
* Bind events.
*/
private void bindEvents() {
linkLayers.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
GWT.log("layersDDB clicked");
if (overlayLayersPanel.isVisible()) {
overlayLayersPanel.setVisible(false);
} else {
overlayLayersPanel.setVisible(true);
}
}
});
searchFacilityButton.addDomHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
// event.preventDefault();
event.stopPropagation();
}
}, ClickEvent.getType());
openCollectionDropDown.addDomHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
// event.preventDefault();
event.stopPropagation();
}
}, ClickEvent.getType());
linkCustomOverlayLayers.addDomHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
// event.preventDefault();
event.stopPropagation();
}
}, ClickEvent.getType());
linkCrossFilteringLayers.addDomHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
// event.preventDefault();
event.stopPropagation();
}
}, ClickEvent.getType());
}
/**
* Sets the panels height.
*
* @param height the new panels height
*/
public void setPanelsHeight(int height) {
String toH = height + "px";
mapPanel.setMapHeight(height);
detailsPanel.setHeight(toH);
setOverlayPanelMaxHeight();
}
public void setPanelsWidth(int clientWidth) {
if(clientWidth<GeoportalDataViewerConstants.TABLET_WIDTH) {
openCollectionDropDown.setText("");
linkCustomOverlayLayers.setText("");
linkCrossFilteringLayers.setText("");
searchFacilityButton.setText("");
linkLayers.setText("");
linkPresetLocation.setText("");
linkMap.setText("");
}else {
openCollectionDropDown.setText(GisToolbarFacilities.COLLECTION.getName());
linkCustomOverlayLayers.setText(GisToolbarFacilities.OVERLAY.getName());
linkCrossFilteringLayers.setText(GisToolbarFacilities.FILTER.getName());
searchFacilityButton.setText(GisToolbarFacilities.SEARCH.getName());
linkLayers.setText(GisToolbarFacilities.LAYERS.getName());
linkMap.setText(GisToolbarFacilities.MAP.getName());
linkPresetLocation.setText(GisToolbarFacilities.PRESET_LOCATION.getName());
}
}
/**
* Sets the overlay panel max height.
*/
private void setOverlayPanelMaxHeight() {
String overlMH = mapPanel.getOffsetHeight() - 130 + "px";
GWT.log("overlayLayersPanel maxHeight: " + overlMH);
overlayLayersPanel.getElement().getStyle().setProperty("maxHeight", overlMH);
}
/**
* Gets the map panel.
*
* @return the map panel
*/
public MapPanel getMapPanel() {
return mapPanel;
}
public void setMap(OpenLayerOSM map) {
/**
* Sets the map.
*
* @param map the new map
*/
public void setMap(OpenLayerMap map) {
this.map = map;
}
/**
* Bind handlers.
*/
public void bindHandlers() {
dataPointSelection.addClickHandler(new ClickHandler() {
@ -94,8 +441,6 @@ public class GeonaDataViewMainPanel extends Composite {
map.addPointVectorSource();
}
removeQuery.setVisible(true);
//dataBoxSelection.setActive(false);
//dataBoxSelection.getElement().removeClassName("active");
}
});
@ -109,13 +454,11 @@ public class GeonaDataViewMainPanel extends Composite {
map.addExtentInteraction();
}
removeQuery.setVisible(true);
//dataPointSelection.setActive(false);
//dataPointSelection.getElement().removeClassName("active");
}
});
removeQuery.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
map.removeQueryInteractions();
@ -123,92 +466,321 @@ public class GeonaDataViewMainPanel extends Composite {
}
});
}
public void renderProductIntoTab(Tab tab, ConcessioneDV cdv) {
tab.clear();
tab.setHeading(cdv.getNome());
tab.add(new ConcessioneView(cdv));
mapProducts.put(cdv.getId(), tab);
selectTabForProductId(cdv.getId());
}
public boolean selectTabForProductId(long productId) {
Tab product = mapProducts.get(productId);
if(product!=null) {
selectTab(product);
//found
return true;
}
//not found
return false;
}
/**
* Adds the as tab.
*
* @param tabTitle the tab title
* @param tabDescr the tab descr
* @param spinner the spinner
* @param w the w
* @return the tab
*/
public Tab addAsTab(String tabTitle, boolean spinner, Widget w){
// field_create_analytics_request.setActive(false);
Tab tab = new Tab();
mainTabPanel.add(tab);
if(spinner) {
LoaderIcon loader = new LoaderIcon("Loading...");
tab.add(loader);
}
tab.addClickHandler(new ClickHandler() {
extentToItaly.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
Location italyLocation = ExtentMapUtil.getLocation(ExtentMapUtil.PLACE.ITALY);
applicationBus.fireEvent(new MapExtentToEvent(italyLocation));
map.setCenter(italyLocation.getCoordinate(MAP_PROJECTION.EPSG_3857));
map.setZoom(italyLocation.getZoomLevel());
}
});
//tab.setActive(true);
tab.setHeading(tabTitle);
listTabs.add(tab);
if(w!=null)
tab.add(w);
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
extentToEarth.addClickHandler(new ClickHandler() {
@Override
public void execute() {
selectTab(tab);
public void onClick(ClickEvent event) {
Location earthLocation = ExtentMapUtil.getLocation(ExtentMapUtil.PLACE.WORLD);
applicationBus.fireEvent(new MapExtentToEvent(earthLocation));
map.setCenter(earthLocation.getCoordinate(MAP_PROJECTION.EPSG_3857));
map.setZoom(earthLocation.getZoomLevel());
}
});
return tab;
// tab.setActive(true);
}
private void selectTab(Tab theTab) {
int i = 1;
for (Tab tab : listTabs) {
GWT.log("Selecting "+tab);
tab.setActive(false);
if(tab.equals(theTab)) {
GWT.log("Tab selected "+tab);
mainTabPanel.selectTab(i);
/**
* Show as details.
*
* @param result the result
* @param geonaItemRef the geona item ref
*/
public void showAsDetails(ProjectView result, GeoportalItemReferences geonaItemRef) {
detailsPanel.showDetailsFor(result, geonaItemRef);
}
/**
* Hide panel details.
*/
public void hidePanelDetails() {
detailsPanel.hidePanelDetails();
}
/**
* Gets the displayed record.
*
* @return the displayed record
*/
public ProjectView getDisplayedProject() {
return detailsPanel.getDisplayedProject();
}
/**
* Gets the layers DDB.
*
* @return the layers DDB
*/
public Button getLayersDDB() {
return linkLayers;
}
/**
* Show overlay layers.
*
* @param panel the panel
*/
public void showOverlayLayers(FlowPanel panel) {
GWT.log("showOverlayLayers");
// layersDDB.setVisible(true);
overlayLayersPanel.setVisible(true);
overlayLayersPanel.clear();
setOverlayPanelMaxHeight();
overlayLayersPanel.add(panel);
// layersDDBClickEvent();
}
/**
* Layers DDB click event.
*/
private void layersDDBClickEvent() {
linkLayers.fireEvent(new GwtEvent<ClickHandler>() {
@Override
public com.google.gwt.event.shared.GwtEvent.Type<ClickHandler> getAssociatedType() {
return ClickEvent.getType();
}
@Override
protected void dispatch(ClickHandler handler) {
handler.onClick(null);
}
});
}
/**
* Hide overlay layers.
*/
public void hideOverlayLayers() {
GWT.log("hideOverlayLayers");
overlayLayersPanel.clear();
// layersDDB.setVisible(false);
overlayLayersPanel.setVisible(false);
// layersDDBClickEvent();
}
/**
* Sets the map attribution.
*
* @param attribution the new map attribution
*/
public void setMapAttribution(String attribution) {
panelAttribution.clear();
Label label = new Label("Base Map Credits");
Paragraph p = new Paragraph(attribution);
panelAttribution.add(label);
panelAttribution.add(p);
}
/**
* Sets the base layers.
*
* @param listBaseLayers the new base layers
*/
public void setAvailableCollections(Collection<GCubeCollection> collection, String openCollectionID) {
GWT.log("Init Available collections menu");
if (collection == null || collection.isEmpty())
GWT.log("!!! No Available collections");
mapCollectionCheckBoxes = new HashMap<String, List<CheckBox>>();
for (GCubeCollection coll : collection) {
GWT.log("Found available collection " + coll);
final String collectionID = coll.getUcd().getId(); // collectionID == UCD_Id
LayerCollectionPanel lcp = new LayerCollectionPanel(coll, applicationBus);
openCollectionPanel.add(lcp);
List<CheckBox> listCollections = mapCollectionCheckBoxes.get(collectionID);
if (listCollections == null)
listCollections = new ArrayList<CheckBox>();
listCollections.add(lcp.getCheckbox());
mapCollectionCheckBoxes.put(collectionID, listCollections);
// Opening All Collections if openCollectionID is null
if (openCollectionID == null) {
lcp.getCheckbox().setValue(true, true);
// String collectionID = checkbox.getId().replace("gcubeCollectionSelector_",
// "");
GWT.log("Opening the collection: " + collectionID);
applicationBus.fireEvent(new OpenCollectionEvent(collectionID));
}
}
// Opening All Collections if openCollectionID is null
if (openCollectionID != null) {
List<CheckBox> listCheckBoxes = mapCollectionCheckBoxes.get(openCollectionID);
if (listCheckBoxes != null) {
for (CheckBox checkBox : listCheckBoxes) {
checkBox.setValue(true, true);
String collectionID = checkBox.getId().replace("gcubeCollectionSelector_", "");
GWT.log("Opening the input collection: " + collectionID);
applicationBus.fireEvent(new OpenCollectionEvent(collectionID));
}
}
}
}
public void openCollectionMenu() {
GWT.log("openCollectionMenu");
GeoportalDataViewerConstants.clickElement(openCollectionDropDown.getElement().getFirstChildElement());
}
public void setBaseLayers(List<BaseMapLayer> listBaseLayers) {
if (listBaseLayers == null)
return;
int i = 0;
for (BaseMapLayer baseMapLayer : listBaseLayers) {
RadioButton radio = new RadioButton("base-layer");
radio.setText(baseMapLayer.getName());
if (i == 0) {
radio.setValue(true, false);
}
radio.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
@Override
public void onValueChange(ValueChangeEvent<Boolean> event) {
applicationBus.fireEvent(new ChangeMapLayerEvent(baseMapLayer));
}
});
SimplePanel sp = new SimplePanel(radio);
sp.getElement().addClassName("form-inline");
sp.getElement().addClassName("map-layers-radio");
panelBaseLayers.add(sp);
i++;
}
}
public void addOverlayLayers(GCubeCollection collection,
List<GroupedLayersDV<? extends LayerIDV>> listGroupedLayers) {
if (listGroupedLayers == null)
return;
com.github.gwtbootstrap.client.ui.Label collectionGroup = new com.github.gwtbootstrap.client.ui.Label(
collection.getUcd().getName());
collectionGroup.setType(LabelType.WARNING);
LayoutPanel lc = new LayoutPanel();
lc.add(collectionGroup);
panelCustomOverlayLayers.add(lc);
for (GroupedLayersDV gCustomLayerDV : listGroupedLayers) {
if (gCustomLayerDV.getListCustomLayers() != null) {
FlowPanel lcInner = new FlowPanel();
lcInner.getElement().getStyle().setMarginLeft(5.0, Unit.PX);
com.github.gwtbootstrap.client.ui.Label labelGroup = new com.github.gwtbootstrap.client.ui.Label(
gCustomLayerDV.getName());
labelGroup.setType(LabelType.INFO);
String descr = gCustomLayerDV.getDescription() != null && !gCustomLayerDV.getDescription().isEmpty()
? gCustomLayerDV.getDescription()
: gCustomLayerDV.getName();
labelGroup.setTitle(descr);
lcInner.add(labelGroup);
if (descr.compareTo(gCustomLayerDV.getName()) != 0) {
HTML overlayGroupDescr = new HTML();
overlayGroupDescr.getElement().setClassName("overlay-panel-style-description");
overlayGroupDescr.setHTML(descr);
lcInner.add(overlayGroupDescr);
}
List<ConfiguredLayerDV> list = gCustomLayerDV.getListCustomLayers();
for (ConfiguredLayerDV customLayer : list) {
if (customLayer.isDisplay()) {
LayerItem layerItem = new LayerItem();
if (customLayer.getWMS_URL() != null) {
final String mapServerHost = URLUtil.getPathURL(customLayer.getWMS_URL());
GWT.log("mapServerHost: " + mapServerHost);
layerItem.setMapServerHost(mapServerHost);
layerItem.setBaseLayer(false);
layerItem.setName(customLayer.getName());
layerItem.setTitle(customLayer.getTitle());
layerItem.setWmsLink(customLayer.getWMS_URL());
// panelCustomOverlayLayers.add(new CrossFilteringLayerPanel(layerItem,
// applicationBus));
lcInner.add(new OverlayCustomLayerPanel(layerItem, applicationBus));
map.addGroupedCustomWMSLayer(layerItem);
}
}
}
panelCustomOverlayLayers.add(lcInner);
}
}
linkCustomOverlayLayers.setVisible(listGroupedLayers.size() > 0);
}
public void addCrossFilteringLayers(GCubeCollection collection,
List<GroupedLayersDV<? extends LayerIDV>> listGroupedLayers) {
if (listGroupedLayers == null)
return;
com.github.gwtbootstrap.client.ui.Label collectionGroup = new com.github.gwtbootstrap.client.ui.Label(
collection.getUcd().getName());
collectionGroup.setType(LabelType.WARNING);
LayoutPanel lc = new LayoutPanel();
lc.add(collectionGroup);
panelCrossFilteringLayers.add(lc);
for (GroupedLayersDV<? extends LayerIDV> groupedLayerDV : listGroupedLayers) {
FlowPanel lcInner = new FlowPanel();
lcInner.getElement().getStyle().setMarginLeft(5.0, Unit.PX);
com.github.gwtbootstrap.client.ui.Label labelGroup = new com.github.gwtbootstrap.client.ui.Label(
groupedLayerDV.getName());
labelGroup.setType(LabelType.INFO);
String descr = groupedLayerDV.getDescription() != null && !groupedLayerDV.getDescription().isEmpty()
? groupedLayerDV.getDescription()
: groupedLayerDV.getName();
labelGroup.setTitle(descr);
lcInner.add(labelGroup);
// panelCustomOverlayLayers.add(labelGroup);
if (descr.compareTo(groupedLayerDV.getName()) != 0) {
HTML overlayGroupDescr = new HTML();
overlayGroupDescr.getElement().setClassName("filter-panel-style-description");
overlayGroupDescr.setHTML(descr);
lcInner.add(overlayGroupDescr);
// panelCustomOverlayLayers.add(overlayGroupDescr);
}
CrossFilteringLayerPanel cfp = new CrossFilteringLayerPanel(collection, groupedLayerDV, applicationBus);
cfp.setFilterButton(linkCrossFilteringLayers);
lcInner.add(cfp);
panelCrossFilteringLayers.add(lcInner);
}
linkCrossFilteringLayers.setVisible(listGroupedLayers.size() > 0);
}
}

View File

@ -1,16 +1,98 @@
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
xmlns:g="urn:import:com.google.gwt.user.client.ui"
xmlns:b="urn:import:com.github.gwtbootstrap.client.ui">
xmlns:b="urn:import:com.github.gwtbootstrap.client.ui"
xmlns:c="urn:import:org.gcube.portlets.user.geoportaldataviewer.client.ui">
<ui:style>
.margin-right-10 {
margin-right: 10px;
}
.font-weight-bold {
font-weight: bold;
}
.open-collection-style {
padding-left: 15px;
padding-right: 15px;
}
.margin-left-top-5 {
margin-left: 5px;
margin-top: 5px;
}
.margin-left-5 {
margin-left: 5px;
}
</ui:style>
<g:HTMLPanel ui:field="mainHTMLPanel">
<b:TabPanel ui:field="mainTabPanel" tabPosition="top">
<b:Tab ui:field="mapTabPanel" active="true" heading="Map">
<b:DropdownButton type="LINK" text="Query">
<g:HTMLPanel ui:field="mainContainerPanel">
<g:HTMLPanel ui:field="mainToolBar"
addStyleNames="inner-toolbar">
<b:DropdownButton type="LINK" text=" " icon="INFO">
<g:HTMLPanel ui:field="panelInfo"
addStyleNames="info-interaction">
<g:Label>Map Interactions</g:Label>
<b:Paragraph>
<b:Icon type="CHECK_EMPTY" />
Use
<code>Shift+Drag</code>
to draw an extent for zoom in the Map
</b:Paragraph>
<b:Paragraph>
<b:Icon type="HAND_UP" />
Click on the Points shown on the Map to view their features
</b:Paragraph>
<g:HTMLPanel ui:field="panelAttribution"
addStyleNames="info-interaction" visible="false">
</g:HTMLPanel>
</g:HTMLPanel>
</b:DropdownButton>
<b:DropdownButton type="LINK" text="Collection"
ui:field="openCollectionDropDown">
<g:HTMLPanel ui:field="openCollectionPanel"
addStyleNames="open-collection-style">
</g:HTMLPanel>
</b:DropdownButton>
<b:DropdownButton type="LINK" text="Map" ui:field="linkMap" icon="GLOBE">
<g:HTMLPanel ui:field="panelBaseLayers">
</g:HTMLPanel>
</b:DropdownButton>
<b:DropdownButton type="LINK" visible="false" text="Overlay" ui:field="linkCustomOverlayLayers" icon="REORDER">
<g:HTMLPanel ui:field="panelCustomOverlayLayers" addStyleNames="overlay-panel-style">
</g:HTMLPanel>
</b:DropdownButton>
<b:DropdownButton type="LINK" visible="false" text="Filter" ui:field="linkCrossFilteringLayers" icon="FILTER">
<g:HTMLPanel ui:field="panelCrossFilteringLayers" addStyleNames="filter-panel-style">
</g:HTMLPanel>
</b:DropdownButton>
<b:DropdownButton type="LINK" text="Search"
ui:field="searchFacilityButton">
<g:FlowPanel addStyleNames="search-field">
<g:HorizontalPanel>
<b:Label type="INFO">Search in </b:Label>
<b:ListBox title="Search in the Collection..."
ui:field="navListSearch">
</b:ListBox>
</g:HorizontalPanel>
</g:FlowPanel>
<g:ScrollPanel ui:field="searchFacilityPanel"
addStyleNames="search-facility"></g:ScrollPanel>
</b:DropdownButton>
<b:DropdownButton type="LINK" text="Preset Location"
ui:field="linkPresetLocation" addStyleNames="preset-location">
<b:Nav>
<b:Button type="LINK" ui:field="extentToItaly"
text="Italy" title="Center to Italy"></b:Button>
</b:Nav>
<b:Nav>
<b:Button type="LINK" ui:field="extentToEarth"
text="World" title="Center to World"></b:Button>
</b:Nav>
</b:DropdownButton>
<b:DropdownButton type="LINK" text="Query"
visible="false">
<!-- <b:ButtonGroup toggle="checkbox" ui:field="buttonGroup"> -->
<b:NavLink ui:field="dataPointSelection"
addStyleNames="{style.margin-right-10}">Data Point
@ -19,8 +101,15 @@
Selection</b:NavLink>
<!-- </b:ButtonGroup> -->
</b:DropdownButton>
<b:Button type="LINK" ui:field="removeQuery" text="Remove Query" visible="false"></b:Button>
</b:Tab>
</b:TabPanel>
<b:Button type="LINK" ui:field="removeQuery"
text="Remove Query" visible="false"></b:Button>
<b:Button type="LINK" text="Layers" ui:field="linkLayers">
</b:Button>
<!-- <g:ScrollPanel ui:field="overlayLayersPanel"
addStyleNames="layers-panel" visible="false"></g:ScrollPanel> -->
</g:HTMLPanel>
</g:HTMLPanel>
<c:DetailsPanel ui:field="detailsPanel"
addStyleNames="details-panel"></c:DetailsPanel>
</g:HTMLPanel>
</ui:UiBinder>

View File

@ -0,0 +1,70 @@
package org.gcube.portlets.user.geoportaldataviewer.client.ui;
import com.github.gwtbootstrap.client.ui.Button;
import com.github.gwtbootstrap.client.ui.Modal;
import com.github.gwtbootstrap.client.ui.ModalFooter;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Widget;
/**
* The Class ModalWindow.
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
*
* Nov 20, 2020
*/
public class ModalWindow {
private Modal modal;
private Object caller;
/**
* Instantiates a new modal window.
*
* @param title the title
* @param width the width
* @param maxHeight the max height
*/
public ModalWindow(String title, int width, int maxHeight) {
modal = new Modal(false);
modal.hide(false);
modal.setTitle(title);
modal.setCloseVisible(true);
modal.setWidth(width);
modal.setMaxHeigth(maxHeight+"px");
ModalFooter modalFooter = new ModalFooter();
final Button buttClose = new Button("Close");
modalFooter.add(buttClose);
buttClose.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
modal.hide();
}
});
modal.add(modalFooter);
}
public void add(Widget toAdd) {
modal.add(toAdd);
}
public void setCaller(Object caller) {
this.caller = caller;
}
public void show() {
modal.show();
}
public void setWidth(int width) {
modal.setWidth(width);
}
}

View File

@ -0,0 +1,213 @@
package org.gcube.portlets.user.geoportaldataviewer.client.ui.cms.gallery;
import java.util.Set;
import org.gcube.application.geoportalcommon.shared.geoportal.materialization.innerobject.FilesetDV;
import org.gcube.application.geoportalcommon.shared.geoportal.materialization.innerobject.PayloadDV;
import org.gcube.application.geoportalcommon.shared.geoportal.view.SectionView;
import org.gcube.application.geoportalcommon.shared.geoportal.view.SubDocumentView;
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONParser;
import com.google.gwt.json.client.JSONString;
import com.google.gwt.json.client.JSONValue;
import com.google.gwt.user.client.Random;
import com.google.gwt.user.client.ui.HTMLPanel;
/**
* The Class ImagesSectionGallery.
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
*
* Jul 21, 2021
*/
public class ImagesSectionGallery {
private HTMLPanel galleryPanel;
private String galleryDivId;
private SectionView sectionView;
/**
* Instantiates a new images section gallery.
*
* @param sectionView the section view
*/
public ImagesSectionGallery(SectionView sectionView) {
this.galleryDivId = "nanogallery" + Random.nextInt() + Random.nextInt();
this.galleryPanel = new HTMLPanel("<div id='" + galleryDivId + "'></div>");
this.sectionView = sectionView;
}
/**
* Show gallery.
*
* @param json_array_images the json array images
* @param galleryDivId the gallery div id
*/
private native void showGallery(JavaScriptObject json_array_images, String galleryDivId) /*-{
//console.log("showing: " + json_array_images)
var waitForJQuery = setInterval(
function() {
if (typeof $wnd.$ != 'undefined') {
$wnd
.$("#" + galleryDivId)
.nanogallery2(
{
thumbnailHeight : '200 XS150 SM150', // RESPONSIVE THUMBNAIL HEIGHT: default=200px, XS resolution=150px, SM resolution=150px
thumbnailWidth : '218 XS150 SM150', // RESPONSIVE THUMBNAIL WIDTH: auto
thumbnailAlignment : 'left',
thumbnailBorderHorizontal : 0,
thumbnailBorderVertical : 0,
thumbnailGutterWidth : '10 XS10 SM10',
thumbnailGutterHeight : '10 XS10 SM10',
// THUMBNAIL TOOLS & LABEL
thumbnailLabel : {
display : true,
position : 'onBottom',
align : 'left'
},
thumbnailToolbarImage : {
bottomLeft : 'display'
},
// replace the default DISPLAY tool icon
icons : {
thumbnailDisplay : '<i class="fa fa-long-arrow-right" aria-hidden="true"></i> display'
},
// DISPLAY ANIMATION
galleryDisplayTransition : 'slideUp',
galleryDisplayTransitionDuration : 1000,
thumbnailDisplayTransition : 'scaleDown',
thumbnailDisplayTransitionDuration : 300,
thumbnailDisplayInterval : 50,
// THUMBNAIL'S HOVER ANIMATION
//thumbnailBuildInit2 : 'tools_font-size_1.5em|title_font-size_1.5em',
thumbnailHoverEffect2 : 'imageScaleIn80|tools_opacity_0_1|tools_translateX_-30px_0px|title_opacity_1_0|title_translateX_0px_-30px',
touchAnimation : true,
touchAutoOpenDelay : 800,
// GALLERY THEME
galleryTheme : {
thumbnail : {
borderRadius : '2px !important',
background : '#ffffff !important',
titleShadow : 'none !important',
titleColor : '#696969 !important',
labelBackground : '#f3f3f3 !important'
},
thumbnailIcon : {
color : '#000',
shadow : 'none'
},
},
viewerToolbar : {
display : true,
standard : 'minimizeButton, label',
minimized : 'minimizeButton, label, fullscreenButton, downloadButton'
},
viewerTools : {
topLeft : 'pageCounter',
topRight : 'playPauseButton, zoomButton, fullscreenButton, downloadButton, closeButton'
},
// DEEP LINKING
locationHash : false,
items : json_array_images
})
clearInterval(waitForJQuery);
}
}, 200);
}-*/;
/**
* Gets the gallery panel.
*
* @return the gallery panel
*/
public HTMLPanel getGalleryPanel() {
return galleryPanel;
}
/**
* Fill gallery.
*/
public void fillGallery() {
JSONArray jsonArray = new JSONArray();
int index = 0;
for (SubDocumentView subdoc : sectionView.getListSubDocuments()) {
JSONValue meta = JSONParser.parseStrict(subdoc.getMetadataAsJSON());
for (FilesetDV image : subdoc.getListImages()) {
try {
if (image.getListPayload() != null) {
for (PayloadDV payloadDV : image.getListPayload()) {
JSONObject json = new JSONObject();
json.put("src", new JSONString(payloadDV.getLink()));
json.put("srct", new JSONString(payloadDV.getLink()));
json.put("downloadURL", new JSONString(payloadDV.getLink()));
try {
json.put("title", new JSONString(getFirstValueOfJSON(meta)));
} catch (Exception e) {
GWT.log("Error on reading the title from: " + meta);
json.put("title", new JSONString(meta.toString()));
}
json.put("description", new JSONString(meta.toString()));
jsonArray.set(jsonArray.size(), json);
index++;
}
}
} catch (Exception e) {
GWT.log("Error on adding the image to gallery from: " + image);
}
}
}
if(jsonArray.size()>0) {
showGallery(jsonArray.getJavaScriptObject(), galleryDivId);
}
}
/**
* Gets the first value of JSON.
*
* @param metadata the metadata
* @return the first value of JSON
*/
public String getFirstValueOfJSON(JSONValue metadata) {
String value = "";
if (metadata == null)
return value;
if (metadata.isArray() != null) {
JSONArray array = (JSONArray) metadata;
for (int i = 0; i < array.size(); i++) {
JSONObject object = (JSONObject) array.get(i);
Set<String> set = object.keySet();
value = object.get(set.iterator().next()).toString();
}
} else if (metadata.isObject() != null) {
JSONObject object = (JSONObject) metadata;
Set<String> set = object.keySet();
value = object.get(set.iterator().next()).toString();
} else if (metadata.isString() != null) {
value = metadata.toString();
}
return value;
}
}

View File

@ -0,0 +1,227 @@
package org.gcube.portlets.user.geoportaldataviewer.client.ui.cms.layers;
import org.gcube.application.geoportalcommon.shared.geoportal.materialization.GCubeSDIViewerLayerDV;
import org.gcube.application.geoportalcommon.shared.geoportal.materialization.innerobject.BBOXDV;
import org.gcube.application.geoportalcommon.shared.geoportal.view.SubDocumentView;
import org.gcube.application.geoportalcommon.shared.gis.BoundsMap;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.MAP_PROJECTION;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.map.ExtentMapUtil;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.map.ExtentMapUtil.Location;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.map.ExtentMapUtil.PLACE;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.map.MapView;
import org.gcube.portlets.user.geoportaldataviewer.client.util.URLUtil;
import com.github.gwtbootstrap.client.ui.Alert;
import com.github.gwtbootstrap.client.ui.DropdownButton;
import com.github.gwtbootstrap.client.ui.NavLink;
import com.github.gwtbootstrap.client.ui.constants.AlertType;
import com.github.gwtbootstrap.client.ui.constants.ButtonType;
import com.github.gwtbootstrap.client.ui.constants.IconType;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Style;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.Widget;
import ol.Coordinate;
public class LayersSectionViewer extends Composite {
private static LayersSectionViewerUiBinder uiBinder = GWT.create(LayersSectionViewerUiBinder.class);
interface LayersSectionViewerUiBinder extends UiBinder<Widget, LayersSectionViewer> {
}
@UiField
HTMLPanel layerPanel;
@UiField
HTMLPanel mapViewPanel;
private static enum IMAGE_EXPORT_AS {
PNG, JPEG
};
int downloadAttempt = 0;
private GCubeSDIViewerLayerDV layer;
private SubDocumentView subDocumentView;
public LayersSectionViewer(GCubeSDIViewerLayerDV layer, SubDocumentView subDocumentView) {
initWidget(uiBinder.createAndBindUi(this));
GWT.log("Showing: " + layer);
this.layer = layer;
this.subDocumentView = subDocumentView;
String wmsLink = null;
try {
wmsLink = layer.getWMSLink();
} catch (Exception e) {
return;
}
if (wmsLink == null) {
GeoportalDataViewerConstants.printJs("Wms link is null");
return;
}
String layerName = URLUtil.extractValueOfParameterFromURL("layers", wmsLink);
GWT.log("WMS LINK: " + wmsLink);
GWT.log("layerName: " + layerName);
DropdownButton exportMapButton = new DropdownButton("Export Map as...");
exportMapButton.setType(ButtonType.LINK);
exportMapButton.setIcon(IconType.DOWNLOAD_ALT);
exportMapButton.setTitle("Export the map view (OSM + layer) as an image...");
Style exportStyle = exportMapButton.getElement().getStyle();
// exportStyle.setWidth(100, Unit.PCT);
exportStyle.setMarginLeft(70, Unit.PCT);
Location italyLocation = ExtentMapUtil.getLocation(PLACE.ITALY);
Coordinate transformedCenterCoordinate = italyLocation.getCoordinate(MAP_PROJECTION.EPSG_3857);
MapView mapView = new MapView(transformedCenterCoordinate,
GeoportalDataViewerConstants.LIGHT_MAP_ITALY_FIT_ZOOM_ON, "70%", "300px");
mapViewPanel.add(mapView);
mapViewPanel.add(exportMapButton);
String mapServerHost = wmsLink.contains("?") ? wmsLink.substring(0, wmsLink.indexOf("?")) : wmsLink;
GWT.log("mapServerHost: " + mapServerHost);
BBOXDV bbox = layer.getBbox();
try {
if (bbox != null) {
if (!GWT.isProdMode()) {
GWT.log("bbox: " + bbox);
// GWT.log("bbox keys: " + bbox.keySet());
// GWT.log("bbox values: " + bbox.values());
GWT.log("minX: " + bbox.getMinX());
GWT.log("minY: " + bbox.getMinY());
GWT.log("maxX: " + bbox.getMaxX());
GWT.log("maxY: " + bbox.getMaxY());
}
BoundsMap bounds = new BoundsMap(bbox.getMinX(), bbox.getMinY(), bbox.getMaxX(), bbox.getMaxY(), "");
GWT.log("bounds: " + bounds);
mapView.addWMSLayer(mapServerHost, layerName, bounds);
} else {
Alert alert = new Alert();
alert.setType(AlertType.ERROR);
alert.setText("No BBOX found for this layer");
alert.setClose(false);
layerPanel.add(alert);
}
} catch (Exception e) {
Alert alert = new Alert();
alert.setType(AlertType.ERROR);
alert.setHTML("Error on adding the layer to Map. Please check its WMS link: <br/>"+layer.getWMSLink());
alert.getElement().getStyle().setProperty("wordBreak", "break-all");
alert.setClose(false);
layerPanel.add(alert);
}
String htmlLinkId = mapView.getPanelMapElementId() + "-image-download";
for (IMAGE_EXPORT_AS exportType : IMAGE_EXPORT_AS.values()) {
NavLink navLink = new NavLink(exportType.name());
String exportExt = exportType.name().toLowerCase();
String filename = layerName + "." + exportExt;
String mimeType = "image/" + exportExt;
final HTML htmlLink = new HTML("<a id=\"" + htmlLinkId + "\" download=\"" + filename + "\"></a>");
navLink.getElement().appendChild(htmlLink.getElement());
navLink.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
downloadAttempt++;
if (downloadAttempt > 3) {
Window.alert("LOOP");
return;
}
// DOWNLOAD the OSM + layer by canvas
downloadMap(mapView.getLightOLM().getMap(), mapView.getPanelMapElementId(), htmlLinkId, filename,
mimeType);
}
});
exportMapButton.add(navLink);
}
if (subDocumentView.getMetadataAsJSON() != null) {
String table = GeoportalDataViewerConstants.jsonToTableHTML(subDocumentView.getMetadataAsJSON());
layerPanel.add(new HTML(table));
}
}
public static native void exportPDF(String layerURL) /*-{
var image = new Image(layerURL);
var doc = new $wnd.jspdf.jsPDF();
doc.addImage(layerURL, 'PNG', 0, 0, image.width, image.height);
doc.save("map.pdf")
}-*/;
/**
* Prints the.
*
* @param msg the msg
*/
public static native void downloadMap(ol.Map map, String mapPanelId, String linkId, String filename,
String mimeType)/*-{
//console.log("map: " + map);
map.once('rendercomplete', function() {
var mapCanvas = $doc.createElement('canvas');
var size = map.getSize();
mapCanvas.width = size[0];
mapCanvas.height = size[1];
var mapContext = mapCanvas.getContext('2d');
var mapContainer = $doc.querySelector('#' + mapPanelId);
//console.log("mapContainer:" +JSON.stringify(mapContainer, null, 4));
Array.prototype.forEach.call(mapContainer
.querySelectorAll('.ol-layer canvas'), function(canvas) {
if (canvas.width > 0) {
var opacity = canvas.parentNode.style.opacity;
mapContext.globalAlpha = opacity === '' ? 1
: Number(opacity);
var transform = canvas.style.transform;
// Get the transform parameters from the style's transform matrix
var matrix = transform.match(/^matrix\(([^\(]*)\)$/)[1]
.split(',').map(Number);
// Apply the transform to the export map context
CanvasRenderingContext2D.prototype.setTransform.apply(
mapContext, matrix);
mapContext.drawImage(canvas, 0, 0);
}
});
if (navigator.msSaveBlob) {
// link download attribute does not work on MS browsers
navigator.msSaveBlob(mapCanvas.msToBlob(), filename);
} else {
var link = $doc.getElementById(linkId);
link.href = mapCanvas.toDataURL(mimeType);
link.click();
}
});
map.renderSync();
}-*/;
}

View File

@ -0,0 +1,17 @@
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
xmlns:g="urn:import:com.google.gwt.user.client.ui"
xmlns:b="urn:import:com.github.gwtbootstrap.client.ui">
<ui:style>
.important {
font-weight: bold;
}
</ui:style>
<g:HTMLPanel addStyleNames="style-layer">
<g:VerticalPanel>
<g:HTMLPanel ui:field="mapViewPanel"></g:HTMLPanel>
<g:HTMLPanel ui:field="layerPanel"></g:HTMLPanel>
</g:VerticalPanel>
</g:HTMLPanel>
</ui:UiBinder>

View File

@ -0,0 +1,85 @@
package org.gcube.portlets.user.geoportaldataviewer.client.ui.cms.project;
import java.util.Map.Entry;
import org.gcube.application.geoportalcommon.shared.geoportal.DocumentDV;
import org.gcube.application.geoportalcommon.shared.geoportal.project.TemporalReferenceDV;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants;
public class ProjectUtil {
public static <T extends DocumentDV> String toHMLCode(T document, String projectID) {
String htmlCode = "";
if (document == null)
return htmlCode;
Entry<String, Object> firstEntrySet = document.getFirstEntryOfMap();
if (firstEntrySet != null) {
htmlCode += firstEntrySet.getKey() + ": <b>" + firstEntrySet.getValue() + "</b>";
}
if (projectID != null) {
htmlCode += " (id: " + projectID + ")";
}
return htmlCode;
}
public static <T extends DocumentDV> String toHMLCode(boolean showkey, T document, String projectID) {
String htmlCode = "";
if (document == null)
return htmlCode;
Entry<String, Object> firstEntrySet = document.getFirstEntryOfMap();
if (firstEntrySet != null) {
htmlCode += showkey ? firstEntrySet.getKey() + ": <b>" + firstEntrySet.getValue() + "</b>"
: firstEntrySet.getValue();
}
if (projectID != null) {
htmlCode += " (id: " + projectID + ")";
}
return htmlCode;
}
public static <T extends DocumentDV> String toHMLCode(T document) {
String htmlCode = "";
if (document == null)
return htmlCode;
Entry<String, Object> firstEntrySet = document.getFirstEntryOfMap();
if (firstEntrySet != null) {
htmlCode += firstEntrySet.getKey() + ": <b>" + firstEntrySet.getValue() + "</b>";
}
return htmlCode;
}
public static String toHTMLCode(TemporalReferenceDV tempRef) {
String htmlCode = "<span class='display-date'>";
if (tempRef != null) {
String dateToString = "";
if (tempRef.getStart() != null) {
dateToString += GeoportalDataViewerConstants.DATE_TIME_FORMAT.format(tempRef.getStart());
}
dateToString += " / ";
if (tempRef.getStart() != null) {
dateToString += GeoportalDataViewerConstants.DATE_TIME_FORMAT.format(tempRef.getEnd());
}
htmlCode += dateToString;
}
htmlCode += "</span>";
return htmlCode;
}
}

View File

@ -0,0 +1,359 @@
package org.gcube.portlets.user.geoportaldataviewer.client.ui.cms.project;
import java.util.List;
import org.gcube.application.geoportalcommon.shared.GeoportalItemReferences;
import org.gcube.application.geoportalcommon.shared.geoportal.geojson.GeoJSON;
import org.gcube.application.geoportalcommon.shared.geoportal.project.RelationshipDV;
import org.gcube.application.geoportalcommon.shared.geoportal.view.ProjectView;
import org.gcube.application.geoportalcommon.shared.geoportal.view.SectionView;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.MAP_PROJECTION;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerServiceAsync;
import org.gcube.portlets.user.geoportaldataviewer.client.events.AddLayerToMapEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.events.TimelineProjectRelationsEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.events.TimelineProjectRelationsEvent.EVENT_TYPE;
import org.gcube.portlets.user.geoportaldataviewer.client.gis.MapUtils;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.ModalWindow;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.dialogs.DialogShareableLink;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.map.ExtentMapUtil;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.map.ExtentMapUtil.Location;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.map.ExtentMapUtil.PLACE;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.map.MapView;
import com.github.gwtbootstrap.client.ui.Button;
import com.github.gwtbootstrap.client.ui.constants.ButtonType;
import com.github.gwtbootstrap.client.ui.constants.IconType;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.UListElement;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.Random;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.Widget;
import ol.Coordinate;
/**
* The Class ProjectViewer.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Nov 9, 2022
*/
public class ProjectViewer extends Composite {
private static ProjectViewerUiBinder uiBinder = GWT.create(ProjectViewerUiBinder.class);
/**
* The Interface ProjectViewerUiBinder.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Nov 9, 2022
*/
interface ProjectViewerUiBinder extends UiBinder<Widget, ProjectViewer> {
}
@UiField
HTMLPanel headerPanel;
@UiField
HTMLPanel pageViewDetails;
@UiField
HTMLPanel projectViewerMainPanel;
@UiField
HTMLPanel centroidPanel;
@UiField
HTMLPanel tableOfContentPanel;
@UiField
Button shareButton;
@UiField
Button expandButton;
@UiField
Button relationshipsButton;
@UiField
Button addLayersToMap;
@UiField
HTMLPanel toc_container;
@UiField
HTMLPanel toc_list_container;
@UiField
Button reduceToc;
@UiField
UListElement toc_list_anchors;
private ProjectView theProjectView;
private GeoportalItemReferences geoportalItemReferences;
private String myLogin;
private HandlerManager applicationBus;
private String projectViewerMainPanelID;
/**
* Instantiates a new project viewer.
*/
private ProjectViewer() {
initWidget(uiBinder.createAndBindUi(this));
pageViewDetails.getElement().addClassName("page-view-details");
projectViewerMainPanelID = "projectViewer-" + Random.nextInt();
projectViewerMainPanel.getElement().setId(projectViewerMainPanelID);
}
/**
* Instantiates a new project viewer.
*
* @param applicationBus the application bus
* @param geoportalItemRefs the geoportal item refs
* @param projectView the project view
*/
public ProjectViewer(HandlerManager applicationBus, GeoportalItemReferences geoportalItemRefs,
final ProjectView projectView) {
this();
GWT.log("Rendering " + projectView.getTheProjectDV().getId());
this.theProjectView = projectView;
this.geoportalItemReferences = geoportalItemRefs;
this.applicationBus = applicationBus;
final String theTitle = projectView.getTheProjectDV().getProfileName() != null
? projectView.getTheProjectDV().getProfileName()
: "Project ID: " + projectView.getTheProjectDV().getId();
headerPanel.add(new HTML(theTitle));
shareButton.setType(ButtonType.LINK);
shareButton.setIcon(IconType.SHARE);
shareButton.setTitle("Get a link to share with...");
shareButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
DialogShareableLink dg = new DialogShareableLink(geoportalItemReferences, null);
}
});
expandButton.setType(ButtonType.LINK);
expandButton.setIcon(IconType.EXPAND);
expandButton.setTitle("Show this view in new Window");
expandButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
ProjectViewer cv = new ProjectViewer(applicationBus, geoportalItemReferences, theProjectView);
cv.setExpandViewButtonVisible(false);
cv.setRelationshipsButtonVisible(false);
cv.setAddLayersToMapVisible(false);
cv.setTocContentVisible(true);
int width = Window.getClientWidth() * 75 / 100;
int height = Window.getClientHeight() * 70 / 100;
String modalTitle = ProjectUtil.toHMLCode(false, theProjectView.getTheProjectDV().getTheDocument(),
theProjectView.getTheProjectDV().getId());
ModalWindow mw = new ModalWindow(modalTitle, width, height);
mw.add(cv);
mw.setCaller(ProjectViewer.this);
// mw.setWidth(900);
mw.show();
}
});
relationshipsButton.setType(ButtonType.LINK);
relationshipsButton.setIcon(IconType.LINK);
relationshipsButton.setTitle("Show Relationships of this Project");
List<RelationshipDV> relationships = projectView.getTheProjectDV().getRelationships();
if (relationships != null && relationships.size() > 0) {
relationshipsButton.setVisible(true);
} else {
relationshipsButton.setVisible(false);
}
relationshipsButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
applicationBus.fireEvent(
new TimelineProjectRelationsEvent(theProjectView.getTheProjectDV(), EVENT_TYPE.SHOW));
}
});
addLayersToMap.setType(ButtonType.LINK);
addLayersToMap.setIcon(IconType.MAP_MARKER);
addLayersToMap.setTitle("Add the layer/s of the Project to principal Map");
addLayersToMap.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
applicationBus.fireEvent(new AddLayerToMapEvent(theProjectView.getTheProjectDV(), true));
}
});
setAddLayersToMapVisible(false);
GeoportalDataViewerServiceAsync.Util.getInstance().getMyLogin(new AsyncCallback<String>() {
@Override
public void onSuccess(String result) {
myLogin = result;
addCentroidMap();
}
@Override
public void onFailure(Throwable caught) {
}
});
reduceToc.setType(ButtonType.LINK);
reduceToc.setIcon(IconType.PLUS_SIGN_ALT);
toc_list_container.setVisible(false);
reduceToc.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
boolean visible = toc_list_container.isVisible();
setTocContentVisible(!visible);
// if (visible) {
// toc_list_container.setVisible(false);
// reduceToc.setIcon(IconType.PLUS_SIGN_ALT);
// } else {
// toc_list_container.setVisible(true);
// reduceToc.setIcon(IconType.MINUS_SIGN_ALT);
// }
}
});
for (SectionView sectionView : projectView.getListSections()) {
if (!sectionView.isEmpty()) {
SectionViewer sectionViewer = new SectionViewer(sectionView, projectViewerMainPanelID);
String sectionId = sectionView.getSectionTitle().replaceAll("[^A-Za-z0-9]", "-") + "_"
+ Random.nextInt();
String divTarget = "<div class='anchor-target' id='" + sectionId + "'></div>";
sectionViewer.getElement().insertFirst(new HTML(divTarget).getElement());
addAnchorToSection(sectionId, sectionView.getSectionTitle());
pageViewDetails.add(sectionViewer);
}
if (sectionView.hasSpatialLayers()) {
setAddLayersToMapVisible(true);
}
}
if (toc_list_anchors.getChildCount() > 0) {
tableOfContentPanel.setVisible(true);
}
}
private void addAnchorToSection(String id, String text) {
String htmlAnchor = "<a href='#" + id + "'>" + text + "</a>";
toc_list_anchors.appendChild(new HTML("<li>" + htmlAnchor + "</li>").getElement());
}
protected void setTocContentVisible(boolean bool) {
toc_list_container.setVisible(bool);
if (bool) {
reduceToc.setIcon(IconType.MINUS_SIGN_ALT);
} else {
reduceToc.setIcon(IconType.PLUS_SIGN_ALT);
}
}
/**
* Adds the centroid map.
*/
private void addCentroidMap() {
Location italyLocation = ExtentMapUtil.getLocation(PLACE.ITALY);
Coordinate transformedCenterCoordinate = italyLocation.getCoordinate(MAP_PROJECTION.EPSG_3857);
MapView mapView = new MapView(transformedCenterCoordinate,
GeoportalDataViewerConstants.LIGHT_MAP_ITALY_FIT_ZOOM_ON, "70%", "300px");
if (theProjectView != null && theProjectView.getTheProjectDV() != null) {
GeoJSON spatialReference = theProjectView.getTheProjectDV().getSpatialReference();
Coordinate transfCoord = MapUtils.geoJSONToBBOXCenter(spatialReference, MAP_PROJECTION.EPSG_4326.getName(),
MAP_PROJECTION.EPSG_3857.getName());
if (transfCoord != null) {
boolean authenticatedUser = myLogin != null ? true : false;
mapView.addMarker(transfCoord, authenticatedUser);
centroidPanel.add(mapView);
}
} else if (theProjectView != null) {
GeoportalDataViewerConstants
.printJs("I cannot add centroid as maker one or both coordinates are null. Lat: " + theProjectView
+ ", Long:" + theProjectView);
}
}
/**
* Gets the project view.
*
* @return the project view
*/
public ProjectView getProjectView() {
return theProjectView;
}
/**
* Sets the expand view button visible.
*
* @param bool the new expand view button visible
*/
protected void setExpandViewButtonVisible(boolean bool) {
expandButton.setVisible(bool);
}
/**
* Sets the adds the layers to map visible.
*
* @param bool the new adds the layers to map visible
*/
protected void setAddLayersToMapVisible(boolean bool) {
addLayersToMap.setVisible(bool);
}
/**
* Sets the relationships button visible.
*
* @param bool the new relationships button visible
*/
protected void setRelationshipsButtonVisible(boolean bool) {
relationshipsButton.setVisible(bool);
}
}

View File

@ -0,0 +1,66 @@
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
xmlns:g="urn:import:com.google.gwt.user.client.ui"
xmlns:b="urn:import:com.github.gwtbootstrap.client.ui">
<ui:style>
.margin-left-10 {
margin-left: 10px;
}
.font-size-h1-22 h1 {
font-size: 22px;
}
.align-to-right {
right: 20px;
position: absolute;
top: 20px !important;
}
.the-title {
background-color: rgba(0, 60, 136, .7);
color: white;
padding: 10px 10px;
font-size: 14px;
padding-left: 40px;
}
.width-100 {
width: 100%;
}
.display-item-list {
display: inline-table;
}
</ui:style>
<g:HTMLPanel ui:field="projectViewerMainPanel">
<!-- <g:HTMLPanel ui:field="sharePanel" -->
<!-- addStyleNames="{style.align-to-right}"> -->
<!-- </g:HTMLPanel> -->
<g:HTMLPanel ui:field="headerPanel"
addStyleNames="{style.the-title}"></g:HTMLPanel>
<g:HTMLPanel ui:field="pageViewDetails">
<g:HorizontalPanel
addStyleNames="functionalities-style">
<b:Button ui:field="shareButton">Share</b:Button>
<b:Button ui:field="expandButton">Expand</b:Button>
<b:Button ui:field="relationshipsButton">Relationships</b:Button>
<b:Button ui:field="addLayersToMap">Add Layers to Map</b:Button>
</g:HorizontalPanel>
<g:HTMLPanel ui:field="centroidPanel"></g:HTMLPanel>
<g:HTMLPanel ui:field="tableOfContentPanel"
visible="false" addStyleNames="{style.display-item-list}">
<g:HTMLPanel ui:field="toc_container"
addStyleNames="toc_container">
<b:Button ui:field="reduceToc"
addStyleNames="toc_container_reduce_button"></b:Button>
<div class="toc_title">Contents</div>
<g:HTMLPanel ui:field="toc_list_container" addStyleNames="toc_list_container">
<ul ui:field="toc_list_anchors"></ul>
</g:HTMLPanel>
</g:HTMLPanel>
</g:HTMLPanel>
</g:HTMLPanel>
</g:HTMLPanel>
</ui:UiBinder>

Some files were not shown because too many files have changed in this diff Show More