@allmaps/stdlib

中文文档
1.0.0-beta.42发布于 2026/09/22MITES Module近 30 天下载 1.2万

全部地图标准库

中文使用文档
文档目录200 节
  1. 许可证
  2. API 密码
  3. new ResourceFetchError(kind, input, options)
  4. ResourceFetchError#cause?
  5. ResourceFetchError#corsLikely
  6. ResourceFetchError#input
  7. ResourceFetchError#kind
  8. ResourceFetchError#status?
  9. ResourceFetchError#statusText?
  10. ResourceFetchError#url
  11. ResourceFetchErrorKind
  12. angle(line)
  13. angularMean(angles)
  14. arrayContains(array, object, isEqualObject)
  15. arrayDifference(array0, array1, isEqualObject)
  16. arrayMatrixSize(arrayMatrix)
  17. arrayRepeated(array, isEqualObject)
  18. arrayUnique(array, isEqualObject)
  19. bboxToCenter(bbox)
  20. bboxToDiameter(bbox)
  21. bboxToLine(bbox)
  22. bboxToPolygon(bbox)
  23. bboxToRectangle(bbox)
  24. bboxToResolution(bbox)
  25. bboxToSize(bbox)
  26. bboxesToScale(bbox0, bbox1, fit)
  27. bufferBbox(bbox, dist0, dist1)
  28. bufferBboxByRatio(bbox, ratio)
  29. camelCaseToWords(string)
  30. clipPoint(point, min, max)
  31. clipPointLngLatProjection(point)
  32. clipPointWebMercatorProjection(point)
  33. clipValue(value, min, max)
  34. closeMultiPolygon(multiPolygon)
  35. closePolygon(polygon)
  36. closeRing(ring)
  37. combineBboxes(bboxes)
  38. computeBbox(geometry)
  39. computeMinMax(values)
  40. computeRotatedBboxProperties(geometry, angle)
  41. conformLineString(lineString)
  42. conformMultiLineString(multiLineString)
  43. conformMultiPolygon(multiPolygon)
  44. conformPolygon(polygon)
  45. conformRing(ring)
  46. contractGeojsonGeometriesToGeojsonMultiGeometry(geojsonGeom…
  47. contractGeojsonLineStringsToGeojsonMultiLineString(geojsonL…
  48. contractGeojsonPointsToGeojsonMultiPoint(geojsonPoints)
  49. contractGeojsonPolygonsToGeojsonMultiPolygon(geojsonPolygon…
  50. convexHull(points)
  51. degreesToRadians(degrees)
  52. distance(from, to)
  53. doBboxesIntersect(bbox0, bbox1)
  54. equalSet(set1, set2)
  55. expandGeojsonMultiGeometryToGeojsonGeometries(geojsonMultiG…
  56. expandGeojsonMultiLineStringToGeojsonLineStrings(geojsonMul…
  57. expandGeojsonMultiPointToGeojsonPoints(geojsonMultiPoint)
  58. expandGeojsonMultiPolygonToGeojsonPolygons(geojsonMultiPoly…
  59. fetchAnnotationsFromApi(restBaseUrl, parsedIiif, fetch)
  60. fetchImageBitmap(input, init, fetchFn)
  61. fetchImageInfo(imageUri, init, fetchFn)
  62. fetchJson(input, init, fetchFn)
  63. fetchUrl(input, init, fetchFn)
  64. flipX(point)
  65. flipY(point)
  66. geojsonFeatureCollectionToGeojsonGeometries(geojsonFeatureC…
  67. geojsonFeatureToGeojsonGeometry(geojsonFeature)
  68. geojsonFeaturesToGeojsonFeatureCollection(geojsonFeatures)
  69. geojsonGeometriesToGeojsonFeatureCollection(geojsonGeometri…
  70. geojsonGeometryToGeojsonFeature(geojsonGeometry, properties)
  71. geojsonGeometryToGeometry(geojsonPoint)
  72. geojsonGeometryToSvgGeometry(geojsonGeometry)
  73. geojsonLineStringToLineString(geojsonLineString)
  74. geojsonMultiLineStringToMultiLineString(geojsonMultiLineStr…
  75. geojsonMultiPointToMultiPoint(geojsonMultiPoint)
  76. geojsonMultiPolygonToMultiPolygon(geojsonMultiPolygon, clos…
  77. geojsonPointToPoint(geojsonPoint)
  78. geojsonPolygonToPolygon(geojsonPolygon, close)
  79. geojsonPolygonToRing(geojsonPolygon, close)
  80. geometryToDiameter(geometry)
  81. geometryToGeojsonGeometry(point, options)
  82. geometryToSvgGeometry(point)
  83. getFullResourceMask(imageWidth, imageHeight)
  84. getPropertyFromCacheOrComputation(cache, key, computation, …
  85. getPropertyFromDoubleCacheOrComputation(cache, key0, key1, …
  86. getPropertyFromQuadrupleCacheOrComputation(cache, key0, key…
  87. getPropertyFromQuintupleCacheOrComputation(cache, key0, key…
  88. getPropertyFromTripleCacheOrComputation(cache, key0, key1, …
  89. groupBy(arr, key)
  90. hexToFractionalOpaqueRgba(hex)
  91. hexToFractionalRgb(hex)
  92. hexToFractionalRgba(hex)
  93. hexToOpaqueRgba(hex)
  94. hexToRgb(hex)
  95. hexToRgba(hex)
  96. intersectBboxes(bbox0, bbox1)
  97. invertPoint(point)
  98. invertPoints(points)
  99. isClosed(input)
  100. isEqualArray(array0, array1, isEqualObject)
  101. isEqualPoint(point0, point1)
  102. isEqualPointArray(pointArray0, pointArray1)
  103. isEqualPointArrayArray(pointArrayArray0, pointArrayArray1)
  104. isGeojsonGeometry(obj)
  105. isGeojsonLineString(input)
  106. isGeojsonMultiGeometry(obj)
  107. isGeojsonMultiLineString(input)
  108. isGeojsonMultiPoint(input)
  109. isGeojsonMultiPolygon(input)
  110. isGeojsonPoint(input)
  111. isGeojsonPolygon(input)
  112. isGeometry(input)
  113. isLineString(input)
  114. isMultiLineString(input)
  115. isMultiPoint(input)
  116. isMultiPolygon(input)
  117. isPoint(input)
  118. isPolygon(input)
  119. isRing(input)
  120. isSvgCircle(input)
  121. isSvgLine(input)
  122. isSvgPolyLine(input)
  123. isSvgPolygon(input)
  124. isSvgRect(input)
  125. isValidHttpUrl(string)
  126. lineAngle(line)
  127. lineStringToGeojsonLineString(lineString)
  128. lineStringToLines(lineString)
  129. linesIntersectionPoint(line0, line1, options)
  130. mapToResourceMaskSvgPolygon(map)
  131. mergeGeojsonFeaturesCollections(geojsonFeatureCollections)
  132. mergeOptions(baseOptions, additionalPartialOptions)
  133. mergeOptionsUnlessUndefined(baseOptions, additionalOptions)
  134. mergePartialOptions(partialOptions)
  135. mergeTwoOptionsUnlessUndefined(baseOptions, additionalOptio…
  136. midPoint(points)
  137. mixLineStrings(lineString0, lineString1, t)
  138. mixNumbers(number0, number1, t)
  139. mixPoints(point0, point1, t)
  140. multiLineStringToGeojsonMultiLineString(multiLineString)
  141. multiPointToGeojsonMultiPoint(multiPoint)
  142. multiPolygonToGeojsonMultiPolygon(multiPolygon, close)
  143. multiplyArrayMatrix(arrayMatrix, factor)
  144. newArrayMatrix(rows, cols, value)
  145. newBlockArrayMatrix(blocks, emptyValue)
  146. objectDifference(newObject, baseObject, objectKeysPossiblyC…
  147. omit(object, keys)
  148. optionKeysByMapIdToUndefinedOptionsByMapId(optionKeysByMapI…
  149. optionKeysToUndefinedOptions(optionKeys)
  150. pasteArrayMatrix(arrayMatrix, rowsStart, colsStart, subArra…
  151. pasteArrayMatrixInPlace(arrayMatrix, rowsStart, colsStart, …
  152. pixelToIntArrayIndex(pixel, size, channels, flipY)
  153. pointInBbox(point, bbox)
  154. pointToGeojsonPoint(point)
  155. pointToPixel(point, translate)
  156. pointsAndPointsToLines(points0, points1)
  157. polygonIsBboxRectangle(polygon)
  158. polygonSelfIntersectionPoints(polygon, options)
  159. polygonToGeojsonPolygon(polygon, close)
  160. prolongedLinesIntersectionPoint(line0, line1)
  161. radiansToDegrees(radians)
  162. rectangleToSize(rectangle)
  163. rectanglesToScale(rectangle0, rectangle1, fit)
  164. removeUndefinedOptions(optionsArray)
  165. rgbToHex(rgb)
  166. rgbaToHex(rgba)
  167. ringIsBboxRectangle(ring)
  168. ringToGeojsonPolygon(ring, close)
  169. rms(from, to)
  170. rotateArray(array, offset)
  171. rotatePoint(point, angle, pivot, cosAngle, sinAngle)
  172. rotatePoints(points, angle, pivot)
  173. scaleBbox(bbox, scale)
  174. scalePoint(point, scale)
  175. scalePoints(points, scale)
  176. scaleSize(size, scale)
  177. shallowCopyArrayMatrix(arrayMatrix)
  178. sizeToBbox(size, center)
  179. sizeToCenter(size)
  180. sizeToRectangle(size, center)
  181. sizeToResolution(size)
  182. sizesToScale(size0, size1, fit)
  183. sliceArrayMatrix(arrayMatrix, rowsStart, colsStart, rowsEnd…
  184. squaredDistance(from, to)
  185. stepDistanceAngle(point, dist, angle)
  186. stringToSvgGeometriesGenerator(svg)
  187. subArrayMatrix(arrayMatrix, rows, cols)
  188. subSetArray(arr1, arr2)
  189. svgGeometriesToSvgString(geometries)
  190. svgGeometryToGeometry(svgCircle)
  191. svgGeometryToString(geometry)
  192. threePointsToAngle(pointA, pointB, pointC)
  193. translatePoint(point, translationPoint, addOrSubstract)
  194. translatePoints(points, point, addOrSubstract)
  195. transposeArrayMatrix(arrayMatrix)
  196. triangleAngles(triangle)
  197. triangleArea(triangle)
  198. uncloseMultiPolygon(multiPolygon)
  199. unclosePolygon(polygon)
  200. uncloseRing(ring)

@allmaps/stdlib (英语)

全部地图标准库

许可证

麻省理工学院

API 密码

new ResourceFetchError(kind, input, options)

参数
  • kind (单位:千美元)'http' | 'network-or-cors'(中文(简体) )
  • input (单位:千美元)URL | RequestInfo(中文(简体) )
  • options (单位:千美元)ResourceFetchErrorOptions | undefined(中文(简体) )
回返

ResourceFetchError。 。 。 .

扩展
  • Error

ResourceFetchError#cause?

类型
unknown

ResourceFetchError#corsLikely

类型
boolean

ResourceFetchError#input

类型
URL | RequestInfo

ResourceFetchError#kind

类型
'http' | 'network-or-cors'

ResourceFetchError#status?

类型
number

ResourceFetchError#statusText?

类型
string

ResourceFetchError#url

类型
string

ResourceFetchErrorKind

类型
'http' | 'network-or-cors'

angle(line)

参数
  • line (单位:千美元)[Point, Point](中文(简体) )
回返

number。 。 。 .

angularMean(angles)

参数
  • angles (单位:千美元)number(中文(简体) )
回返

number。 。 。 .

arrayContains(array, object, isEqualObject)

参数
  • array (单位:千美元)Array<T>(中文(简体) )
  • object (单位:千美元)T(中文(简体) )
  • isEqualObject (单位:千美元)((t0: T, t1: T) => boolean) | undefined(中文(简体) )
回返

{item: T; index: number} | undefined。 。 。 .

arrayDifference(array0, array1, isEqualObject)

参数
  • array0 (单位:千美元)Array<T>(中文(简体) )
  • array1 (单位:千美元)Array<T>(中文(简体) )
  • isEqualObject (单位:千美元)((t0: T, t1: T) => boolean) | undefined(中文(简体) )
回返

Array<T>。 。 。 .

arrayMatrixSize(arrayMatrix)

参数
  • arrayMatrix (单位:千美元)Array<Array<T>>(中文(简体) )
回返

[number, number]。 。 。 .

arrayRepeated(array, isEqualObject)

参数
  • array (单位:千美元)Array<T>(中文(简体) )
  • isEqualObject (单位:千美元)((t0: T, t1: T) => boolean) | undefined(中文(简体) )
回返

Array<{item: T; index: number}>。 。 。 .

arrayUnique(array, isEqualObject)

参数
  • array (单位:千美元)Array<T>(中文(简体) )
  • isEqualObject (单位:千美元)((t0: T, t1: T) => boolean) | undefined(中文(简体) )
回返

Array<T>。 。 。 .

bboxToCenter(bbox)

参数
  • bbox (单位:千美元)[number, number, number, number](中文(简体) )
回返

[number, number]。 。 。 .

bboxToDiameter(bbox)

参数
  • bbox (单位:千美元)[number, number, number, number](中文(简体) )
回返

number。 。 。 .

bboxToLine(bbox)

参数
  • bbox (单位:千美元)[number, number, number, number](中文(简体) )
回返

[Point, Point]。 。 。 .

bboxToPolygon(bbox)

参数
  • bbox (单位:千美元)[number, number, number, number](中文(简体) )
回返

Array<Array<Point>>。 。 。 .

bboxToRectangle(bbox)

参数
  • bbox (单位:千美元)[number, number, number, number](中文(简体) )
回返

[Point, Point, Point, Point]。 。 。 .

bboxToResolution(bbox)

参数
  • bbox (单位:千美元)[number, number, number, number](中文(简体) )
回返

number。 。 。 .

bboxToSize(bbox)

参数
  • bbox (单位:千美元)[number, number, number, number](中文(简体) )
回返

[number, number]。 。 。 .

bboxesToScale(bbox0, bbox1, fit)

参数
  • bbox0 (单位:千美元)[number, number, number, number](中文(简体) )
  • bbox1 (单位:千美元)[number, number, number, number](中文(简体) )
  • fit? (单位:千美元)Fit | undefined(中文(简体) )
回返

number。 。 。 .

bufferBbox(bbox, dist0, dist1)

参数
  • bbox (单位:千美元)[number, number, number, number](中文(简体) )
  • dist0 (单位:千美元)number(中文(简体) )
  • dist1? (单位:千美元)number | undefined(中文(简体) )
回返

[number, number, number, number]。 。 。 .

bufferBboxByRatio(bbox, ratio)

参数
  • bbox (单位:千美元)[number, number, number, number](中文(简体) )
  • ratio? (单位:千美元)number | undefined(中文(简体) )
回返

[number, number, number, number]。 。 。 .

camelCaseToWords(string)

参数
  • string (单位:千美元)string(中文(简体) )
回返

string。 。 。 .

clipPoint(point, min, max)

参数
  • point (单位:千美元)[number, number](中文(简体) )
  • min (单位:千美元)[number, number](中文(简体) )
  • max (单位:千美元)[number, number](中文(简体) )
回返

[number, number]。 。 。 .

clipPointLngLatProjection(point)

参数
  • point (单位:千美元)[number, number](中文(简体) )
回返

[number, number]。 。 。 .

clipPointWebMercatorProjection(point)

参数
  • point (单位:千美元)[number, number](中文(简体) )
回返

[number, number]。 。 。 .

clipValue(value, min, max)

参数
  • value (单位:千美元)number(中文(简体) )
  • min (单位:千美元)number(中文(简体) )
  • max (单位:千美元)number(中文(简体) )
回返

number。 。 。 .

closeMultiPolygon(multiPolygon)

参数
  • multiPolygon (单位:千美元)Array<Array<Array<Point>>>(中文(简体) )
回返

Array<Array<Array<Point>>>。 。 。 .

closePolygon(polygon)

参数
  • polygon (单位:千美元)Array<Array<Point>>(中文(简体) )
回返

Array<Array<Point>>。 。 。 .

closeRing(ring)

参数
  • ring (单位:千美元)Array<Point>(中文(简体) )
回返

Array<Point>。 。 。 .

combineBboxes(bboxes)

参数
  • bboxes (单位:千美元)[number, number, number, number](中文(简体) )
回返

Bbox | undefined。 。 。 .

computeBbox(geometry)

参数
  • geometry (单位:千美元)GeojsonGeometry | Geometry(中文(简体) )
回返

[number, number, number, number]。 。 。 .

computeMinMax(values)

参数
  • values (单位:千美元)Array<number>(中文(简体) )
回返

[number, number]。 。 。 .

computeRotatedBboxProperties(geometry, angle)

参数
  • geometry (单位:千美元)GeojsonGeometry | Geometry(中文(简体) )
  • angle (单位:千美元)number(中文(简体) )
回返

{ center: Point size: Size bbox: Bbox rectangle: Rectangle rotatedRectangle: Rectangle }。 。 。 .

conformLineString(lineString)

参数
  • lineString (单位:千美元)Array<Point>(中文(简体) )
回返

Array<Point>。 。 。 .

conformMultiLineString(multiLineString)

参数
  • multiLineString (单位:千美元)Array<Array<Point>>(中文(简体) )
回返

Array<Array<Point>>。 。 。 .

conformMultiPolygon(multiPolygon)

参数
  • multiPolygon (单位:千美元)Array<Array<Array<Point>>>(中文(简体) )
回返

Array<Array<Array<Point>>>。 。 。 .

conformPolygon(polygon)

参数
  • polygon (单位:千美元)Array<Array<Point>>(中文(简体) )
回返

Array<Array<Point>>。 。 。 .

conformRing(ring)

参数
  • ring (单位:千美元)Array<Point>(中文(简体) )
回返

Array<Point>。 。 。 .

contractGeojsonGeometriesToGeojsonMultiGeometry(geojsonGeometries)

参数
  • geojsonGeometries (单位:千美元)Array<GeojsonLineString | GeojsonPoint | GeojsonPolygon>(中文(简体) )
回返

GeojsonMultiLineString | GeojsonMultiPoint | GeojsonMultiPolygon。 。 。 .

contractGeojsonLineStringsToGeojsonMultiLineString(geojsonLineStrings)

参数
  • geojsonLineStrings (单位:千美元)Array<GeojsonLineString>(中文(简体) )
回返

{type: 'MultiLineString'; coordinates: number[][][]}。 。 。 .

contractGeojsonPointsToGeojsonMultiPoint(geojsonPoints)

参数
  • geojsonPoints (单位:千美元)Array<GeojsonPoint>(中文(简体) )
回返

{type: 'MultiPoint'; coordinates: number[][]}。 。 。 .

contractGeojsonPolygonsToGeojsonMultiPolygon(geojsonPolygons)

参数
  • geojsonPolygons (单位:千美元)Array<GeojsonPolygon>(中文(简体) )
回返

{type: 'MultiPolygon'; coordinates: number[][][][]}。 。 。 .

convexHull(points)

参数
  • points (单位:千美元)Array<Point>(中文(简体) )
回返

Ring | undefined。 。 。 .

degreesToRadians(degrees)

参数
  • degrees (单位:千美元)number(中文(简体) )
回返

number。 。 。 .

distance(from, to)

参数
  • from (单位:千美元)[number, number](中文(简体) )
  • to (单位:千美元)[number, number](中文(简体) )
回返

number。 。 。 .

doBboxesIntersect(bbox0, bbox1)

参数
  • bbox0 (单位:千美元)[number, number, number, number](中文(简体) )
  • bbox1 (单位:千美元)[number, number, number, number](中文(简体) )
回返

boolean。 。 。 .

equalSet(set1, set2)

参数
  • set1 (单位:千美元)Set<T> | null(中文(简体) )
  • set2 (单位:千美元)Set<T> | null(中文(简体) )
回返

boolean。 。 。 .

expandGeojsonMultiGeometryToGeojsonGeometries(geojsonMultiGeometry)

参数
  • geojsonMultiGeometry (单位:千美元)GeojsonMultiLineString | GeojsonMultiPoint | GeojsonMultiPolygon(中文(简体) )
回返

Array<GeojsonLineString> | Array<GeojsonPoint> | Array<GeojsonPolygon>。 。 。 .

expandGeojsonMultiLineStringToGeojsonLineStrings(geojsonMultiLineString)

参数
  • geojsonMultiLineString (单位:千美元){type: 'MultiLineString'; coordinates: number[][][]}(中文(简体) )
回返

Array<GeojsonLineString>。 。 。 .

expandGeojsonMultiPointToGeojsonPoints(geojsonMultiPoint)

参数
  • geojsonMultiPoint (单位:千美元){type: 'MultiPoint'; coordinates: number[][]}(中文(简体) )
回返

Array<GeojsonPoint>。 。 。 .

expandGeojsonMultiPolygonToGeojsonPolygons(geojsonMultiPolygon)

参数
  • geojsonMultiPolygon (单位:千美元){type: 'MultiPolygon'; coordinates: number[][][][]}(中文(简体) )
回返

Array<GeojsonPolygon>。 。 。 .

fetchAnnotationsFromApi(restBaseUrl, parsedIiif, fetch)

参数
  • restBaseUrl (单位:千美元)string(中文(简体) )
  • parsedIiif (单位:千美元)Collection | Image | Manifest(中文(简体) )
  • fetch? (单位:千美元) | ((input: RequestInfo | URL, init?: RequestInit) => Promise<Response>) | undefined(中文(简体) )
回返

Promise<any>。 。 。 .

fetchImageBitmap(input, init, fetchFn)

参数
  • input (单位:千美元)URL | RequestInfo(中文(简体) )
  • init? (单位:千美元)RequestInit | undefined(中文(简体) )
  • fetchFn? (单位:千美元)FetchFn | undefined(中文(简体) )
回返

Promise<ImageBitmap>。 。 。 .

fetchImageInfo(imageUri, init, fetchFn)

参数
  • imageUri (单位:千美元)string(中文(简体) )
  • init? (单位:千美元)RequestInit | undefined(中文(简体) )
  • fetchFn? (单位:千美元)FetchFn | undefined(中文(简体) )
回返

Promise<unknown>。 。 。 .

fetchJson(input, init, fetchFn)

参数
  • input (单位:千美元)URL | RequestInfo(中文(简体) )
  • init? (单位:千美元)RequestInit | undefined(中文(简体) )
  • fetchFn? (单位:千美元)FetchFn | undefined(中文(简体) )
回返

Promise<unknown>。 。 。 .

fetchUrl(input, init, fetchFn)

参数
  • input (单位:千美元)URL | RequestInfo(中文(简体) )
  • init? (单位:千美元)RequestInit | undefined(中文(简体) )
  • fetchFn? (单位:千美元)FetchFn | undefined(中文(简体) )
回返

Promise<Response>。 。 。 .

flipX(point)

参数
  • point (单位:千美元)[number, number](中文(简体) )
回返

[number, number]。 。 。 .

flipY(point)

参数
  • point (单位:千美元)[number, number](中文(简体) )
回返

[number, number]。 。 。 .

geojsonFeatureCollectionToGeojsonGeometries(geojsonFeatureCollection)

参数
  • geojsonFeatureCollection (单位:千美元){type: 'FeatureCollection'; features: GeojsonFeature[]}(中文(简体) )
回返

Array<GeojsonGeometry>。 。 。 .

geojsonFeatureToGeojsonGeometry(geojsonFeature)

参数
  • geojsonFeature (单位:千美元){type: 'Feature'; properties: unknown; geometry: GeojsonGeometry}(中文(简体) )
回返

| GeojsonLineString | GeojsonMultiLineString | GeojsonMultiPoint | GeojsonMultiPolygon | GeojsonPoint | GeojsonPolygon。 。 。 .

geojsonFeaturesToGeojsonFeatureCollection(geojsonFeatures)

参数
  • geojsonFeatures (单位:千美元)Array<GeojsonFeature> | GeojsonFeature(中文(简体) )
回返

{type: 'FeatureCollection'; features: GeojsonFeature[]}。 。 。 .

geojsonGeometriesToGeojsonFeatureCollection(geojsonGeometries, properties)

参数
  • geojsonGeometries (单位:千美元)Array<GeojsonGeometry>(中文(简体) )
  • properties? (单位:千美元)Array<unknown> | undefined(中文(简体) )
回返

{type: 'FeatureCollection'; features: GeojsonFeature[]}。 。 。 .

geojsonGeometryToGeojsonFeature(geojsonGeometry, properties)

参数
  • geojsonGeometry (单位:千美元) | GeojsonLineString | GeojsonMultiLineString | GeojsonMultiPoint | GeojsonMultiPolygon | GeojsonPoint | GeojsonPolygon(中文(简体) )
  • properties? (单位:千美元)unknown(中文(简体) )
回返

{type: 'Feature'; properties: unknown; geometry: GeojsonGeometry}。 。 。 .

geojsonGeometryToGeometry(geojsonPoint)

参数
  • geojsonPoint (单位:千美元){type: 'Point'; coordinates: number[]}(中文(简体) )
回返

[number, number]。 。 。 .

geojsonGeometryToSvgGeometry(geojsonGeometry)

参数
  • geojsonGeometry (单位:千美元) | GeojsonLineString | GeojsonMultiLineString | GeojsonMultiPoint | GeojsonMultiPolygon | GeojsonPoint | GeojsonPolygon(中文(简体) )
回返

SvgCircle | SvgLine | SvgPolyLine | SvgPolygon | SvgRect。 。 。 .

geojsonLineStringToLineString(geojsonLineString)

参数
  • geojsonLineString (单位:千美元){type: 'LineString'; coordinates: number[][]}(中文(简体) )
回返

Array<Point>。 。 。 .

geojsonMultiLineStringToMultiLineString(geojsonMultiLineString)

参数
  • geojsonMultiLineString (单位:千美元){type: 'MultiLineString'; coordinates: number[][][]}(中文(简体) )
回返

Array<Array<Point>>。 。 。 .

geojsonMultiPointToMultiPoint(geojsonMultiPoint)

参数
  • geojsonMultiPoint (单位:千美元){type: 'MultiPoint'; coordinates: number[][]}(中文(简体) )
回返

Array<Point>。 。 。 .

geojsonMultiPolygonToMultiPolygon(geojsonMultiPolygon, close)

参数
  • geojsonMultiPolygon (单位:千美元){type: 'MultiPolygon'; coordinates: number[][][][]}(中文(简体) )
  • close (单位:千美元)boolean | undefined(中文(简体) )
回返

Array<Array<Array<Point>>>。 。 。 .

geojsonPointToPoint(geojsonPoint)

参数
  • geojsonPoint (单位:千美元){type: 'Point'; coordinates: number[]}(中文(简体) )
回返

[number, number]。 。 。 .

geojsonPolygonToPolygon(geojsonPolygon, close)

参数
  • geojsonPolygon (单位:千美元){type: 'Polygon'; coordinates: number[][][]}(中文(简体) )
  • close (单位:千美元)boolean | undefined(中文(简体) )
回返

Array<Array<Point>>。 。 。 .

geojsonPolygonToRing(geojsonPolygon, close)

参数
  • geojsonPolygon (单位:千美元){type: 'Polygon'; coordinates: number[][][]}(中文(简体) )
  • close (单位:千美元)boolean | undefined(中文(简体) )
回返

Array<Point>。 。 。 .

geometryToDiameter(geometry)

参数
  • geometry (单位:千美元)GeojsonGeometry | Geometry(中文(简体) )
回返

number。 。 。 .

geometryToGeojsonGeometry(point, options)

参数
  • point (单位:千美元)[number, number](中文(简体) )
  • options? (单位:千美元)Partial<MultiGeometryOptions> | undefined(中文(简体) )
回返

{type: 'Point'; coordinates: number[]}。 。 。 .

geometryToSvgGeometry(point)

参数
  • point (单位:千美元)[number, number](中文(简体) )
回返

{type: 'circle'; attributes?: SvgAttributes; coordinates: Point}。 。 。 .

getFullResourceMask(imageWidth, imageHeight)

参数
  • imageWidth (单位:千美元)number(中文(简体) )
  • imageHeight (单位:千美元)number(中文(简体) )
回返

Array<Point>。 。 。 .

getPropertyFromCacheOrComputation(cache, key, computation, checkUse, checkStore)

参数
  • cache (单位:千美元)Map<K, T>(中文(简体) )
  • key (单位:千美元)K(中文(简体) )
  • computation (单位:千美元)() => T(中文(简体) )
  • checkUse (单位:千美元)((t: T) => boolean) | undefined(中文(简体) )
  • checkStore (单位:千美元)((t: T) => boolean) | undefined(中文(简体) )
回返

T。 。 。 .

getPropertyFromDoubleCacheOrComputation(cache, key0, key1, computation, checkUse, checkStore)

参数
  • cache (单位:千美元)Map<K0, Map<K1, T>>(中文(简体) )
  • key0 (单位:千美元)K0(中文(简体) )
  • key1 (单位:千美元)K1(中文(简体) )
  • computation (单位:千美元)() => T(中文(简体) )
  • checkUse (单位:千美元)((t: T) => boolean) | undefined(中文(简体) )
  • checkStore (单位:千美元)((t: T) => boolean) | undefined(中文(简体) )
回返

T。 。 。 .

getPropertyFromQuadrupleCacheOrComputation(cache, key0, key1, key2, key3, computation, checkUse, checkStore)

参数
  • cache (单位:千美元)Map<K0, Map<K1, Map<K2, Map<K3, T>>>>(中文(简体) )
  • key0 (单位:千美元)K0(中文(简体) )
  • key1 (单位:千美元)K1(中文(简体) )
  • key2 (单位:千美元)K2(中文(简体) )
  • key3 (单位:千美元)K3(中文(简体) )
  • computation (单位:千美元)() => T(中文(简体) )
  • checkUse (单位:千美元)((t: T) => boolean) | undefined(中文(简体) )
  • checkStore (单位:千美元)((t: T) => boolean) | undefined(中文(简体) )
回返

T。 。 。 .

getPropertyFromQuintupleCacheOrComputation(cache, key0, key1, key2, key3, key4, computation, checkUse, checkStore)

参数
  • cache (单位:千美元)Map<K0, Map<K1, Map<K2, Map<K3, Map<K4, T>>>>>(中文(简体) )
  • key0 (单位:千美元)K0(中文(简体) )
  • key1 (单位:千美元)K1(中文(简体) )
  • key2 (单位:千美元)K2(中文(简体) )
  • key3 (单位:千美元)K3(中文(简体) )
  • key4 (单位:千美元)K4(中文(简体) )
  • computation (单位:千美元)() => T(中文(简体) )
  • checkUse (单位:千美元)((t: T) => boolean) | undefined(中文(简体) )
  • checkStore (单位:千美元)((t: T) => boolean) | undefined(中文(简体) )
回返

T。 。 。 .

getPropertyFromTripleCacheOrComputation(cache, key0, key1, key2, computation, checkUse, checkStore)

参数
  • cache (单位:千美元)Map<K0, Map<K1, Map<K2, T>>>(中文(简体) )
  • key0 (单位:千美元)K0(中文(简体) )
  • key1 (单位:千美元)K1(中文(简体) )
  • key2 (单位:千美元)K2(中文(简体) )
  • computation (单位:千美元)() => T(中文(简体) )
  • checkUse (单位:千美元)((t: T) => boolean) | undefined(中文(简体) )
  • checkStore (单位:千美元)((t: T) => boolean) | undefined(中文(简体) )
回返

T。 。 。 .

groupBy(arr, key)

参数
  • arr (单位:千美元)Array<T>(中文(简体) )
  • key (单位:千美元)(i: T) => K(中文(简体) )
回返

{[P in K]: Array<T>}。 。 。 .

hexToFractionalOpaqueRgba(hex)

将十六进制转换为分数 RGBA, 并将透明度设置为 1

参数
  • hex (单位:千美元)string(中文(简体) )
    • 十六进制字符串, 如“ # 0033ffcc ”
回返

小数RGB,e([number, number, number, number].g. [0, 0.2, 1, 1] (中文(简体) )

hexToFractionalRgb(hex)

将十六进制转换为分数 RGB

参数
  • hex (单位:千美元)string(中文(简体) )
    • 十六进制字符串, 如“ # 0033ff ”
回返

小数RGB,e([number, number, number]. g. [0, 0.2, 1] (中文(简体) )

hexToFractionalRgba(hex)

将十六进制转换为分数 RGBA

参数
  • hex (单位:千美元)string(中文(简体) )
    • 十六进制字符串, 如“ # 0033ff ”
回返

小数RGB,e([number, number, number, number].g. [0, 0.2, 1, 1] (中文(简体) )

hexToOpaqueRgba(hex)

将 HEX 转换为 RGB, 并将透明度设置为 255

参数
  • hex (单位:千美元)string(中文(简体) )
    • HEX 字符串, 例如 '# 0033ffcc'
回返

RGB, e (中文(简体) )[number, number, number, number].g. [0、51、255、255] (中文(简体) )

hexToRgb(hex)

将 HEX 转换为 RGB

参数
  • hex (单位:千美元)string(中文(简体) )
    • HEX 字符串, 例如 '# 0033ff'
回返

RGB, e (中文(简体) )[number, number, number]. g. [0, 51, 255] (中文(简体) )

hexToRgba(hex)

将 HEX 转换为 RGB

参数
  • hex (单位:千美元)string(中文(简体) )
    • HEX 字符串, 例如 '# 0033ffff'
回返

RGB, e (中文(简体) )[number, number, number, number].g. [0、51、255、255] (中文(简体) )

intersectBboxes(bbox0, bbox1)

参数
  • bbox0 (单位:千美元)[number, number, number, number](中文(简体) )
  • bbox1 (单位:千美元)[number, number, number, number](中文(简体) )
回返

Bbox | undefined。 。 。 .

invertPoint(point)

参数
  • point (单位:千美元)[number, number](中文(简体) )
回返

[number, number]。 。 。 .

invertPoints(points)

参数
  • points (单位:千美元)Array<Point>(中文(简体) )
回返

Array<Point>。 。 。 .

isClosed(input)

参数
  • input (单位:千美元)Array<Point>(中文(简体) )
回返

boolean。 。 。 .

isEqualArray(array0, array1, isEqualObject)

参数
  • array0 (单位:千美元)Array<T>(中文(简体) )
  • array1 (单位:千美元)Array<T>(中文(简体) )
  • isEqualObject (单位:千美元)((t0: T, t1: T) => boolean) | undefined(中文(简体) )
回返

boolean。 。 。 .

isEqualPoint(point0, point1)

参数
  • point0 (单位:千美元)[number, number](中文(简体) )
  • point1 (单位:千美元)[number, number](中文(简体) )
回返

boolean。 。 。 .

isEqualPointArray(pointArray0, pointArray1)

参数
  • pointArray0 (单位:千美元)Array<Point>(中文(简体) )
  • pointArray1 (单位:千美元)Array<Point>(中文(简体) )
回返

boolean。 。 。 .

isEqualPointArrayArray(pointArrayArray0, pointArrayArray1)

参数
  • pointArrayArray0 (单位:千美元)Array<Array<Point>>(中文(简体) )
  • pointArrayArray1 (单位:千美元)Array<Array<Point>>(中文(简体) )
回返

boolean。 。 。 .

isGeojsonGeometry(obj)

参数
  • obj (单位:千美元)unknown(中文(简体) )
回返

boolean。 。 。 .

isGeojsonLineString(input)

参数
  • input (单位:千美元)unknown(中文(简体) )
回返

boolean。 。 。 .

isGeojsonMultiGeometry(obj)

参数
  • obj (单位:千美元)unknown(中文(简体) )
回返

boolean。 。 。 .

isGeojsonMultiLineString(input)

参数
  • input (单位:千美元)unknown(中文(简体) )
回返

boolean。 。 。 .

isGeojsonMultiPoint(input)

参数
  • input (单位:千美元)unknown(中文(简体) )
回返

boolean。 。 。 .

isGeojsonMultiPolygon(input)

参数
  • input (单位:千美元)unknown(中文(简体) )
回返

boolean。 。 。 .

isGeojsonPoint(input)

参数
  • input (单位:千美元)unknown(中文(简体) )
回返

boolean。 。 。 .

isGeojsonPolygon(input)

参数
  • input (单位:千美元)unknown(中文(简体) )
回返

boolean。 。 。 .

isGeometry(input)

参数
  • input (单位:千美元)unknown(中文(简体) )
回返

boolean。 。 。 .

isLineString(input)

参数
  • input (单位:千美元)unknown(中文(简体) )
回返

boolean。 。 。 .

isMultiLineString(input)

参数
  • input (单位:千美元)unknown(中文(简体) )
回返

boolean。 。 。 .

isMultiPoint(input)

参数
  • input (单位:千美元)unknown(中文(简体) )
回返

boolean。 。 。 .

isMultiPolygon(input)

参数
  • input (单位:千美元)unknown(中文(简体) )
回返

boolean。 。 。 .

isPoint(input)

参数
  • input (单位:千美元)unknown(中文(简体) )
回返

boolean。 。 。 .

isPolygon(input)

参数
  • input (单位:千美元)unknown(中文(简体) )
回返

boolean。 。 。 .

isRing(input)

参数
  • input (单位:千美元)unknown(中文(简体) )
回返

boolean。 。 。 .

isSvgCircle(input)

参数
  • input (单位:千美元)any(中文(简体) )
回返

boolean。 。 。 .

isSvgLine(input)

参数
  • input (单位:千美元)any(中文(简体) )
回返

boolean。 。 。 .

isSvgPolyLine(input)

参数
  • input (单位:千美元)any(中文(简体) )
回返

boolean。 。 。 .

isSvgPolygon(input)

参数
  • input (单位:千美元)any(中文(简体) )
回返

boolean。 。 。 .

isSvgRect(input)

参数
  • input (单位:千美元)any(中文(简体) )
回返

boolean。 。 。 .

isValidHttpUrl(string)

参数
  • string (单位:千美元)string(中文(简体) )
回返

boolean。 。 。 .

lineAngle(line)

参数
  • line (单位:千美元)[Point, Point](中文(简体) )
回返

number。 。 。 .

lineStringToGeojsonLineString(lineString)

参数
  • lineString (单位:千美元)Array<Point>(中文(简体) )
回返

{type: 'LineString'; coordinates: number[][]}。 。 。 .

lineStringToLines(lineString)

参数
  • lineString (单位:千美元)Array<Point>(中文(简体) )
回返

Array<Line>。 。 。 .

linesIntersectionPoint(line0, line1, options)

参数
  • line0 (单位:千美元)[Point, Point](中文(简体) )
  • line1 (单位:千美元)[Point, Point](中文(简体) )
  • options? (单位:千美元)Partial<IntersectionOptions> | undefined(中文(简体) )
回返

Point | undefined。 。 。 .

mapToResourceMaskSvgPolygon(map)

参数
  • map (单位:千美元){ '@context'?: "https://schemas.allmaps.org/map/2/context.json" | undefined; type: "GeoreferencedMap"; id?: string | undefined; created?: string | undefined; modified?: string | undefined; ... 5 more ...; _allmaps?: unknown; }(中文(简体) )
回返

{type: 'polygon'; attributes?: SvgAttributes; coordinates: Ring}。 。 。 .

mergeGeojsonFeaturesCollections(geojsonFeatureCollections)

参数
  • geojsonFeatureCollections (单位:千美元)Array<GeojsonFeatureCollection>(中文(简体) )
回返

{type: 'FeatureCollection'; features: GeojsonFeature[]}。 。 。 .

mergeOptions(baseOptions, additionalPartialOptions)

参数
  • baseOptions (单位:千美元)T(中文(简体) )
  • additionalPartialOptions (单位:千美元)U[0](中文(简体) )
回返

T & U[number]。 。 。 .

mergeOptionsUnlessUndefined(baseOptions, additionalOptions)

参数
  • baseOptions (单位:千美元)T(中文(简体) )
  • additionalOptions (单位:千美元)Partial<U> | undefined(中文(简体) )
回返

T & Partial<U>。 。 。 .

mergePartialOptions(partialOptions)

参数
  • partialOptions (单位:千美元)U[0](中文(简体) )
回返

{[P in keyof U[number]]?: U[number][P] | undefined}。 。 。 .

mergeTwoOptionsUnlessUndefined(baseOptions, additionalOption)

参数
  • baseOptions (单位:千美元)T(中文(简体) )
  • additionalOption (单位:千美元)Partial<U> | undefined(中文(简体) )
回返

T & Partial<U>。 。 。 .

midPoint(points)

参数
  • points (单位:千美元)[number, number](中文(简体) )
回返

[number, number]。 。 。 .

mixLineStrings(lineString0, lineString1, t)

参数
  • lineString0 (单位:千美元)Array<Point>(中文(简体) )
  • lineString1 (单位:千美元)Array<Point>(中文(简体) )
  • t (单位:千美元)number(中文(简体) )
回返

Array<Point>。 。 。 .

mixNumbers(number0, number1, t)

参数
  • number0 (单位:千美元)number(中文(简体) )
  • number1 (单位:千美元)number(中文(简体) )
  • t (单位:千美元)number(中文(简体) )
回返

number。 。 。 .

mixPoints(point0, point1, t)

参数
  • point0 (单位:千美元)[number, number](中文(简体) )
  • point1 (单位:千美元)[number, number](中文(简体) )
  • t (单位:千美元)number(中文(简体) )
回返

[number, number]。 。 。 .

multiLineStringToGeojsonMultiLineString(multiLineString)

参数
  • multiLineString (单位:千美元)Array<Array<Point>>(中文(简体) )
回返

{type: 'MultiLineString'; coordinates: number[][][]}。 。 。 .

multiPointToGeojsonMultiPoint(multiPoint)

参数
  • multiPoint (单位:千美元)Array<Point>(中文(简体) )
回返

{type: 'MultiPoint'; coordinates: number[][]}。 。 。 .

multiPolygonToGeojsonMultiPolygon(multiPolygon, close)

参数
  • multiPolygon (单位:千美元)Array<Array<Array<Point>>>(中文(简体) )
  • close (单位:千美元)boolean | undefined(中文(简体) )
回返

{type: 'MultiPolygon'; coordinates: number[][][][]}。 。 。 .

multiplyArrayMatrix(arrayMatrix, factor)

参数
  • arrayMatrix (单位:千美元)Array<Array<number>>(中文(简体) )
  • factor (单位:千美元)number(中文(简体) )
回返

Array<Array<number>>。 。 。 .

newArrayMatrix(rows, cols, value)

创建并填充 ArrayMatrix : 一组矩阵, 日后可以装入为 ml- matrix 矩阵

参数
  • rows (单位:千美元)number(中文(简体) )
  • cols (单位:千美元)number(中文(简体) )
  • value (单位:千美元)T | undefined(中文(简体) )
回返

Array<Array<T>>。 。 。 .

newBlockArrayMatrix(blocks, emptyValue)

参数
  • blocks (单位:千美元)Array<Array<Array<Array<T>>>>(中文(简体) )
  • emptyValue (单位:千美元)T | undefined(中文(简体) )
回返

Array<Array<T>>。 。 。 .

objectDifference(newObject, baseObject, objectKeysPossiblyChanged)

参数
  • newObject (单位:千美元)object(中文(简体) )
  • baseObject (单位:千美元)object(中文(简体) )
  • objectKeysPossiblyChanged? (单位:千美元)Array<string> | undefined(中文(简体) )
回返

object。 。 。 .

omit(object, keys)

参数
  • object (单位:千美元)T(中文(简体) )
  • keys (单位:千美元)Array<K>(中文(简体) )
回返

{[P in Exclude<keyof T, K>]: T[P]}。 。 。 .

optionKeysByMapIdToUndefinedOptionsByMapId(optionKeysByMapId)

参数
  • optionKeysByMapId (单位:千美元)Map<string, T> | undefined(中文(简体) )
回返

Map<string, Record<T[number], undefined>> | undefined。 。 。 .

optionKeysToUndefinedOptions(optionKeys)

参数
  • optionKeys (单位:千美元)T | undefined(中文(简体) )
回返

Record<T[number], undefined> | undefined。 。 。 .

pasteArrayMatrix(arrayMatrix, rowsStart, colsStart, subArrayMatrix)

参数
  • arrayMatrix (单位:千美元)Array<Array<T>>(中文(简体) )
  • rowsStart (单位:千美元)number(中文(简体) )
  • colsStart (单位:千美元)number(中文(简体) )
  • subArrayMatrix (单位:千美元)Array<Array<T>>(中文(简体) )
回返

Array<Array<T>>。 。 。 .

pasteArrayMatrixInPlace(arrayMatrix, rowsStart, colsStart, subArrayMatrix)

参数
  • arrayMatrix (单位:千美元)Array<Array<T>>(中文(简体) )
  • rowsStart (单位:千美元)number(中文(简体) )
  • colsStart (单位:千美元)number(中文(简体) )
  • subArrayMatrix (单位:千美元)Array<Array<T>>(中文(简体) )
回返

Array<Array<T>>。 。 。 .

pixelToIntArrayIndex(pixel, size, channels, flipY)

参数
  • pixel (单位:千美元)[number, number](中文(简体) )
  • size (单位:千美元)[number, number](中文(简体) )
  • channels (单位:千美元)number(中文(简体) )
  • flipY (单位:千美元)boolean | undefined(中文(简体) )
回返

number。 。 。 .

pointInBbox(point, bbox)

参数
  • point (单位:千美元)[number, number](中文(简体) )
  • bbox (单位:千美元)[number, number, number, number](中文(简体) )
回返

boolean。 。 。 .

pointToGeojsonPoint(point)

参数
  • point (单位:千美元)[number, number](中文(简体) )
回返

{type: 'Point'; coordinates: number[]}。 。 。 .

pointToPixel(point, translate)

参数
  • point (单位:千美元)[number, number](中文(简体) )
  • translate (单位:千美元)Point | undefined(中文(简体) )
回返

[number, number]。 。 。 .

pointsAndPointsToLines(points0, points1)

参数
  • points0 (单位:千美元)Array<Point>(中文(简体) )
  • points1 (单位:千美元)Array<Point>(中文(简体) )
回返

Array<Line>。 。 。 .

polygonIsBboxRectangle(polygon)

参数
  • polygon (单位:千美元)Array<Array<Point>>(中文(简体) )
回返

boolean。 。 。 .

polygonSelfIntersectionPoints(polygon, options)

参数
  • polygon (单位:千美元)Array<Array<Point>>(中文(简体) )
  • options? (单位:千美元)Partial<IntersectionOptions> | undefined(中文(简体) )
回返

Array<Point>。 。 。 .

polygonToGeojsonPolygon(polygon, close)

参数
  • polygon (单位:千美元)Array<Array<Point>>(中文(简体) )
  • close (单位:千美元)boolean | undefined(中文(简体) )
回返

{type: 'Polygon'; coordinates: number[][][]}。 。 。 .

prolongedLinesIntersectionPoint(line0, line1)

参数
  • line0 (单位:千美元)[Point, Point](中文(简体) )
  • line1 (单位:千美元)[Point, Point](中文(简体) )
回返

Point | undefined。 。 。 .

radiansToDegrees(radians)

参数
  • radians (单位:千美元)number(中文(简体) )
回返

number。 。 。 .

rectangleToSize(rectangle)

参数
  • rectangle (单位:千美元)[Point, Point, Point, Point](中文(简体) )
回返

[number, number]。 。 。 .

rectanglesToScale(rectangle0, rectangle1, fit)

参数
  • rectangle0 (单位:千美元)[Point, Point, Point, Point](中文(简体) )
  • rectangle1 (单位:千美元)[Point, Point, Point, Point](中文(简体) )
  • fit? (单位:千美元)Fit | undefined(中文(简体) )
回返

number。 。 。 .

removeUndefinedOptions(optionsArray)

参数
  • optionsArray (单位:千美元)U[0](中文(简体) )
回返

{ [P in keyof {[K in keyof U[number]]: Exclude<U[number][K], undefined>}]?: {[K in keyof U[number]]: Exclude<U[number][K], undefined>}[P] | undefined }。 。 。 .

rgbToHex(rgb)

将 RBG 转换为 HEX

参数
  • rgb (单位:千美元)[number, number, number](中文(简体) )
    • RGB 色彩阵列, 例如 [0, 51, 255]
回返

HEX 字符串, e (string. g. '#0033ff' (中文(简体) )

rgbaToHex(rgba)

将 RBGA 转换为 HEX

参数
  • rgba (单位:千美元)[number, number, number, number](中文(简体) )
回返

HEX 字符串, e (string. g. '# 0033ffff' (中文(简体) )

ringIsBboxRectangle(ring)

参数
  • ring (单位:千美元)Array<Point>(中文(简体) )
回返

boolean。 。 。 .

ringToGeojsonPolygon(ring, close)

参数
  • ring (单位:千美元)Array<Point>(中文(简体) )
  • close (单位:千美元)boolean | undefined(中文(简体) )
回返

{type: 'Polygon'; coordinates: number[][][]}。 。 。 .

rms(from, to)

参数
  • from (单位:千美元)Array<Point>(中文(简体) )
  • to (单位:千美元)Array<Point>(中文(简体) )
回返

number。 。 。 .

rotateArray(array, offset)

参数
  • array (单位:千美元)Array<T>(中文(简体) )
  • offset (单位:千美元)number(中文(简体) )
回返

Array<T>。 。 。 .

rotatePoint(point, angle, pivot, cosAngle, sinAngle)

参数
  • point (单位:千美元)[number, number](中文(简体) )
  • angle (单位:千美元)number | undefined(中文(简体) )
  • pivot (单位:千美元)Point | undefined(中文(简体) )
  • cosAngle? (单位:千美元)number | undefined(中文(简体) )
  • sinAngle? (单位:千美元)number | undefined(中文(简体) )
回返

[number, number]。 。 。 .

rotatePoints(points, angle, pivot)

参数
  • points (单位:千美元)Array<Point>(中文(简体) )
  • angle (单位:千美元)number | undefined(中文(简体) )
  • pivot (单位:千美元)Point | undefined(中文(简体) )
回返

Array<Point>。 。 。 .

scaleBbox(bbox, scale)

参数
  • bbox (单位:千美元)[number, number, number, number](中文(简体) )
  • scale (单位:千美元)number(中文(简体) )
回返

[number, number, number, number]。 。 。 .

scalePoint(point, scale)

参数
  • point (单位:千美元)[number, number](中文(简体) )
  • scale (单位:千美元)number(中文(简体) )
回返

[number, number]。 。 。 .

scalePoints(points, scale)

参数
  • points (单位:千美元)Array<Point>(中文(简体) )
  • scale (单位:千美元)number(中文(简体) )
回返

Array<Point>。 。 。 .

scaleSize(size, scale)

参数
  • size (单位:千美元)[number, number](中文(简体) )
  • scale (单位:千美元)number(中文(简体) )
回返

[number, number]。 。 。 .

shallowCopyArrayMatrix(arrayMatrix)

参数
  • arrayMatrix (单位:千美元)Array<Array<T>>(中文(简体) )
回返

Array<Array<T>>。 。 。 .

sizeToBbox(size, center)

参数
  • size (单位:千美元)[number, number](中文(简体) )
  • center? (单位:千美元)Point | undefined(中文(简体) )
回返

[number, number, number, number]。 。 。 .

sizeToCenter(size)

参数
  • size (单位:千美元)[number, number](中文(简体) )
回返

[number, number]。 。 。 .

sizeToRectangle(size, center)

参数
  • size (单位:千美元)[number, number](中文(简体) )
  • center? (单位:千美元)Point | undefined(中文(简体) )
回返

[Point, Point, Point, Point]。 。 。 .

sizeToResolution(size)

参数
  • size (单位:千美元)[number, number](中文(简体) )
回返

number。 。 。 .

sizesToScale(size0, size1, fit)

从两个大小计算一个比例尺

对于未说明的“ fit” , 比例尺是根据大小产生的表面积来计算的.

用于指定的“ fit ” :

平方矩形 bbox0 '*' 和 bbox1' 示例 :

'cain' 其中'*'包含' (在第一个尺寸0中相对较宽)

           ****
           *  *

. .

  • . * (中文(简体) ). . . * * 翻译: 页:1

盖' *'被'所覆盖 (在第一个尺寸0中相对较宽)

           ....
           .  .

.. . . . . 所出所出所出所出所出所出所出所出所出所出所出 .. . . . . . . .. .

“ 相等 ” , 其中“ * ” 与“ ” 相同 (在第一个尺寸0中相对较宽)

****       ....

。 。 。 ..。 。 。 . .** (中文(简体) ). .* (中文(简体) ) 。 。 。 . . . .. 。 。 。 .. . * (中文(简体) ). .** (中文(简体) ). ****.

参数
  • size0 (单位:千美元)[number, number](中文(简体) )
    • 第一个大小
  • size1 (单位:千美元)[number, number](中文(简体) )
    • 第二个大小
  • fit? (单位:千美元)Fit | undefined(中文(简体) )
    • 合适的
回返

number。 。 。 .

sliceArrayMatrix(arrayMatrix, rowsStart, colsStart, rowsEnd, colsEnd)

参数
  • arrayMatrix (单位:千美元)Array<Array<T>>(中文(简体) )
  • rowsStart (单位:千美元)number(中文(简体) )
  • colsStart (单位:千美元)number(中文(简体) )
  • rowsEnd? (单位:千美元)number | undefined(中文(简体) )
  • colsEnd? (单位:千美元)number | undefined(中文(简体) )
回返

Array<Array<T>>。 。 。 .

squaredDistance(from, to)

参数
  • from (单位:千美元)[number, number](中文(简体) )
  • to (单位:千美元)Point | undefined(中文(简体) )
回返

number。 。 。 .

stepDistanceAngle(point, dist, angle)

参数
  • point (单位:千美元)[number, number](中文(简体) )
  • dist (单位:千美元)number(中文(简体) )
  • angle (单位:千美元)number(中文(简体) )
回返

[number, number]。 。 。 .

stringToSvgGeometriesGenerator(svg)

参数
  • svg (单位:千美元)string(中文(简体) )
回返

Generator<SvgGeometry, void, unknown>。 。 。 .

subArrayMatrix(arrayMatrix, rows, cols)

参数
  • arrayMatrix (单位:千美元)Array<Array<T>>(中文(简体) )
  • rows (单位:千美元)Array<number>(中文(简体) )
  • cols (单位:千美元)Array<number>(中文(简体) )
回返

Array<Array<T>>。 。 。 .

subSetArray(arr1, arr2)

参数
  • arr1 (单位:千美元)Array<T>(中文(简体) )
  • arr2 (单位:千美元)Array<T>(中文(简体) )
回返

boolean。 。 。 .

svgGeometriesToSvgString(geometries)

参数
  • geometries (单位:千美元)Array<SvgGeometry>(中文(简体) )
回返

string。 。 。 .

svgGeometryToGeometry(svgCircle)

参数
  • svgCircle (单位:千美元){type: 'circle'; attributes?: SvgAttributes; coordinates: Point}(中文(简体) )
回返

[number, number]。 。 。 .

svgGeometryToString(geometry)

参数
  • geometry (单位:千美元)SvgCircle | SvgLine | SvgPolyLine | SvgPolygon | SvgRect(中文(简体) )
回返

string。 。 。 .

threePointsToAngle(pointA, pointB, pointC)

由 B 和 C 点在 A 点 下生成的回角α

参数
  • pointA (单位:千美元)[number, number](中文(简体) )
  • pointB (单位:千美元)[number, number](中文(简体) )
  • pointC (单位:千美元)[number, number](中文(简体) )
回返

number。 。 。 .

translatePoint(point, translationPoint, addOrSubstract)

参数
  • point (单位:千美元)[number, number](中文(简体) )
  • translationPoint (单位:千美元)[number, number](中文(简体) )
  • addOrSubstract (单位:千美元)'add' | 'substract' | undefined(中文(简体) )
回返

[number, number]。 。 。 .

translatePoints(points, point, addOrSubstract)

参数
  • points (单位:千美元)Array<Point>(中文(简体) )
  • point (单位:千美元)[number, number](中文(简体) )
  • addOrSubstract (单位:千美元)'add' | 'substract' | undefined(中文(简体) )
回返

Array<Point>。 。 。 .

transposeArrayMatrix(arrayMatrix)

参数
  • arrayMatrix (单位:千美元)Array<Array<T>>(中文(简体) )
回返

Array<Array<T>>。 。 。 .

triangleAngles(triangle)

参数
  • triangle (单位:千美元)[Point, Point, Point](中文(简体) )
回返

[number, number, number]。 。 。 .

triangleArea(triangle)

参数
  • triangle (单位:千美元)[Point, Point, Point](中文(简体) )
回返

number。 。 。 .

uncloseMultiPolygon(multiPolygon)

参数
  • multiPolygon (单位:千美元)Array<Array<Array<Point>>>(中文(简体) )
回返

Array<Array<Array<Point>>>。 。 。 .

unclosePolygon(polygon)

参数
  • polygon (单位:千美元)Array<Array<Point>>(中文(简体) )
回返

Array<Array<Point>>。 。 。 .

uncloseRing(ring)

参数
  • ring (单位:千美元)Array<Point>(中文(简体) )
回返

Array<Point>。 。 。 .

版本与发布记录

@allmaps/stdlib 共发布 36 个版本,首次发布于 2023/02/16;过去 12 个月发布了 5 个版本。

版本发布日期距今
1.0.0-beta.42latest2026/09/221 个月前
1.0.0-beta.412026/05/295 个月前
1.0.0-beta.402026/02/108 个月前
1.0.0-beta.392025/11/2711 个月前
1.0.0-beta.382025/11/1111 个月前
1.0.0-beta.372025/07/201.3 年前

其他发布通道:beta → 1.0.0-beta.34。

关于 @allmaps/stdlib 的常见问题

@allmaps/stdlib 是什么?

全部地图标准库

如何安装 @allmaps/stdlib?

在项目目录运行 npm install @allmaps/stdlib,或使用 pnpm add / yarn add / bun add。

@allmaps/stdlib 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/allmaps__stdlib 是否存在。

@allmaps/stdlib 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@allmaps/stdlib 可以商用吗?

@allmaps/stdlib 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@allmaps/stdlib 的下载量有多少?

根据 npm 官方下载统计,@allmaps/stdlib 在 2026/10/06 – 2026/11/04 这 30 天内被下载 11,705 次,日均约 390 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@allmaps/stdlib 还在维护吗?

最新版本 1.0.0-beta.42 发布于 2026/09/22(1 个月前);至今共发布 36 个版本,其中过去 12 个月发布了 5 个;首次发布于 2023/02/16。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。