# Map popup only works initially

**URL:** <https://forum.inductiveautomation.com/t/map-popup-only-works-initially/69846>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [February 14, 2023, 5:57pm UTC](https://forum.inductiveautomation.com/t/map-popup-only-works-initially/69846 "2023-02-14T17:57:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Randolph\_Sewell](https://avatars.discourse-cdn.com/v4/letter/r/cdc98d/32.png) [@Randolph\_Sewell](https://forum.inductiveautomation.com/u/Randolph_Sewell)\
**Post date:** [February 14, 2023, 5:57pm UTC](https://forum.inductiveautomation.com/t/map-popup-only-works-initially/69846/1 "2023-02-14T17:57:42Z")

</div>

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)[0].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!

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [February 14, 2023, 6:33pm UTC](https://forum.inductiveautomation.com/t/map-popup-only-works-initially/69846/2 "2023-02-14T18:33:42Z")

</div>

Are you sure that no write is occurring, or is a write occurring with _the same value_? Verify the params you reference are changing, otherwise it would appear like the write is never occurring because you're seeing the same value as it had the last time you wrote to it. I recommend placing some logging after variable assignment which logs the value of the variable so you can see what the values being used actually are.

---

<div class="post-metadata">

**Author:** ![Randolph\_Sewell](https://avatars.discourse-cdn.com/v4/letter/r/cdc98d/32.png) [@Randolph\_Sewell](https://forum.inductiveautomation.com/u/Randolph_Sewell)\
**Post date:** [February 14, 2023, 6:38pm UTC](https://forum.inductiveautomation.com/t/map-popup-only-works-initially/69846/3 "2023-02-14T18:38:10Z")

</div>

The variable is changing and displaying correctly. It's the tag that I'm writing to in the line after assigning the variable that's value is only changing when a new marker is hovered over.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [February 14, 2023, 6:40pm UTC](https://forum.inductiveautomation.com/t/map-popup-only-works-initially/69846/4 "2023-02-14T18:40:26Z")

</div>

Check the returned quality of the writeBlocking call?  
Did you put any logging after the writeBlocking line to verify your code continues beyond that point?  
Have you checked the Gateway for any logged errors stemming from this script?

---

<div class="post-metadata">

**Author:** ![Randolph\_Sewell](https://avatars.discourse-cdn.com/v4/letter/r/cdc98d/32.png) [@Randolph\_Sewell](https://forum.inductiveautomation.com/u/Randolph_Sewell)\
**Post date:** [February 14, 2023, 6:46pm UTC](https://forum.inductiveautomation.com/t/map-popup-only-works-initially/69846/5 "2023-02-14T18:46:19Z")

</div>

No errors in logs not sure how to check returned quality of writeBlocking call. When teh call works the quality is always good.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [February 14, 2023, 7:03pm UTC](https://forum.inductiveautomation.com/t/map-popup-only-works-initially/69846/6 "2023-02-14T19:03:10Z")

</div>

```auto
system.getLogger("QUALCHECK").info(system.tag.writeBlocking(["[default]Current_Weather/Current_Temperature"],[currTemp])[0].isGood())

```
