Skip to content

PB-1691 : Remove pin and highlight position offset in 3D view#1352

Merged
sami-nouidri-swisstopo merged 1 commit intodevelopfrom
task-PB-1691-pin-position-3d
May 27, 2025
Merged

PB-1691 : Remove pin and highlight position offset in 3D view#1352
sami-nouidri-swisstopo merged 1 commit intodevelopfrom
task-PB-1691-pin-position-3d

Conversation

@sami-nouidri-swisstopo
Copy link
Contributor

@sami-nouidri-swisstopo sami-nouidri-swisstopo commented May 23, 2025

Test link

The Marker icon has an offset in 2d space, in order to display it anchored on the tip, which
cause the offset visible in 3d. Our solution is to add a conditional check in 3d
to properly display markers, as all other icons don't have this problem.

Here's the result :

image

Test link

@cypress
Copy link

cypress bot commented May 23, 2025

web-mapviewer    Run #5392

Run Properties:  status check passed Passed #5392  •  git commit d56c8fd42c: PB-1691 : Remove pin and highlight position offset in 3D view
Project web-mapviewer
Branch Review task-PB-1691-pin-position-3d
Run status status check passed Passed #5392
Run duration 05m 18s
Commit git commit d56c8fd42c: PB-1691 : Remove pin and highlight position offset in 3D view
Committer Sami Nouidri
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 20
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 252
View all changes introduced in this branch ↗︎

@sami-nouidri-swisstopo sami-nouidri-swisstopo force-pushed the task-PB-1691-pin-position-3d branch 2 times, most recently from 723e951 to 7322b18 Compare May 26, 2025 12:30
@sami-nouidri-swisstopo sami-nouidri-swisstopo marked this pull request as ready for review May 26, 2025 12:31
@sami-nouidri-swisstopo sami-nouidri-swisstopo force-pushed the task-PB-1691-pin-position-3d branch 3 times, most recently from 86edecf to 47117f1 Compare May 26, 2025 14:14
@sommerfe
Copy link
Contributor

When adding some other drawing features like label or line string there seems to be an error because none of it is displayed anymore https://sys-s.dev.bgdi.ch/11etrt82j3hu

}
}
if (entity.billboard) {
const imageUrl = entity.billboard.image._value._url
Copy link
Contributor

Choose a reason for hiding this comment

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

That call to entity.billboard.image should return a string (see here )

I don't think it's a good idea to use some private attributes of the object/entity (prefixed with _), you should find a way to access this information through some standard mean

@sami-nouidri-swisstopo sami-nouidri-swisstopo force-pushed the task-PB-1691-pin-position-3d branch 2 times, most recently from 07adc1f to cd2cf29 Compare May 27, 2025 08:38
@sami-nouidri-swisstopo
Copy link
Contributor Author

When adding some other drawing features like label or line string there seems to be an error because none of it is displayed anymore https://sys-s.dev.bgdi.ch/11etrt82j3hu

I've addressed this and fixed how image URL is fetched, and now it seems to all work :

image

}
}

const isDefaultMarker = imageUrl ? imageUrl.includes('marker') : false
Copy link
Contributor

Choose a reason for hiding this comment

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

this might not be very safe, is there another way of verifying this if its the default marker? imageUrl === 'marker'?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've changed my check to be specific to 001-marker with imageUrl.includes('001-marker')

}
}

const isDefaultMarker = imageUrl ? imageUrl.includes('001-marker') : false
Copy link
Contributor

Choose a reason for hiding this comment

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

you can imageUrl?.includes('001-marker') instead of using a ternary. A undefined or null value will be "false" in JS (magic 🙈 )

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

@sami-nouidri-swisstopo sami-nouidri-swisstopo force-pushed the task-PB-1691-pin-position-3d branch 2 times, most recently from 1d33d18 to 6a0841b Compare May 27, 2025 12:35
The Marker icon has an offset in 2d space,  in order to display it anchored on the tip, which
cause the offset visible in 3d. Our solution is to add a conditional check in 3d
to properly display markers, as all other icons don't have this problem.
@sami-nouidri-swisstopo sami-nouidri-swisstopo force-pushed the task-PB-1691-pin-position-3d branch from 6a0841b to d56c8fd Compare May 27, 2025 13:39
@sami-nouidri-swisstopo sami-nouidri-swisstopo merged commit a8161a1 into develop May 27, 2025
6 checks passed
@sami-nouidri-swisstopo sami-nouidri-swisstopo deleted the task-PB-1691-pin-position-3d branch May 27, 2025 13:53
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.

3 participants