【发布时间】:2016-08-16 02:58:57
【问题描述】:
我尝试在 typescript 中使用 GeoJson,但编译器会为这两个变量抛出错误:Generic type 'Feature<T>' requires 1 type argument(s)
const pos = <GeoJSON.Feature>{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [0, 1]
}
};
const oldPos = <GeoJSON.Feature>{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [2, 4]
}
};
这是什么意思?
【问题讨论】:
-
试试
>
标签: generics typescript geojson