Closed jaakla closed 7 years ago
extrude
takes a function! Here are the docs: https://mapzen.com/documentation/tangram/draw/#extrude
Here's an example:
extrude: |
function() {
return feature.area / 100.;
}
(example added to the docs with https://github.com/tangrams/tangram-docs/commit/2282dbeea1ea2ebf140ecc193ad5d94e1c4e04b0)
And here's a sample scene with that example: https://mapzen.com/tangram/play/?api=5%2F1221#15.1500/40.7550/-74.0011
No luck with min_height via function :( ?
Can you provide an example of what it is you are trying to accomplish?
On Wed, Nov 15, 2017 at 3:50 AM, Jaak Laineste notifications@github.com wrote:
No luck with min_height via function :( ?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tangrams/tangram/issues/620#issuecomment-344525714, or mute the thread https://github.com/notifications/unsubscribe-auth/AABBXdnqKSvH-4f9eo4zMh11vXUKL246ks5s2qXtgaJpZM4QdOcn .
I dont really know whether and how Tangram shows extruded buildings if min_heigth > 0, but I would expect it shows a bit more complex buildings like this example from f4map.
Update: now I see Tangram does not use min_height ? Same building:
@jaakla Yes, extrude
takes a function which can return [min_height, max_height]! Here's the relevant line from the docs:
Optional boolean, number, [min, max], or function returning any of the previous values.
By default, if extrude
is set to true
, the feature's min_height
and max_height
properties will be used. Here's the relevant line from the docs:
boolean: if true, features will be extruded using the values in the feature’s height and min_height properties (if those properties exist).
Here's an example scene: https://mapzen.com/tangram/play/?api=5/1224#15.0625/40.7560/-74.0005
However, for now, Tangram only extrudes vertically, which means we don't support the roof types in the OSM "Simple 3D Buildings" schema, the way f4map does: http://wiki.openstreetmap.org/wiki/Simple_3D_buildings
The central spire of the Tallina Teletorn has a roof:shape
of pyramidal
: https://www.openstreetmap.org/way/228672266
So it may not look quite like the image you included above (and you may need to move the camera around to see it), but here's the Tallina Teletorn in the main Tangram demo (http://tangrams.github.io/tangram/#17.54333107500086/59.471267674342386/24.886954963300443):
Openmaptiles.org vector tile schema uses render_height and render_min_height as tag names for building heights. It seems that Tangram renderer expects specific hardcoded names for same properties (
height
andmin_height
). Is there way to read the values from these different property names? Maybe accept field name as value for 'extrude' style parameter?Is it good pattern to hardcode mapzen schema properties to the rendering?
Also it would be even better to use function here, as depending on specific styling and zoom level one may want to amplify (or reduce) building heights in 3D rendering.
cc @cellum