mirror of https://github.com/Nofated095/Q2TG.git
fix: 转换地图坐标系
This commit is contained in:
parent
848d926cc6
commit
377a34f4a3
|
@ -17,6 +17,7 @@
|
|||
"dependencies": {
|
||||
"@prisma/client": "latest",
|
||||
"axios": "^0.26.0",
|
||||
"eviltransform": "^0.2.2",
|
||||
"file-type": "^17.1.1",
|
||||
"log4js": "^6.4.1",
|
||||
"nodejs-base64": "^2.0.0",
|
||||
|
|
|
@ -16,7 +16,7 @@ import { Api } from 'telegram';
|
|||
import { config } from '../providers/userConfig';
|
||||
import { file as createTempFile, FileResult } from 'tmp-promise';
|
||||
import fsP from 'fs/promises';
|
||||
import GeoPoint = Api.GeoPoint;
|
||||
import eviltransform from 'eviltransform';
|
||||
|
||||
// noinspection FallThroughInSwitchStatementJS
|
||||
export default class ForwardService {
|
||||
|
@ -226,13 +226,15 @@ export default class ForwardService {
|
|||
contact.firstName + (contact.lastName ? ' ' + contact.lastName : '') +
|
||||
(contact.phoneNumber ? `\n电话:${contact.phoneNumber}` : ''));
|
||||
}
|
||||
else if (message.venue && message.venue.geo instanceof GeoPoint) {
|
||||
else if (message.venue && message.venue.geo instanceof Api.GeoPoint) {
|
||||
// 地标
|
||||
chain.push(segment.location(message.venue.geo.lat, message.venue.geo.long, `${message.venue.title} (${message.venue.address})`));
|
||||
const geo: { lat: number, lng: number } = eviltransform.wgs2gcj(message.venue.geo.lat, message.venue.geo.long);
|
||||
chain.push(segment.location(geo.lat, geo.lng, `${message.venue.title} (${message.venue.address})`));
|
||||
}
|
||||
else if (message.geo instanceof GeoPoint) {
|
||||
else if (message.geo instanceof Api.GeoPoint) {
|
||||
// 普通的位置,没有名字
|
||||
chain.push(segment.location(message.geo.lat, message.geo.long, '选中的位置'));
|
||||
const geo: { lat: number, lng: number } = eviltransform.wgs2gcj(message.geo.lat, message.geo.long);
|
||||
chain.push(segment.location(geo.lat, geo.lng, '选中的位置'));
|
||||
}
|
||||
else if (message.media instanceof Api.MessageMediaDocument && message.media.document instanceof Api.Document) {
|
||||
// TODO 转发比较小的群文件
|
||||
|
|
|
@ -611,6 +611,13 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"eviltransform@npm:^0.2.2":
|
||||
version: 0.2.2
|
||||
resolution: "eviltransform@npm:0.2.2"
|
||||
checksum: db4efeea529f4ab173eff7184ebd2273c2b64e4a5f772e5d3d250be773c46e60f3a176d7f7ced9ebb95cae9d8aee195d3aca2215bd4305453ffa0f74c48aa846
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"ext@npm:^1.1.2":
|
||||
version: 1.6.0
|
||||
resolution: "ext@npm:1.6.0"
|
||||
|
@ -1546,6 +1553,7 @@ __metadata:
|
|||
"@prisma/client": latest
|
||||
"@types/node": ^17.0.18
|
||||
axios: ^0.26.0
|
||||
eviltransform: ^0.2.2
|
||||
file-type: ^17.1.1
|
||||
log4js: ^6.4.1
|
||||
nodejs-base64: ^2.0.0
|
||||
|
|
Loading…
Reference in New Issue