When I receive a SMS from some selected contacts with message Where are you? I reply (via SMS) to the user my current google maps location url. I have written a tasker profile for this.
Profile: Ask Where In Sms (66)
Event: Received Text [ Type:Any Sender:CG:Group1 Content:* ]
Enter: Sms React (67)
A1: Variable Set [ Name:%message To:%SMSRB Recurse Variables:Off Do Maths:Off Append:Off Max Rounding Digits:3 ]
A2: Variable Set [ Name:%sendername To:%SMSRN Recurse Variables:Off Do Maths:Off Append:Off Max Rounding Digits:3 ]
A3: Variable Set [ Name:%number To:%SMSRF Recurse Variables:Off Do Maths:Off Append:Off Max Rounding Digits:3 ]
A4: Flash [ Text:%sendername (%number):
%message Long:On ]
A5: If [ %message ~R [Ww]here are you? ]
A6: Get Location [ Source:GPS Timeout (Seconds):10 Continue Task Immediately:Off Keep Tracking:Off ]
A7: Variable Set [ Name:%coord To:%LOC Recurse Variables:Off Do Maths:Off Append:Off Max Rounding Digits:3 ]
A8: JavaScriptlet [ Code:function func(dms, type){
var sign = 1, Abs=0;
var days, minutes, secounds, direction;
if(dms < 0) { sign = -1; }
Abs = Math.abs( Math.round(dms * 1000000.));
//Math.round is used to eliminate the small error caused by rounding in the computer:
//e.g. 0.2 is not the same as 0.20000000000284
//Error checks
if(type == "lat" && Abs > (90 * 1000000)){
//alert(" Degrees Latitude must be in the range of -90. to 90. ");
return false;
} else if(type == "lon" && Abs > (180 * 1000000)){
//alert(" Degrees Longitude must be in the range of -180 to 180. ");
return false;
}
days = Math.floor(Abs / 1000000);
minutes = Math.floor(((Abs/1000000) - days) * 60);
secounds = ( Math.floor((( ((Abs/1000000) - days) * 60) - minutes) * 100000) *60/100000 ).toFixed();
days = days * sign;
if(type == 'lat') direction = days<0 ? 'S' : 'N';
if(type == 'lon') direction = days<0 ? 'W' : 'E';
//else return value
return (days * sign) + 'º' + minutes + "'" + secounds + "\"" + direction;
}
let parts = coord.split(',').map(parseFloat)
let lat = parts[0];
let lon = parts[1];
let latstr = func(lat,'lat');
let lonstr = func(lon,'lon');
var latlonstr = escape(`${latstr}+${lonstr}`); Libraries: Auto Exit:On Timeout (Seconds):45 ]
A10: Variable Set [ Name:%reply To:I am here: %mapsurl Recurse Variables:Off Do Maths:Off Append:Off Max Rounding Digits:3 ]
A11: Send SMS [ Number:%number Message:%reply Store In Messaging App:Off SIM Card: ]
1. receive the message and store the body and sender into a variable
2. get location
3. Compute the coordinates in degrees-minutes-seconds format (DMS) and store into a variable
4. compose reply and send
However, that URL doesn't open in Google Maps app; the app launches but, it doesn't drop a location marker to my current location.
1. In the google maps app, the url pattern is different.
2. The url in the sms reply work in the phone's browser
Is there some android maps API which could give me the Google Maps (deep link) url for the same purpose?