Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
HELP ! I want to find my location and show it with point in map.
-
Hi! this is my code.
I want to find my location and show it with point in map.import location.time location.start_updates( ) time.sleep(3) x = location.get_location( ) location.stop_updates( ) (lat,lon)= (x ["latitude"], x ["longitude"]) img= location.render_map_snapshot(lat,lon, map_type= "terrain", img_width=512, img_height=512) img.show( )
-
-
@ccc said in HELP ! I want to find my location and show it with point in map.:
https://forum.omz-software.com/search?term=get_location&in=titlesposts
Is there a similar issue?
-
@kostaszar91 what is map_type= "terrain"?
-
@kostaszar91 try this
import time import location import ui location.start_updates() time.sleep(3) x = location.get_location() location.stop_updates() lat, lon = x["latitude"], x["longitude"] img = location.render_map_snapshot( lat, lon, map_type="satellite", img_width=512, img_height=512, show_poi=True ) with ui.ImageContext(512,512) as ctx: img.draw() oval = ui.Path.oval(256,256,10,10) ui.set_color('red') oval.fill() img = ctx.get_image() img.show()