Thanks I did get it to work with LineString. My GEOJson had to be dynamic. So I came up with using a variable as a template and then substituting the properties.. In addition, I had a requirement to put a Label 1/2 way between the points.
Set(GeoLineTemplate,"{
""type"": ""Feature"",
""properties"": {
""_azureMapsShapeId"": ""THEGUID"",
""selected"": true
},
""id"": ""THEGUID"",
""geometry"": {
""type"": ""LineString"",
""coordinates"": [
[
POINTA_LONG,
POINTA_LAT
],
[
POINTB_LONG,
POINTB_LAT ]
]
}
ForAll(data As LD,
Collect(JSONTable,
{
Label: LD.Label,
Shape_Name: ".",
Shape_GeoJSON:
Substitute(
Substitute(
Substitute(
Substitute(
Substitute(GeoLineTemplate, "POINTA_LONG", LD.Longitude),
"POINTA_LAT", LD.Latitude
),
"POINTB_LONG", LD.EndLongitude
),
"POINTB_LAT", LD.EndLatitude
),
"THEGUID", GUID()
)
}); // end of collect()
Collect(JSONTable,
{
Label: LD.Label,
Shape_Name: LD.Distance &"' " & LookUp(localCollection, ID=LD.id).Title,
Shape_GeoJSON:
Substitute(
Substitute(
Substitute(
Substitute(
Substitute(GeoLineTemplate, "POINTA_LONG", (LD.Longitude+LD.EndLongitude)/2),
"POINTA_LAT", (LD.Latitude+LD.EndLatitude)/2
),
"POINTB_LONG", (LD.Longitude+LD.Longitude)/2
),
"POINTB_LAT", (LD.Latitude+LD.Latitude)/2
),
"THEGUID", GUID()
)
});//end of collect
); // end of ForAll