34class LocationWindowMapObjectsExample {
35 LocationWindow? _locationWindow;
36 CircleMapObject? _circleMapObject;
37 IconMapObject? _iconMapObject;
38 PolygonMapObject? _polygonMapObject;
39 PolylineMapObject? _polylineMapObject;
40 DottedPolylineMapObject? _dottedPolylineMapObject;
42 LocationWindowMapObjectsExample() {
43 _demonstrateLocationWindowMapObjectsMethods();
49 void _demonstrateLocationWindowMapObjectsMethods() {
50 print(
"=== LocationWindowMapObjects Example ===");
52 _demonstrateCircleMapObjects();
53 _demonstrateIconMapObjects();
54 _demonstratePolygonMapObjects();
55 _demonstratePolylineMapObjects();
56 _demonstrateDottedPolylineMapObjects();
57 _demonstrateRemoveAllMapObjects();
64 void _demonstrateCircleMapObjects() {
65 print(
"--- Circle Map Objects ---");
67 if (_locationWindow ==
null) {
68 print(
"LocationWindow not available yet");
74 LocationPoint center = LocationPoint(10.0, 20.0);
75 _circleMapObject = _locationWindow!.addCircleMapObject();
77 "Created circle map object with center (${center.x}, ${center.y}) and radius 5.0",
83 LocationPoint circleCenter = _circleMapObject!.getPosition();
84 print(
"Circle center: (${circleCenter.x}, ${circleCenter.y})");
89 double radius = _circleMapObject!.getRadius();
90 print(
"Circle radius: $radius");
95 _circleMapObject = _locationWindow!.addCircleMapObject();
96 print(
"Added circle map object");
99 if (_circleMapObject !=
null) {
102 LocationPoint centerPoint = LocationPoint(100.0, 200.0);
103 bool success = _circleMapObject!.setPosition(centerPoint);
105 "Set circle position to (${centerPoint.x}, ${centerPoint.y}): $success",
111 LocationPoint animatedPoint = LocationPoint(150.0, 250.0);
112 bool animatedSuccess = _circleMapObject!.setPositionAnimated(
115 AnimationType.LINEAR,
118 "Set circle position with animation to (${animatedPoint.x}, ${animatedPoint.y}): $animatedSuccess",
124 bool offsetSuccess = _circleMapObject!.setOffset(2.0, 3.0);
125 print(
"Set position offset to (2.0, 3.0) pixels: $offsetSuccess");
130 bool outlineColorSuccess = _circleMapObject!.setOutlineColor(
136 print(
"Set circle outline color to blue: $outlineColorSuccess");
141 bool outlineAlphaSuccess = _circleMapObject!.setOutlineAlpha(0.5);
142 print(
"Set circle outline alpha to 0.5: $outlineAlphaSuccess");
147 bool outlineRadiusSuccess = _circleMapObject!.setOutlineRadius(2.0);
148 print(
"Set circle outline radius to 2.0: $outlineRadiusSuccess");
153 bool colorSuccess = _circleMapObject!.setColor(1.0, 0.0, 0.0, 0.8);
154 print(
"Set circle color to red with 80% opacity: $colorSuccess");
159 bool radiusSuccess = _circleMapObject!.setRadius(10.0);
160 print(
"Set circle radius to 10.0 meters: $radiusSuccess");
165 bool collisionSuccess = _circleMapObject!.setCollisionEnabled(
true);
166 print(
"Enabled collision detection for circle: $collisionSuccess");
171 bool bufferSuccess = _circleMapObject!.setBuffer(5.0, 5.0);
172 print(
"Set collision buffer to 5x5 pixels: $bufferSuccess");
177 bool prioritySuccess = _circleMapObject!.setPriority(1);
178 print(
"Set rendering priority to 1: $prioritySuccess");
183 bool visibleSuccess = _circleMapObject!.setVisible(
true);
184 print(
"Set circle visibility to true: $visibleSuccess");
189 MapObjectType objectType = _circleMapObject!.mapObjectType;
190 print(
"Circle map object type: $objectType");
195 bool alphaSuccess = _circleMapObject!.setAlpha(0.7);
196 print(
"Set circle alpha to 0.7: $alphaSuccess");
201 bool interactiveSuccess = _circleMapObject!.setInteractive(
true);
202 print(
"Set circle interactive to true: $interactiveSuccess");
207 bool titleSuccess = _circleMapObject!.setTitle(
"Circle Object");
208 print(
"Set circle title to 'Circle Object': $titleSuccess");
213 Map<String, dynamic> customData = {
"key":
"value",
"number": 42};
214 bool dataSuccess = _circleMapObject!.setData(customData);
215 print(
"Set circle custom data: $dataSuccess");
220 int objectId = _circleMapObject!.id;
221 print(
"Circle object ID: $objectId");
226 String objectTypeString = _circleMapObject!.type;
227 print(
"Circle object type: $objectTypeString");
232 Map<String, dynamic> retrievedData = _circleMapObject!.data;
233 print(
"Circle custom data: $retrievedData");
239 if (_circleMapObject !=
null) {
240 bool removed = _locationWindow!.removeCircleMapObject(_circleMapObject!);
241 print(
"Removed circle map object: $removed");
242 _circleMapObject =
null;
247 List<CircleMapObject> circles = [];
248 for (
int i = 0; i < 3; i++) {
249 CircleMapObject circle = _locationWindow!.addCircleMapObject();
250 if (circle !=
null) {
251 circle.setPosition(LocationPoint(50.0 * i, 100.0 * i));
252 circle.setColor(0.0, 1.0, 0.0, 0.6);
253 circle.setRadius(5.0 + i * 2.0);
256 "Created circle $i at (${50.0 * i}, ${100.0 * i}) with radius ${5.0 + i * 2.0}",
261 for (
int i = 0; i < circles.length; i++) {
262 _locationWindow!.removeCircleMapObject(circles[i]);
263 print(
"Removed circle $i");
270 void _demonstrateIconMapObjects() {
271 print(
"--- Icon Map Objects ---");
273 if (_locationWindow ==
null) {
274 print(
"LocationWindow not available yet");
280 LocationPoint position = LocationPoint(30.0, 40.0);
281 _iconMapObject = _locationWindow!.addIconMapObject();
282 print(
"Created icon map object at (${position.x}, ${position.y})");
287 LocationPoint iconPosition = _iconMapObject!.getPosition();
288 print(
"Icon position: (${iconPosition.x}, ${iconPosition.y})");
293 _iconMapObject = _locationWindow!.addIconMapObject();
294 print(
"Added icon map object");
297 if (_iconMapObject !=
null) {
300 LocationPoint iconPoint = LocationPoint(200.0, 300.0);
301 bool success = _iconMapObject!.setPosition(iconPoint);
302 print(
"Set icon position to (${iconPoint.x}, ${iconPoint.y}): $success");
307 LocationPoint animatedIconPoint = LocationPoint(250.0, 350.0);
308 bool animatedSuccess = _iconMapObject!.setPositionAnimated(
314 "Set icon position with animation to (${animatedIconPoint.x}, ${animatedIconPoint.y}): $animatedSuccess",
320 bool sizeSuccess = _iconMapObject!.setSize(32.0, 32.0);
321 print(
"Set icon size to 32x32 pixels: $sizeSuccess");
326 bool angleSuccess = _iconMapObject!.setAngle(45.0);
327 print(
"Set icon rotation angle to 45 degrees: $angleSuccess");
332 bool angleAnimatedSuccess = _iconMapObject!.setAngleAnimated(
338 "Set icon rotation with animation to 90 degrees: $angleAnimatedSuccess",
344 bool collisionSuccess = _iconMapObject!.setCollisionEnabled(
true);
345 print(
"Enabled collision detection for icon: $collisionSuccess");
350 bool bufferSuccess = _iconMapObject!.setBuffer(10.0, 10.0);
351 print(
"Set collision buffer to 10x10 pixels: $bufferSuccess");
356 bool offsetSuccess = _iconMapObject!.setOffset(0.0, -16.0);
357 print(
"Set position offset to (0.0, -16.0) pixels: $offsetSuccess");
362 bool prioritySuccess = _iconMapObject!.setPriority(2);
363 print(
"Set rendering priority to 2: $prioritySuccess");
368 bool visibleSuccess = _iconMapObject!.setVisible(
true);
369 print(
"Set icon visibility to true: $visibleSuccess");
374 MapObjectType objectType = _iconMapObject!.mapObjectType;
375 print(
"Icon map object type: $objectType");
380 bool iconSuccess = _iconMapObject!.setIcon(
"path/to/icon.png");
381 print(
"Set icon image: $iconSuccess");
386 bool bitmapSuccess = _iconMapObject!.setBitmap(
"path/to/bitmap.png");
387 print(
"Set icon bitmap: $bitmapSuccess");
392 bool flatSuccess = _iconMapObject!.setFlat(
true);
393 print(
"Set icon flat mode to true: $flatSuccess");
398 bool placementSuccess = _iconMapObject!.setPlacement(Placement.center);
399 print(
"Set icon placement to center: $placementSuccess");
404 bool alphaSuccess = _iconMapObject!.setAlpha(0.7);
405 print(
"Set icon alpha to 0.7: $alphaSuccess");
410 bool interactiveSuccess = _iconMapObject!.setInteractive(
true);
411 print(
"Set icon interactive to true: $interactiveSuccess");
416 bool titleSuccess = _iconMapObject!.setTitle(
"Icon Object");
417 print(
"Set icon title to 'Icon Object': $titleSuccess");
422 Map<String, dynamic> customData = {
"key":
"value",
"number": 42};
423 bool dataSuccess = _iconMapObject!.setData(customData);
424 print(
"Set icon custom data: $dataSuccess");
429 int objectId = _iconMapObject!.id;
430 print(
"Icon object ID: $objectId");
435 String objectTypeString = _iconMapObject!.type;
436 print(
"Icon object type: $objectTypeString");
441 Map<String, dynamic> retrievedData = _iconMapObject!.data;
442 print(
"Icon custom data: $retrievedData");
448 if (_iconMapObject !=
null) {
449 bool removed = _locationWindow!.removeIconMapObject(_iconMapObject!);
450 print(
"Removed icon map object: $removed");
451 _iconMapObject =
null;
456 List<IconMapObject> icons = [];
457 for (
int i = 0; i < 3; i++) {
458 IconMapObject icon = _locationWindow!.addIconMapObject();
460 icon.setPosition(LocationPoint(100.0 * i, 150.0 * i));
461 icon.setSize(24.0, 24.0);
462 icon.setAngle(i * 30.0);
465 "Created icon $i at (${100.0 * i}, ${150.0 * i}) with angle ${i * 30.0}",
470 for (
int i = 0; i < icons.length; i++) {
471 _locationWindow!.removeIconMapObject(icons[i]);
472 print(
"Removed icon $i");
479 void _demonstratePolygonMapObjects() {
480 print(
"--- Polygon Map Objects ---");
482 if (_locationWindow ==
null) {
483 print(
"LocationWindow not available yet");
489 _polygonMapObject = _locationWindow!.addPolygonMapObject();
490 print(
"Added polygon map object");
493 if (_polygonMapObject !=
null) {
496 List<LocationPoint> points = [
497 LocationPoint(100.0, 200.0),
498 LocationPoint(150.0, 250.0),
499 LocationPoint(200.0, 200.0),
500 LocationPoint(150.0, 150.0),
502 LocationPolygon polygon = LocationPolygon(points);
503 bool success = _polygonMapObject!.setPolygon(polygon);
504 print(
"Set polygon with ${points.length} points: $success");
509 bool colorSuccess = _polygonMapObject!.setColor(0.0, 1.0, 0.0, 0.7);
510 print(
"Set polygon color to green with 70% opacity: $colorSuccess");
515 bool outlineColorSuccess = _polygonMapObject!.setOutlineColor(
521 print(
"Set polygon outline color to blue: $outlineColorSuccess");
526 bool outlineWidthSuccess = _polygonMapObject!.setOutlineWidth(2.0);
527 print(
"Set polygon outline width to 2.0 pixels: $outlineWidthSuccess");
532 bool outlineAlphaSuccess = _polygonMapObject!.setOutlineAlpha(0.8);
533 print(
"Set polygon outline alpha to 0.8: $outlineAlphaSuccess");
538 bool outlineOrderSuccess = _polygonMapObject!.setOutlineOrder(1);
539 print(
"Set polygon outline order to 1: $outlineOrderSuccess");
544 bool orderSuccess = _polygonMapObject!.setOrder(2);
545 print(
"Set polygon rendering order to 2: $orderSuccess");
550 bool visibleSuccess = _polygonMapObject!.setVisible(
true);
551 print(
"Set polygon visibility to true: $visibleSuccess");
556 MapObjectType objectType = _polygonMapObject!.mapObjectType;
557 print(
"Polygon map object type: $objectType");
562 bool alphaSuccess = _polygonMapObject!.setAlpha(0.7);
563 print(
"Set polygon alpha to 0.7: $alphaSuccess");
568 bool interactiveSuccess = _polygonMapObject!.setInteractive(
true);
569 print(
"Set polygon interactive to true: $interactiveSuccess");
574 bool titleSuccess = _polygonMapObject!.setTitle(
"Polygon Object");
575 print(
"Set polygon title to 'Polygon Object': $titleSuccess");
580 Map<String, dynamic> customData = {
"key":
"value",
"number": 42};
581 bool dataSuccess = _polygonMapObject!.setData(customData);
582 print(
"Set polygon custom data: $dataSuccess");
587 int objectId = _polygonMapObject!.id;
588 print(
"Polygon object ID: $objectId");
593 String objectTypeString = _polygonMapObject!.type;
594 print(
"Polygon object type: $objectTypeString");
599 Map<String, dynamic> retrievedData = _polygonMapObject!.data;
600 print(
"Polygon custom data: $retrievedData");
606 if (_polygonMapObject !=
null) {
607 bool removed = _locationWindow!.removePolygonMapObject(
610 print(
"Removed polygon map object: $removed");
611 _polygonMapObject =
null;
616 List<PolygonMapObject> polygons = [];
617 for (
int i = 0; i < 3; i++) {
618 PolygonMapObject polygon = _locationWindow!.addPolygonMapObject();
619 if (polygon !=
null) {
620 List<LocationPoint> points = [
621 LocationPoint(300.0 + i * 50, 400.0 + i * 50),
622 LocationPoint(350.0 + i * 50, 450.0 + i * 50),
623 LocationPoint(400.0 + i * 50, 400.0 + i * 50),
624 LocationPoint(350.0 + i * 50, 350.0 + i * 50),
626 LocationPolygon polygonGeometry = LocationPolygon(points);
627 polygon.setPolygon(polygonGeometry);
628 polygon.setColor(0.0, 0.0, 1.0, 0.5);
629 polygons.add(polygon);
630 print(
"Created polygon $i with ${points.length} points");
634 for (
int i = 0; i < polygons.length; i++) {
635 _locationWindow!.removePolygonMapObject(polygons[i]);
636 print(
"Removed polygon $i");
643 void _demonstratePolylineMapObjects() {
644 print(
"--- Polyline Map Objects ---");
646 if (_locationWindow ==
null) {
647 print(
"LocationWindow not available yet");
653 List<Point> points = [
659 Polyline polyline = Polyline(points);
660 LocationPolyline locationPolyline = LocationPolyline(polyline);
661 _polylineMapObject = _locationWindow!.addPolylineMapObject();
662 print(
"Created polyline map object with ${points.length} points");
667 LocationPolyline polylineShape = _polylineMapObject!.getPolyLine();
668 print(
"Polyline has ${polylineShape.points.length} points");
673 _polylineMapObject = _locationWindow!.addPolylineMapObject();
674 print(
"Added polyline map object");
677 if (_polylineMapObject !=
null) {
680 List<Point> polylinePoints = [
686 Polyline polyline = Polyline(polylinePoints);
687 LocationPolyline locationPolyline = LocationPolyline(polyline);
688 bool success = _polylineMapObject!.setPolyLine(locationPolyline);
689 print(
"Set polyline geometry: $success");
694 bool widthSuccess = _polylineMapObject!.setWidth(3.0);
695 print(
"Set polyline width to 3.0 pixels: $widthSuccess");
700 bool colorSuccess = _polylineMapObject!.setColor(1.0, 0.5, 0.0, 0.9);
701 print(
"Set polyline color to orange with 90% opacity: $colorSuccess");
706 bool orderSuccess = _polylineMapObject!.setOrder(2);
707 print(
"Set rendering order to 2: $orderSuccess");
712 bool capSuccess = _polylineMapObject!.setCapType(CapType.ROUND);
713 print(
"Set cap type to ROUND: $capSuccess");
718 bool joinSuccess = _polylineMapObject!.setJoinType(JoinType.ROUND);
719 print(
"Set join type to ROUND: $joinSuccess");
724 bool miterSuccess = _polylineMapObject!.setMiterLimit(5.0);
725 print(
"Set miter limit to 5.0: $miterSuccess");
730 bool outlineWidthSuccess = _polylineMapObject!.setOutlineWidth(1.0);
731 print(
"Set polyline outline width to 1.0: $outlineWidthSuccess");
736 bool outlineColorSuccess = _polylineMapObject!.setOutlineColor(
742 print(
"Set polyline outline color to black: $outlineColorSuccess");
747 bool outlineAlphaSuccess = _polylineMapObject!.setOutlineAlpha(0.8);
748 print(
"Set polyline outline alpha to 0.8: $outlineAlphaSuccess");
753 bool outlineOrderSuccess = _polylineMapObject!.setOutlineOrder(1);
754 print(
"Set polyline outline order to 1: $outlineOrderSuccess");
759 bool outlineCapSuccess = _polylineMapObject!.setOutlineCapType(
762 print(
"Set polyline outline cap type to ROUND: $outlineCapSuccess");
767 bool outlineJoinSuccess = _polylineMapObject!.setOutlineJoinType(
770 print(
"Set polyline outline join type to ROUND: $outlineJoinSuccess");
775 bool outlineMiterSuccess = _polylineMapObject!.setOutlineMiterLimit(3.0);
776 print(
"Set polyline outline miter limit to 3.0: $outlineMiterSuccess");
781 bool visibleSuccess = _polylineMapObject!.setVisible(
true);
782 print(
"Set polyline visibility to true: $visibleSuccess");
787 MapObjectType objectType = _polylineMapObject!.mapObjectType;
788 print(
"Polyline map object type: $objectType");
793 bool alphaSuccess = _polylineMapObject!.setAlpha(0.7);
794 print(
"Set polyline alpha to 0.7: $alphaSuccess");
799 bool interactiveSuccess = _polylineMapObject!.setInteractive(
true);
800 print(
"Set polyline interactive to true: $interactiveSuccess");
805 bool titleSuccess = _polylineMapObject!.setTitle(
"Polyline Object");
806 print(
"Set polyline title to 'Polyline Object': $titleSuccess");
811 Map<String, dynamic> customData = {
"key":
"value",
"number": 42};
812 bool dataSuccess = _polylineMapObject!.setData(customData);
813 print(
"Set polyline custom data: $dataSuccess");
818 int objectId = _polylineMapObject!.id;
819 print(
"Polyline object ID: $objectId");
824 String objectTypeString = _polylineMapObject!.type;
825 print(
"Polyline object type: $objectTypeString");
830 Map<String, dynamic> retrievedData = _polylineMapObject!.data;
831 print(
"Polyline custom data: $retrievedData");
837 if (_polylineMapObject !=
null) {
838 bool removed = _locationWindow!.removePolylineMapObject(
841 print(
"Removed polyline map object: $removed");
842 _polylineMapObject =
null;
847 List<PolylineMapObject> polylines = [];
848 for (
int i = 0; i < 3; i++) {
849 PolylineMapObject polyline = _locationWindow!.addPolylineMapObject();
850 if (polyline !=
null) {
851 List<Point> points = [
852 Point(i * 30.0, i * 30.0),
853 Point((i + 1) * 30.0, (i + 1) * 30.0),
855 Polyline poly = Polyline(points);
856 LocationPolyline locPoly = LocationPolyline(poly);
857 polyline.setPolyLine(locPoly);
858 polyline.setWidth(2.0 + i);
859 polyline.setColor(0.0, 1.0, 1.0, 0.8);
860 polylines.add(polyline);
861 print(
"Created polyline $i with width ${2.0 + i}");
865 for (
int i = 0; i < polylines.length; i++) {
866 _locationWindow!.removePolylineMapObject(polylines[i]);
867 print(
"Removed polyline $i");
874 void _demonstrateDottedPolylineMapObjects() {
875 print(
"--- Dotted Polyline Map Objects ---");
877 if (_locationWindow ==
null) {
878 print(
"LocationWindow not available yet");
884 List<Point> points = [
890 Polyline polyline = Polyline(points);
891 LocationPolyline locationPolyline = LocationPolyline(polyline);
892 _dottedPolylineMapObject = _locationWindow!.addDottedPolylineMapObject();
893 print(
"Created dotted polyline map object with ${points.length} points");
898 LocationPolyline dottedPolylineShape =
899 _dottedPolylineMapObject!.getPolyLine();
900 print(
"Dotted polyline has ${dottedPolylineShape.points.length} points");
905 _dottedPolylineMapObject = _locationWindow!.addDottedPolylineMapObject();
906 print(
"Added dotted polyline map object");
909 if (_dottedPolylineMapObject !=
null) {
912 List<Point> dottedPoints = [
918 Polyline dottedPolyline = Polyline(dottedPoints);
919 LocationPolyline locationDottedPolyline = LocationPolyline(
922 bool success = _dottedPolylineMapObject!.setPolyLine(
923 locationDottedPolyline,
925 print(
"Set dotted polyline geometry: $success");
930 bool widthSuccess = _dottedPolylineMapObject!.setWidth(2.0);
931 print(
"Set dotted polyline width to 2.0 pixels: $widthSuccess");
936 bool colorSuccess = _dottedPolylineMapObject!.setColor(
943 "Set dotted polyline color to purple with 80% opacity: $colorSuccess",
949 bool orderSuccess = _dottedPolylineMapObject!.setOrder(3);
950 print(
"Set rendering order to 3: $orderSuccess");
955 bool collisionSuccess = _dottedPolylineMapObject!.setCollisionEnabled(
959 "Enabled collision detection for dotted polyline: $collisionSuccess",
965 bool placementSuccess = _dottedPolylineMapObject!.setPlacement(
968 print(
"Set dotted polyline placement to center: $placementSuccess");
973 bool minRatioSuccess = _dottedPolylineMapObject!.setPlacementMinRatio(
976 print(
"Set dotted polyline placement min ratio to 0.5: $minRatioSuccess");
981 bool spacingSuccess = _dottedPolylineMapObject!.setPlacementSpacing(10.0);
982 print(
"Set dotted polyline placement spacing to 10.0: $spacingSuccess");
987 bool prioritySuccess = _dottedPolylineMapObject!.setPriority(1);
988 print(
"Set dotted polyline rendering priority to 1: $prioritySuccess");
993 bool repeatDistanceSuccess = _dottedPolylineMapObject!.setRepeatDistance(
997 "Set dotted polyline repeat distance to 20.0: $repeatDistanceSuccess",
1003 bool repeatGroupSuccess = _dottedPolylineMapObject!.setRepeatGroup(1);
1004 print(
"Set dotted polyline repeat group to 1: $repeatGroupSuccess");
1009 bool sizeSuccess = _dottedPolylineMapObject!.setSize(16.0, 16.0);
1010 print(
"Set dotted polyline size to 16x16: $sizeSuccess");
1015 bool visibleSuccess = _dottedPolylineMapObject!.setVisible(
true);
1016 print(
"Set dotted polyline visibility to true: $visibleSuccess");
1021 MapObjectType objectType = _dottedPolylineMapObject!.mapObjectType;
1022 print(
"Dotted polyline map object type: $objectType");
1027 bool alphaSuccess = _dottedPolylineMapObject!.setAlpha(0.7);
1028 print(
"Set dotted polyline alpha to 0.7: $alphaSuccess");
1033 bool interactiveSuccess = _dottedPolylineMapObject!.setInteractive(
true);
1034 print(
"Set dotted polyline interactive to true: $interactiveSuccess");
1039 bool titleSuccess = _dottedPolylineMapObject!.setTitle(
1040 "Dotted Polyline Object",
1043 "Set dotted polyline title to 'Dotted Polyline Object': $titleSuccess",
1049 Map<String, dynamic> customData = {
"key":
"value",
"number": 42};
1050 bool dataSuccess = _dottedPolylineMapObject!.setData(customData);
1051 print(
"Set dotted polyline custom data: $dataSuccess");
1056 int objectId = _dottedPolylineMapObject!.id;
1057 print(
"Dotted polyline object ID: $objectId");
1062 String objectTypeString = _dottedPolylineMapObject!.type;
1063 print(
"Dotted polyline object type: $objectTypeString");
1068 Map<String, dynamic> retrievedData = _dottedPolylineMapObject!.data;
1069 print(
"Dotted polyline custom data: $retrievedData");
1075 if (_dottedPolylineMapObject !=
null) {
1076 bool removed = _locationWindow!.removeDottedPolylineMapObject(
1077 _dottedPolylineMapObject!,
1079 print(
"Removed dotted polyline map object: $removed");
1080 _dottedPolylineMapObject =
null;
1085 List<DottedPolylineMapObject> dottedPolylines = [];
1086 for (
int i = 0; i < 2; i++) {
1087 DottedPolylineMapObject dottedPolyline =
1088 _locationWindow!.addDottedPolylineMapObject();
1089 if (dottedPolyline !=
null) {
1090 List<Point> points = [
1091 Point(i * 40.0, i * 40.0 + 100.0),
1092 Point((i + 1) * 40.0, (i + 1) * 40.0 + 100.0),
1094 Polyline poly = Polyline(points);
1095 LocationPolyline locPoly = LocationPolyline(poly);
1096 dottedPolyline.setPolyLine(locPoly);
1097 dottedPolyline.setWidth(1.5);
1098 dottedPolyline.setColor(1.0, 0.0, 1.0, 0.6);
1099 dottedPolylines.add(dottedPolyline);
1100 print(
"Created dotted polyline $i");
1104 for (
int i = 0; i < dottedPolylines.length; i++) {
1105 _locationWindow!.removeDottedPolylineMapObject(dottedPolylines[i]);
1106 print(
"Removed dotted polyline $i");
1113 void _demonstrateRemoveAllMapObjects() {
1114 print(
"--- Remove All Map Objects ---");
1116 if (_locationWindow ==
null) {
1117 print(
"LocationWindow not available yet");
1122 CircleMapObject circle = _locationWindow!.addCircleMapObject();
1123 IconMapObject icon = _locationWindow!.addIconMapObject();
1124 PolygonMapObject polygon = _locationWindow!.addPolygonMapObject();
1125 PolylineMapObject polyline = _locationWindow!.addPolylineMapObject();
1126 DottedPolylineMapObject dottedPolyline =
1127 _locationWindow!.addDottedPolylineMapObject();
1129 print(
"Created 5 map objects");
1133 _locationWindow!.removeAllMapObjects();
1134 print(
"Removed all map objects");
1142 if (_circleMapObject !=
null) {
1143 _locationWindow?.removeCircleMapObject(_circleMapObject!);
1144 _circleMapObject =
null;
1146 if (_iconMapObject !=
null) {
1147 _locationWindow?.removeIconMapObject(_iconMapObject!);
1148 _iconMapObject =
null;
1150 if (_polygonMapObject !=
null) {
1152 _polygonMapObject =
null;
1154 if (_polylineMapObject !=
null) {
1155 _locationWindow?.removePolylineMapObject(_polylineMapObject!);
1156 _polylineMapObject =
null;
1158 if (_dottedPolylineMapObject !=
null) {
1159 _locationWindow?.removeDottedPolylineMapObject(_dottedPolylineMapObject!);
1160 _dottedPolylineMapObject =
null;
1162 print(
"LocationWindowMapObjects example cleanup completed");