我正在尝试使用http://leafletjs.com/reference-1.2.0.html#polyline 中的演示
// create a red polyline from an array of LatLng points
var latlngs = [
[45.51, -122.68],
[37.77, -122.43],
[34.04, -118.2]
];
var polyline = L.polyline(latlngs, {color: 'red'}).addTo(map);
// zoom the map to the polyline
map.fitBounds(polyline.getBounds());
Run Code Online (Sandbox Code Playgroud)
但是,它给我一个错误:
[ts]
Argument of type 'number[][]' is not assignable to parameter of type 'LatLngExpression[]'.
Type 'number[]' is not assignable to type 'LatLngExpression'.
Type 'number[]' is not assignable to type '[number, number]'.
Property '0' is missing in type 'number[]'.
Run Code Online (Sandbox Code Playgroud)
使用带有 Angular/TypeScript …
假设我有一系列字符串,如:
1000
2000
100
200
20
10
Run Code Online (Sandbox Code Playgroud)
我如何订购它们,以便数字排序的第一个数字,但它是最长的?
例如
1000
100
10
2000
200
20
Run Code Online (Sandbox Code Playgroud)
(这可能是微不足道的,但我想不出任何事情).