Wayholder.fromWay constructor
Wayholder.fromWay(
- Way way
Creates a new wayholder from a existing way. Note that the existing way may NOT contain any path (if created from a OsmRelation)
Implementation
Wayholder.fromWay(Way way) : tags = way.tags {
_inner = way.latLongs.skip(1).map((toElement) => Waypath(path: toElement)).toList();
_closedOuters = [];
_openOuters = [];
if (way.latLongs.isNotEmpty) {
if (LatLongUtils.isClosedWay(way.latLongs[0])) {
_closedOuters.add(Waypath(path: way.latLongs[0]));
} else {
_openOuters.add(Waypath(path: way.latLongs[0]));
}
}
layer = way.layer;
labelPosition = way.labelPosition;
}