-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Comments
related to #9814 which is the same feature for |
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:
or in
|
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. |
Has there been any progress getting markers, points, or any object to render with a z-offset or altitude? |
Any progress here? |
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.
The text was updated successfully, but these errors were encountered: