Placemark.scope is computed by parsing the feature identifier, but this means a placemark can have only one scope. In fact, a Geocoding API result can have multiple scopes, but the remaining scopes are encoded in the place_type property.
|
@objc open var scope: PlacemarkScope { |
|
let components = identifier.components(separatedBy: ".") |
|
assert(components.count > 0) |
|
return PlacemarkScope(descriptions: [components.prefix(2).joined(separator: ".")]) ?? PlacemarkScope(descriptions: [components.first!]) ?? [] |
|
} |
/ref mapbox/mapbox-java#512
/cc @frederoni @samfader