markers should be able to set altitude
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
## Motivation
To get a property from an extrusion layer using a marker position, you have to use `map.project(marker.getLngLat())`. This isn't the actual lngLat, but the position as if you had placed the marker on top of what appeared to be the extrusion layer.
so far so good
The problem arises when you try to move, moreso rotate/tilt the map and you see that the marker hasn't been anchored to the same position on the extrusion layer but rather to the map below it.
## Design Alternatives
- set height of the marker so that tilt/rotate won't move it relative to the extruded layer
- project map to the base level equivalent position had there been no extruded layer on top
Do nothing is not an option as it doesn't make visual sense to be given a position on a 2d projection only to rotate the map and see the point move away, keeping with the lngLat base height position, invalidating the property at the previous viewport.
## Design
1st option is nicer because it shows the marker position always where it is expected.
2nd option is more of a workaround if height cannot be set for the marker.
### Mock-Up
Developers have to enable setting height of marker. This should be automatic when creating a marker from clicking a point on the map with an extrusion layer.
Users will have an additional parameter/option whith marker.setLngLat() where you can specify a height. The default would match the extrusion layer at time of creation, different behaviour can be optional.
### Concepts
When the marker is created it appears in the green and retrieving properties from the extrusion layer will retrieve the correct one for green. (The marker lngLat is actually in the orange).
When the map is tilted back up, the marker appears in the orange and the property would have to be re-loaded (workaround) to get the orange property. Really, the height of the marker should be set (automatically or manually) so that it is placed on the surface of the extrusion layer to make rotations and tilts seem natural.


### Implementation
I believe most of the framework for what's needed is there.
API will need to be updated.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the marker API and existing marker implementation, which the issue identifies as needing updates, then trace how marker positions relate to extrusion-layer projections during map tilt and rotation. Done means a marker can accept a height through the API and remain correctly anchored to the intended extrusion surface.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- computer-graphics, frontend, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100