Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interface Location类型定义有不匹配的地方 #160

Open
jefn76 opened this issue Feb 14, 2023 · 1 comment
Open

interface Location类型定义有不匹配的地方 #160

jefn76 opened this issue Feb 14, 2023 · 1 comment

Comments

@jefn76
Copy link

jefn76 commented Feb 14, 2023

调用Geolocation.getCurrentPosition()的时候,position打印出来的数据和当前类型定义文件不匹配。
这是打印出来的数据:
image

这是当前文件类型:
export interface Location {
accuracy: number;
latitude: number;
longitude: number;
altitude?: number;
speed?: number;
heading?: number;
timestamp?: number;
errorCode?: ErrorCode;
errorInfo?: string;
locationDetail?: string;
locationType?: LocationType;
gpsAccuracy?: GpsAccuracy;
coordinateType?: "WGS84" | "GCJ02";
trustedLevel?: TrustedLevel;
}

@qiuxiang
Copy link
Owner

position 的类型是这个

/**
* 定位信息
*
* @see https://developer.mozilla.org/zh-CN/docs/Web/API/Position
*/
export interface Position {
coords: Coordinates;
timestamp: number;
location: Location;
}

而 location 的类型也没问题,只是有些字段没有标注出来。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants