TkinterMapView icon indicating copy to clipboard operation
TkinterMapView copied to clipboard

marker color will not update until it moves off screen then back on.

Open synaption opened this issue 3 years ago • 2 comments

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.

synaption avatar Oct 27 '22 03:10 synaption

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)

synaption avatar Oct 27 '22 04:10 synaption

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.

TomSchimansky avatar Nov 02 '22 23:11 TomSchimansky