Viglino / ol-ext

Cool extensions for Openlayers (ol) - animated clusters, CSS popup, Font Awesome symbol renderer, charts for statistical map (pie/bar), layer switcher, wikipedia layer, animations, canvas filters.
https://viglino.github.io/ol-ext/
Other
1.22k stars 464 forks source link

How to set the style of 3D building ? #574

Closed q77322708 closed 3 years ago

q77322708 commented 3 years ago

Take this example: http://viglino.github.io/ol-ext/examples/map/map.layer.3D.html image

How to set the style of 3D building ? Line and surface style setting of 3D building .

Viglino commented 3 years ago

When creating your vector3D there is a style option, see doc

Viglino commented 3 years ago

The is also a setStyle method...

q77322708 commented 3 years ago

Line style is OK. Top surface style is OK.

question: 1、How to set the styles of 4 side surfaces ? 微信图片_20210301112726

2、The current 3D building data is GeoJSON format . Does 3D building data support MVT format ?

q77322708 commented 3 years ago

var r3D = new ol.render3D({ height:0, maxResolution:0.6, defaultHeight:3.5 ,
// ghost : true, style: new ol.style.Style({

  fill: new ol.style.Fill({ 
    color: '#ff2d237d' 
  }) ,

  stroke:new ol.style.Stroke({ 
    color: '#79fe4d'  ,
    width: 2
  }) ,

  }),

 });
Viglino commented 3 years ago

The floor style is the one of the layer...

Viglino commented 3 years ago

render3D only apply to vector layer for MVT, you have to look at MapBox or MapLibre solution, see ol integration https://openlayers.org/en/latest/examples/mapbox-layer.html (experimental)

q77322708 commented 3 years ago

OK,OK~~ Thank you very much.

remotesc2 commented 5 months ago

@q77322708 请问,你提到的这个问题解决了吗?