Mapbox-拉伸线 [英] Mapbox - extruding lines

查看:226
本文介绍了Mapbox-拉伸线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以对GeoJSON LineString功能应用填充-挤压? 基本上,我正在寻找一种以z偏移量在3d模式下绘制线(可以是1条线或多条连接线)的方法.

如果这不可能,那么可以改为使用多边形吗? 就像将我的线转换成多边形(我该怎么做?)

解决方案

您要的内容尚未实现,但已在Mapbox GL JS中的 http://turfjs.org/docs#buffer 来做到这一点.

整条线/多边形将以相同高度偏移,因此根据您的应用程序,您可以使用草皮的linkChunk http://turfjs.org/docs#lineChunk 将其分解为较小的功能,您可以为其分配不同的高度属性.

Is it possible to apply fill-extrusion for a GeoJSON LineString feature? Basically I'm looking for a way to draw lines (can be 1 line or multiple connected) in a 3d mode with z-offset.

If that's not possible, maybe this can be done with a polygon instead? Like, converting my lines to polygons (how can i do that?)

解决方案

What you're asking for isn't yet implemented, but ticketed in Mapbox GL JS at https://github.com/mapbox/mapbox-gl-js/issues/3993.

For now you'll need to opt for your second suggestion of converting the LineString feature to a Polygon. You can do this with turf's buffer function http://turfjs.org/docs#buffer.

The whole line/polygon will be offset at the same height, so depending on your application you could use turf's linkChunk http://turfjs.org/docs#lineChunk to get it broken up into smaller features which you assign different height properties to.

这篇关于Mapbox-拉伸线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆