SMS: send only the Yandex Maps link so it fits in one message

Drop the 'Я тут: lat,lon' prefix - the Cyrillic forced UCS-2 (70-char SMS) and the
coords were redundant with the pin. The bare ASCII link is GSM-7 and fits in one SMS.
This commit is contained in:
4aiman 2026-10-26 19:28:08 +03:00
commit a68c298946

View file

@ -4726,9 +4726,10 @@ async function sendLocationSms() {
let last = GPS.recording.lastMovingPoint || pts[pts.length - 1];
if (!last || last.lat == null) { appAlert("Нет координат — подожди фикс GPS"); return; }
let lat = (+last.lat).toFixed(5), lon = (+last.lon).toFixed(5);
// Yandex Maps: pt=lon,lat drops a pin at the position
let link = `https://yandex.ru/maps/?pt=${lon},${lat}&z=16&l=map`;
let text = `Я тут: ${lat},${lon} ${link}`;
// Yandex Maps: pt=lon,lat drops a pin at the position. Link ONLY (ASCII, ~54 chars)
// so the whole message is GSM-7 and fits in a single SMS — any Cyrillic would force
// UCS-2 (70-char limit) and risk splitting into two.
let text = `https://yandex.ru/maps/?pt=${lon},${lat}&z=16&l=map`;
let esc = s => String(s).replace(/</g, "&lt;");
let ok = await appConfirm(
`Отправить СМС с местоположением?<br><br><b>Кому:</b> ${esc(number)}<br><br><span style="font-size:12px;color:#9aa4ae;word-break:break-all">${esc(text)}</span>`,