-
Notifications
You must be signed in to change notification settings - Fork 51
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
New Sample: Overview Map Sample #164
base: main
Are you sure you want to change the base?
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.
See the comments above
Pull the recent changes. I noticed it too and already have it fixed. |
Screen.Recording.2024-12-05.at.3.15.31.PM.mov |
I specifically pulled it after you pushed the changes. |
I just tested it and its working, so it sounds like you might have missed the latest commit. See video of it working above ^ |
sample_project/Assets/SampleViewer/Samples/OverviewMap/Scripts/LocationMarker.cs
Outdated
Show resolved
Hide resolved
sample_project/Assets/SampleViewer/Samples/OverviewMap/readme.md
Outdated
Show resolved
Hide resolved
sample_project/Assets/SampleViewer/Samples/OverviewMap/readme.md
Outdated
Show resolved
Hide resolved
sample_project/Assets/SampleViewer/Samples/OverviewMap/readme.md
Outdated
Show resolved
Hide resolved
sample_project/Assets/SampleViewer/Samples/OverviewMap/readme.md
Outdated
Show resolved
Hide resolved
sample_project/Assets/SampleViewer/Samples/OverviewMap/readme.md
Outdated
Show resolved
Hide resolved
I like the overall UI design and UX. Works really well. The two issues I pointed out previously have been resolved after the latest commits.
Unity_xhtjrbAu6Y.mp4
|
Mesh colliders are enabled... Looks like a bug with mesh colliders because you can go through but once you through to the map it won't let you go any further. |
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.
Ui/UX comments are addressed, looks good now! Thanks
sample_project/Assets/SampleViewer/Samples/OverviewMap/Scripts/ChangeOverviewScale.cs
Show resolved
Hide resolved
sample_project/Assets/SampleViewer/Samples/OverviewMap/Scripts/ChangeOverviewScale.cs
Outdated
Show resolved
Hide resolved
sample_project/Assets/SampleViewer/Samples/OverviewMap/Scripts/ChangeOverviewScale.cs
Outdated
Show resolved
Hide resolved
sample_project/Assets/SampleViewer/Samples/OverviewMap/Scripts/DisableExposure.cs
Outdated
Show resolved
Hide resolved
sample_project/Assets/SampleViewer/Samples/OverviewMap/Scripts/LocationMarker.cs
Outdated
Show resolved
Hide resolved
private ArcGISCameraControllerComponent cameraController; | ||
private ArcGISLocationComponent cameraLocationComponent; | ||
private ArcGISLocationComponent locationComponent; | ||
private float northOffset = 225.0f; |
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.
Why do we need to offset the rotation? Why 5/8?
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.
The orientation of the location marker is wrong. Without an offset it will be facing the wrong direction. 225 is the value it is off by. Only way to get rid of the offset is to fix it in a 3D modeling software like Blender
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 you're not planning to expose or change this, it would probably be better as const
Is this issue logged? |
What I was referring to is to remove the space in "UI element" and change it to "UIElement" as space is prone to errors in compiling. Some call it camel case, some call it upper camel case, some call it pascal case |
@ZackAllen are we going to start enforcing naming convention for sub folders? Or just Sample Parent Folders? |
private Volume skyAndFog; | ||
private Exposure exposure; | ||
|
||
void Start() |
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.
private void start
exposure.active = false; | ||
} | ||
} | ||
} |
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.
EOF
overviewCamera.orthographicSize = (float)cameraLocationComponent.Position.Z; | ||
SetLocationMarkerScale(); | ||
} | ||
} |
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.
EOF
private ArcGISCameraControllerComponent cameraController; | ||
private ArcGISLocationComponent cameraLocationComponent; | ||
private ArcGISLocationComponent locationComponent; | ||
private float northOffset = 225.0f; |
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 you're not planning to expose or change this, it would probably be better as const
}); | ||
} | ||
|
||
private void Update() |
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.
These chunks are nearly the same and can be refactored. Here's a possible refactor:
private void Update()
{
if (cameraLocationComponent == null || locationComponent == null || mapComponent == null)
{
return;
}
UpdateLocationAndRotation();
if (rotationToggle.isOn)
{
overviewMap.transform.localEulerAngles = new Vector3(0, 0, (float)cameraLocationComponent.Rotation.Heading);
}
}
private void UpdateLocationAndRotation()
{
var cameraPosition = cameraLocationComponent.Position;
var cameraRotation = cameraLocationComponent.Rotation;
var newPosition = new ArcGISPoint(cameraPosition.X, cameraPosition.Y, locationComponent.Position.Z, mapComponent.OriginPosition.SpatialReference);
locationComponent.Position = newPosition;
var newRotation = new ArcGISRotation(cameraRotation.Heading + northOffset, locationComponent.Rotation.Pitch, locationComponent.Rotation.Roll);
locationComponent.Rotation = newRotation;
var cameraComponentLocation = cameraComponent.GetComponent<ArcGISLocationComponent>();
if (cameraComponentLocation != null)
{
cameraComponentLocation.Position = new ArcGISPoint(cameraPosition.X, cameraPosition.Y, cameraComponentLocation.Position.Z, mapComponent.OriginPosition.SpatialReference);
}
}
Sample
The overview map sample is a highly requested sample and was given moderate priority from Adrien.
The sample builds off the overview map created in for the AR Feature Layer sample currently under review. It uses two map components each with a different basemap. The Main ArcGIS Map has a 3D object scene layer where as the overview does not.
Checklist
keyword: Short description of change
ArcGIS Maps SDK Version
Maps SDK 1.7 W/ Unity 2022.3 LTS