TkinterMapView
TkinterMapView copied to clipboard
marker color will not update until it moves off screen then back on.
I am trying to have a marker change color when I click it. the command looks like this
def click_command(self, marker):
marker.marker_color_circle=self.blue
marker.draw()
print(marker.text)
This does not work until I move the screen so the marker goes out of view, and when it comes back into view it works.
It's a bit of a hack, but if there is a better way to do it, I would like to know.
def click_command(self, marker):
marker.delete()
lat=marker.position[0]
lon=marker.position[1]
self.marker_list.append(self.map_widget.set_marker(lat, lon, marker_color_circle=self.blue))
print(marker.text)
Currently there is no method of doing this, I can just give you a better hack, but I can not guarantee this will work in the future, because maybe the variable names will change:
marker.map_widget.canvas.itemconfigure(marker.big_circle, fill=self.marker_color_circle, outline=self.marker_color_outside)
Maybe I will ad a method to change the colors.