Arbitrary extra metadata, preserved on the connection and passed to the label function.
The first endpoint of the connection, as a Place object or the id of a place the module currently shows.
OptionalidA stable id for this connection, generated if omitted.
The second endpoint of the connection, as a Place object or the id of a place the module currently shows.
A single connection between two places, rendered as a line on the map.
Remarks
You can give each endpoint as a full Place object or as the
idof a place the PlacesModule currently shows (viashow()). The module resolves an id against its currently shown places to get the coordinates. It silently skips connections that reference unknown ids.An id resolves each time the connections are drawn, which happens on
showConnections(), a configuration change and a style change.show()andclear()drop every connection, so none outlives the places it referred to, and none comes back when those places are shown again.The connection keeps any extra properties and passes them to the optional label function, so you can render metadata such as distance or travel time along the line.
Example