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

markers should be able to set altitude #9945

Open
viktor76525 opened this issue Aug 20, 2020 · 5 comments
Open

markers should be able to set altitude #9945

viktor76525 opened this issue Aug 20, 2020 · 5 comments

Comments

@viktor76525
Copy link

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.
1
2

Implementation

I believe most of the framework for what's needed is there.
API will need to be updated.

@mourner mourner changed the title markers should be able to set height markers should be able to set altitude Aug 20, 2020
@andrewharvey
Copy link
Collaborator

related to #9814 which is the same feature for Popup

@arcsump
Copy link

arcsump commented Jan 7, 2021

Also may potentially solve #3993,as what is needed in my use case I presented is a way to set the elevation of the current markers and if possible , markers produced by geoJSON.

Much like:

map.addLayer({ 'id': layerID, 'type': 'symbol', 'source': 'places', 'layout': { 'icon-elevation': '100.00' } });

or in

map.addLayer({ 'id': 'geojsonID', 'type': 'circle', 'source': 'geojson-points', 'paint': { 'circle-elevation': '100.00' } });

@arcsump
Copy link

arcsump commented Feb 11, 2021

Maptalks implemented the feature to toggle altitude features on and off, so to anyone who needs the feature , head over to that until it can be implemented.

@spencerthayer
Copy link

Has there been any progress getting markers, points, or any object to render with a z-offset or altitude?

@DasAuryn
Copy link

DasAuryn commented Feb 8, 2024

Any progress here?

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

No branches or pull requests

6 participants