geographicArea property
Retrieves the geographic area that represents the landmark's spatial extent.
The returned GeographicArea can be a rectangle, circle, or polygon depending on the landmark data. The centroid is available via coordinates.
Returns
- GeographicArea: The landmark's full geographic area.
Implementation
GeographicArea get geographicArea {
final OperationResult resultString = objectMethod(
pointerId,
'Landmark',
'getGeographicArea',
);
switch (GeographicAreaTypeExtension.fromId(
resultString['result']['type'],
)) {
case GeographicAreaType.rectangle:
return RectangleGeographicArea.fromJson(resultString['result']);
case GeographicAreaType.circle:
return CircleGeographicArea.fromJson(resultString['result']);
case GeographicAreaType.polygon:
return PolygonGeographicArea.fromJson(resultString['result']);
case GeographicAreaType.tileCollection:
return RectangleGeographicArea.fromJson(resultString['result']);
case GeographicAreaType.undefined:
return RectangleGeographicArea.fromJson(resultString['result']);
}
}
Sets the geographic area that defines this landmark's extent.
Use a RectangleGeographicArea, CircleGeographicArea or PolygonGeographicArea as appropriate.
Parameters
area: The GeographicArea instance describing the landmark boundary.
Implementation
set geographicArea(final GeographicArea area) {
final Map<String, dynamic> serializedGeographicArea = area.toJson();
serializedGeographicArea['type'] = area.type.id;
objectMethod(
pointerId,
'Landmark',
'setGeographicArea',
args: serializedGeographicArea,
);
}