Loading...
Searching...
No Matches
location_window_map_objects_example.dart
Go to the documentation of this file.
1import 'dart:ffi';
2import 'dart:math' as math;
3import 'dart:typed_data';
4import 'package:meta/meta.dart';
5import 'package:navigine_sdk/com/_library_context.dart' as __lib;
6import 'package:navigine_sdk/com/_native_base.dart' as __lib;
7import 'package:navigine_sdk/com/_weak_map.dart';
8import 'package:navigine_sdk/com/builtin_types__conversion.dart';
9import 'package:navigine_sdk/com/navigine/idl/animation_type.dart';
10import 'package:navigine_sdk/com/navigine/idl/cap_type.dart';
11import 'package:navigine_sdk/com/navigine/idl/circle_map_object.dart';
12import 'package:navigine_sdk/com/navigine/idl/dotted_polyline_map_object.dart';
13import 'package:navigine_sdk/com/navigine/idl/icon_map_object.dart';
14import 'package:navigine_sdk/com/navigine/idl/join_type.dart';
15import 'package:navigine_sdk/com/navigine/idl/location_point.dart';
16import 'package:navigine_sdk/com/navigine/sdk/location_polygon.dart';
17import 'package:navigine_sdk/com/navigine/sdk/location_polyline.dart';
18import 'package:navigine_sdk/com/navigine/idl/map_object.dart';
19import 'package:navigine_sdk/com/navigine/idl/map_object_type.dart';
20import 'package:navigine_sdk/com/navigine/idl/placement.dart';
21import 'package:navigine_sdk/com/navigine/idl/point.dart';
22import 'package:navigine_sdk/com/navigine/idl/polygon.dart';
23import 'package:navigine_sdk/com/navigine/idl/polygon_map_object.dart';
24import 'package:navigine_sdk/com/navigine/idl/polyline.dart';
25import 'package:navigine_sdk/com/navigine/idl/polyline_map_object.dart';
26import 'package:navigine_sdk/image_wrapper.dart';
27
34class LocationWindowMapObjectsExample {
41
42 LocationWindowMapObjectsExample() {
43 _demonstrateLocationWindowMapObjectsMethods();
44 }
45
49 void _demonstrateLocationWindowMapObjectsMethods() {
50 print("=== LocationWindowMapObjects Example ===");
51
52 _demonstrateLocationScopedGeometryRecords();
53
54 _demonstrateCircleMapObjects();
55 _demonstrateIconMapObjects();
56 _demonstratePolygonMapObjects();
57 _demonstratePolylineMapObjects();
58 _demonstrateDottedPolylineMapObjects();
59 _demonstrateRemoveAllMapObjects();
60 _cleanup();
61 }
62
66 void _demonstrateLocationScopedGeometryRecords() {
67 print("--- LocationPolygon / LocationPolyline records ---");
68
69 // [dart_LocationPolygon_record]
70 List<Point> ring = [
71 Point(1.0, 2.0),
72 Point(3.0, 4.0),
73 Point(5.0, 2.0),
74 ];
75 Polygon metricPolygon = Polygon(ring);
76 LocationPolygon locationPolygon = LocationPolygon(metricPolygon, 42, 7);
77 Polygon polygonBack = locationPolygon.polygon;
78 print(
79 "LocationPolygon: location ${locationPolygon.locationId} sublocation ${locationPolygon.sublocationId} vertices ${polygonBack.points.length}",
80 );
81 // [dart_LocationPolygon_record]
82
83 // [dart_LocationPolyline_record]
84 List<Point> linePts = [Point(0.0, 0.0), Point(10.0, 10.0)];
85 Polyline metricPolyline = Polyline(linePts);
86 LocationPolyline locationPolyline = LocationPolyline(metricPolyline, 42, 7);
87 Polyline polylineBack = locationPolyline.polyline;
88 print("LocationPolyline points ${polylineBack.points.length}");
89 // [dart_LocationPolyline_record]
90 }
91
95 void _demonstrateCircleMapObjects() {
96 print("--- Circle Map Objects ---");
97
98 if (_locationWindow == null) {
99 print("LocationWindow not available yet");
100 return;
101 }
102
103 // [dart_CircleMapObject_constructor]
104 // Create circle map object
105 LocationPoint center = LocationPoint(10.0, 20.0);
106 _circleMapObject = _locationWindow!.addCircleMapObject();
107 print(
108 "Created circle map object with center (${center.x}, ${center.y}) and radius 5.0",
109 );
110 // [dart_CircleMapObject_constructor]
111
112 // [dart_CircleMapObject_getCenter]
113 // Access circle center
114 LocationPoint circleCenter = _circleMapObject!.getPosition();
115 print("Circle center: (${circleCenter.x}, ${circleCenter.y})");
116 // [dart_CircleMapObject_getCenter]
117
118 // [dart_CircleMapObject_getRadius]
119 // Access circle radius
120 double radius = _circleMapObject!.getRadius();
121 print("Circle radius: $radius");
122 // [dart_CircleMapObject_getRadius]
123
124 // [dart_LocationWindow_addCircleMapObject]
125 // Add circle map object
126 _circleMapObject = _locationWindow!.addCircleMapObject();
127 print("Added circle map object");
128 // [dart_LocationWindow_addCircleMapObject]
129
130 if (_circleMapObject != null) {
131 // [dart_CircleMapObject_setPosition]
132 // Set circle position
133 LocationPoint centerPoint = LocationPoint(100.0, 200.0);
134 bool success = _circleMapObject!.setPosition(centerPoint);
135 print(
136 "Set circle position to (${centerPoint.x}, ${centerPoint.y}): $success",
137 );
138 // [dart_CircleMapObject_setPosition]
139
140 // [dart_CircleMapObject_setPositionAnimated]
141 // Set circle position with animation
142 LocationPoint animatedPoint = LocationPoint(150.0, 250.0);
143 bool animatedSuccess = _circleMapObject!.setPositionAnimated(
144 animatedPoint,
145 2.0,
146 AnimationType.LINEAR,
147 );
148 print(
149 "Set circle position with animation to (${animatedPoint.x}, ${animatedPoint.y}): $animatedSuccess",
150 );
151 // [dart_CircleMapObject_setPositionAnimated]
152
153 // [dart_CircleMapObject_setOffset]
154 // Set position offset
155 bool offsetSuccess = _circleMapObject!.setOffset(2.0, 3.0);
156 print("Set position offset to (2.0, 3.0) pixels: $offsetSuccess");
157 // [dart_CircleMapObject_setOffset]
158
159 // [dart_CircleMapObject_setOutlineColor]
160 // Set outline color
161 bool outlineColorSuccess = _circleMapObject!.setOutlineColor(
162 0.0,
163 0.0,
164 1.0,
165 1.0,
166 );
167 print("Set circle outline color to blue: $outlineColorSuccess");
168 // [dart_CircleMapObject_setOutlineColor]
169
170 // [dart_CircleMapObject_setOutlineAlpha]
171 // Set outline alpha
172 bool outlineAlphaSuccess = _circleMapObject!.setOutlineAlpha(0.5);
173 print("Set circle outline alpha to 0.5: $outlineAlphaSuccess");
174 // [dart_CircleMapObject_setOutlineAlpha]
175
176 // [dart_CircleMapObject_setOutlineRadius]
177 // Set outline radius
178 bool outlineRadiusSuccess = _circleMapObject!.setOutlineRadius(2.0);
179 print("Set circle outline radius to 2.0: $outlineRadiusSuccess");
180 // [dart_CircleMapObject_setOutlineRadius]
181
182 // [dart_CircleMapObject_setColor]
183 // Set circle color
184 bool colorSuccess = _circleMapObject!.setColor(1.0, 0.0, 0.0, 0.8);
185 print("Set circle color to red with 80% opacity: $colorSuccess");
186 // [dart_CircleMapObject_setColor]
187
188 // [dart_CircleMapObject_setRadius]
189 // Set circle radius
190 bool radiusSuccess = _circleMapObject!.setRadius(10.0);
191 print("Set circle radius to 10.0 meters: $radiusSuccess");
192 // [dart_CircleMapObject_setRadius]
193
194 // [dart_CircleMapObject_setCollisionEnabled]
195 // Enable collision detection
196 bool collisionSuccess = _circleMapObject!.setCollisionEnabled(true);
197 print("Enabled collision detection for circle: $collisionSuccess");
198 // [dart_CircleMapObject_setCollisionEnabled]
199
200 // [dart_CircleMapObject_setBuffer]
201 // Set collision buffer
202 bool bufferSuccess = _circleMapObject!.setBuffer(5.0, 5.0);
203 print("Set collision buffer to 5x5 pixels: $bufferSuccess");
204 // [dart_CircleMapObject_setBuffer]
205
206 // [dart_CircleMapObject_setPriority]
207 // Set rendering priority
208 bool prioritySuccess = _circleMapObject!.setPriority(1);
209 print("Set rendering priority to 1: $prioritySuccess");
210 // [dart_CircleMapObject_setPriority]
211
212 // [dart_MapObject_setVisible]
213 // Set visibility
214 bool visibleSuccess = _circleMapObject!.setVisible(true);
215 print("Set circle visibility to true: $visibleSuccess");
216 // [dart_MapObject_setVisible]
217
218 // [dart_CircleMapObject_getMapObjectType]
219 // Get map object type
220 MapObjectType objectType = _circleMapObject!.mapObjectType;
221 print("Circle map object type: $objectType");
222 // [dart_CircleMapObject_getMapObjectType]
223
224 // [dart_MapObject_setAlpha]
225 // Set alpha transparency
226 bool alphaSuccess = _circleMapObject!.setAlpha(0.7);
227 print("Set circle alpha to 0.7: $alphaSuccess");
228 // [dart_MapObject_setAlpha]
229
230 // [dart_MapObject_setInteractive]
231 // Set interactive mode
232 bool interactiveSuccess = _circleMapObject!.setInteractive(true);
233 print("Set circle interactive to true: $interactiveSuccess");
234 // [dart_MapObject_setInteractive]
235
236 // [dart_MapObject_setTitle]
237 // Set title
238 bool titleSuccess = _circleMapObject!.setTitle("Circle Object");
239 print("Set circle title to 'Circle Object': $titleSuccess");
240 // [dart_MapObject_setTitle]
241
242 // [dart_MapObject_setData]
243 // Set custom data
244 Map<String, dynamic> customData = {"key": "value", "number": 42};
245 bool dataSuccess = _circleMapObject!.setData(customData);
246 print("Set circle custom data: $dataSuccess");
247 // [dart_MapObject_setData]
248
249 // [dart_MapObject_getId]
250 // Get object ID
251 int objectId = _circleMapObject!.id;
252 print("Circle object ID: $objectId");
253 // [dart_MapObject_getId]
254
255 // [dart_MapObject_getType]
256 // Get object type
257 String objectTypeString = _circleMapObject!.type;
258 print("Circle object type: $objectTypeString");
259 // [dart_MapObject_getType]
260
261 // [dart_MapObject_getData]
262 // Get custom data
263 Map<String, dynamic> retrievedData = _circleMapObject!.data;
264 print("Circle custom data: $retrievedData");
265 // [dart_MapObject_getData]
266 }
267
268 // [dart_LocationWindow_removeCircleMapObject]
269 // Remove circle map object
270 if (_circleMapObject != null) {
271 bool removed = _locationWindow!.removeCircleMapObject(_circleMapObject!);
272 print("Removed circle map object: $removed");
273 _circleMapObject = null;
274 }
275 // [dart_LocationWindow_removeCircleMapObject]
276
277 // Test multiple circle objects
278 List<CircleMapObject> circles = [];
279 for (int i = 0; i < 3; i++) {
280 CircleMapObject circle = _locationWindow!.addCircleMapObject();
281 if (circle != null) {
282 circle.setPosition(LocationPoint(50.0 * i, 100.0 * i));
283 circle.setColor(0.0, 1.0, 0.0, 0.6);
284 circle.setRadius(5.0 + i * 2.0);
285 circles.add(circle);
286 print(
287 "Created circle $i at (${50.0 * i}, ${100.0 * i}) with radius ${5.0 + i * 2.0}",
288 );
289 }
290 }
291
292 for (int i = 0; i < circles.length; i++) {
293 _locationWindow!.removeCircleMapObject(circles[i]);
294 print("Removed circle $i");
295 }
296 }
297
301 void _demonstrateIconMapObjects() {
302 print("--- Icon Map Objects ---");
303
304 if (_locationWindow == null) {
305 print("LocationWindow not available yet");
306 return;
307 }
308
309 // [dart_IconMapObject_constructor]
310 // Create icon map object
311 LocationPoint position = LocationPoint(30.0, 40.0);
312 _iconMapObject = _locationWindow!.addIconMapObject();
313 print("Created icon map object at (${position.x}, ${position.y})");
314 // [dart_IconMapObject_constructor]
315
316 // [dart_IconMapObject_getPosition]
317 // Access icon position
318 LocationPoint iconPosition = _iconMapObject!.getPosition();
319 print("Icon position: (${iconPosition.x}, ${iconPosition.y})");
320 // [dart_IconMapObject_getPosition]
321
322 // [dart_LocationWindow_addIconMapObject]
323 // Add icon map object
324 _iconMapObject = _locationWindow!.addIconMapObject();
325 print("Added icon map object");
326 // [dart_LocationWindow_addIconMapObject]
327
328 if (_iconMapObject != null) {
329 // [dart_IconMapObject_setPosition]
330 // Set icon position
331 LocationPoint iconPoint = LocationPoint(200.0, 300.0);
332 bool success = _iconMapObject!.setPosition(iconPoint);
333 print("Set icon position to (${iconPoint.x}, ${iconPoint.y}): $success");
334 // [dart_IconMapObject_setPosition]
335
336 // [dart_IconMapObject_setPositionAnimated]
337 // Set icon position with animation
338 LocationPoint animatedIconPoint = LocationPoint(250.0, 350.0);
339 bool animatedSuccess = _iconMapObject!.setPositionAnimated(
340 animatedIconPoint,
341 1.5,
342 AnimationType.CUBIC,
343 );
344 print(
345 "Set icon position with animation to (${animatedIconPoint.x}, ${animatedIconPoint.y}): $animatedSuccess",
346 );
347 // [dart_IconMapObject_setPositionAnimated]
348
349 // [dart_IconMapObject_setSize]
350 // Set icon size
351 bool sizeSuccess = _iconMapObject!.setSize(32.0, 32.0);
352 print("Set icon size to 32x32 pixels: $sizeSuccess");
353 // [dart_IconMapObject_setSize]
354
355 // [dart_IconMapObject_setAngle]
356 // Set icon rotation angle
357 bool angleSuccess = _iconMapObject!.setAngle(45.0);
358 print("Set icon rotation angle to 45 degrees: $angleSuccess");
359 // [dart_IconMapObject_setAngle]
360
361 // [dart_IconMapObject_setAngleAnimated]
362 // Set icon rotation with animation
363 bool angleAnimatedSuccess = _iconMapObject!.setAngleAnimated(
364 90.0,
365 2.0,
366 AnimationType.SINE,
367 );
368 print(
369 "Set icon rotation with animation to 90 degrees: $angleAnimatedSuccess",
370 );
371 // [dart_IconMapObject_setAngleAnimated]
372
373 // [dart_IconMapObject_setCollisionEnabled]
374 // Enable collision detection
375 bool collisionSuccess = _iconMapObject!.setCollisionEnabled(true);
376 print("Enabled collision detection for icon: $collisionSuccess");
377 // [dart_IconMapObject_setCollisionEnabled]
378
379 // [dart_IconMapObject_setBuffer]
380 // Set collision buffer
381 bool bufferSuccess = _iconMapObject!.setBuffer(10.0, 10.0);
382 print("Set collision buffer to 10x10 pixels: $bufferSuccess");
383 // [dart_IconMapObject_setBuffer]
384
385 // [dart_IconMapObject_setOffset]
386 // Set position offset
387 bool offsetSuccess = _iconMapObject!.setOffset(0.0, -16.0);
388 print("Set position offset to (0.0, -16.0) pixels: $offsetSuccess");
389 // [dart_IconMapObject_setOffset]
390
391 // [dart_IconMapObject_setPriority]
392 // Set rendering priority
393 bool prioritySuccess = _iconMapObject!.setPriority(2);
394 print("Set rendering priority to 2: $prioritySuccess");
395 // [dart_IconMapObject_setPriority]
396
397 // [dart_IconMapObject_setVisible]
398 // Set visibility
399 bool visibleSuccess = _iconMapObject!.setVisible(true);
400 print("Set icon visibility to true: $visibleSuccess");
401 // [dart_IconMapObject_setVisible]
402
403 // [dart_IconMapObject_getMapObjectType]
404 // Get map object type
405 MapObjectType objectType = _iconMapObject!.mapObjectType;
406 print("Icon map object type: $objectType");
407 // [dart_IconMapObject_getMapObjectType]
408
409 // [dart_IconMapObject_setIcon]
410 // Set icon image
411 bool iconSuccess = _iconMapObject!.setIcon("path/to/icon.png");
412 print("Set icon image: $iconSuccess");
413 // [dart_IconMapObject_setIcon]
414
415 // [dart_IconMapObject_setBitmap]
416 // Set icon bitmap
417 bool bitmapSuccess = _iconMapObject!.setBitmap("path/to/bitmap.png");
418 print("Set icon bitmap: $bitmapSuccess");
419 // [dart_IconMapObject_setBitmap]
420
421 // [dart_IconMapObject_setFlat]
422 // Set icon flat mode
423 bool flatSuccess = _iconMapObject!.setFlat(true);
424 print("Set icon flat mode to true: $flatSuccess");
425 // [dart_IconMapObject_setFlat]
426
427 // [dart_IconMapObject_setPlacement]
428 // Set icon placement
429 bool placementSuccess = _iconMapObject!.setPlacement(Placement.center);
430 print("Set icon placement to center: $placementSuccess");
431 // [dart_IconMapObject_setPlacement]
432
433 // [dart_MapObject_setAlpha_1]
434 // Set alpha transparency
435 bool alphaSuccess = _iconMapObject!.setAlpha(0.7);
436 print("Set icon alpha to 0.7: $alphaSuccess");
437 // [dart_MapObject_setAlpha_1]
438
439 // [dart_MapObject_setInteractive_1]
440 // Set interactive mode
441 bool interactiveSuccess = _iconMapObject!.setInteractive(true);
442 print("Set icon interactive to true: $interactiveSuccess");
443 // [dart_MapObject_setInteractive_1]
444
445 // [dart_MapObject_setTitle_1]
446 // Set title
447 bool titleSuccess = _iconMapObject!.setTitle("Icon Object");
448 print("Set icon title to 'Icon Object': $titleSuccess");
449 // [dart_MapObject_setTitle_1]
450
451 // [dart_MapObject_setData_1]
452 // Set custom data
453 Map<String, dynamic> customData = {"key": "value", "number": 42};
454 bool dataSuccess = _iconMapObject!.setData(customData);
455 print("Set icon custom data: $dataSuccess");
456 // [dart_MapObject_setData_1]
457
458 // [dart_MapObject_getId_1]
459 // Get object ID
460 int objectId = _iconMapObject!.id;
461 print("Icon object ID: $objectId");
462 // [dart_MapObject_getId_1]
463
464 // [dart_MapObject_getType_1]
465 // Get object type
466 String objectTypeString = _iconMapObject!.type;
467 print("Icon object type: $objectTypeString");
468 // [dart_MapObject_getType_1]
469
470 // [dart_MapObject_getData_1]
471 // Get custom data
472 Map<String, dynamic> retrievedData = _iconMapObject!.data;
473 print("Icon custom data: $retrievedData");
474 // [dart_MapObject_getData_1]
475 }
476
477 // [dart_LocationWindow_removeIconMapObject]
478 // Remove icon map object
479 if (_iconMapObject != null) {
480 bool removed = _locationWindow!.removeIconMapObject(_iconMapObject!);
481 print("Removed icon map object: $removed");
482 _iconMapObject = null;
483 }
484 // [dart_LocationWindow_removeIconMapObject]
485
486 // Test multiple icon objects
487 List<IconMapObject> icons = [];
488 for (int i = 0; i < 3; i++) {
489 IconMapObject icon = _locationWindow!.addIconMapObject();
490 if (icon != null) {
491 icon.setPosition(LocationPoint(100.0 * i, 150.0 * i));
492 icon.setSize(24.0, 24.0);
493 icon.setAngle(i * 30.0);
494 icons.add(icon);
495 print(
496 "Created icon $i at (${100.0 * i}, ${150.0 * i}) with angle ${i * 30.0}",
497 );
498 }
499 }
500
501 for (int i = 0; i < icons.length; i++) {
502 _locationWindow!.removeIconMapObject(icons[i]);
503 print("Removed icon $i");
504 }
505 }
506
510 void _demonstratePolygonMapObjects() {
511 print("--- Polygon Map Objects ---");
512
513 if (_locationWindow == null) {
514 print("LocationWindow not available yet");
515 return;
516 }
517
518 // [dart_LocationWindow_addPolygonMapObject]
519 // Add polygon map object
520 _polygonMapObject = _locationWindow!.addPolygonMapObject();
521 print("Added polygon map object");
522 // [dart_LocationWindow_addPolygonMapObject]
523
524 if (_polygonMapObject != null) {
525 // [dart_PolygonMapObject_setPolygon]
526 // Set polygon geometry
527 List<Point> points = [
528 Point(100.0, 200.0),
529 Point(150.0, 250.0),
530 Point(200.0, 200.0),
531 Point(150.0, 150.0),
532 ];
533 Polygon metricPolygon = Polygon(points);
534 LocationPolygon polygon = LocationPolygon(metricPolygon, 1, 0);
535 bool success = _polygonMapObject!.setPolygon(polygon);
536 print("Set polygon with ${points.length} points: $success");
537 // [dart_PolygonMapObject_setPolygon]
538
539 // [dart_PolygonMapObject_setColor]
540 // Set polygon color
541 bool colorSuccess = _polygonMapObject!.setColor(0.0, 1.0, 0.0, 0.7);
542 print("Set polygon color to green with 70% opacity: $colorSuccess");
543 // [dart_PolygonMapObject_setColor]
544
545 // [dart_PolygonMapObject_setOutlineColor]
546 // Set polygon outline color
547 bool outlineColorSuccess = _polygonMapObject!.setOutlineColor(
548 0.0,
549 0.0,
550 1.0,
551 1.0,
552 );
553 print("Set polygon outline color to blue: $outlineColorSuccess");
554 // [dart_PolygonMapObject_setOutlineColor]
555
556 // [dart_PolygonMapObject_setOutlineWidth]
557 // Set polygon outline width
558 bool outlineWidthSuccess = _polygonMapObject!.setOutlineWidth(2.0);
559 print("Set polygon outline width to 2.0 pixels: $outlineWidthSuccess");
560 // [dart_PolygonMapObject_setOutlineWidth]
561
562 // [dart_PolygonMapObject_setOutlineAlpha]
563 // Set polygon outline alpha
564 bool outlineAlphaSuccess = _polygonMapObject!.setOutlineAlpha(0.8);
565 print("Set polygon outline alpha to 0.8: $outlineAlphaSuccess");
566 // [dart_PolygonMapObject_setOutlineAlpha]
567
568 // [dart_PolygonMapObject_setOutlineOrder]
569 // Set polygon outline order
570 bool outlineOrderSuccess = _polygonMapObject!.setOutlineOrder(1);
571 print("Set polygon outline order to 1: $outlineOrderSuccess");
572 // [dart_PolygonMapObject_setOutlineOrder]
573
574 // [dart_PolygonMapObject_setOrder]
575 // Set polygon rendering order
576 bool orderSuccess = _polygonMapObject!.setOrder(2);
577 print("Set polygon rendering order to 2: $orderSuccess");
578 // [dart_PolygonMapObject_setOrder]
579
580 // [dart_PolygonMapObject_setVisible]
581 // Set visibility
582 bool visibleSuccess = _polygonMapObject!.setVisible(true);
583 print("Set polygon visibility to true: $visibleSuccess");
584 // [dart_PolygonMapObject_setVisible]
585
586 // [dart_PolygonMapObject_getMapObjectType]
587 // Get map object type
588 MapObjectType objectType = _polygonMapObject!.mapObjectType;
589 print("Polygon map object type: $objectType");
590 // [dart_PolygonMapObject_getMapObjectType]
591
592 // [dart_MapObject_setAlpha_2]
593 // Set alpha transparency
594 bool alphaSuccess = _polygonMapObject!.setAlpha(0.7);
595 print("Set polygon alpha to 0.7: $alphaSuccess");
596 // [dart_MapObject_setAlpha_2]
597
598 // [dart_MapObject_setInteractive_2]
599 // Set interactive mode
600 bool interactiveSuccess = _polygonMapObject!.setInteractive(true);
601 print("Set polygon interactive to true: $interactiveSuccess");
602 // [dart_MapObject_setInteractive_2]
603
604 // [dart_MapObject_setTitle_2]
605 // Set title
606 bool titleSuccess = _polygonMapObject!.setTitle("Polygon Object");
607 print("Set polygon title to 'Polygon Object': $titleSuccess");
608 // [dart_MapObject_setTitle_2]
609
610 // [dart_MapObject_setData_2]
611 // Set custom data
612 Map<String, dynamic> customData = {"key": "value", "number": 42};
613 bool dataSuccess = _polygonMapObject!.setData(customData);
614 print("Set polygon custom data: $dataSuccess");
615 // [dart_MapObject_setData_2]
616
617 // [dart_MapObject_getId_2]
618 // Get object ID
619 int objectId = _polygonMapObject!.id;
620 print("Polygon object ID: $objectId");
621 // [dart_MapObject_getId_2]
622
623 // [dart_MapObject_getType_2]
624 // Get object type
625 String objectTypeString = _polygonMapObject!.type;
626 print("Polygon object type: $objectTypeString");
627 // [dart_MapObject_getType_2]
628
629 // [dart_MapObject_getData_2]
630 // Get custom data
631 Map<String, dynamic> retrievedData = _polygonMapObject!.data;
632 print("Polygon custom data: $retrievedData");
633 // [dart_MapObject_getData_2]
634 }
635
636 // [dart_LocationWindow_removePolygonMapObject]
637 // Remove polygon map object
638 if (_polygonMapObject != null) {
639 bool removed = _locationWindow!.removePolygonMapObject(
641 );
642 print("Removed polygon map object: $removed");
643 _polygonMapObject = null;
644 }
645 // [dart_LocationWindow_removePolygonMapObject]
646
647 // Test multiple polygon objects
648 List<PolygonMapObject> polygons = [];
649 for (int i = 0; i < 3; i++) {
650 PolygonMapObject polygon = _locationWindow!.addPolygonMapObject();
651 if (polygon != null) {
652 List<Point> points = [
653 Point(300.0 + i * 50, 400.0 + i * 50),
654 Point(350.0 + i * 50, 450.0 + i * 50),
655 Point(400.0 + i * 50, 400.0 + i * 50),
656 Point(350.0 + i * 50, 350.0 + i * 50),
657 ];
658 Polygon metricPoly = Polygon(points);
659 LocationPolygon polygonGeometry = LocationPolygon(metricPoly, 1, 0);
660 polygon.setPolygon(polygonGeometry);
661 polygon.setColor(0.0, 0.0, 1.0, 0.5);
662 polygons.add(polygon);
663 print("Created polygon $i with ${points.length} points");
664 }
665 }
666
667 for (int i = 0; i < polygons.length; i++) {
668 _locationWindow!.removePolygonMapObject(polygons[i]);
669 print("Removed polygon $i");
670 }
671 }
672
676 void _demonstratePolylineMapObjects() {
677 print("--- Polyline Map Objects ---");
678
679 if (_locationWindow == null) {
680 print("LocationWindow not available yet");
681 return;
682 }
683
684 // [dart_PolylineMapObject_constructor]
685 // Create polyline map object
686 List<Point> points = [
687 Point(100.0, 110.0),
688 Point(105.0, 115.0),
689 Point(110.0, 120.0),
690 Point(115.0, 125.0),
691 ];
692 Polyline polyline = Polyline(points);
693 LocationPolyline locationPolyline = LocationPolyline(polyline, 1, 0);
694 _polylineMapObject = _locationWindow!.addPolylineMapObject();
695 print("Created polyline map object with ${points.length} points");
696 // [dart_PolylineMapObject_constructor]
697
698 // [dart_PolylineMapObject_getPolyline]
699 // Access polyline
700 LocationPolyline polylineShape = _polylineMapObject!.getPolyLine();
701 print("Polyline has ${polylineShape.polyline.points.length} points");
702 // [dart_PolylineMapObject_getPolyline]
703
704 // [dart_LocationWindow_addPolylineMapObject]
705 // Add polyline map object
706 _polylineMapObject = _locationWindow!.addPolylineMapObject();
707 print("Added polyline map object");
708 // [dart_LocationWindow_addPolylineMapObject]
709
710 if (_polylineMapObject != null) {
711 // [dart_PolylineMapObject_setPolyLine]
712 // Set polyline geometry
713 List<Point> polylinePoints = [
714 Point(0.0, 0.0),
715 Point(50.0, 50.0),
716 Point(100.0, 0.0),
717 Point(150.0, 50.0),
718 ];
719 Polyline polyline = Polyline(polylinePoints);
720 LocationPolyline locationPolyline = LocationPolyline(polyline, 1, 0);
721 bool success = _polylineMapObject!.setPolyLine(locationPolyline);
722 print("Set polyline geometry: $success");
723 // [dart_PolylineMapObject_setPolyLine]
724
725 // [dart_PolylineMapObject_setWidth]
726 // Set polyline width
727 bool widthSuccess = _polylineMapObject!.setWidth(3.0);
728 print("Set polyline width to 3.0 pixels: $widthSuccess");
729 // [dart_PolylineMapObject_setWidth]
730
731 // [dart_PolylineMapObject_setColor]
732 // Set polyline color
733 bool colorSuccess = _polylineMapObject!.setColor(1.0, 0.5, 0.0, 0.9);
734 print("Set polyline color to orange with 90% opacity: $colorSuccess");
735 // [dart_PolylineMapObject_setColor]
736
737 // [dart_PolylineMapObject_setOrder]
738 // Set rendering order
739 bool orderSuccess = _polylineMapObject!.setOrder(2);
740 print("Set rendering order to 2: $orderSuccess");
741 // [dart_PolylineMapObject_setOrder]
742
743 // [dart_PolylineMapObject_setCapType]
744 // Set cap type
745 bool capSuccess = _polylineMapObject!.setCapType(CapType.ROUND);
746 print("Set cap type to ROUND: $capSuccess");
747 // [dart_PolylineMapObject_setCapType]
748
749 // [dart_PolylineMapObject_setJoinType]
750 // Set join type
751 bool joinSuccess = _polylineMapObject!.setJoinType(JoinType.ROUND);
752 print("Set join type to ROUND: $joinSuccess");
753 // [dart_PolylineMapObject_setJoinType]
754
755 // [dart_PolylineMapObject_setMiterLimit]
756 // Set miter limit
757 bool miterSuccess = _polylineMapObject!.setMiterLimit(5.0);
758 print("Set miter limit to 5.0: $miterSuccess");
759 // [dart_PolylineMapObject_setMiterLimit]
760
761 // [dart_PolylineMapObject_setOutlineWidth]
762 // Set outline width
763 bool outlineWidthSuccess = _polylineMapObject!.setOutlineWidth(1.0);
764 print("Set polyline outline width to 1.0: $outlineWidthSuccess");
765 // [dart_PolylineMapObject_setOutlineWidth]
766
767 // [dart_PolylineMapObject_setOutlineColor]
768 // Set outline color
769 bool outlineColorSuccess = _polylineMapObject!.setOutlineColor(
770 0.0,
771 0.0,
772 0.0,
773 1.0,
774 );
775 print("Set polyline outline color to black: $outlineColorSuccess");
776 // [dart_PolylineMapObject_setOutlineColor]
777
778 // [dart_PolylineMapObject_setOutlineAlpha]
779 // Set outline alpha
780 bool outlineAlphaSuccess = _polylineMapObject!.setOutlineAlpha(0.8);
781 print("Set polyline outline alpha to 0.8: $outlineAlphaSuccess");
782 // [dart_PolylineMapObject_setOutlineAlpha]
783
784 // [dart_PolylineMapObject_setOutlineOrder]
785 // Set outline order
786 bool outlineOrderSuccess = _polylineMapObject!.setOutlineOrder(1);
787 print("Set polyline outline order to 1: $outlineOrderSuccess");
788 // [dart_PolylineMapObject_setOutlineOrder]
789
790 // [dart_PolylineMapObject_setOutlineCapType]
791 // Set outline cap type
792 bool outlineCapSuccess = _polylineMapObject!.setOutlineCapType(
793 CapType.ROUND,
794 );
795 print("Set polyline outline cap type to ROUND: $outlineCapSuccess");
796 // [dart_PolylineMapObject_setOutlineCapType]
797
798 // [dart_PolylineMapObject_setOutlineJoinType]
799 // Set outline join type
800 bool outlineJoinSuccess = _polylineMapObject!.setOutlineJoinType(
801 JoinType.ROUND,
802 );
803 print("Set polyline outline join type to ROUND: $outlineJoinSuccess");
804 // [dart_PolylineMapObject_setOutlineJoinType]
805
806 // [dart_PolylineMapObject_setOutlineMiterLimit]
807 // Set outline miter limit
808 bool outlineMiterSuccess = _polylineMapObject!.setOutlineMiterLimit(3.0);
809 print("Set polyline outline miter limit to 3.0: $outlineMiterSuccess");
810 // [dart_PolylineMapObject_setOutlineMiterLimit]
811
812 // [dart_PolylineMapObject_setVisible]
813 // Set visibility
814 bool visibleSuccess = _polylineMapObject!.setVisible(true);
815 print("Set polyline visibility to true: $visibleSuccess");
816 // [dart_PolylineMapObject_setVisible]
817
818 // [dart_PolylineMapObject_getMapObjectType]
819 // Get map object type
820 MapObjectType objectType = _polylineMapObject!.mapObjectType;
821 print("Polyline map object type: $objectType");
822 // [dart_PolylineMapObject_getMapObjectType]
823
824 // [dart_MapObject_setAlpha_3]
825 // Set alpha transparency
826 bool alphaSuccess = _polylineMapObject!.setAlpha(0.7);
827 print("Set polyline alpha to 0.7: $alphaSuccess");
828 // [dart_MapObject_setAlpha_3]
829
830 // [dart_MapObject_setInteractive_3]
831 // Set interactive mode
832 bool interactiveSuccess = _polylineMapObject!.setInteractive(true);
833 print("Set polyline interactive to true: $interactiveSuccess");
834 // [dart_MapObject_setInteractive_3]
835
836 // [dart_MapObject_setTitle_3]
837 // Set title
838 bool titleSuccess = _polylineMapObject!.setTitle("Polyline Object");
839 print("Set polyline title to 'Polyline Object': $titleSuccess");
840 // [dart_MapObject_setTitle_3]
841
842 // [dart_MapObject_setData_3]
843 // Set custom data
844 Map<String, dynamic> customData = {"key": "value", "number": 42};
845 bool dataSuccess = _polylineMapObject!.setData(customData);
846 print("Set polyline custom data: $dataSuccess");
847 // [dart_MapObject_setData_3]
848
849 // [dart_MapObject_getId_3]
850 // Get object ID
851 int objectId = _polylineMapObject!.id;
852 print("Polyline object ID: $objectId");
853 // [dart_MapObject_getId_3]
854
855 // [dart_MapObject_getType_3]
856 // Get object type
857 String objectTypeString = _polylineMapObject!.type;
858 print("Polyline object type: $objectTypeString");
859 // [dart_MapObject_getType_3]
860
861 // [dart_MapObject_getData_3]
862 // Get custom data
863 Map<String, dynamic> retrievedData = _polylineMapObject!.data;
864 print("Polyline custom data: $retrievedData");
865 // [dart_MapObject_getData_3]
866 }
867
868 // [dart_LocationWindow_removePolylineMapObject]
869 // Remove polyline map object
870 if (_polylineMapObject != null) {
871 bool removed = _locationWindow!.removePolylineMapObject(
873 );
874 print("Removed polyline map object: $removed");
875 _polylineMapObject = null;
876 }
877 // [dart_LocationWindow_removePolylineMapObject]
878
879 // Test multiple polyline objects
880 List<PolylineMapObject> polylines = [];
881 for (int i = 0; i < 3; i++) {
882 PolylineMapObject polyline = _locationWindow!.addPolylineMapObject();
883 if (polyline != null) {
884 List<Point> points = [
885 Point(i * 30.0, i * 30.0),
886 Point((i + 1) * 30.0, (i + 1) * 30.0),
887 ];
888 Polyline poly = Polyline(points);
889 LocationPolyline locPoly = LocationPolyline(poly, 1, 0);
890 polyline.setPolyLine(locPoly);
891 polyline.setWidth(2.0 + i);
892 polyline.setColor(0.0, 1.0, 1.0, 0.8);
893 polylines.add(polyline);
894 print("Created polyline $i with width ${2.0 + i}");
895 }
896 }
897
898 for (int i = 0; i < polylines.length; i++) {
899 _locationWindow!.removePolylineMapObject(polylines[i]);
900 print("Removed polyline $i");
901 }
902 }
903
907 void _demonstrateDottedPolylineMapObjects() {
908 print("--- Dotted Polyline Map Objects ---");
909
910 if (_locationWindow == null) {
911 print("LocationWindow not available yet");
912 return;
913 }
914
915 // [dart_DottedPolylineMapObject_constructor]
916 // Create dotted polyline map object
917 List<Point> points = [
918 Point(160.0, 170.0),
919 Point(165.0, 175.0),
920 Point(170.0, 180.0),
921 Point(175.0, 185.0),
922 ];
923 Polyline polyline = Polyline(points);
924 LocationPolyline locationPolyline = LocationPolyline(polyline, 1, 0);
925 _dottedPolylineMapObject = _locationWindow!.addDottedPolylineMapObject();
926 print("Created dotted polyline map object with ${points.length} points");
927 // [dart_DottedPolylineMapObject_constructor]
928
929 // [dart_DottedPolylineMapObject_getPolyline]
930 // Access dotted polyline
931 LocationPolyline dottedPolylineShape =
932 _dottedPolylineMapObject!.getPolyLine();
933 print(
934 "Dotted polyline has ${dottedPolylineShape.polyline.points.length} points",
935 );
936 // [dart_DottedPolylineMapObject_getPolyline]
937
938 // [dart_LocationWindow_addDottedPolylineMapObject]
939 // Add dotted polyline map object
940 _dottedPolylineMapObject = _locationWindow!.addDottedPolylineMapObject();
941 print("Added dotted polyline map object");
942 // [dart_LocationWindow_addDottedPolylineMapObject]
943
944 if (_dottedPolylineMapObject != null) {
945 // [dart_DottedPolylineMapObject_setPolyline]
946 // Set dotted polyline geometry
947 List<Point> dottedPoints = [
948 Point(0.0, 100.0),
949 Point(50.0, 150.0),
950 Point(100.0, 100.0),
951 Point(150.0, 150.0),
952 ];
953 Polyline dottedPolyline = Polyline(dottedPoints);
954 LocationPolyline locationDottedPolyline = LocationPolyline(
955 dottedPolyline,
956 1,
957 0,
958 );
959 bool success = _dottedPolylineMapObject!.setPolyLine(
960 locationDottedPolyline,
961 );
962 print("Set dotted polyline geometry: $success");
963 // [dart_DottedPolylineMapObject_setPolyline]
964
965 // [dart_DottedPolylineMapObject_setWidth]
966 // Set dotted polyline width
967 bool widthSuccess = _dottedPolylineMapObject!.setWidth(2.0);
968 print("Set dotted polyline width to 2.0 pixels: $widthSuccess");
969 // [dart_DottedPolylineMapObject_setWidth]
970
971 // [dart_DottedPolylineMapObject_setColor]
972 // Set dotted polyline color
973 bool colorSuccess = _dottedPolylineMapObject!.setColor(
974 0.5,
975 0.0,
976 1.0,
977 0.8,
978 );
979 print(
980 "Set dotted polyline color to purple with 80% opacity: $colorSuccess",
981 );
982 // [dart_DottedPolylineMapObject_setColor]
983
984 // [dart_DottedPolylineMapObject_setOrder]
985 // Set rendering order
986 bool orderSuccess = _dottedPolylineMapObject!.setOrder(3);
987 print("Set rendering order to 3: $orderSuccess");
988 // [dart_DottedPolylineMapObject_setOrder]
989
990 // [dart_DottedPolylineMapObject_setCollisionEnabled]
991 // Enable collision detection
992 bool collisionSuccess = _dottedPolylineMapObject!.setCollisionEnabled(
993 true,
994 );
995 print(
996 "Enabled collision detection for dotted polyline: $collisionSuccess",
997 );
998 // [dart_DottedPolylineMapObject_setCollisionEnabled]
999
1000 // [dart_DottedPolylineMapObject_setPlacement]
1001 // Set placement type
1002 bool placementSuccess = _dottedPolylineMapObject!.setPlacement(
1003 Placement.center,
1004 );
1005 print("Set dotted polyline placement to center: $placementSuccess");
1006 // [dart_DottedPolylineMapObject_setPlacement]
1007
1008 // [dart_DottedPolylineMapObject_setPlacementMinRatio]
1009 // Set placement min ratio
1010 bool minRatioSuccess = _dottedPolylineMapObject!.setPlacementMinRatio(
1011 0.5,
1012 );
1013 print("Set dotted polyline placement min ratio to 0.5: $minRatioSuccess");
1014 // [dart_DottedPolylineMapObject_setPlacementMinRatio]
1015
1016 // [dart_DottedPolylineMapObject_setPlacementSpacing]
1017 // Set placement spacing
1018 bool spacingSuccess = _dottedPolylineMapObject!.setPlacementSpacing(10.0);
1019 print("Set dotted polyline placement spacing to 10.0: $spacingSuccess");
1020 // [dart_DottedPolylineMapObject_setPlacementSpacing]
1021
1022 // [dart_DottedPolylineMapObject_setPriority]
1023 // Set rendering priority
1024 bool prioritySuccess = _dottedPolylineMapObject!.setPriority(1);
1025 print("Set dotted polyline rendering priority to 1: $prioritySuccess");
1026 // [dart_DottedPolylineMapObject_setPriority]
1027
1028 // [dart_DottedPolylineMapObject_setRepeatDistance]
1029 // Set repeat distance
1030 bool repeatDistanceSuccess = _dottedPolylineMapObject!.setRepeatDistance(
1031 20.0,
1032 );
1033 print(
1034 "Set dotted polyline repeat distance to 20.0: $repeatDistanceSuccess",
1035 );
1036 // [dart_DottedPolylineMapObject_setRepeatDistance]
1037
1038 // [dart_DottedPolylineMapObject_setRepeatGroup]
1039 // Set repeat group
1040 bool repeatGroupSuccess = _dottedPolylineMapObject!.setRepeatGroup(1);
1041 print("Set dotted polyline repeat group to 1: $repeatGroupSuccess");
1042 // [dart_DottedPolylineMapObject_setRepeatGroup]
1043
1044 // [dart_DottedPolylineMapObject_setSize]
1045 // Set size
1046 bool sizeSuccess = _dottedPolylineMapObject!.setSize(16.0, 16.0);
1047 print("Set dotted polyline size to 16x16: $sizeSuccess");
1048 // [dart_DottedPolylineMapObject_setSize]
1049
1050 // [dart_DottedPolylineMapObject_setVisible]
1051 // Set visibility
1052 bool visibleSuccess = _dottedPolylineMapObject!.setVisible(true);
1053 print("Set dotted polyline visibility to true: $visibleSuccess");
1054 // [dart_DottedPolylineMapObject_setVisible]
1055
1056 // [dart_DottedPolylineMapObject_getMapObjectType]
1057 // Get map object type
1058 MapObjectType objectType = _dottedPolylineMapObject!.mapObjectType;
1059 print("Dotted polyline map object type: $objectType");
1060 // [dart_DottedPolylineMapObject_getMapObjectType]
1061
1062 // [dart_MapObject_setAlpha_4]
1063 // Set alpha transparency
1064 bool alphaSuccess = _dottedPolylineMapObject!.setAlpha(0.7);
1065 print("Set dotted polyline alpha to 0.7: $alphaSuccess");
1066 // [dart_MapObject_setAlpha_4]
1067
1068 // [dart_MapObject_setInteractive_4]
1069 // Set interactive mode
1070 bool interactiveSuccess = _dottedPolylineMapObject!.setInteractive(true);
1071 print("Set dotted polyline interactive to true: $interactiveSuccess");
1072 // [dart_MapObject_setInteractive_4]
1073
1074 // [dart_MapObject_setTitle_4]
1075 // Set title
1076 bool titleSuccess = _dottedPolylineMapObject!.setTitle(
1077 "Dotted Polyline Object",
1078 );
1079 print(
1080 "Set dotted polyline title to 'Dotted Polyline Object': $titleSuccess",
1081 );
1082 // [dart_MapObject_setTitle_4]
1083
1084 // [dart_MapObject_setData_4]
1085 // Set custom data
1086 Map<String, dynamic> customData = {"key": "value", "number": 42};
1087 bool dataSuccess = _dottedPolylineMapObject!.setData(customData);
1088 print("Set dotted polyline custom data: $dataSuccess");
1089 // [dart_MapObject_setData_4]
1090
1091 // [dart_MapObject_getId_4]
1092 // Get object ID
1093 int objectId = _dottedPolylineMapObject!.id;
1094 print("Dotted polyline object ID: $objectId");
1095 // [dart_MapObject_getId_4]
1096
1097 // [dart_MapObject_getType_4]
1098 // Get object type
1099 String objectTypeString = _dottedPolylineMapObject!.type;
1100 print("Dotted polyline object type: $objectTypeString");
1101 // [dart_MapObject_getType_4]
1102
1103 // [dart_MapObject_getData_4]
1104 // Get custom data
1105 Map<String, dynamic> retrievedData = _dottedPolylineMapObject!.data;
1106 print("Dotted polyline custom data: $retrievedData");
1107 // [dart_MapObject_getData_4]
1108 }
1109
1110 // [dart_LocationWindow_removeDottedPolylineMapObject]
1111 // Remove dotted polyline map object
1112 if (_dottedPolylineMapObject != null) {
1113 bool removed = _locationWindow!.removeDottedPolylineMapObject(
1115 );
1116 print("Removed dotted polyline map object: $removed");
1118 }
1119 // [dart_LocationWindow_removeDottedPolylineMapObject]
1120
1121 // Test multiple dotted polyline objects
1122 List<DottedPolylineMapObject> dottedPolylines = [];
1123 for (int i = 0; i < 2; i++) {
1124 DottedPolylineMapObject dottedPolyline =
1125 _locationWindow!.addDottedPolylineMapObject();
1126 if (dottedPolyline != null) {
1127 List<Point> points = [
1128 Point(i * 40.0, i * 40.0 + 100.0),
1129 Point((i + 1) * 40.0, (i + 1) * 40.0 + 100.0),
1130 ];
1131 Polyline poly = Polyline(points);
1132 LocationPolyline locPoly = LocationPolyline(poly, 1, 0);
1133 dottedPolyline.setPolyLine(locPoly);
1134 dottedPolyline.setWidth(1.5);
1135 dottedPolyline.setColor(1.0, 0.0, 1.0, 0.6);
1136 dottedPolylines.add(dottedPolyline);
1137 print("Created dotted polyline $i");
1138 }
1139 }
1140
1141 for (int i = 0; i < dottedPolylines.length; i++) {
1142 _locationWindow!.removeDottedPolylineMapObject(dottedPolylines[i]);
1143 print("Removed dotted polyline $i");
1144 }
1145 }
1146
1150 void _demonstrateRemoveAllMapObjects() {
1151 print("--- Remove All Map Objects ---");
1152
1153 if (_locationWindow == null) {
1154 print("LocationWindow not available yet");
1155 return;
1156 }
1157
1158 // Create various map objects
1159 CircleMapObject circle = _locationWindow!.addCircleMapObject();
1160 IconMapObject icon = _locationWindow!.addIconMapObject();
1161 PolygonMapObject polygon = _locationWindow!.addPolygonMapObject();
1162 PolylineMapObject polyline = _locationWindow!.addPolylineMapObject();
1163 DottedPolylineMapObject dottedPolyline =
1164 _locationWindow!.addDottedPolylineMapObject();
1165
1166 print("Created 5 map objects");
1167
1168 // [dart_LocationWindow_removeAllMapObjects]
1169 // Remove all map objects
1170 _locationWindow!.removeAllMapObjects();
1171 print("Removed all map objects");
1172 // [dart_LocationWindow_removeAllMapObjects]
1173 }
1174
1178 void _cleanup() {
1179 if (_circleMapObject != null) {
1180 _locationWindow?.removeCircleMapObject(_circleMapObject!);
1181 _circleMapObject = null;
1182 }
1183 if (_iconMapObject != null) {
1184 _locationWindow?.removeIconMapObject(_iconMapObject!);
1185 _iconMapObject = null;
1186 }
1187 if (_polygonMapObject != null) {
1188 // Polygon objects are removed automatically when LocationWindow is destroyed
1189 _polygonMapObject = null;
1190 }
1191 if (_polylineMapObject != null) {
1192 _locationWindow?.removePolylineMapObject(_polylineMapObject!);
1193 _polylineMapObject = null;
1194 }
1195 if (_dottedPolylineMapObject != null) {
1196 _locationWindow?.removeDottedPolylineMapObject(_dottedPolylineMapObject!);
1198 }
1199 print("LocationWindowMapObjects example cleanup completed");
1200 }
1201}
1202
1203// Main function