-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug/DES-2184: Add way to select overlapping layers. #86
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. good solution on the overlapping point cloud and users not being able to select them! 👍
i have some questions and comments which mostly relate to the styling of active features.
and possibly stashing the label assets until a later time.
@@ -197,7 +228,36 @@ export class MapComponent implements OnInit, OnDestroy { | |||
* @param ev | |||
*/ | |||
featureClickHandler(ev: any): void { | |||
const f = ev.layer.feature; | |||
this.geoDataService.activeFeature = f; | |||
if (ev.layer.feature.featureType() === 'point_cloud') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (ev.layer.feature.featureType() === 'point_cloud') { | |
if (ev.layer.feature.geometry.type !== 'Point') { |
nonPointFeatures array consists of features where condition d.geometry.type === 'Point'
is false.
what about generic polygons or lines. [ or do we want to handle only point clouds at this point. if so, maybe change the name (and condition) of the variable nonPointFeatures
so its about point clouds. ]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we add a follow on ticket for this?
collection.features.forEach(d => { | ||
let feat: LayerGroup; | ||
if (d.geometry.type === 'Polygon' && d.properties.style) { | ||
|
||
d.properties.style = d.properties.customStyle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
related to https://github.com/TACC-Cloud/hazmapper/pull/86/files#r852545813, I still don't think we should set the style on the feature collection as then its shown to the user but isn't reflective of the data.
src/app/services/geo-data.service.ts
Outdated
@@ -76,7 +76,13 @@ export class GeoDataService { | |||
this.setLoadFeatureData(true); | |||
this.http.get<FeatureCollection>(this.envService.apiUrl + `/${projectRoute}/${projectId}/features/` + '?' + qstring) | |||
.subscribe( (fc: FeatureCollection) => { | |||
fc.features = fc.features.map( (feat: Feature) => new Feature(feat)); | |||
fc.features = fc.features.map( (feat: Feature) => { | |||
if (feat.properties.style) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment as https://github.com/TACC-Cloud/hazmapper/pull/86/files#r907817871
Closing as an alternative solution was implemented in #181 |
Overview:
Implement a way to select point cloud layers that are overlapping through a context menu.
PR Status:
Related Jira tickets:
Summary of Changes:
Asset styling
Added indication for active assets (red) and added default styles for assets (as constants). I also added extra asset types in
leafletUtils.js
to include style default asset types. Also lowered opacity ofPolygon
assets as per Michael's request.Handling overlapping layers
For now, I put
Polygon
assets in a lower z-index compared to thePoint
assets just in case that somePoint
assets are unselectable.I installed
leaflet-contextmenu
(link) and added basic type definitions to get rid of errors.I use this
contextmenu
to give the user a menu based on if there are overlappingPolygon
layers in on the pointer position. If there is only onePolygon
, we just select it.The rendered asset at the top (highest implied
z-index
) should be at the top of thecontextmenu
.Asset labels
As Michael suggested, I put on optional/toggleable labels for
Polygon
assets for clarification. I haven't figured out how we would use the Point cloud description for the names rather than just thefeatureId
.Testing Steps:
Polygon
assets.contextmenu
.Point
andPolygon
) change color on selection.UI Photos:
Notes: