Loading...
Searching...
No Matches
LocationWindowMapObjectsExample.kt
Go to the documentation of this file.
1package com.navigine.examples
2
3import com.navigine.idl.kotlin.LocationWindow
4import com.navigine.idl.kotlin.CircleMapObject
5import com.navigine.idl.kotlin.IconMapObject
6import com.navigine.idl.kotlin.PolygonMapObject
7import com.navigine.idl.kotlin.PolylineMapObject
8import com.navigine.idl.kotlin.DottedPolylineMapObject
9import com.navigine.idl.kotlin.AnimationType
10import com.navigine.idl.kotlin.CapType
11import com.navigine.idl.kotlin.JoinType
12import com.navigine.idl.kotlin.LocationPoint
13import com.navigine.idl.kotlin.LocationPolygon
14import com.navigine.idl.kotlin.LocationPolyline
15import com.navigine.idl.kotlin.MapObjectType
16import com.navigine.idl.kotlin.Placement
17import com.navigine.idl.kotlin.Color
18import com.navigine.idl.kotlin.Size
19import com.navigine.idl.kotlin.Point
20import com.navigine.idl.kotlin.Polygon
21import com.navigine.idl.kotlin.Polyline
22
23/**
24 * LocationWindowMapObjects usage example for Kotlin
25 * Demonstrates specific methods: addCircleMapObject, removeCircleMapObject, addIconMapObject,
26 * removeIconMapObject, addPolygonMapObject, addPolylineMapObject, removePolylineMapObject,
27 * addDottedPolylineMapObject, removeDottedPolylineMapObject, removeAllMapObjects
28 */
29class LocationWindowMapObjectsExample {
30 private var locationWindow: LocationWindow? = null
31 private var circleMapObject: CircleMapObject? = null
32 private var iconMapObject: IconMapObject? = null
33 private var polygonMapObject: PolygonMapObject? = null
34 private var polylineMapObject: PolylineMapObject? = null
35 private var dottedPolylineMapObject: DottedPolylineMapObject? = null
36
37 init {
38 demonstrateLocationWindowMapObjectsMethods()
39 }
40
41 /**
42 * Demonstrate LocationWindowMapObjects methods
43 */
44 private fun demonstrateLocationWindowMapObjectsMethods() {
45 println("=== LocationWindowMapObjects Example ===")
46
47 // Initialize LocationWindow (in real app, this would be provided by the framework)
48 // locationWindow = getLocationWindow()
49
50 demonstrateLocationScopedGeometryRecords()
51
52 demonstrateCircleMapObjects()
53 demonstrateIconMapObjects()
54 demonstratePolygonMapObjects()
55 demonstratePolylineMapObjects()
56 demonstrateDottedPolylineMapObjects()
57 demonstrateRemoveAllMapObjects()
58
59 cleanup()
60 }
61
62 /**
63 * Metrics geometry scoped to a location / sublocation (@see LocationPolygon, LocationPolyline).
64 */
65 private fun demonstrateLocationScopedGeometryRecords() {
66 println("--- LocationPolygon / LocationPolyline records ---")
67
68 // [kotlin_LocationPolygon_record]
69 val ring = listOf(Point(1.0, 2.0), Point(3.0, 4.0), Point(5.0, 2.0))
70 val metricPolygon = Polygon(ring)
71 val locationPolygon = LocationPolygon(metricPolygon, 42, 7)
72 val polygonBack = locationPolygon.getPolygon()
73 val polygonLocationId = locationPolygon.getLocationId()
74 val polygonSublocationId = locationPolygon.getSublocationId()
75 println("LocationPolygon: location $polygonLocationId, sublocation $polygonSublocationId, vertices ${polygonBack.getPoints().size}")
76 // [kotlin_LocationPolygon_record]
77
78 // [kotlin_LocationPolyline_record]
79 val linePoints = listOf(Point(0.0, 0.0), Point(10.0, 10.0))
80 val metricPolyline = Polyline(linePoints)
81 val locationPolyline = LocationPolyline(metricPolyline, 42, 7)
82 val polylineBack = locationPolyline.getPolyline()
83 println("LocationPolyline: points ${polylineBack.getPoints().size}")
84 // [kotlin_LocationPolyline_record]
85 }
86
87 /**
88 * Demonstrate circle map objects
89 */
90 private fun demonstrateCircleMapObjects() {
91 println("--- Circle Map Objects ---")
92
93 if (locationWindow == null) {
94 println("LocationWindow not available yet")
95 return
96 }
97
98 // [kotlin_CircleMapObject_constructor]
99 // Create circle map object
100 val center = LocationPoint(10.0, 20.0)
101 circleMapObject = locationWindow!!.addCircleMapObject()
102 println("Created circle map object with center (${center.x}, ${center.y}) and radius 5.0")
103 // [kotlin_CircleMapObject_constructor]
104
105 // [kotlin_CircleMapObject_getCenter]
106 // Access circle center
107 val circleCenter = circleMapObject!!.getPosition()
108 println("Circle center: (${circleCenter.x}, ${circleCenter.y})")
109 // [kotlin_CircleMapObject_getCenter]
110
111 // [kotlin_CircleMapObject_getRadius]
112 // Access circle radius
113 val radius = circleMapObject!!.getRadius()
114 println("Circle radius: $radius")
115 // [kotlin_CircleMapObject_getRadius]
116
117 // [kotlin_LocationWindow_addCircleMapObject]
118 // Add circle map object
119 circleMapObject = locationWindow!!.addCircleMapObject()
120 println("Added circle map object")
121 // [kotlin_LocationWindow_addCircleMapObject]
122
123 if (circleMapObject != null) {
124 // [kotlin_CircleMapObject_setPosition]
125 // Set circle position
126 val centerPoint = LocationPoint(100.0, 200.0)
127 val success = circleMapObject!!.setPosition(centerPoint)
128 println("Set circle position to (${centerPoint.x}, ${centerPoint.y}): $success")
129 // [kotlin_CircleMapObject_setPosition]
130
131 // [kotlin_CircleMapObject_setPositionAnimated]
132 // Set circle position with animation
133 val animatedPoint = LocationPoint(150.0, 250.0)
134 val animatedSuccess = circleMapObject!!.setPositionAnimated(animatedPoint, 2.0, AnimationType.LINEAR)
135 println("Set circle position with animation to (${animatedPoint.x}, ${animatedPoint.y}): $animatedSuccess")
136 // [kotlin_CircleMapObject_setPositionAnimated]
137
138 // [kotlin_CircleMapObject_setRadius]
139 // Set circle radius
140 val radiusSuccess = circleMapObject!!.setRadius(10.0)
141 println("Set circle radius to 10.0 meters: $radiusSuccess")
142 // [kotlin_CircleMapObject_setRadius]
143
144 // [kotlin_CircleMapObject_setCollisionEnabled]
145 // Enable collision detection
146 val collisionSuccess = circleMapObject!!.setCollisionEnabled(true)
147 println("Enabled collision detection for circle: $collisionSuccess")
148 // [kotlin_CircleMapObject_setCollisionEnabled]
149
150 // [kotlin_CircleMapObject_setBuffer]
151 // Set collision buffer
152 val bufferSuccess = circleMapObject!!.setBuffer(5.0, 5.0)
153 println("Set collision buffer to 5x5 pixels: $bufferSuccess")
154 // [kotlin_CircleMapObject_setBuffer]
155
156 // [kotlin_CircleMapObject_setOffset]
157 // Set position offset
158 val offsetSuccess = circleMapObject!!.setOffset(2.0, 3.0)
159 println("Set position offset to (2.0, 3.0) pixels: $offsetSuccess")
160 // [kotlin_CircleMapObject_setOffset]
161
162 // [kotlin_CircleMapObject_setOutlineColor]
163 // Set outline color
164 val outlineColorSuccess = circleMapObject!!.setOutlineColor(0.0, 0.0, 1.0, 1.0)
165 println("Set circle outline color to blue: $outlineColorSuccess")
166 // [kotlin_CircleMapObject_setOutlineColor]
167
168 // [kotlin_CircleMapObject_setOutlineAlpha]
169 // Set outline alpha
170 val outlineAlphaSuccess = circleMapObject!!.setOutlineAlpha(0.5)
171 println("Set circle outline alpha to 0.5: $outlineAlphaSuccess")
172 // [kotlin_CircleMapObject_setOutlineAlpha]
173
174 // [kotlin_CircleMapObject_setOutlineRadius]
175 // Set outline radius
176 val outlineRadiusSuccess = circleMapObject!!.setOutlineRadius(2.0)
177 println("Set circle outline radius to 2.0: $outlineRadiusSuccess")
178 // [kotlin_CircleMapObject_setOutlineRadius]
179
180 // [kotlin_CircleMapObject_setColor]
181 // Set circle color
182 val colorSuccess = circleMapObject!!.setColor(1.0, 0.0, 0.0, 0.8)
183 println("Set circle color to red with 80% opacity: $colorSuccess")
184 // [kotlin_CircleMapObject_setColor]
185
186 // [kotlin_CircleMapObject_setPriority]
187 // Set rendering priority
188 val prioritySuccess = circleMapObject!!.setPriority(1)
189 println("Set rendering priority to 1: $prioritySuccess")
190 // [kotlin_CircleMapObject_setPriority]
191
192 // [kotlin_MapObject_setVisible]
193 // Set visibility
194 val visibleSuccess = circleMapObject!!.setVisible(true)
195 println("Set circle visibility to true: $visibleSuccess")
196 // [kotlin_MapObject_setVisible]
197
198 // [kotlin_CircleMapObject_getMapObjectType]
199 // Get map object type
200 val objectType = circleMapObject!!.mapObjectType
201 println("Circle map object type: $objectType")
202 // [kotlin_CircleMapObject_getMapObjectType]
203
204 // [kotlin_MapObject_setAlpha]
205 // Set alpha transparency
206 val alphaSuccess = circleMapObject!!.setAlpha(0.7)
207 println("Set circle alpha to 0.7: $alphaSuccess")
208 // [kotlin_MapObject_setAlpha]
209
210 // [kotlin_MapObject_setInteractive]
211 // Set interactive mode
212 val interactiveSuccess = circleMapObject!!.setInteractive(true)
213 println("Set circle interactive to true: $interactiveSuccess")
214 // [kotlin_MapObject_setInteractive]
215
216 // [kotlin_MapObject_setTitle]
217 // Set title
218 val titleSuccess = circleMapObject!!.setTitle("Circle Object")
219 println("Set circle title to 'Circle Object': $titleSuccess")
220 // [kotlin_MapObject_setTitle]
221
222 // [kotlin_MapObject_setData]
223 // Set custom data
224 val customData = mapOf("key" to "value", "number" to "42")
225 val dataSuccess = circleMapObject!!.setData(customData)
226 println("Set circle custom data: $dataSuccess")
227 // [kotlin_MapObject_setData]
228
229 // [kotlin_MapObject_getId]
230 // Get object ID
231 val objectId = circleMapObject!!.id
232 println("Circle object ID: $objectId")
233 // [kotlin_MapObject_getId]
234
235 // [kotlin_MapObject_getType]
236 // Get object type
237 val objectTypeString = circleMapObject!!.type
238 println("Circle object type: $objectTypeString")
239 // [kotlin_MapObject_getType]
240
241 // [kotlin_MapObject_getData]
242 // Get custom data
243 val retrievedData = circleMapObject!!.data
244 println("Circle custom data: $retrievedData")
245 // [kotlin_MapObject_getData]
246 }
247
248 // [kotlin_LocationWindow_removeCircleMapObject]
249 // Remove circle map object
250 if (circleMapObject != null) {
251 val removed = locationWindow!!.removeCircleMapObject(circleMapObject!!)
252 println("Removed circle map object: $removed")
253 circleMapObject = null
254 }
255 // [kotlin_LocationWindow_removeCircleMapObject]
256
257 // Test multiple circle objects
258 val circles = mutableListOf<CircleMapObject>()
259 for (i in 0..2) {
260 val circle = locationWindow!!.addCircleMapObject()
261 if (circle != null) {
262 circle.setPosition(LocationPoint(50.0 * i, 100.0 * i))
263 circle.setColor(0.0, 1.0, 0.0, 0.6)
264 circle.setRadius(5.0 + i * 2.0)
265 circles.add(circle)
266 println("Created circle $i at (${50.0 * i}, ${100.0 * i}) with radius ${5.0 + i * 2.0}")
267 }
268 }
269
270 for (i in circles.indices) {
271 locationWindow!!.removeCircleMapObject(circles[i])
272 println("Removed circle $i")
273 }
274 }
275
276 /**
277 * Demonstrate icon map objects
278 */
279 private fun demonstrateIconMapObjects() {
280 println("--- Icon Map Objects ---")
281
282 if (locationWindow == null) {
283 println("LocationWindow not available yet")
284 return
285 }
286
287 // [kotlin_IconMapObject_constructor]
288 // Create icon map object
289 val position = LocationPoint(30.0, 40.0)
290 iconMapObject = locationWindow!!.addIconMapObject()
291 println("Created icon map object at (${position.x}, ${position.y})")
292 // [kotlin_IconMapObject_constructor]
293
294 // [kotlin_IconMapObject_getPosition]
295 // Access icon position
296 val iconPosition = iconMapObject!!.getPosition()
297 println("Icon position: (${iconPosition.x}, ${iconPosition.y})")
298 // [kotlin_IconMapObject_getPosition]
299
300 // [kotlin_LocationWindow_addIconMapObject]
301 // Add icon map object
302 iconMapObject = locationWindow!!.addIconMapObject()
303 println("Added icon map object")
304 // [kotlin_LocationWindow_addIconMapObject]
305
306 if (iconMapObject != null) {
307 // [kotlin_IconMapObject_setPosition]
308 // Set icon position
309 val position = LocationPoint(30.0, 40.0)
310 val success = iconMapObject!!.setPosition(position)
311 println("Set icon position to (${position.x}, ${position.y}): $success")
312 // [kotlin_IconMapObject_setPosition]
313
314 // [kotlin_IconMapObject_setPositionAnimated]
315 // Set icon position with animation
316 val animatedPosition = LocationPoint(35.0, 45.0)
317 val animatedSuccess = iconMapObject!!.setPositionAnimated(animatedPosition, 1.5, AnimationType.CUBIC)
318 println("Set icon position with animation to (${animatedPosition.x}, ${animatedPosition.y}): $animatedSuccess")
319 // [kotlin_IconMapObject_setPositionAnimated]
320
321 // [kotlin_IconMapObject_setIcon]
322 // Set icon image
323 val iconSuccess = iconMapObject!!.setIcon("path/to/icon.png")
324 println("Set icon image: $iconSuccess")
325 // [kotlin_IconMapObject_setIcon]
326
327 // [kotlin_IconMapObject_setBitmap]
328 // Set icon bitmap
329 val bitmapSuccess = iconMapObject!!.setBitmap("path/to/bitmap.png")
330 println("Set icon bitmap: $bitmapSuccess")
331 // [kotlin_IconMapObject_setBitmap]
332
333 // [kotlin_IconMapObject_setFlat]
334 // Set icon flat mode
335 val flatSuccess = iconMapObject!!.setFlat(true)
336 println("Set icon flat mode to true: $flatSuccess")
337 // [kotlin_IconMapObject_setFlat]
338
339 // [kotlin_IconMapObject_setSize]
340 // Set icon size
341 val size = Size(32.0, 32.0)
342 val sizeSuccess = iconMapObject!!.setSize(size)
343 println("Set icon size to (${size.width}, ${size.height}): $sizeSuccess")
344 // [kotlin_IconMapObject_setSize]
345
346 // [kotlin_IconMapObject_setAngle]
347 // Set icon rotation angle
348 val angleSuccess = iconMapObject!!.setAngle(45.0)
349 println("Set icon rotation angle to 45 degrees: $angleSuccess")
350 // [kotlin_IconMapObject_setAngle]
351
352 // [kotlin_IconMapObject_setAngleAnimated]
353 // Set icon rotation with animation
354 val angleAnimatedSuccess = iconMapObject!!.setAngleAnimated(90.0, 2.0, AnimationType.SINE)
355 println("Set icon rotation with animation to 90 degrees: $angleAnimatedSuccess")
356 // [kotlin_IconMapObject_setAngleAnimated]
357
358 // [kotlin_IconMapObject_setCollisionEnabled]
359 // Enable collision detection
360 val collisionSuccess = iconMapObject!!.setCollisionEnabled(true)
361 println("Enabled collision detection for icon: $collisionSuccess")
362 // [kotlin_IconMapObject_setCollisionEnabled]
363
364 // [kotlin_IconMapObject_setBuffer]
365 // Set collision buffer
366 val bufferSuccess = iconMapObject!!.setBuffer(10.0, 10.0)
367 println("Set collision buffer to 10x10 pixels: $bufferSuccess")
368 // [kotlin_IconMapObject_setBuffer]
369
370 // [kotlin_IconMapObject_setPlacement]
371 // Set icon placement
372 val placementSuccess = iconMapObject!!.setPlacement(Placement.CENTER)
373 println("Set icon placement to CENTER: $placementSuccess")
374 // [kotlin_IconMapObject_setPlacement]
375
376 // [kotlin_IconMapObject_setOffset]
377 // Set position offset
378 val offsetSuccess = iconMapObject!!.setOffset(0.0, -16.0)
379 println("Set position offset to (0.0, -16.0) pixels: $offsetSuccess")
380 // [kotlin_IconMapObject_setOffset]
381
382 // [kotlin_IconMapObject_setPriority]
383 // Set rendering priority
384 val prioritySuccess = iconMapObject!!.setPriority(2)
385 println("Set rendering priority to 2: $prioritySuccess")
386 // [kotlin_IconMapObject_setPriority]
387
388 // [kotlin_IconMapObject_setVisible]
389 // Set visibility
390 val visibleSuccess = iconMapObject!!.setVisible(true)
391 println("Set icon visibility to true: $visibleSuccess")
392 // [kotlin_IconMapObject_setVisible]
393
394 // [kotlin_IconMapObject_getMapObjectType]
395 // Get map object type
396 val objectType = iconMapObject!!.mapObjectType
397 println("Icon map object type: $objectType")
398 // [kotlin_IconMapObject_getMapObjectType]
399
400 // [kotlin_MapObject_setAlpha_1]
401 // Set alpha transparency
402 val alphaSuccess = iconMapObject!!.setAlpha(0.8)
403 println("Set icon alpha to 0.8: $alphaSuccess")
404 // [kotlin_MapObject_setAlpha_1]
405
406 // [kotlin_MapObject_setInteractive_1]
407 // Set interactive mode
408 val interactiveSuccess = iconMapObject!!.setInteractive(true)
409 println("Set icon interactive to true: $interactiveSuccess")
410 // [kotlin_MapObject_setInteractive_1]
411
412 // [kotlin_MapObject_setTitle_1]
413 // Set title
414 val titleSuccess = iconMapObject!!.setTitle("Icon Object")
415 println("Set icon title to 'Icon Object': $titleSuccess")
416 // [kotlin_MapObject_setTitle_1]
417
418 // [kotlin_MapObject_setData_1]
419 // Set custom data
420 val customData = mapOf("key" to "value", "number" to "42")
421 val dataSuccess = iconMapObject!!.setData(customData)
422 println("Set icon custom data: $dataSuccess")
423 // [kotlin_MapObject_setData_1]
424
425 // [kotlin_MapObject_getId_1]
426 // Get object ID
427 val objectId = iconMapObject!!.id
428 println("Icon object ID: $objectId")
429 // [kotlin_MapObject_getId_1]
430
431 // [kotlin_MapObject_getType_1]
432 // Get object type
433 val objectTypeString = iconMapObject!!.type
434 println("Icon object type: $objectTypeString")
435 // [kotlin_MapObject_getType_1]
436
437 // [kotlin_MapObject_getData_1]
438 // Get custom data
439 val retrievedData = iconMapObject!!.data
440 println("Icon custom data: $retrievedData")
441 // [kotlin_MapObject_getData_1]
442 }
443
444 // [kotlin_LocationWindow_removeIconMapObject]
445 // Remove icon map object
446 if (iconMapObject != null) {
447 val removed = locationWindow!!.removeIconMapObject(iconMapObject!!)
448 println("Removed icon map object: $removed")
449 iconMapObject = null
450 }
451 // [kotlin_LocationWindow_removeIconMapObject]
452
453 // Test multiple icon objects
454 val icons = mutableListOf<IconMapObject>()
455 for (i in 0..2) {
456 val icon = locationWindow!!.addIconMapObject()
457 if (icon != null) {
458 icon.setPosition(LocationPoint(60.0 * i, 120.0 * i))
459 icon.setIcon("path/to/icon$i.png")
460 icon.setSize(Size(24.0, 24.0))
461 icons.add(icon)
462 println("Created icon $i at (${60.0 * i}, ${120.0 * i})")
463 }
464 }
465
466 for (i in icons.indices) {
467 locationWindow!!.removeIconMapObject(icons[i])
468 println("Removed icon $i")
469 }
470 }
471
472 /**
473 * Demonstrate polygon map objects
474 */
475 private fun demonstratePolygonMapObjects() {
476 println("--- Polygon Map Objects ---")
477
478 if (locationWindow == null) {
479 println("LocationWindow not available yet")
480 return
481 }
482
483 // [kotlin_LocationWindow_addPolygonMapObject]
484 // Add polygon map object
485 polygonMapObject = locationWindow!!.addPolygonMapObject()
486 println("Added polygon map object")
487 // [kotlin_LocationWindow_addPolygonMapObject]
488
489 if (polygonMapObject != null) {
490 // [kotlin_PolygonMapObject_setPolygon]
491 // Set polygon geometry
492 val points = listOf(
493 Point(50.0, 60.0),
494 Point(55.0, 65.0),
495 Point(60.0, 60.0),
496 Point(55.0, 55.0)
497 )
498 val metricPolygon = Polygon(points)
499 val polygon = LocationPolygon(metricPolygon, 1, 0)
500 val success = polygonMapObject!!.setPolygon(polygon)
501 println("Set polygon with ${points.size} points: $success")
502 // [kotlin_PolygonMapObject_setPolygon]
503
504 // [kotlin_PolygonMapObject_setColor]
505 // Set polygon color
506 val colorSuccess = polygonMapObject!!.setColor(0.0, 1.0, 0.0, 0.7)
507 println("Set polygon color to green with 70% opacity: $colorSuccess")
508 // [kotlin_PolygonMapObject_setColor]
509
510 // [kotlin_PolygonMapObject_setOrder]
511 // Set polygon rendering order
512 val orderSuccess = polygonMapObject!!.setOrder(2)
513 println("Set polygon rendering order to 2: $orderSuccess")
514 // [kotlin_PolygonMapObject_setOrder]
515
516 // [kotlin_PolygonMapObject_setOutlineColor]
517 // Set polygon outline color
518 val outlineColorSuccess = polygonMapObject!!.setOutlineColor(0.0, 0.0, 1.0, 1.0)
519 println("Set polygon outline color to blue: $outlineColorSuccess")
520 // [kotlin_PolygonMapObject_setOutlineColor]
521
522 // [kotlin_PolygonMapObject_setOutlineWidth]
523 // Set polygon outline width
524 val outlineWidthSuccess = polygonMapObject!!.setOutlineWidth(2.0)
525 println("Set polygon outline width to 2.0 pixels: $outlineWidthSuccess")
526 // [kotlin_PolygonMapObject_setOutlineWidth]
527
528 // [kotlin_PolygonMapObject_setOutlineAlpha]
529 // Set polygon outline alpha
530 val outlineAlphaSuccess = polygonMapObject!!.setOutlineAlpha(0.8)
531 println("Set polygon outline alpha to 0.8: $outlineAlphaSuccess")
532 // [kotlin_PolygonMapObject_setOutlineAlpha]
533
534 // [kotlin_PolygonMapObject_setOutlineOrder]
535 // Set polygon outline order
536 val outlineOrderSuccess = polygonMapObject!!.setOutlineOrder(1)
537 println("Set polygon outline order to 1: $outlineOrderSuccess")
538 // [kotlin_PolygonMapObject_setOutlineOrder]
539
540 // [kotlin_PolygonMapObject_setVisible]
541 // Set visibility
542 val visibleSuccess = polygonMapObject!!.setVisible(true)
543 println("Set polygon visibility to true: $visibleSuccess")
544 // [kotlin_PolygonMapObject_setVisible]
545
546 // [kotlin_PolygonMapObject_getMapObjectType]
547 // Get map object type
548 val objectType = polygonMapObject!!.mapObjectType
549 println("Polygon map object type: $objectType")
550 // [kotlin_PolygonMapObject_getMapObjectType]
551
552 // [kotlin_MapObject_setAlpha_2]
553 // Set alpha transparency
554 val alphaSuccess = polygonMapObject!!.setAlpha(0.6)
555 println("Set polygon alpha to 0.6: $alphaSuccess")
556 // [kotlin_MapObject_setAlpha_2]
557
558 // [kotlin_MapObject_setInteractive_2]
559 // Set interactive mode
560 val interactiveSuccess = polygonMapObject!!.setInteractive(true)
561 println("Set polygon interactive to true: $interactiveSuccess")
562 // [kotlin_MapObject_setInteractive_2]
563
564 // [kotlin_MapObject_setTitle_2]
565 // Set title
566 val titleSuccess = polygonMapObject!!.setTitle("Polygon Object")
567 println("Set polygon title to 'Polygon Object': $titleSuccess")
568 // [kotlin_MapObject_setTitle_2]
569
570 // [kotlin_MapObject_setData_2]
571 // Set custom data
572 val customData = mapOf("key" to "value", "number" to "42")
573 val dataSuccess = polygonMapObject!!.setData(customData)
574 println("Set polygon custom data: $dataSuccess")
575 // [kotlin_MapObject_setData_2]
576
577 // [kotlin_MapObject_getId_2]
578 // Get object ID
579 val objectId = polygonMapObject!!.id
580 println("Polygon object ID: $objectId")
581 // [kotlin_MapObject_getId_2]
582
583 // [kotlin_MapObject_getType_2]
584 // Get object type
585 val objectTypeString = polygonMapObject!!.type
586 println("Polygon object type: $objectTypeString")
587 // [kotlin_MapObject_getType_2]
588
589 // [kotlin_MapObject_getData_2]
590 // Get custom data
591 val retrievedData = polygonMapObject!!.data
592 println("Polygon custom data: $retrievedData")
593 // [kotlin_MapObject_getData_2]
594 }
595
596 // [kotlin_LocationWindow_removePolygonMapObject]
597 // Remove polygon map object
598 if (polygonMapObject != null) {
599 val removed = locationWindow!!.removePolygonMapObject(polygonMapObject!!)
600 println("Removed polygon map object: $removed")
601 polygonMapObject = null
602 }
603 // [kotlin_LocationWindow_removePolygonMapObject]
604
605 // Test multiple polygon objects
606 val polygons = mutableListOf<PolygonMapObject>()
607 for (i in 0..2) {
608 val polygon = locationWindow!!.addPolygonMapObject()
609 if (polygon != null) {
610 val points = listOf(
611 Point(300.0 + i * 50, 400.0 + i * 50),
612 Point(350.0 + i * 50, 450.0 + i * 50),
613 Point(400.0 + i * 50, 400.0 + i * 50),
614 Point(350.0 + i * 50, 350.0 + i * 50)
615 )
616 val metricPoly = Polygon(points)
617 val polygonGeometry = LocationPolygon(metricPoly, 1, 0)
618 polygon.setPolygon(polygonGeometry)
619 polygon.setColor(0.0, 0.0, 1.0, 0.5)
620 polygons.add(polygon)
621 println("Created polygon $i with ${points.size} points")
622 }
623 }
624
625 for (i in polygons.indices) {
626 locationWindow!!.removePolygonMapObject(polygons[i])
627 println("Removed polygon $i")
628 }
629 }
630
631 /**
632 * Demonstrate polyline map objects
633 */
634 private fun demonstratePolylineMapObjects() {
635 println("--- Polyline Map Objects ---")
636
637 if (locationWindow == null) {
638 println("LocationWindow not available yet")
639 return
640 }
641
642 // [kotlin_PolylineMapObject_constructor]
643 // Create polyline map object
644 val points = listOf(
645 Point(100.0, 110.0),
646 Point(105.0, 115.0),
647 Point(110.0, 120.0),
648 Point(115.0, 125.0)
649 )
650 val metricPolyline = Polyline(points)
651 val polyline = LocationPolyline(metricPolyline, 1, 0)
652 polylineMapObject = locationWindow!!.addPolylineMapObject()
653 println("Created polyline map object with ${points.size} points")
654 // [kotlin_PolylineMapObject_constructor]
655
656 // [kotlin_PolylineMapObject_getPolyline]
657 // Access polyline
658 val polylineShape = polylineMapObject!!.getPolyLine()
659 println("Polyline has ${polylineShape.getPolyline().getPoints().size} points")
660 // [kotlin_PolylineMapObject_getPolyline]
661
662 // [kotlin_LocationWindow_addPolylineMapObject]
663 // Add polyline map object
664 polylineMapObject = locationWindow!!.addPolylineMapObject()
665 println("Added polyline map object")
666 // [kotlin_LocationWindow_addPolylineMapObject]
667
668 if (polylineMapObject != null) {
669 // [kotlin_PolylineMapObject_setPolyLine]
670 // Set polyline geometry
671 val points = listOf(
672 Point(100.0, 110.0),
673 Point(105.0, 115.0),
674 Point(110.0, 120.0),
675 Point(115.0, 125.0)
676 )
677 val metricPl = Polyline(points)
678 val polyline = LocationPolyline(metricPl, 1, 0)
679 val success = polylineMapObject!!.setPolyLine(polyline)
680 println("Set polyline with ${points.size} points: $success")
681 // [kotlin_PolylineMapObject_setPolyLine]
682
683 // [kotlin_PolylineMapObject_setWidth]
684 // Set polyline width
685 val widthSuccess = polylineMapObject!!.setWidth(3.0)
686 println("Set polyline width to 3.0 pixels: $widthSuccess")
687 // [kotlin_PolylineMapObject_setWidth]
688
689 // [kotlin_PolylineMapObject_setColor]
690 // Set polyline color
691 val colorSuccess = polylineMapObject!!.setColor(0.0, 1.0, 0.0, 0.8)
692 println("Set polyline color to green with 80% opacity: $colorSuccess")
693 // [kotlin_PolylineMapObject_setColor]
694
695 // [kotlin_PolylineMapObject_setOrder]
696 // Set polyline rendering order
697 val orderSuccess = polylineMapObject!!.setOrder(1)
698 println("Set polyline rendering order to 1: $orderSuccess")
699 // [kotlin_PolylineMapObject_setOrder]
700
701 // [kotlin_PolylineMapObject_setCapType]
702 // Set polyline cap type
703 val capTypeSuccess = polylineMapObject!!.setCapType(CapType.ROUND)
704 println("Set polyline cap type to ROUND: $capTypeSuccess")
705 // [kotlin_PolylineMapObject_setCapType]
706
707 // [kotlin_PolylineMapObject_setJoinType]
708 // Set polyline join type
709 val joinTypeSuccess = polylineMapObject!!.setJoinType(JoinType.ROUND)
710 println("Set polyline join type to ROUND: $joinTypeSuccess")
711 // [kotlin_PolylineMapObject_setJoinType]
712
713 // [kotlin_PolylineMapObject_setMiterLimit]
714 // Set polyline miter limit
715 val miterLimitSuccess = polylineMapObject!!.setMiterLimit(2.0)
716 println("Set polyline miter limit to 2.0: $miterLimitSuccess")
717 // [kotlin_PolylineMapObject_setMiterLimit]
718
719 // [kotlin_PolylineMapObject_setOutlineWidth]
720 // Set polyline outline width
721 val outlineWidthSuccess = polylineMapObject!!.setOutlineWidth(1.0)
722 println("Set polyline outline width to 1.0 pixels: $outlineWidthSuccess")
723 // [kotlin_PolylineMapObject_setOutlineWidth]
724
725 // [kotlin_PolylineMapObject_setOutlineColor]
726 // Set polyline outline color
727 val outlineColorSuccess = polylineMapObject!!.setOutlineColor(0.0, 0.0, 0.0, 1.0)
728 println("Set polyline outline color to black: $outlineColorSuccess")
729 // [kotlin_PolylineMapObject_setOutlineColor]
730
731 // [kotlin_PolylineMapObject_setOutlineAlpha]
732 // Set polyline outline alpha
733 val outlineAlphaSuccess = polylineMapObject!!.setOutlineAlpha(0.5)
734 println("Set polyline outline alpha to 0.5: $outlineAlphaSuccess")
735 // [kotlin_PolylineMapObject_setOutlineAlpha]
736
737 // [kotlin_PolylineMapObject_setOutlineOrder]
738 // Set polyline outline rendering order
739 val outlineOrderSuccess = polylineMapObject!!.setOutlineOrder(0)
740 println("Set polyline outline rendering order to 0: $outlineOrderSuccess")
741 // [kotlin_PolylineMapObject_setOutlineOrder]
742
743 // [kotlin_PolylineMapObject_setOutlineCapType]
744 // Set polyline outline cap type
745 val outlineCapTypeSuccess = polylineMapObject!!.setOutlineCapType(CapType.SQUARE)
746 println("Set polyline outline cap type to SQUARE: $outlineCapTypeSuccess")
747 // [kotlin_PolylineMapObject_setOutlineCapType]
748
749 // [kotlin_PolylineMapObject_setOutlineJoinType]
750 // Set polyline outline join type
751 val outlineJoinTypeSuccess = polylineMapObject!!.setOutlineJoinType(JoinType.MITER)
752 println("Set polyline outline join type to MITER: $outlineJoinTypeSuccess")
753 // [kotlin_PolylineMapObject_setOutlineJoinType]
754
755 // [kotlin_PolylineMapObject_setOutlineMiterLimit]
756 // Set polyline outline miter limit
757 val outlineMiterLimitSuccess = polylineMapObject!!.setOutlineMiterLimit(3.0)
758 println("Set polyline outline miter limit to 3.0: $outlineMiterLimitSuccess")
759 // [kotlin_PolylineMapObject_setOutlineMiterLimit]
760
761 // [kotlin_PolylineMapObject_setVisible]
762 // Set visibility
763 val visibleSuccess = polylineMapObject!!.setVisible(true)
764 println("Set polyline visibility to true: $visibleSuccess")
765 // [kotlin_PolylineMapObject_setVisible]
766
767 // [kotlin_PolylineMapObject_getMapObjectType]
768 // Get map object type
769 val objectType = polylineMapObject!!.mapObjectType
770 println("Polyline map object type: $objectType")
771 // [kotlin_PolylineMapObject_getMapObjectType]
772
773 // [kotlin_MapObject_setAlpha_3]
774 // Set alpha transparency
775 val alphaSuccess = polylineMapObject!!.setAlpha(0.7)
776 println("Set polyline alpha to 0.7: $alphaSuccess")
777 // [kotlin_MapObject_setAlpha_3]
778
779 // [kotlin_MapObject_setInteractive_3]
780 // Set interactive mode
781 val interactiveSuccess = polylineMapObject!!.setInteractive(true)
782 println("Set polyline interactive to true: $interactiveSuccess")
783 // [kotlin_MapObject_setInteractive_3]
784
785 // [kotlin_MapObject_setTitle_3]
786 // Set title
787 val titleSuccess = polylineMapObject!!.setTitle("Polyline Object")
788 println("Set polyline title to 'Polyline Object': $titleSuccess")
789 // [kotlin_MapObject_setTitle_3]
790
791 // [kotlin_MapObject_setData_3]
792 // Set custom data
793 val customData = mapOf("key" to "value", "number" to "42")
794 val dataSuccess = polylineMapObject!!.setData(customData)
795 println("Set polyline custom data: $dataSuccess")
796 // [kotlin_MapObject_setData_3]
797
798 // [kotlin_MapObject_getId_3]
799 // Get object ID
800 val objectId = polylineMapObject!!.id
801 println("Polyline object ID: $objectId")
802 // [kotlin_MapObject_getId_3]
803
804 // [kotlin_MapObject_getType_3]
805 // Get object type
806 val objectTypeString = polylineMapObject!!.type
807 println("Polyline object type: $objectTypeString")
808 // [kotlin_MapObject_getType_3]
809
810 // [kotlin_MapObject_getData_3]
811 // Get custom data
812 val retrievedData = polylineMapObject!!.data
813 println("Polyline custom data: $retrievedData")
814 // [kotlin_MapObject_getData_3]
815 }
816
817 // [kotlin_LocationWindow_removePolylineMapObject]
818 // Remove polyline map object
819 if (polylineMapObject != null) {
820 val removed = locationWindow!!.removePolylineMapObject(polylineMapObject!!)
821 println("Removed polyline map object: $removed")
822 polylineMapObject = null
823 }
824 // [kotlin_LocationWindow_removePolylineMapObject]
825
826 // Test multiple polyline objects
827 val polylines = mutableListOf<PolylineMapObject>()
828 for (i in 0..2) {
829 val polyline = locationWindow!!.addPolylineMapObject()
830 if (polyline != null) {
831 val points = listOf(
832 Point(120.0 + i * 30, 130.0 + i * 30),
833 Point(125.0 + i * 30, 135.0 + i * 30),
834 Point(130.0 + i * 30, 140.0 + i * 30)
835 )
836 val metricPl = Polyline(points)
837 val polylineGeometry = LocationPolyline(metricPl, 1, 0)
838 polyline.setPolyLine(polylineGeometry)
839 polyline.setColor(1.0, 0.0, 0.0, 0.6)
840 polyline.setWidth(2.0)
841 polylines.add(polyline)
842 println("Created polyline $i with ${points.size} points")
843 }
844 }
845
846 for (i in polylines.indices) {
847 locationWindow!!.removePolylineMapObject(polylines[i])
848 println("Removed polyline $i")
849 }
850 }
851
852 /**
853 * Demonstrate dotted polyline map objects
854 */
855 private fun demonstrateDottedPolylineMapObjects() {
856 println("--- Dotted Polyline Map Objects ---")
857
858 if (locationWindow == null) {
859 println("LocationWindow not available yet")
860 return
861 }
862
863 // [kotlin_DottedPolylineMapObject_constructor]
864 // Create dotted polyline map object
865 val points = listOf(
866 Point(160.0, 170.0),
867 Point(165.0, 175.0),
868 Point(170.0, 180.0),
869 Point(175.0, 185.0)
870 )
871 val dottedMetric = Polyline(points)
872 val polyline = LocationPolyline(dottedMetric, 1, 0)
873 dottedPolylineMapObject = locationWindow!!.addDottedPolylineMapObject()
874 println("Created dotted polyline map object with ${points.size} points")
875 // [kotlin_DottedPolylineMapObject_constructor]
876
877 // [kotlin_DottedPolylineMapObject_getPolyline]
878 // Access dotted polyline
879 val dottedPolylineShape = dottedPolylineMapObject!!.getPolyLine()
880 println("Dotted polyline has ${dottedPolylineShape.getPolyline().getPoints().size} points")
881 // [kotlin_DottedPolylineMapObject_getPolyline]
882
883 // [kotlin_LocationWindow_addDottedPolylineMapObject]
884 // Add dotted polyline map object
885 dottedPolylineMapObject = locationWindow!!.addDottedPolylineMapObject()
886 println("Added dotted polyline map object")
887 // [kotlin_LocationWindow_addDottedPolylineMapObject]
888
889 if (dottedPolylineMapObject != null) {
890 // [kotlin_DottedPolylineMapObject_setPolyline]
891 // Set dotted polyline geometry
892 val points = listOf(
893 Point(160.0, 170.0),
894 Point(165.0, 175.0),
895 Point(170.0, 180.0),
896 Point(175.0, 185.0)
897 )
898 val dottedPl = Polyline(points)
899 val polyline = LocationPolyline(dottedPl, 1, 0)
900 val success = dottedPolylineMapObject!!.setPolyline(polyline)
901 println("Set dotted polyline with ${points.size} points: $success")
902 // [kotlin_DottedPolylineMapObject_setPolyline]
903
904 // [kotlin_DottedPolylineMapObject_setColor]
905 // Set dotted polyline color
906 val colorSuccess = dottedPolylineMapObject!!.setColor(0.5, 0.0, 1.0, 0.8)
907 println("Set dotted polyline color to purple with 80% opacity: $colorSuccess")
908 // [kotlin_DottedPolylineMapObject_setColor]
909
910 // [kotlin_DottedPolylineMapObject_setWidth]
911 // Set dotted polyline width
912 val widthSuccess = dottedPolylineMapObject!!.setWidth(3.0)
913 println("Set dotted polyline width to 3.0 pixels: $widthSuccess")
914 // [kotlin_DottedPolylineMapObject_setWidth]
915
916 // [kotlin_DottedPolylineMapObject_setOrder]
917 // Set dotted polyline rendering order
918 val orderSuccess = dottedPolylineMapObject!!.setOrder(2)
919 println("Set dotted polyline rendering order to 2: $orderSuccess")
920 // [kotlin_DottedPolylineMapObject_setOrder]
921
922 // [kotlin_DottedPolylineMapObject_setCollisionEnabled]
923 // Enable collision detection
924 val collisionSuccess = dottedPolylineMapObject!!.setCollisionEnabled(true)
925 println("Enabled collision detection for dotted polyline: $collisionSuccess")
926 // [kotlin_DottedPolylineMapObject_setCollisionEnabled]
927
928 // [kotlin_DottedPolylineMapObject_setPlacement]
929 // Set placement type
930 val placementSuccess = dottedPolylineMapObject!!.setPlacement(Placement.CENTER)
931 println("Set dotted polyline placement to CENTER: $placementSuccess")
932 // [kotlin_DottedPolylineMapObject_setPlacement]
933
934 // [kotlin_DottedPolylineMapObject_setPlacementMinRatio]
935 // Set placement min ratio
936 val minRatioSuccess = dottedPolylineMapObject!!.setPlacementMinRatio(0.5)
937 println("Set dotted polyline placement min ratio to 0.5: $minRatioSuccess")
938 // [kotlin_DottedPolylineMapObject_setPlacementMinRatio]
939
940 // [kotlin_DottedPolylineMapObject_setPlacementSpacing]
941 // Set placement spacing
942 val spacingSuccess = dottedPolylineMapObject!!.setPlacementSpacing(10.0)
943 println("Set dotted polyline placement spacing to 10.0: $spacingSuccess")
944 // [kotlin_DottedPolylineMapObject_setPlacementSpacing]
945
946 // [kotlin_DottedPolylineMapObject_setPriority]
947 // Set rendering priority
948 val prioritySuccess = dottedPolylineMapObject!!.setPriority(1)
949 println("Set dotted polyline rendering priority to 1: $prioritySuccess")
950 // [kotlin_DottedPolylineMapObject_setPriority]
951
952 // [kotlin_DottedPolylineMapObject_setRepeatDistance]
953 // Set repeat distance
954 val repeatDistanceSuccess = dottedPolylineMapObject!!.setRepeatDistance(20.0)
955 println("Set dotted polyline repeat distance to 20.0: $repeatDistanceSuccess")
956 // [kotlin_DottedPolylineMapObject_setRepeatDistance]
957
958 // [kotlin_DottedPolylineMapObject_setRepeatGroup]
959 // Set repeat group
960 val repeatGroupSuccess = dottedPolylineMapObject!!.setRepeatGroup(1)
961 println("Set dotted polyline repeat group to 1: $repeatGroupSuccess")
962 // [kotlin_DottedPolylineMapObject_setRepeatGroup]
963
964 // [kotlin_DottedPolylineMapObject_setSize]
965 // Set size
966 val size = Size(16.0, 16.0)
967 val sizeSuccess = dottedPolylineMapObject!!.setSize(size)
968 println("Set dotted polyline size to (${size.width}, ${size.height}): $sizeSuccess")
969 // [kotlin_DottedPolylineMapObject_setSize]
970
971 // [kotlin_DottedPolylineMapObject_setVisible]
972 // Set visibility
973 val visibleSuccess = dottedPolylineMapObject!!.setVisible(true)
974 println("Set dotted polyline visibility to true: $visibleSuccess")
975 // [kotlin_DottedPolylineMapObject_setVisible]
976
977 // [kotlin_DottedPolylineMapObject_getMapObjectType]
978 // Get map object type
979 val objectType = dottedPolylineMapObject!!.mapObjectType
980 println("Dotted polyline map object type: $objectType")
981 // [kotlin_DottedPolylineMapObject_getMapObjectType]
982
983 // [kotlin_MapObject_setAlpha_4]
984 // Set alpha transparency
985 val alphaSuccess = dottedPolylineMapObject!!.setAlpha(0.8)
986 println("Set dotted polyline alpha to 0.8: $alphaSuccess")
987 // [kotlin_MapObject_setAlpha_4]
988
989 // [kotlin_MapObject_setInteractive_4]
990 // Set interactive mode
991 val interactiveSuccess = dottedPolylineMapObject!!.setInteractive(true)
992 println("Set dotted polyline interactive to true: $interactiveSuccess")
993 // [kotlin_MapObject_setInteractive_4]
994
995 // [kotlin_MapObject_setTitle_4]
996 // Set title
997 val titleSuccess = dottedPolylineMapObject!!.setTitle("Dotted Polyline Object")
998 println("Set dotted polyline title to 'Dotted Polyline Object': $titleSuccess")
999 // [kotlin_MapObject_setTitle_4]
1000
1001 // [kotlin_MapObject_setData_4]
1002 // Set custom data
1003 val customData = mapOf("key" to "value", "number" to "42")
1004 val dataSuccess = dottedPolylineMapObject!!.setData(customData)
1005 println("Set dotted polyline custom data: $dataSuccess")
1006 // [kotlin_MapObject_setData_4]
1007
1008 // [kotlin_MapObject_getId_4]
1009 // Get object ID
1010 val objectId = dottedPolylineMapObject!!.id
1011 println("Dotted polyline object ID: $objectId")
1012 // [kotlin_MapObject_getId_4]
1013
1014 // [kotlin_MapObject_getType_4]
1015 // Get object type
1016 val objectTypeString = dottedPolylineMapObject!!.type
1017 println("Dotted polyline object type: $objectTypeString")
1018 // [kotlin_MapObject_getType_4]
1019
1020 // [kotlin_MapObject_getData_4]
1021 // Get custom data
1022 val retrievedData = dottedPolylineMapObject!!.data
1023 println("Dotted polyline custom data: $retrievedData")
1024 // [kotlin_MapObject_getData_4]
1025 }
1026
1027 // [kotlin_LocationWindow_removeDottedPolylineMapObject]
1028 // Remove dotted polyline map object
1029 if (dottedPolylineMapObject != null) {
1030 val removed = locationWindow!!.removeDottedPolylineMapObject(dottedPolylineMapObject!!)
1031 println("Removed dotted polyline map object: $removed")
1032 dottedPolylineMapObject = null
1033 }
1034 // [kotlin_LocationWindow_removeDottedPolylineMapObject]
1035
1036 // Test multiple dotted polyline objects
1037 val dottedPolylines = mutableListOf<DottedPolylineMapObject>()
1038 for (i in 0..2) {
1039 val dottedPolyline = locationWindow!!.addDottedPolylineMapObject()
1040 if (dottedPolyline != null) {
1041 val points = listOf(
1042 Point(180.0 + i * 30, 190.0 + i * 30),
1043 Point(185.0 + i * 30, 195.0 + i * 30),
1044 Point(190.0 + i * 30, 200.0 + i * 30)
1045 )
1046 val pl = Polyline(points)
1047 val polylineGeometry = LocationPolyline(pl, 1, 0)
1048 dottedPolyline.setPolyline(polylineGeometry)
1049 dottedPolylines.add(dottedPolyline)
1050 println("Created dotted polyline $i with ${points.size} points")
1051 }
1052 }
1053
1054 for (i in dottedPolylines.indices) {
1055 locationWindow!!.removeDottedPolylineMapObject(dottedPolylines[i])
1056 println("Removed dotted polyline $i")
1057 }
1058 }
1059
1060 /**
1061 * Demonstrate remove all map objects
1062 */
1063 private fun demonstrateRemoveAllMapObjects() {
1064 println("--- Remove All Map Objects ---")
1065
1066 if (locationWindow == null) {
1067 println("LocationWindow not available yet")
1068 return
1069 }
1070
1071 println("Current map objects count: ${getMapObjectsCount()}")
1072
1073 // [kotlin_LocationWindow_removeAllMapObjects]
1074 // Remove all map objects
1075 locationWindow!!.removeAllMapObjects()
1076 println("Removed all map objects")
1077 // [kotlin_LocationWindow_removeAllMapObjects]
1078
1079 println("Map objects count after removal: ${getMapObjectsCount()}")
1080 }
1081
1082 /**
1083 * Get current map objects count
1084 */
1085 private fun getMapObjectsCount(): Int {
1086 var count = 0
1087 if (circleMapObject != null) count++
1088 if (iconMapObject != null) count++
1089 if (polygonMapObject != null) count++
1090 if (polylineMapObject != null) count++
1091 if (dottedPolylineMapObject != null) count++
1092 return count
1093 }
1094
1095 /**
1096 * Cleanup resources
1097 */
1098 private fun cleanup() {
1099 println("--- Cleanup ---")
1100
1101 if (locationWindow != null) {
1102 locationWindow!!.removeAllMapObjects()
1103 println("Cleaned up all map objects")
1104 }
1105
1106 circleMapObject = null
1107 iconMapObject = null
1108 polygonMapObject = null
1109 polylineMapObject = null
1110 dottedPolylineMapObject = null
1111 println("Cleared map objects references")
1112 }
1113}
1114
1115// Main function to run the example
1116fun main() {
1117 LocationWindowMapObjectsExample()
1118}