Skip to content
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

Quality of Life: Feature layer Refactor and updates #129

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

mmgaw113
Copy link
Collaborator

@mmgaw113 mmgaw113 commented Dec 19, 2024

Sample

  • Refactor the feature layer sample to clean up and reformat the code
  • Remake the feature item in C++ for more consistent performance across the sample
  • Write the Blueprint functions in bp_FeatureLayer in c++ in order to remove the Blueprint class (Note this deletion is why weather_wbp and BlueprintWeather_wbp have changed)
  • Update UI to show properties of currently selected feature
  • Add input to Feature Layer Query so users can select a feature
  • Add visual Feedback via Highlight material to show the currently selected feature

Checklist

  • PR title follows convention - keyword: Short description of change
  • PR targets the correct branch
  • New Blueprints follow Unreal Naming Convention
  • Self-review of changes
  • There are no warnings related to changes
  • A build was made and tested on all relevant platforms
  • No unrelated changes have been made to any other code or project files
  • No unnecessary includes or namespaces added
  • Code follows plugin coding style
  • New code and changed code has proper formatting
  • No unintentional formatting changes
  • Commits have descriptive titles

Blueprints
Feature Layer WBP: https://blueprintue.com/blueprint/939quqzf/

ArcGIS Maps SDK Version

Maps SDK 1.7 w/UE 5.3

@mmgaw113 mmgaw113 requested a review from a team December 19, 2024 23:55
@mmgaw113 mmgaw113 self-assigned this Dec 19, 2024
@Jade-JadeH
Copy link
Collaborator

Good to see that bp was removed from this sample, this is one of the things I want to improve on our sample repo. I see surface placement is also used. Great.

  1. I didn't checkout out the unity PR, but thought we're going to make the pins not overlapping?

image

  1. It the feature 0-indexed or 1-indexed? because when I select feature 0-6 I'm expecting to see 7 features but seeing 6, I tried a couple of other numbers and see the same.
    image

  2. How do I see the properties of the currently selected feature? Is it in the UI or in the detail panel?
    image

@mmgaw113
Copy link
Collaborator Author

  1. I didn't checkout out the unity PR, but thought we're going to make the pins not overlapping?

In order to make them not over lap whatsoever, the pin mesh scale would be so incredibly small it would be difficult to see without the camera being super close. With this specific data set (trees), they are clustered together which makes it hard to not have any overlapping. This is pretty similar to how the unity one looked.

@mmgaw113
Copy link
Collaborator Author

2. It the feature 0-indexed or 1-indexed? because when I select feature 0-6 I'm expecting to see 7 features but seeing 6, I tried a couple of other numbers and see the same.

It might be triggering the wrong portion of the If Statement that runs a forloop for Last Value - 1, I will have to look into it. But you are right, you should see 7.

@mmgaw113
Copy link
Collaborator Author

3. How do I see the properties of the currently selected feature? Is it in the UI or in the detail panel?

Shift + Click on a pin. The properties panel will only show up after you click on a pin and it will auto-hide the outfield drop down. Additionally, if you want to see the outfield drop-down while the properties panel is active, it will hide the properties panel.

@Jade-JadeH
Copy link
Collaborator

Jade-JadeH commented Dec 20, 2024

  1. How do I see the properties of the currently selected feature? Is it in the UI or in the detail panel?

Shift + Click on a pin. The properties panel will only show up after you click on a pin and it will auto-hide the outfield drop down. Additionally, if you want to see the outfield drop-down while the properties panel is active, it will hide the properties panel.

Aw ok, I see. I can see that based on what outfield you select, it shows different kind of properties which works very well. Based on this I noticed:

  1. the dropdown menu can't be collapsed
    UnrealEditor_svwKK21Vm3

Other comments I have are:

  1. A typo on the instruction: data set ---> dataset; I also think we should remove "we apologize for the inconvenience".
  2. Can we zoom to a point? For example, click on one point on the outliner and zoom to that point.

@mmgaw113
Copy link
Collaborator Author

Unfortunately that is expected behavior :/ The issue I was running into is that if we want it to show up when the outfields drop down is up, it needs to be bound to opposite of the book value for that toggle.

I could probably check if "selected feature" != nullptr before toggling it.

@mmgaw113
Copy link
Collaborator Author

I don't think we can zoom to a point based on the inspector. That functionality only works when not in play mode and it's the same for both engines. It would be really complicated to write and we'd need to do it in the viewport which would take up a lot of space. I think it would be a nice to have but not super important for the sample. Maybe a toolkit idea?

@Jade-JadeH
Copy link
Collaborator

I don't think we can zoom to a point based on the inspector. That functionality only works when not in play mode and it's the same for both engines. It would be really complicated to write and we'd need to do it in the viewport which would take up a lot of space. I think it would be a nice to have but not super important for the sample. Maybe a toolkit idea?

I can agree on that, I encountered this issue when I'm doing samples too.

}

//check for errors that could result in a crash or null return
bool AFeatureLayer::ErrorCheck()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naming should be improved here to indicate what bool result means. Something like AFeatureLayer::HasErrors().

Comment on lines +91 to +98
if (WebLink.Link.EndsWith("outfields=*"))
{
bButtonActive = true;
}
else
{
bButtonActive = false;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (WebLink.Link.EndsWith("outfields=*"))
{
bButtonActive = true;
}
else
{
bButtonActive = false;
}
bButtonActive = WebLink.Link.EndsWith("outfields=*");

Comment on lines +154 to +157
if (!mapComponent)
{
return;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!mapComponent)
{
return;
}

This has already been verified on line 140.

return;
}

item->Index = StartValue;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of repeat code here with the block starting in 453. Any reason the for loop on line 437 doesn't cover this case?

@ZackAllen
Copy link
Collaborator

Behavior of the sample worked correctly for me. Pins could use more adjustment, there is more overlapping here than the Unity implementation.

@avr757
Copy link
Collaborator

avr757 commented Dec 24, 2024

The UI look great overall, nice work!! just a few suggestions:

  1. The spacing between these menus seems inconsistent, we can improve this by moving the property info menu down a bit so that the spacing will be equal.
    image

  2. It seems in the "Point Layer" text the "L" is capitalized? I think we could also add a sentence to the instruction about clicking the pins using the "Shift + Click" so users will know about this new instruction.
    image

  3. I was a bit confused with this UX: I thought after we deselect/reselect some of the properties in the dropdown, the number of these properties will automatically updates. It turns out I have to click a different pin to see the updates? Is this intentional just out of curiosity? I just thought it would be an easier UX for the users if it automatically updates.
    Video: https://github.com/user-attachments/assets/3fdcc40b-abb0-4746-a72b-3fbb00d45a06

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants