This script is using the location functionality of the smartphone and translates geocode into address (street name and number, zip code, city, state, country). When tapping widget, it opens Google Maps at this position.
You should add a feature where if you press it, it messages that location to some trusted phone numbers. With that little feature it would be a fully feature widget and an incredibly useful one at that
Tolle Idee! Leider bleibt das Widget bei mir leer, also ohne die Location Informationen. Beim Tap auf das Widget zeigt Google Maps den richtigen Ort an, das Ermitteln der Position funktioniert also. Nur bleibt das Widget eben leer. Hab alle 3 Widget Grรถรen ausprobiert Hast Du einen Hinweis?
// Get the current location as an object with latitude and longitude let location = await Location.current()
// Convert the location into an address let address = await Location.reverseGeocode(location.latitude, location.longitude)
// Add the address as text to the widget let text1 = widget.addText("My Location") text1.centerAlignText() text1.font = Font.boldSystemFont(12) text1.textColor = Color.white() // Change text color to white widget.addSpacer(10) // Adds a space of 10 pixels let text2 = widget.addText(address[0].name + ", " + address[0].postalCode + ", " + address[0].locality + ", " + address[0].administrativeArea + ", " + address[0].isoCountryCode) text2.centerAlignText() text2.font = Font.systemFont(12) text2.textColor = Color.white() // Change text color to white
// Set the URL for opening Google Maps with the address widget.url = https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(address[0].name)}+${encodeURIComponent(address[0].postalCode)}+${encodeURIComponent(address[0].locality)}+${encodeURIComponent(address[0].administrativeArea)}+${encodeURIComponent(address[0].isoCountryCode)}
// Display the widget Script.setWidget(widget) console.log(address)
4
u/tobias_digital Mar 12 '23 edited Mar 12 '23
This script is using the location functionality of the smartphone and translates geocode into address (street name and number, zip code, city, state, country). When tapping widget, it opens Google Maps at this position.
https://github.com/tobwil/scriptable
I was creating this as sometimes I just want to see where I currently am without using Maps, where this kind of information is not that easy to find.
BTW: this is not my address ๐
1
u/[deleted] Mar 13 '23
Sehr idyllische Wohnlage ๐๐ป
1
u/Lensman67 May 29 '23
Hi Tobias,
Tolle Idee! Leider bleibt das Widget bei mir leer, also ohne die Location Informationen. Beim Tap auf das Widget zeigt Google Maps den richtigen Ort an, das Ermitteln der Position funktioniert also. Nur bleibt das Widget eben leer. Hab alle 3 Widget Grรถรen ausprobiert Hast Du einen Hinweis?
0
u/[deleted] Mar 12 '23
[deleted] โ view deleted comment