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) {
_inner = way.latLongs.skip(1).map((toElement) => Waypath(toElement)).toList();
_closedOuters = [];
_openOuters = [];
if (way.latLongs.isNotEmpty) {
if (LatLongUtils.isClosedWay(way.latLongs[0])) {
_closedOuters.add(Waypath(way.latLongs[0]));
} else {
_openOuters.add(Waypath(way.latLongs[0]));
}
}
tags = way.tags;
layer = way.layer;
labelPosition = way.labelPosition;
}