TomSchimansky / TkinterMapView

A python Tkinter widget to display tile based maps like OpenStreetMap or Google Satellite Images.
Creative Commons Zero v1.0 Universal
596 stars 88 forks source link

Cant change the placement of the map with .pack or .place [question] #66

Open Timsword opened 1 year ago

Timsword commented 1 year ago

Hi everyone,

I need to change the placement of my map on the layout.

So far I tried to change it with .pack(anchor= NW) but it didn't work. There is no change at all when I tried this.

I also tried to use .place(x=20,y=20) But when I tried this, map disappeared from the app.

Am I doing something wrong? Can you help me out please?

from tkinter import *
import tkintermapview

def callGui():

    root = Tk()  # title
    root.title("My app")
    root.geometry('1000x600')  # width/length

    my_label = LabelFrame(root)
    my_label.pack(pady=20)

    map_widget = tkintermapview.TkinterMapView(my_label, width=300,height=200,corner_radius=0)

    #set coordinates
    map_widget.set_position(41.002697, 39.716763)
    #set a zoom level
    map_widget.set_zoom(12)

    map_widget.pack(anchor=NW) #no change
    #map_widget.place(x=20,y=20)  # map disappears

    root.mainloop()