Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Having troubles using a variable in creating a marker #39

Closed
LukeyBookey21 opened this issue Aug 16, 2022 · 3 comments
Closed

Having troubles using a variable in creating a marker #39

LukeyBookey21 opened this issue Aug 16, 2022 · 3 comments
Labels
question Further information is requested

Comments

@LukeyBookey21
Copy link

It’ll allow me to manually put the co ordinates in but will not allow me to put a variable containing the exact same co ordinates in the same format. Would anyone have a solution to this thanks.

@TomSchimansky
Copy link
Owner

Can you post your code?

@TomSchimansky TomSchimansky added the question Further information is requested label Aug 17, 2022
@LukeyBookey21
Copy link
Author

LukeyBookey21 commented Aug 17, 2022

def pins():
   global translation
   global rdata
   conn = sqlite3.connect('address_book.db')
   c = conn.cursor()
   c.execute("SELECT * FROM parking")
   data1 = c.fetchone()
   rdata = (data1[0])
   print(rdata)
   marker_1 = map_widget.set_marker(rdata, text="52.55, 13.4")
   
   conn.commit()

   conn.close()

53.727830, -1.353003

not sure what to do as when I paste that co ordinate or address manually instead of 'rdata' or 'data1[0]' it works fine and loads the map up with the pin in the location I want, but when I put in rdata it seems to be having none of it even if I translate it into an address and put it through. New to Tkinter so Im probs missing something silly, help would be appreciated. cheers

@TomSchimansky
Copy link
Owner

set_marker method needs the position as two different attributes.

 marker_1 = map_widget.set_marker(rdata[0], data[1], text="52.55, 13.4")

# or

 marker_1 = map_widget.set_marker(*rdata, text="52.55, 13.4")  # split the tuple into arguments with * operator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants