Loading...
Searching...
No Matches
PolygonMapObject Class Referenceabstract

Represents a polygon object on the location view. More...

+ Inheritance diagram for PolygonMapObject:

Public Member Functions

bool setPolygon (LocationPolygon polygon)
 Method is used to specify the source polygon of the object.
 
bool setColor (double red, double green, double blue, double alpha)
 Method is used to specify the color of the object.
 
bool setOrder (int order)
 Method is used to specify the rendering order of the object.
 
int getId ()
 Gets the unique identifier of the map object.
 
MapObjectType getType ()
 Gets the type of the map object.
 
Uint8List getData ()
 Gets the user-defined data associated with the map object.
 
bool setVisible (bool visible)
 Method is used to specify the visibility of the map object.
 
bool setInteractive (bool interactive)
 Method is used to specify whether the map object can be interacted with.
 
void setData (Uint8List data)
 Method is used to set user-defined data for the map object.
 
bool setTitle (String title)
 Method is used to set the title of the map object.
 
bool setAlpha (double alpha)
 Method is used to set the opacity of the map object.
 

Detailed Description

Represents a polygon object on the location view.

Referenced from LocationWindow.

Definition at line 24 of file polygon_map_object.dart.

Member Function Documentation

◆ getData()

Uint8List MapObject.getData ( )
inherited

Gets the user-defined data associated with the map object.

Returns
The data stored in the map object.

Dart code snippet:

// Get custom data
Map<String, dynamic> retrievedData = _circleMapObject!.data;
print("Circle custom data: $retrievedData");

◆ getId()

int MapObject.getId ( )
inherited

Gets the unique identifier of the map object.

Returns
The unique identifier of the map object.

Dart code snippet:

// Get object ID
int objectId = _circleMapObject!.id;
print("Circle object ID: $objectId");

◆ getType()

MapObjectType MapObject.getType ( )
inherited

Gets the type of the map object.

Returns
The type of the map object MapObjectType.

Dart code snippet:

// Get object type
String objectTypeString = _circleMapObject!.type;
print("Circle object type: $objectTypeString");

◆ setAlpha()

bool MapObject.setAlpha ( double alpha)
inherited

Method is used to set the opacity of the map object.

Parameters
alphaOpacity multiplier. Values below 0 will be set to 0. Values above 1 will be set to 1. Default: 1.
Returns
true if the operation is successful, false otherwise.

Dart code snippet:

// Set alpha transparency
bool alphaSuccess = _circleMapObject!.setAlpha(0.7);
print("Set circle alpha to 0.7: $alphaSuccess");

◆ setColor()

bool PolygonMapObject.setColor ( double red,
double green,
double blue,
double alpha )

Method is used to specify the color of the object.

Parameters
redRed RGBA component.
greenGreen RGBA component.
blueBlue RGBA component.
alphaOpacity multiplier. Values below 0 will be set to 0. Default: 1.
Returns
true if success, false otherwise.

Dart code snippet:

// Set polygon color
bool colorSuccess = _polygonMapObject!.setColor(0.0, 1.0, 0.0, 0.7);
print("Set polygon color to green with 70% opacity: $colorSuccess");

◆ setData()

void MapObject.setData ( Uint8List data)
inherited

Method is used to set user-defined data for the map object.

Parameters
dataData to store in the map object.

Dart code snippet:

// Set custom data
Map<String, dynamic> customData = {"key": "value", "number": 42};
bool dataSuccess = _circleMapObject!.setData(customData);
print("Set circle custom data: $dataSuccess");

◆ setInteractive()

bool MapObject.setInteractive ( bool interactive)
inherited

Method is used to specify whether the map object can be interacted with.

Parameters
interactiveSpecifies whether the object can be picked in the pickMapObjectAt method (true) or not (false). Default: false.
Returns
true if the operation is successful, false otherwise.

Dart code snippet:

// Set interactive mode
bool interactiveSuccess = _circleMapObject!.setInteractive(true);
print("Set circle interactive to true: $interactiveSuccess");

◆ setOrder()

bool PolygonMapObject.setOrder ( int order)

Method is used to specify the rendering order of the object.

Parameters
orderThe rendering order value. Default: 0.
Returns
true if success, false otherwise.

Dart code snippet:

// Set polygon rendering order
bool orderSuccess = _polygonMapObject!.setOrder(2);
print("Set polygon rendering order to 2: $orderSuccess");

◆ setPolygon()

bool PolygonMapObject.setPolygon ( LocationPolygon polygon)

Method is used to specify the source polygon of the object.

Parameters
polygonMetrics coordinates of the polygon LocationPolygon.
Returns
true if success, false otherwise.

Dart code snippet:

// Set polygon geometry
List<LocationPoint> points = [
LocationPoint(100.0, 200.0),
LocationPoint(150.0, 250.0),
LocationPoint(200.0, 200.0),
LocationPoint(150.0, 150.0),
];
LocationPolygon polygon = LocationPolygon(points);
bool success = _polygonMapObject!.setPolygon(polygon);
print("Set polygon with ${points.length} points: $success");

◆ setTitle()

bool MapObject.setTitle ( String title)
inherited

Method is used to set the title of the map object.

Parameters
titleThe title to display on the location view.
Returns
true if the operation is successful, false otherwise.

Dart code snippet:

// Set title
bool titleSuccess = _circleMapObject!.setTitle("Circle Object");
print("Set circle title to 'Circle Object': $titleSuccess");

◆ setVisible()

bool MapObject.setVisible ( bool visible)
inherited

Method is used to specify the visibility of the map object.

Parameters
visibleSpecifies whether the object is visible (true) or hidden (false). Default: true.
Returns
true if the operation is successful, false otherwise.

Dart code snippet:

// Set visibility
bool visibleSuccess = _circleMapObject!.setVisible(true);
print("Set circle visibility to true: $visibleSuccess");

The documentation for this class was generated from the following file: