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

Add ability to control feature altitude via a style spec property #3993

Open
lucaswoj opened this issue Jan 17, 2017 · 55 comments
Open

Add ability to control feature altitude via a style spec property #3993

lucaswoj opened this issue Jan 17, 2017 · 55 comments
Labels
cross-platform 📺 Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.) feature 🍏 needs discussion 💬

Comments

@lucaswoj
Copy link
Contributor

lucaswoj commented Jan 17, 2017

Continued from mapbox/DEPRECATED-mapbox-gl#6

@peterqliu
We should take advantage of the extra dimension that map pitching affords us, and use depth to visualize overlapping elements that would otherwise obstruct each other.

screen shot 2015-12-15 at 4 51 20 pm

Currently, the layer stack order is dictated by the sequence it was specified in the stylesheet; when applied, the proposed z-offset would override that. This is analogous to HTML's natural stacking order overridden by z-index in CSS.

Also, label rendering order is currently tightly bound to layers' z-order, because they both key off of the stylesheet layer sequence. Adding z-offset will free us to decide which layers get rendering priority, regardless of whether they go above or below other layers.

cc @lucaswoj @kkaefer

cc @tmcw @samanpwbb @jfirebaugh @ansis

@1ec5 1ec5 added the cross-platform 📺 Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.) label Jan 17, 2017
@ashleyclough
Copy link

Allowing polygons and symbols to have an altitude or z value would then mean that data presented by fill-extrusion could be represented and interrogated consistent with the 3D presentation [mockup]:

3d polygon and symbol

@robinbezak
Copy link

@ashleyclough Ohh gooosh how u did the markers extrude?

@ashleyclough
Copy link

I didn't, the image is just a mockup, created in Photoshop, of how I would like it to work!

@patodevilla
Copy link

Is there any progress on this feature? I'm building a indoor 3D application and need to have markers or popups to offset from the terrain when the map is pitched. Is there an alternative solution to make this work?

@ansis
Copy link
Contributor

ansis commented Jul 12, 2017

We're currently working on a new approach to symbol placement (collision avoidance) that will be able to handle symbols with z offsets. After we finish that we can take a look at adding this to the spec and implementing it.

@mariokam
Copy link

Hi ansis, any updates on this topic? Is it in the roadmap?

@peterqliu
Copy link
Contributor

@mariokam check out the roadmap here

@mariokam
Copy link

Thanks peterqliu, and I know about this roadmap, but I would expect that big company/startup as Mapbox to have more detailed roadmap, than 4 features in progress and 4 feature in long-term. So I don't see any plans even for z offsets

@xkisu
Copy link

xkisu commented Nov 9, 2017

Any updates on this? I have need of this for a client project where we have several raster layers stacked that need an offset so you can tell them apart.

@ansis
Copy link
Contributor

ansis commented Nov 9, 2017

@xkisu, @mariokam the new approach to symbol placement is being ported from here to mapbox/mapbox-gl-native. We'll be able to start looking at this after that is done.

@tianbaolin
Copy link

I hope mapbox can support altitude in geojson or can set height attribute in a layer..

@1tylermitchell
Copy link

We're setting a raster layer height value and it does draw the layer but only at certain angles. Will this issue (above) address that? It looks like some sort of clipping occurs depending on angle. Any tip?
mapbox_clip_error

@songololo
Copy link

Another vote for supporting relatively basic 3d features in the sense of being able to show overlapping features in 3d space (map pitch) - i.e. a bridge crossing a road, or multiple floor levels inside a building shell. i.e. very simple support for a z-height coordinate, not unlike PostGIS supports a height coordinate.

@dbskccc
Copy link

dbskccc commented Apr 21, 2018

well, i am just hit this when i want to show an indoor map.
all is ok, except for the symbol on top of Extrude layer
my example url

@saferthanhouses
Copy link

saferthanhouses commented Apr 21, 2018

This is something that we'd very much like to see and seems like a necessity in a platform that supports 3d mapping. Are there any updates on a timeline for this? Is there any comparable functionality already existing in the native-sdks?

@janschmutz
Copy link

Any updates on this?

@DinakaranS
Copy link

Any updates on this?

@leehoss
Copy link

leehoss commented Jan 10, 2019

Any updates on this???

@derrickrung
Copy link

Hoping to bring some attention back to this...

Any updates on this?

@cigone-openindoor
Copy link

three.js could help...

@arcsump
Copy link

arcsump commented Sep 29, 2020

I'll be coming up with a more detailed use-case for this, but basically , a way to set the point's elevation is vital for visualizing points at different levels.

Our motivation is, we are surveyors working for a major tunnel project here in AU , and part of what we visualize is the monitoring status of the points for critical supporting structure. We are building a web-based site to be able to monitor the status.

Currently, the points in the area we are monitoring at the moment, look flat,
image

when at least we wanted to reflect the multi-level nature of the points.
image

And, I am not yet referring to the negative extrusion heights that should be useful in visualizing the whole area - this is part of an underground tunnel infrastructure ( which I would happily ask a feature request for separately.)

If someone can refer me to the format I can use to present this use-case, it would be helpful.

I hope we can push for the development of this feature, even just the support for the elevation for point layers.

Also if you feel that I am in the wrong issue, please feel free to advise me.

Many thanks!

@mayteio
Copy link

mayteio commented Sep 29, 2020

@arcsump Metro tunnel? I work for CoM across the road! Have you tried any esri arcgis JS products? The developer experience is horrible but it’s pretty powerful when it comes to 3D, supporting both elevation and negative elevation.

@ats1999
Copy link

ats1999 commented Nov 22, 2020

well, i am just hit this when i want to show an indoor map.
all is ok, except for the symbol on top of Extrude layer
my example url

Can i get the source code?

@arcsump
Copy link

arcsump commented Jan 7, 2021

@arcsump Metro tunnel? I work for CoM across the road! Have you tried any esri arcgis JS products? The developer experience is horrible but it’s pretty powerful when it comes to 3D, supporting both elevation and negative elevation.

Yes, thank you for the suggestion - will definitely look at this and wrld.js as I am not sure what is the status of the request, as they pride on 3d stuff, but seem to have missed out on this functionality.

P.S. nice to know that you are in the "neighborhood", I am but a worker, I must say :-)

@arcsump
Copy link

arcsump commented Feb 11, 2021

an alternative is to use Maptalks until the feature can be implemented.

@arcsump
Copy link

arcsump commented Mar 24, 2021

three.js could help...
It could
In fact a complex solution was implemented for popups in #9814

@likwidgames
Copy link

Any updates on this? This has been open since 2017 and seems like an important feature that competitors already have in place.

@arcsump
Copy link

arcsump commented Jun 20, 2021 via email

@openSourcerer9000
Copy link

The people have spoken... we want more dimensionality!

@leehoss
Copy link

leehoss commented Nov 16, 2021

Yeah can we give this issue a bump up… this feature will change the game !

@cigone-openindoor
Copy link

I must admit that I do not use mapbox anymore, but maplibre.
So no more interest for me...

@spencerthayer
Copy link

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

@arcsump
Copy link

arcsump commented Jun 3, 2022

If someone can actually explain what's stopping Mapbox from implementing the 3rd dimension in this
geojson spec, that would be helpful.

@JonPichel
Copy link

What's the current status of this? I have a Drone GCS which uses ArcGIS Maps SDK for Javascript but would love to switch to Mapbox, but without 3D I can't possibly do that. In my opinion the ability to draw markers, lines and models in 3D would suppose a huge grow for mapbox.

@leehoss
Copy link

leehoss commented Feb 15, 2024

Is there any update on this - do we really need to strip out markers and add them in 3js - seem like a straight forward concept - when we turn terrain on the labels align to the terrain - I'm sure there could be a property to set this value !! Please respond

@ashleyclough
Copy link

Have you seen the symbol-z-elevate property in the v3 style specifications? It won't do it automatically like the terrain alignment as you'll need to know each symbol's z height.

@jamesbarker185
Copy link

would love to be able to have 3d multi-lines on map

@astojilj
Copy link
Contributor

Please check the Elevated Lines section in the latest blog post https://www.mapbox.com/blog/mapbox-style-updates-more-flexible-configurations-for-the-3d-basemap

Per-vertex elevation control is for now possible only with geoJSON source that has lineMetrics set, and using line-progress to access elevation from array data property, like it the render test here:

https://github.com/mapbox/mapbox-gl-js/blob/main/test/integration/render-tests/terrain/lines-elevated/style.json

geojson source:

"geojson1": {
      "type": "geojson",
      "lineMetrics": true,
      "data": {
        "type": "Feature",
        "properties": {
          "elevation": [400, 400, 400, 0, 400, 400, 400]
        },

layer:

      "line-z-offset": [
          "at",
          ["floor", ["*", [ "line-progress" ], 6.9]],
          ["get", "elevation"]
        ]

Stay tuned for additional elevation support and examples.

@abernier
Copy link

abernier commented Sep 26, 2024

@astojilj is it possible for geojson polygons too?

https://docs.mapbox.com/mapbox-gl-js/example/geojson-polygon/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cross-platform 📺 Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.) feature 🍏 needs discussion 💬
Projects
None yet
Development

No branches or pull requests