I am getting multiple polygons from a GeoJson URL and would like to change the properties of the polygons.
I would like to change the transparency the color, and the infobox title and description. I however do not know how to do this, or if it's even possible.
@SteveJG
Hello, thanks for the quick response! I was successful in loading the Json onto the map and changing the color of all the polygons, but I want to change the color based on the outlook. In the provided Json, there is a part that says "'OUTLOOK': 'MARGINAL (AT LEAST 5%)'". Is there any way to do an If statement based on this?
Yes. Extract the json Outlook and based on NOOA keywords associated with the particular polygon, then color the polygon appropriately. There is probably one Outlook keyword associated with any polygon This is a bit more difficult. If keyword is xxxx then Polygon1.FillColor = green might do it.
for the 1st polygon, it is one of these:
"type": "Feature", "properties": {"dn": 1, "PRODUCT": "Day 1 Excessive Rainfall Potential Forecast", "VALID_TIME": "22Z 09/21/22 - 12Z 09/22/22", "START_TIME": "2022-09-21 22:19:00", "OUTLOOK": "Marginal (At Least 5%)", "Snippet": "22Z 09/21/22 - 12Z 09/22/22", "ISSUE_TIME": "2022-09-21 22:19:00", "END_TIME": "2022-09-22 12:00:00"}},
Hello, I may have been confusing with my words earlier, when I said "I changed the color of all the polygons", I meant that I could only change all of them to 1 color, not the color individually.
You can do this in the Designer by setting the Polygon1,2 and 3 each to a color you like or you can do this with Blocks. Here is an example changing only Polygon1 to light blue.
The polygons in a FeatureCollection might be named or might not. If the json names them (possibly this bit {"dn": 1, "PRO...) you know which polygon are named as you see them in the FeatureCollection1.Polygon1, Polygon2, and Polygon3. I think the number assigned is the order they occur in the json. Good question; I am not sure how you know which is which polygon associated with the key words other than by parsing the json. The first set of weather data in this case is that associated with the first set of polygon coordinates.
I would have to think about how you could determine which data set belongs with each polygon ahead of time and how you could know how many polygons are rendered.
I loaded the json as a file. When it loads, the json polygon parameters display so I know there are three polygons in this example json Feature-Collection.