63 NSLog(
@"--- LocationPolygon / LocationPolyline records ---");
66 NSArray<NCPoint *> *ring = @[
67 [[
NCPoint alloc] initWithX:1.0 y:2.0],
68 [[
NCPoint alloc] initWithX:3.0 y:4.0],
69 [[
NCPoint alloc] initWithX:5.0 y:2.0],
74 NSLog(
@"LocationPolygon location %d sublocation %d vertices %lu",
79 NSArray<NCPoint *> *linePts = @[
80 [[
NCPoint alloc] initWithX:0.0 y:0.0],
81 [[
NCPoint alloc] initWithX:10.0 y:10.0],
86 NSLog(
@"LocationPolyline points %lu", (
unsigned long)polylineBack.
points.count);
94 NSLog(
@"--- Circle Map Objects ---");
97 NSLog(
@"LocationWindow not available yet");
105 NSLog(
@"Created circle map object with center (%f, %f) and radius 5.0", center.x, center.y);
111 NSLog(
@"Circle center: (%f, %f)", circleCenter.x, circleCenter.y);
116 double radius = circleObject.radius;
117 NSLog(
@"Circle radius: %f", radius);
124 NSLog(
@"Added circle map object");
128 NSArray *circles = @[
137 NSLog(
@"Added circle at (%f, %f) with radius %f", circle.center.x, circle.center.y, circle.radius);
144 NSLog(
@"Removed circle map object");
147 if (circleObject != nil) {
152 NSLog(
@"Set circle position to (%f, %f): %@", centerPoint.x, centerPoint.y, success ?
@"YES" :
@"NO");
158 BOOL animatedSuccess = [
circleObject setPositionAnimated:animatedPoint duration:2.0 animationType:AnimationTypeLinear];
159 NSLog(
@"Set circle position with animation to (%f, %f): %@", animatedPoint.x, animatedPoint.y, animatedSuccess ?
@"YES" :
@"NO");
165 NSLog(
@"Set circle radius to 10.0 meters: %@", radiusSuccess ?
@"YES" :
@"NO");
171 NSLog(
@"Enabled collision detection for circle: %@", collisionSuccess ?
@"YES" :
@"NO");
176 BOOL bufferSuccess = [
circleObject setBufferWithWidth:5.0 height:5.0];
177 NSLog(
@"Set collision buffer to 5x5 pixels: %@", bufferSuccess ?
@"YES" :
@"NO");
182 BOOL offsetSuccess = [
circleObject setOffsetWithX:2.0 y:3.0];
183 NSLog(
@"Set position offset to (2.0, 3.0) pixels: %@", offsetSuccess ?
@"YES" :
@"NO");
188 BOOL outlineColorSuccess = [
circleObject setOutlineColorWithRed:0.0 green:0.0 blue:1.0 alpha:1.0];
189 NSLog(
@"Set circle outline color to blue: %@", outlineColorSuccess ?
@"YES" :
@"NO");
195 NSLog(
@"Set circle outline alpha to 0.5: %@", outlineAlphaSuccess ?
@"YES" :
@"NO");
201 NSLog(
@"Set circle outline radius to 2.0: %@", outlineRadiusSuccess ?
@"YES" :
@"NO");
206 BOOL colorSuccess = [
circleObject setColorWithRed:1.0 green:0.0 blue:0.0 alpha:0.8];
207 NSLog(
@"Set circle color to red with 80%% opacity: %@", colorSuccess ?
@"YES" :
@"NO");
213 NSLog(
@"Set rendering priority to 1: %@", prioritySuccess ?
@"YES" :
@"NO");
219 NSLog(
@"Set circle visibility to true: %@", visibleSuccess ?
@"YES" :
@"NO");
225 NSLog(
@"Circle map object type: %@", objectType);
231 NSLog(
@"Set circle alpha to 0.7: %@", alphaSuccess ?
@"YES" :
@"NO");
237 NSLog(
@"Set circle interactive to true: %@", interactiveSuccess ?
@"YES" :
@"NO");
243 NSLog(
@"Set circle title to 'Circle Object': %@", titleSuccess ?
@"YES" :
@"NO");
248 NSDictionary *customData = @{
@"key":
@"value",
@"number":
@"42"};
250 NSLog(
@"Set circle custom data: %@", dataSuccess ?
@"YES" :
@"NO");
255 NSInteger objectId = circleObject.id;
256 NSLog(
@"Circle object ID: %ld", (
long)objectId);
261 NSString *objectTypeString = circleObject.type;
262 NSLog(
@"Circle object type: %@", objectTypeString);
267 NSDictionary *retrievedData = circleObject.data;
268 NSLog(
@"Circle custom data: %@", retrievedData);
277 NSLog(
@"--- Icon Map Objects ---");
280 NSLog(
@"LocationWindow not available yet");
288 NSLog(
@"Created icon map object at (%f, %f)", position.x, position.y);
294 NSLog(
@"Icon position: (%f, %f)", iconPosition.x, iconPosition.y);
299 BOOL iconSuccess = [
iconObject setIcon:@"path/to/icon.png"];
300 NSLog(
@"Set icon image: %@", iconSuccess ?
@"YES" :
@"NO");
306 NSLog(
@"Set icon bitmap: %@", bitmapSuccess ?
@"YES" :
@"NO");
312 NSLog(
@"Set icon flat mode to true: %@", flatSuccess ?
@"YES" :
@"NO");
317 NCSize *size = [[
NCSize alloc] initWithWidth:32.0 height:32.0];
319 NSLog(
@"Set icon size to (%.1f, %.1f): %@", size.width, size.height, sizeSuccess ?
@"YES" :
@"NO");
325 NSLog(
@"Set icon rotation angle to 45 degrees: %@", angleSuccess ?
@"YES" :
@"NO");
330 BOOL angleAnimatedSuccess = [
iconObject setAngleAnimated:90.0 duration:2.0 animationType:NCSine];
331 NSLog(
@"Set icon rotation with animation to 90 degrees: %@", angleAnimatedSuccess ?
@"YES" :
@"NO");
337 NSLog(
@"Enabled collision detection for icon: %@", collisionSuccess ?
@"YES" :
@"NO");
342 BOOL bufferSuccess = [
iconObject setBufferWithWidth:10.0 height:10.0];
343 NSLog(
@"Set collision buffer to 10x10 pixels: %@", bufferSuccess ?
@"YES" :
@"NO");
348 BOOL placementSuccess = [
iconObject setPlacement:NCCenter];
349 NSLog(
@"Set icon placement to CENTER: %@", placementSuccess ?
@"YES" :
@"NO");
356 NSLog(
@"Set icon position to (%.1f, %.1f): %@", newPosition.x, newPosition.y, positionSuccess ?
@"YES" :
@"NO");
362 BOOL animatedSuccess = [
iconObject setPositionAnimated:animatedPosition duration:2.0 animationType:NCLinear];
363 NSLog(
@"Set icon position with animation to (%.1f, %.1f): %@", animatedPosition.x, animatedPosition.y, animatedSuccess ?
@"YES" :
@"NO");
368 BOOL offsetSuccess = [
iconObject setOffsetWithWidth:5.0 height:5.0];
369 NSLog(
@"Set icon offset to 5x5 pixels: %@", offsetSuccess ?
@"YES" :
@"NO");
375 NSLog(
@"Set icon priority to 1: %@", prioritySuccess ?
@"YES" :
@"NO");
381 NSLog(
@"Set icon visibility to true: %@", visibleSuccess ?
@"YES" :
@"NO");
387 NSLog(
@"Icon map object type: %@", objectType);
393 NSLog(
@"Set icon alpha to 0.8: %@", alphaSuccess ?
@"YES" :
@"NO");
399 NSLog(
@"Set icon interactive to true: %@", interactiveSuccess ?
@"YES" :
@"NO");
405 NSLog(
@"Set icon title to 'Icon Object': %@", titleSuccess ?
@"YES" :
@"NO");
410 NSDictionary *customData = @{
@"key":
@"value",
@"number":
@"42"};
412 NSLog(
@"Set icon custom data: %@", dataSuccess ?
@"YES" :
@"NO");
417 NSInteger objectId = iconObject.id;
418 NSLog(
@"Icon object ID: %ld", (
long)objectId);
423 NSString *objectTypeString = iconObject.type;
424 NSLog(
@"Icon object type: %@", objectTypeString);
429 NSDictionary *retrievedData = iconObject.data;
430 NSLog(
@"Icon custom data: %@", retrievedData);
437 NSLog(
@"Added icon map object");
450 NSLog(
@"Added icon at (%f, %f)", icon.position.x, icon.position.y);
457 NSLog(
@"Removed icon map object");
465 NSLog(
@"--- Polygon Map Objects ---");
468 NSLog(
@"LocationWindow not available yet");
475 NSLog(
@"Added polygon map object");
478 if (polygonObject != nil) {
481 NSArray<NCPoint *> *points = @[
482 [[
NCPoint alloc] initWithX:100.0 y:200.0],
483 [[
NCPoint alloc] initWithX:150.0 y:250.0],
484 [[
NCPoint alloc] initWithX:200.0 y:200.0],
485 [[
NCPoint alloc] initWithX:150.0 y:150.0],
490 NSLog(
@"Set polygon with %lu points: %@", (
unsigned long)points.count, success ?
@"YES" :
@"NO");
495 BOOL colorSuccess = [
polygonObject setColorWithRed:0.0 green:1.0 blue:0.0 alpha:0.7];
496 NSLog(
@"Set polygon color to green with 70%% opacity: %@", colorSuccess ?
@"YES" :
@"NO");
502 NSLog(
@"Set polygon visibility to true: %@", visibleSuccess ?
@"YES" :
@"NO");
508 NSLog(
@"Polygon map object type: %@", objectType);
514 NSLog(
@"Set polygon rendering order to 2: %@", orderSuccess ?
@"YES" :
@"NO");
519 BOOL outlineColorSuccess = [
polygonObject setOutlineColorWithRed:0.0 green:0.0 blue:1.0 alpha:1.0];
520 NSLog(
@"Set polygon outline color to blue: %@", outlineColorSuccess ?
@"YES" :
@"NO");
525 BOOL outlineWidthSuccess = [
polygonObject setOutlineWidth:2.0];
526 NSLog(
@"Set polygon outline width to 2.0 pixels: %@", outlineWidthSuccess ?
@"YES" :
@"NO");
531 BOOL outlineAlphaSuccess = [
polygonObject setOutlineAlpha:0.8];
532 NSLog(
@"Set polygon outline alpha to 0.8: %@", outlineAlphaSuccess ?
@"YES" :
@"NO");
537 BOOL outlineOrderSuccess = [
polygonObject setOutlineOrder:1];
538 NSLog(
@"Set polygon outline order to 1: %@", outlineOrderSuccess ?
@"YES" :
@"NO");
544 NSLog(
@"Set polygon alpha to 0.6: %@", alphaSuccess ?
@"YES" :
@"NO");
550 NSLog(
@"Set polygon interactive to true: %@", interactiveSuccess ?
@"YES" :
@"NO");
556 NSLog(
@"Set polygon title to 'Polygon Object': %@", titleSuccess ?
@"YES" :
@"NO");
561 NSDictionary *customData = @{
@"key":
@"value",
@"number":
@"42"};
563 NSLog(
@"Set polygon custom data: %@", dataSuccess ?
@"YES" :
@"NO");
568 NSInteger objectId = polygonObject.id;
569 NSLog(
@"Polygon object ID: %ld", (
long)objectId);
574 NSString *objectTypeString = polygonObject.type;
575 NSLog(
@"Polygon object type: %@", objectTypeString);
580 NSDictionary *retrievedData = polygonObject.data;
581 NSLog(
@"Polygon custom data: %@", retrievedData);
587 if (polygonObject != nil) {
589 NSLog(
@"Removed polygon map object: %@", removed ?
@"YES" :
@"NO");
595 for (
int i = 0; i < 3; i++) {
597 if (polygon != nil) {
598 NSArray<NCPoint *> *points = @[
599 [[
NCPoint alloc] initWithX:300.0 + i * 50 y:400.0 + i * 50],
600 [[
NCPoint alloc] initWithX:350.0 + i * 50 y:450.0 + i * 50],
601 [[
NCPoint alloc] initWithX:400.0 + i * 50 y:400.0 + i * 50],
602 [[
NCPoint alloc] initWithX:350.0 + i * 50 y:350.0 + i * 50],
607 [
polygon setColorWithRed:0.0 green:0.0 blue:1.0 alpha:0.5];
609 NSLog(
@"Created polygon %d with %lu points", i, (
unsigned long)points.count);
613 for (
int i = 0; i < polygons.count; i++) {
615 NSLog(
@"Removed polygon %d", i);
623 NSLog(
@"--- Polyline Map Objects ---");
626 NSLog(
@"LocationWindow not available yet");
632 NSArray<NCPoint *> *points = @[
633 [[
NCPoint alloc] initWithX:100.0 y:110.0],
634 [[
NCPoint alloc] initWithX:105.0 y:115.0],
635 [[
NCPoint alloc] initWithX:110.0 y:120.0],
636 [[
NCPoint alloc] initWithX:115.0 y:125.0],
641 NSLog(
@"Created polyline map object with %lu points", (
unsigned long)points.count);
647 NSLog(
@"Polyline has %lu points", (
unsigned long)polylineShape.
polyline.
points.count);
654 NSLog(
@"Added polyline map object");
658 NSArray *polylines = @[
660 [[
NCPoint alloc] initWithX:120.0 y:130.0],
661 [[
NCPoint alloc] initWithX:125.0 y:135.0],
662 [[
NCPoint alloc] initWithX:130.0 y:140.0],
663 ]] locationId:1 sublocationId:0]],
665 [[
NCPoint alloc] initWithX:135.0 y:145.0],
666 [[
NCPoint alloc] initWithX:140.0 y:150.0],
667 [[
NCPoint alloc] initWithX:145.0 y:155.0],
668 [[
NCPoint alloc] initWithX:150.0 y:160.0],
669 ]] locationId:1 sublocationId:0]],
675 NSLog(
@"Added polyline with %lu points", (
unsigned long)line.polyline.polyline.points.count);
682 NSLog(
@"Removed polyline map object");
685 if (polylineObject != nil) {
688 NSArray<NCPoint *> *polylinePoints = @[
689 [[
NCPoint alloc] initWithX:100.0 y:200.0],
690 [[
NCPoint alloc] initWithX:150.0 y:250.0],
691 [[
NCPoint alloc] initWithX:200.0 y:300.0],
692 [[
NCPoint alloc] initWithX:250.0 y:350.0],
697 NSLog(
@"Set polyline with %lu points: %@", (
unsigned long)polylinePoints.count, polylineSuccess ?
@"YES" :
@"NO");
703 NSLog(
@"Set polyline width to 3.0 pixels: %@", widthSuccess ?
@"YES" :
@"NO");
708 BOOL polylineColorSuccess = [
polylineObject setColorWithRed:0.0 green:1.0 blue:0.0 alpha:0.8];
709 NSLog(
@"Set polyline color to green with 80%% opacity: %@", polylineColorSuccess ?
@"YES" :
@"NO");
715 NSLog(
@"Set polyline rendering order to 1: %@", polylineOrderSuccess ?
@"YES" :
@"NO");
721 NSLog(
@"Set polyline cap type to ROUND: %@", capTypeSuccess ?
@"YES" :
@"NO");
727 NSLog(
@"Set polyline join type to ROUND: %@", joinTypeSuccess ?
@"YES" :
@"NO");
733 NSLog(
@"Set polyline miter limit to 2.0: %@", miterLimitSuccess ?
@"YES" :
@"NO");
739 NSLog(
@"Set polyline outline width to 1.0 pixels: %@", outlineWidthSuccess ?
@"YES" :
@"NO");
744 BOOL outlineColorSuccess = [
polylineObject setOutlineColorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
745 NSLog(
@"Set polyline outline color to black: %@", outlineColorSuccess ?
@"YES" :
@"NO");
751 NSLog(
@"Set polyline outline alpha to 0.5: %@", outlineAlphaSuccess ?
@"YES" :
@"NO");
757 NSLog(
@"Set polyline outline rendering order to 0: %@", outlineOrderSuccess ?
@"YES" :
@"NO");
763 NSLog(
@"Set polyline outline cap type to SQUARE: %@", outlineCapTypeSuccess ?
@"YES" :
@"NO");
769 NSLog(
@"Set polyline outline join type to MITER: %@", outlineJoinTypeSuccess ?
@"YES" :
@"NO");
775 NSLog(
@"Set polyline outline miter limit to 3.0: %@", outlineMiterLimitSuccess ?
@"YES" :
@"NO");
781 NSLog(
@"Set polyline visibility to true: %@", visibleSuccess ?
@"YES" :
@"NO");
787 NSLog(
@"Polyline map object type: %@", objectType);
793 NSLog(
@"Set polyline alpha to 0.7: %@", alphaSuccess ?
@"YES" :
@"NO");
799 NSLog(
@"Set polyline interactive to true: %@", interactiveSuccess ?
@"YES" :
@"NO");
805 NSLog(
@"Set polyline title to 'Polyline Object': %@", titleSuccess ?
@"YES" :
@"NO");
810 NSDictionary *customData = @{
@"key":
@"value",
@"number":
@"42"};
812 NSLog(
@"Set polyline custom data: %@", dataSuccess ?
@"YES" :
@"NO");
817 NSInteger objectId = polylineObject.id;
818 NSLog(
@"Polyline object ID: %ld", (
long)objectId);
823 NSString *objectTypeString = polylineObject.type;
824 NSLog(
@"Polyline object type: %@", objectTypeString);
829 NSDictionary *retrievedData = polylineObject.data;
830 NSLog(
@"Polyline custom data: %@", retrievedData);
839 NSLog(
@"--- Dotted Polyline Map Objects ---");
842 NSLog(
@"LocationWindow not available yet");
848 NSArray<NCPoint *> *points = @[
849 [[
NCPoint alloc] initWithX:160.0 y:170.0],
850 [[
NCPoint alloc] initWithX:165.0 y:175.0],
851 [[
NCPoint alloc] initWithX:170.0 y:180.0],
852 [[
NCPoint alloc] initWithX:175.0 y:185.0],
857 NSLog(
@"Created dotted polyline map object with %lu points", (
unsigned long)points.count);
863 NSLog(
@"Dotted polyline has %lu points", (
unsigned long)dottedPolylineShape.
polyline.
points.count);
868 NSArray<NCPoint *> *dottedPoints = @[
869 [[
NCPoint alloc] initWithX:160.0 y:170.0],
870 [[
NCPoint alloc] initWithX:165.0 y:175.0],
871 [[
NCPoint alloc] initWithX:170.0 y:180.0],
872 [[
NCPoint alloc] initWithX:175.0 y:185.0],
877 NSLog(
@"Set dotted polyline with %lu points: %@", (
unsigned long)dottedPoints.count, dottedSuccess ?
@"YES" :
@"NO");
883 NSLog(
@"Set dotted polyline color to purple with 80%% opacity: %@", colorSuccess ?
@"YES" :
@"NO");
889 NSLog(
@"Set dotted polyline width to 3.0 pixels: %@", widthSuccess ?
@"YES" :
@"NO");
895 NSLog(
@"Set dotted polyline rendering order to 2: %@", orderSuccess ?
@"YES" :
@"NO");
901 NSLog(
@"Enabled collision detection for dotted polyline: %@", collisionSuccess ?
@"YES" :
@"NO");
907 NSLog(
@"Set dotted polyline placement to CENTER: %@", placementSuccess ?
@"YES" :
@"NO");
913 NSLog(
@"Set dotted polyline placement min ratio to 0.5: %@", minRatioSuccess ?
@"YES" :
@"NO");
919 NSLog(
@"Set dotted polyline placement spacing to 10.0: %@", spacingSuccess ?
@"YES" :
@"NO");
925 NSLog(
@"Set dotted polyline rendering priority to 1: %@", prioritySuccess ?
@"YES" :
@"NO");
931 NSLog(
@"Set dotted polyline repeat distance to 20.0: %@", repeatDistanceSuccess ?
@"YES" :
@"NO");
937 NSLog(
@"Set dotted polyline repeat group to 1: %@", repeatGroupSuccess ?
@"YES" :
@"NO");
942 NCSize *size = [[
NCSize alloc] initWithWidth:16.0 height:16.0];
944 NSLog(
@"Set dotted polyline size to (%.1f, %.1f): %@", size.width, size.height, sizeSuccess ?
@"YES" :
@"NO");
950 NSLog(
@"Set dotted polyline visibility to true: %@", visibleSuccess ?
@"YES" :
@"NO");
956 NSLog(
@"Dotted polyline map object type: %@", objectType);
962 NSLog(
@"Set dotted polyline alpha to 0.8: %@", alphaSuccess ?
@"YES" :
@"NO");
968 NSLog(
@"Set dotted polyline interactive to true: %@", interactiveSuccess ?
@"YES" :
@"NO");
974 NSLog(
@"Set dotted polyline title to 'Dotted Polyline Object': %@", titleSuccess ?
@"YES" :
@"NO");
979 NSDictionary *customData = @{
@"key":
@"value",
@"number":
@"42"};
981 NSLog(
@"Set dotted polyline custom data: %@", dataSuccess ?
@"YES" :
@"NO");
986 NSInteger objectId = dottedPolylineObject.id;
987 NSLog(
@"Dotted polyline object ID: %ld", (
long)objectId);
992 NSString *objectTypeString = dottedPolylineObject.type;
993 NSLog(
@"Dotted polyline object type: %@", objectTypeString);
998 NSDictionary *retrievedData = dottedPolylineObject.data;
999 NSLog(
@"Dotted polyline custom data: %@", retrievedData);
1006 NSLog(
@"Added dotted polyline map object");
1010 NSArray *dottedPolylines = @[
1012 [[
NCPoint alloc] initWithX:180.0 y:190.0],
1013 [[
NCPoint alloc] initWithX:185.0 y:195.0],
1014 [[
NCPoint alloc] initWithX:190.0 y:200.0],
1015 ]] locationId:1 sublocationId:0]],
1017 [[
NCPoint alloc] initWithX:195.0 y:205.0],
1018 [[
NCPoint alloc] initWithX:200.0 y:210.0],
1019 [[
NCPoint alloc] initWithX:205.0 y:215.0],
1020 [[
NCPoint alloc] initWithX:210.0 y:220.0],
1021 ]] locationId:1 sublocationId:0]],
1027 NSLog(
@"Added dotted polyline with %lu points", (
unsigned long)dottedLine.polyline.polyline.points.count);
1034 NSLog(
@"Removed dotted polyline map object");