本文整理汇总了TypeScript中@turf/turf.lineString函数的典型用法代码示例。如果您正苦于以下问题:TypeScript lineString函数的具体用法?TypeScript lineString怎么用?TypeScript lineString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了lineString函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1:
feature.geometry.coordinates.map(coords => {
const name = changeCase.title(feature.properties['BaseStreet'])
const suffix = suffixLookup[feature.properties['SuffixType']]
const direction = directionsLookup[feature.properties['PrefixDire']]
const ref = feature.properties['SegID']
const properties: any = {
source: 'Lake County',
highway: 'residential',
maxspeed: feature.properties['SpeedLimit'] ? `${ feature.properties['SpeedLimit'] } mph` : undefined,
name: [name, suffix, direction].join(' ').trim()
}
if (ref) {
properties.ref = ref
properties['source:ref'] = 'Lake County'
}
results.features.push(lineString(coords, properties))
})
开发者ID:osmottawa,项目名称:imports,代码行数:17,代码来源:parse-data.ts
示例2:
///////////////////////////////////////////
// -- Test featurecollection --
turf.featureCollection([point1, point2])
turf.featureCollection([point1, polygon1])
turf.featureCollection([polygon1, polygon2])
turf.featureCollection([lineString1, polygon1])
turf.featureCollection([lineString1, point1])
// -- Test feature --
turf.feature(point1)
turf.feature(polygon1)
turf.feature(lineString1)
// -- Test lineString --
turf.lineString(lineString1.geometry.coordinates)
turf.lineString(lineString1.geometry.coordinates, properties)
// -- Test multiLineString --
turf.multiLineString(multiLineString1.geometry.coordinates)
// -- Test point --
turf.point(point1.geometry.coordinates)
turf.point(point1.geometry.coordinates, properties)
// -- Test multiPoint --
turf.multiPoint(multiPoint1.geometry.coordinates)
// -- Test polygon --
turf.polygon(polygon1.geometry.coordinates, properties)
开发者ID:ArtemZag,项目名称:DefinitelyTyped,代码行数:30,代码来源:turf-tests.ts
注:本文中的@turf/turf.lineString函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论