I'm using a map with markers that when you hover over/click it sends parameters to
a popup view about that site including a path to the JSON data. The problem is, it displays the sites info correctly the first time you hover over it... however if you go back to the marker, it displays the last markers info... so essentially the tags associated with the view only ever change when a new marker is hovered over. If I completely close out of the window (not refresh) then it will reset. Here's the part I don't get... the variables are changing each time a different marker is hovered over, but not the tags which I just write the variable to right after... for example I have this code
#set path to TagPath parameter path = self.view.params.TagPath #read JSON data at passed in tagPath JSON = system.tag.readBlocking(path).value #convert JSON data to dictionary obj = system.util.jsonDecode(JSON) #Grab all the different important weather stats and store them in variables currTemp = obj['current_weather']['temperature'] # This variable works system.tag.writeBlocking(["[default]Current_Weather/Current_Temperature"],[currTemp]) # this doesn't work except the very first time for each marker
I return the value "currTemp" to a label, and it displays the right value even when going back and forward between two markers which is what I want... however, the tag "Current_Temperature" which I right to right after assigning "currTemp" doesn't change unless its a new marker thats never been hovered over. Essentially "currTemp" variable changes correctly, but writing that value to a tag immediately after the variable is assigned only works once.
It's as if the writeBlocking isn't getting called except once, but how can that be when its 100% true that the line above it does get called every time a marker is hovered over not just a new one.
Any help is greatly appreciated!