add geocoding sample
This commit is contained in:
9
place-widget.lua
Normal file
9
place-widget.lua
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
function on_alarm()
|
||||||
|
local location = system:get_location()
|
||||||
|
net:get_text("https://nominatim.openstreetmap.org/reverse?format=json&lat=".. location[1].."&lon=".. location[2].."&addressdetails=1")
|
||||||
|
end
|
||||||
|
|
||||||
|
function on_network_result(result)
|
||||||
|
local adr = ajson:get_value(result, "object string:display_name")
|
||||||
|
ui:show_text(adr)
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user