coordinateFormatter
解析经纬度坐标字符串并返回对应的点对象
方法
fromLatitudeLongitude
解析经纬度坐标字符串并返回对应的点对象
fromLatitudeLongitude(coordinates, spatialReference?): Point
参数
- coordinates:
string经纬度坐标字符串,如"40.7128° N, 74.0060° W"或"40°42'46"N 74°00'22"W" - spatialReference?:
SpatialReference地理坐标系统的空间参考对象。如果为null,将使用WGS84坐标系
返回:Point
fromMgrs
解析军事网格参考系(MGRS)坐标字符串并返回对应的点对象
fromMgrs(coordinates, spatialReference, conversionMode): Point
参数
- coordinates:
stringMGRS坐标字符串,如"33TWN1234567890" - spatialReference:
SpatialReferenceMGRS坐标引用的地理坐标系统对象。如果为null,将使用WGS84坐标系 - conversionMode:
"automatic"|"new-180-in-zone-01"|"new-180-in-zone-60"|"old-180-in-zone-01"|"old-180-in-zone-60"MGRS坐标使用的转换模式,用于处理180度经线附近的坐标
返回:Point
fromUsng
解析美国国家网格(USNG)坐标字符串并返回对应的点对象
fromUsng(coordinates, spatialReference?): Point
参数
- coordinates:
stringUSNG坐标字符串,如"18S UJ 23480 06467" - spatialReference?:
SpatialReferenceUSNG坐标所在的地理坐标系统对象。如果为null,将使用WGS84坐标系
返回:Point
fromUtm
解析通用横轴墨卡托(UTM)坐标字符串并返回对应的点对象
fromUtm(coordinates, spatialReference, conversionMode): Point
参数
- coordinates:
stringUTM坐标字符串,如"18T 585628 4511322"或"18N 585628 4511322" - spatialReference:
SpatialReferenceUTM坐标所在的地理坐标系统对象。如果为null,将使用WGS84坐标系 - conversionMode:
"latitude-band-indicators"|"north-south-indicators"UTM坐标使用的纬度标记方案:纬度带指示符或半球指示符
返回:Point
isLoaded
检查模块的所有依赖项是否已加载
isLoaded(): boolean
返回:boolean
isSupported
检查当前浏览器是否支持此模块
isSupported(): boolean
返回:boolean
load
加载模块的依赖项
load(): Promise
返回:Promise
toLatitudeLongitude
将点对象转换为格式化的经纬度坐标字符串
toLatitudeLongitude(point, format, decimalPlaces?): string
参数
- point:
Point要转换的点对象,其空间参考应为WGS84或其他地理坐标系。 - format:
"dd"|"ddm"|"dms"格式化模式:"dd"(十进制度)、"ddm"(度分)、"dms"(度分秒) - decimalPlaces?:
number小数位数,应为0到6之间的整数
返回:string
toMgrs
将点对象转换为军事网格参考系(MGRS)坐标字符串
toMgrs(point, conversionMode, precision?, addSpaces?): string
参数
- point:
Point要转换的点对象,其空间参考应为WGS84或其他地理坐标系。 - conversionMode:
"automatic"|"new-180-in-zone-01"|"new-180-in-zone-60"|"old-180-in-zone-01"|"old-180-in-zone-60"返回MGRS字符串使用的转换模式 - precision?:
number坐标表示的精度,应为0到5之间的整数,数值越大精度越高 - addSpaces?:
boolean是否添加空格分隔符。false时生成无空格字符串,true时在各部分间添加空格
返回:string
toUsng
将点对象转换为美国国家网格(USNG)坐标字符串
toUsng(point, precision?, addSpaces?): string
参数
- point:
Point要转换的点对象,其空间参考应为WGS84或其他地理坐标系。 - precision?:
number坐标表示的精度,应为0到5之间的整数,数值越大精度越高 - addSpaces?:
boolean是否添加空格分隔符。false时生成无空格字符串,true时在各部分间添加空格
返回:string
toUtm
将点对象转换为通用横轴墨卡托(UTM)坐标字符串
toUtm(point, conversionMode, addSpaces?): string
参数
- point:
Point要转换的点对象,其空间参考应为WGS84或其他地理坐标系。 - conversionMode:
"latitude-band-indicators"|"north-south-indicators"返回UTM字符串使用的纬度标记方案:纬度带指示符或半球指示符 - addSpaces?:
boolean是否添加空格分隔符。false时生成无空格字符串,true时在UTM带、纬度标识符和数值坐标间添加空格
返回:string

BIMFlux AI
