Skip to content

Commit 26095f1

Browse files
committed
added some properties to geojson
1 parent 72922d8 commit 26095f1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/helpers/geoJson.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ func NodesToLineString(nodes [][]float64, popupContent int32) []byte {
2222
return rawJson
2323
}
2424

25-
func NodeToPoint(node []float64, idx int32) []byte {
25+
func NodeToPoint(node []float64, index int32) []byte {
2626
fc := geojson.NewFeatureCollection()
2727
feature := geojson.NewPointFeature([]float64{node[1], node[0]})
28-
feature.SetProperty("idx", idx)
28+
popupContent := fmt.Sprintf("Lat: %f\nLong: %f\nIndex: %d", node[0], node[1], index)
29+
feature.SetProperty("popupContent", popupContent)
30+
feature.SetProperty("index", index)
2931
fc.AddFeature(feature)
3032
rawJson, _ := fc.MarshalJSON()
3133
return rawJson

0 commit comments

Comments
 (0)