小编Tra*_*sty的帖子

打字稿中的 LeafletJS 多折线

我正在尝试使用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 …

leaflet typescript angular

2
推荐指数
1
解决办法
1841
查看次数

数字顺序,但最长的数字首先

假设我有一系列字符串,如:

1000
2000
100
200
20
10
Run Code Online (Sandbox Code Playgroud)

我如何订购它们,以便数字排序的第一个数字,但它是最长的?

例如

1000
100
10
2000
200
20
Run Code Online (Sandbox Code Playgroud)

(这可能是微不足道的,但我想不出任何事情).

java sorting string

0
推荐指数
1
解决办法
54
查看次数

标签 统计

angular ×1

java ×1

leaflet ×1

sorting ×1

string ×1

typescript ×1