I don't want to add a new marker for every new site that comes online. So I reference each site in this loop and try to generate the JSON for the marker. The map throws a "t.map is not a function" error and all the JSON is out of order. I tried lots of methods and searching online but couldn't find any guides for a property like "marker" that has variable length (or I would have just used the expression binding).
Here's the reference of what a regular marker looks like I'm aware some of my properties might not be done properly like the colors or "null" not sure if that causes the issue...
I would start troubleshooting by just limiting your loop to a single marker for now to see if it's just a marker later in the loop causing issues, or if it will work with just 1. If it works with just 1, then increase your loop in increments until it gets the error as there may be one location that's breaking the entire component.
This is the error I'm not getting after reducing it to one marker. I have no idea how to change it from a object to an array using just ignitions scripting?
UPDATE:
Used this post
to make a list and append to it the dictionary and now I'm closer I think but I get a "Cannot read properties of undefined (reading 'content')"
Yea I tried that and still getting the "cannot read contents error in the post above", I think I need to write the actual dicitonary different somehow.
You don't want to return a dictionary, you want to return a list of markers (which are dictionaries)
not sure what line you're declaring newDict but I think you're declaring it as newDict = {}
I would change it to newList = []
Then on line 34, change that newDict[str(count)] = <your marker dictionary> to newList.append(<your marker dictionary>)
Trying these rn I'll edit this when I'm done. Thanks! @michael.flagler@Matthew.gaitan
Thanks so much the map isn't showing an error but the marker isn't showing up still sadly.
Got the marker to show up by changing the 'null' fields to actual values as I'm not sure how to put an actual null value in. The marker shows up way at the wrong place however, its suppose dto be in texas, I know its the right coordinates bc i use the same values for the map default center and thats right. It does move when i change the lat and long in the code however its way off from where that actually is.