60 NSLog(
@"--- Circle Map Objects ---");
62 if (_locationWindow == nil) {
63 NSLog(
@"LocationWindow not available yet");
69 NCLocationPoint *center = [[
NCLocationPoint alloc] initWithX:10.0 y:20.0];
70 NCCircleMapObject *circleObject = [[
NCCircleMapObject alloc] initWithCenter:center radius:5.0];
71 NSLog(
@"Created circle map object with center (%f, %f) and radius 5.0", center.x, center.y);
76 NCLocationPoint *circleCenter = circleObject.center;
77 NSLog(
@"Circle center: (%f, %f)", circleCenter.x, circleCenter.y);
82 double radius = circleObject.radius;
83 NSLog(
@"Circle radius: %f", radius);
88 [_locationWindow addCircleMapObject:circleObject];
90 NSLog(
@"Added circle map object");
100 for (NCCircleMapObject *circle in circles) {
101 [_locationWindow addCircleMapObject:circle];
103 NSLog(
@"Added circle at (%f, %f) with radius %f", circle.center.x, circle.center.y, circle.radius);
108 [_locationWindow removeCircleMapObject:circleObject];
110 NSLog(
@"Removed circle map object");
113 if (circleObject != nil) {
116 NCLocationPoint *centerPoint = [[
NCLocationPoint alloc] initWithX:100.0 y:200.0];
118 NSLog(
@"Set circle position to (%f, %f): %@", centerPoint.x, centerPoint.y, success ?
@"YES" :
@"NO");
123 NCLocationPoint *animatedPoint = [[
NCLocationPoint alloc] initWithX:150.0 y:250.0];
124 BOOL animatedSuccess = [
circleObject setPositionAnimated:animatedPoint duration:2.0 animationType:AnimationTypeLinear];
125 NSLog(
@"Set circle position with animation to (%f, %f): %@", animatedPoint.x, animatedPoint.y, animatedSuccess ?
@"YES" :
@"NO");
131 NSLog(
@"Set circle radius to 10.0 meters: %@", radiusSuccess ?
@"YES" :
@"NO");
136 BOOL collisionSuccess = [
circleObject setCollisionEnabled:YES];
137 NSLog(
@"Enabled collision detection for circle: %@", collisionSuccess ?
@"YES" :
@"NO");
142 BOOL bufferSuccess = [
circleObject setBufferWithWidth:5.0 height:5.0];
143 NSLog(
@"Set collision buffer to 5x5 pixels: %@", bufferSuccess ?
@"YES" :
@"NO");
148 BOOL offsetSuccess = [
circleObject setOffsetWithX:2.0 y:3.0];
149 NSLog(
@"Set position offset to (2.0, 3.0) pixels: %@", offsetSuccess ?
@"YES" :
@"NO");
154 BOOL outlineColorSuccess = [
circleObject setOutlineColorWithRed:0.0 green:0.0 blue:1.0 alpha:1.0];
155 NSLog(
@"Set circle outline color to blue: %@", outlineColorSuccess ?
@"YES" :
@"NO");
160 BOOL outlineAlphaSuccess = [
circleObject setOutlineAlpha:0.5];
161 NSLog(
@"Set circle outline alpha to 0.5: %@", outlineAlphaSuccess ?
@"YES" :
@"NO");
166 BOOL outlineRadiusSuccess = [
circleObject setOutlineRadius:2.0];
167 NSLog(
@"Set circle outline radius to 2.0: %@", outlineRadiusSuccess ?
@"YES" :
@"NO");
172 BOOL colorSuccess = [
circleObject setColorWithRed:1.0 green:0.0 blue:0.0 alpha:0.8];
173 NSLog(
@"Set circle color to red with 80%% opacity: %@", colorSuccess ?
@"YES" :
@"NO");
179 NSLog(
@"Set rendering priority to 1: %@", prioritySuccess ?
@"YES" :
@"NO");
185 NSLog(
@"Set circle visibility to true: %@", visibleSuccess ?
@"YES" :
@"NO");
190 NCMapObjectType objectType = circleObject.mapObjectType;
191 NSLog(
@"Circle map object type: %@", objectType);
197 NSLog(
@"Set circle alpha to 0.7: %@", alphaSuccess ?
@"YES" :
@"NO");
202 BOOL interactiveSuccess = [
circleObject setInteractive:YES];
203 NSLog(
@"Set circle interactive to true: %@", interactiveSuccess ?
@"YES" :
@"NO");
208 BOOL titleSuccess = [
circleObject setTitle:@"Circle Object"];
209 NSLog(
@"Set circle title to 'Circle Object': %@", titleSuccess ?
@"YES" :
@"NO");
214 NSDictionary *customData = @{
@"key":
@"value",
@"number":
@"42"};
216 NSLog(
@"Set circle custom data: %@", dataSuccess ?
@"YES" :
@"NO");
221 NSInteger objectId = circleObject.id;
222 NSLog(
@"Circle object ID: %ld", (
long)objectId);
227 NSString *objectTypeString = circleObject.type;
228 NSLog(
@"Circle object type: %@", objectTypeString);
233 NSDictionary *retrievedData = circleObject.data;
234 NSLog(
@"Circle custom data: %@", retrievedData);
243 NSLog(
@"--- Icon Map Objects ---");
245 if (_locationWindow == nil) {
246 NSLog(
@"LocationWindow not available yet");
252 NCLocationPoint *position = [[
NCLocationPoint alloc] initWithX:30.0 y:40.0];
253 NCIconMapObject *iconObject = [[
NCIconMapObject alloc] initWithPosition:position];
254 NSLog(
@"Created icon map object at (%f, %f)", position.x, position.y);
259 NCLocationPoint *iconPosition = iconObject.position;
260 NSLog(
@"Icon position: (%f, %f)", iconPosition.x, iconPosition.y);
265 BOOL iconSuccess = [
iconObject setIcon:@"path/to/icon.png"];
266 NSLog(
@"Set icon image: %@", iconSuccess ?
@"YES" :
@"NO");
271 BOOL bitmapSuccess = [
iconObject setBitmap:@"path/to/bitmap.png"];
272 NSLog(
@"Set icon bitmap: %@", bitmapSuccess ?
@"YES" :
@"NO");
278 NSLog(
@"Set icon flat mode to true: %@", flatSuccess ?
@"YES" :
@"NO");
283 NCSize *size = [[
NCSize alloc] initWithWidth:32.0 height:32.0];
285 NSLog(
@"Set icon size to (%.1f, %.1f): %@", size.width, size.height, sizeSuccess ?
@"YES" :
@"NO");
290 BOOL angleSuccess = [
iconObject setAngle:45.0];
291 NSLog(
@"Set icon rotation angle to 45 degrees: %@", angleSuccess ?
@"YES" :
@"NO");
296 BOOL angleAnimatedSuccess = [
iconObject setAngleAnimated:90.0 duration:2.0 animationType:NCSine];
297 NSLog(
@"Set icon rotation with animation to 90 degrees: %@", angleAnimatedSuccess ?
@"YES" :
@"NO");
302 BOOL collisionSuccess = [
iconObject setCollisionEnabled:YES];
303 NSLog(
@"Enabled collision detection for icon: %@", collisionSuccess ?
@"YES" :
@"NO");
308 BOOL bufferSuccess = [
iconObject setBufferWithWidth:10.0 height:10.0];
309 NSLog(
@"Set collision buffer to 10x10 pixels: %@", bufferSuccess ?
@"YES" :
@"NO");
314 BOOL placementSuccess = [
iconObject setPlacement:NCCenter];
315 NSLog(
@"Set icon placement to CENTER: %@", placementSuccess ?
@"YES" :
@"NO");
320 NCLocationPoint *newPosition = [[
NCLocationPoint alloc] initWithX:35.0 y:45.0];
321 BOOL positionSuccess = [
iconObject setPosition:newPosition];
322 NSLog(
@"Set icon position to (%.1f, %.1f): %@", newPosition.x, newPosition.y, positionSuccess ?
@"YES" :
@"NO");
327 NCLocationPoint *animatedPosition = [[
NCLocationPoint alloc] initWithX:40.0 y:50.0];
328 BOOL animatedSuccess = [
iconObject setPositionAnimated:animatedPosition duration:2.0 animationType:NCLinear];
329 NSLog(
@"Set icon position with animation to (%.1f, %.1f): %@", animatedPosition.x, animatedPosition.y, animatedSuccess ?
@"YES" :
@"NO");
334 BOOL offsetSuccess = [
iconObject setOffsetWithWidth:5.0 height:5.0];
335 NSLog(
@"Set icon offset to 5x5 pixels: %@", offsetSuccess ?
@"YES" :
@"NO");
340 BOOL prioritySuccess = [
iconObject setPriority:1];
341 NSLog(
@"Set icon priority to 1: %@", prioritySuccess ?
@"YES" :
@"NO");
346 BOOL visibleSuccess = [
iconObject setVisible:YES];
347 NSLog(
@"Set icon visibility to true: %@", visibleSuccess ?
@"YES" :
@"NO");
352 NCMapObjectType objectType = iconObject.mapObjectType;
353 NSLog(
@"Icon map object type: %@", objectType);
358 BOOL alphaSuccess = [
iconObject setAlpha:0.8];
359 NSLog(
@"Set icon alpha to 0.8: %@", alphaSuccess ?
@"YES" :
@"NO");
364 BOOL interactiveSuccess = [
iconObject setInteractive:YES];
365 NSLog(
@"Set icon interactive to true: %@", interactiveSuccess ?
@"YES" :
@"NO");
370 BOOL titleSuccess = [
iconObject setTitle:@"Icon Object"];
371 NSLog(
@"Set icon title to 'Icon Object': %@", titleSuccess ?
@"YES" :
@"NO");
376 NSDictionary *customData = @{
@"key":
@"value",
@"number":
@"42"};
377 BOOL dataSuccess = [
iconObject setData:customData];
378 NSLog(
@"Set icon custom data: %@", dataSuccess ?
@"YES" :
@"NO");
383 NSInteger objectId = iconObject.id;
384 NSLog(
@"Icon object ID: %ld", (
long)objectId);
389 NSString *objectTypeString = iconObject.type;
390 NSLog(
@"Icon object type: %@", objectTypeString);
395 NSDictionary *retrievedData = iconObject.data;
396 NSLog(
@"Icon custom data: %@", retrievedData);
401 [_locationWindow addIconMapObject:iconObject];
403 NSLog(
@"Added icon map object");
413 for (NCIconMapObject *icon in icons) {
414 [_locationWindow addIconMapObject:icon];
416 NSLog(
@"Added icon at (%f, %f)", icon.position.x, icon.position.y);
421 [_locationWindow removeIconMapObject:iconObject];
423 NSLog(
@"Removed icon map object");
431 NSLog(
@"--- Polygon Map Objects ---");
433 if (_locationWindow == nil) {
434 NSLog(
@"LocationWindow not available yet");
440 NCPolygonMapObject *polygonObject = [_locationWindow addPolygonMapObject];
441 NSLog(
@"Added polygon map object");
444 if (polygonObject != nil) {
455 NSLog(
@"Set polygon with %lu points: %@", (
unsigned long)points.count, success ?
@"YES" :
@"NO");
460 BOOL colorSuccess = [
polygonObject setColorWithRed:0.0 green:1.0 blue:0.0 alpha:0.7];
461 NSLog(
@"Set polygon color to green with 70%% opacity: %@", colorSuccess ?
@"YES" :
@"NO");
467 NSLog(
@"Set polygon visibility to true: %@", visibleSuccess ?
@"YES" :
@"NO");
472 NCMapObjectType objectType = polygonObject.mapObjectType;
473 NSLog(
@"Polygon map object type: %@", objectType);
479 NSLog(
@"Set polygon rendering order to 2: %@", orderSuccess ?
@"YES" :
@"NO");
484 BOOL outlineColorSuccess = [
polygonObject setOutlineColorWithRed:0.0 green:0.0 blue:1.0 alpha:1.0];
485 NSLog(
@"Set polygon outline color to blue: %@", outlineColorSuccess ?
@"YES" :
@"NO");
490 BOOL outlineWidthSuccess = [
polygonObject setOutlineWidth:2.0];
491 NSLog(
@"Set polygon outline width to 2.0 pixels: %@", outlineWidthSuccess ?
@"YES" :
@"NO");
496 BOOL outlineAlphaSuccess = [
polygonObject setOutlineAlpha:0.8];
497 NSLog(
@"Set polygon outline alpha to 0.8: %@", outlineAlphaSuccess ?
@"YES" :
@"NO");
502 BOOL outlineOrderSuccess = [
polygonObject setOutlineOrder:1];
503 NSLog(
@"Set polygon outline order to 1: %@", outlineOrderSuccess ?
@"YES" :
@"NO");
509 NSLog(
@"Set polygon alpha to 0.6: %@", alphaSuccess ?
@"YES" :
@"NO");
514 BOOL interactiveSuccess = [
polygonObject setInteractive:YES];
515 NSLog(
@"Set polygon interactive to true: %@", interactiveSuccess ?
@"YES" :
@"NO");
520 BOOL titleSuccess = [
polygonObject setTitle:@"Polygon Object"];
521 NSLog(
@"Set polygon title to 'Polygon Object': %@", titleSuccess ?
@"YES" :
@"NO");
526 NSDictionary *customData = @{
@"key":
@"value",
@"number":
@"42"};
528 NSLog(
@"Set polygon custom data: %@", dataSuccess ?
@"YES" :
@"NO");
533 NSInteger objectId = polygonObject.id;
534 NSLog(
@"Polygon object ID: %ld", (
long)objectId);
539 NSString *objectTypeString = polygonObject.type;
540 NSLog(
@"Polygon object type: %@", objectTypeString);
545 NSDictionary *retrievedData = polygonObject.data;
546 NSLog(
@"Polygon custom data: %@", retrievedData);
552 if (polygonObject != nil) {
553 BOOL removed = [_locationWindow removePolygonMapObject:polygonObject];
554 NSLog(
@"Removed polygon map object: %@", removed ?
@"YES" :
@"NO");
560 for (
int i = 0; i < 3; i++) {
561 NCPolygonMapObject *polygon = [_locationWindow addPolygonMapObject];
562 if (polygon != nil) {
569 NCLocationPolygon *polygonGeometry = [[
NCLocationPolygon alloc] initWithPoints:points];
570 [
polygon setPolygon:polygonGeometry];
571 [
polygon setColorWithRed:0.0 green:0.0 blue:1.0 alpha:0.5];
573 NSLog(
@"Created polygon %d with %lu points", i, (
unsigned long)points.count);
577 for (
int i = 0; i < polygons.count; i++) {
578 [_locationWindow removePolygonMapObject:polygons[
i]];
579 NSLog(
@"Removed polygon %d", i);
587 NSLog(
@"--- Polyline Map Objects ---");
589 if (_locationWindow == nil) {
590 NSLog(
@"LocationWindow not available yet");
603 NCPolylineMapObject *polylineObject = [[
NCPolylineMapObject alloc] initWithPolyline:polyline];
604 NSLog(
@"Created polyline map object with %lu points", (
unsigned long)points.count);
609 NCLocationPolyline *polylineShape = polylineObject.polyline;
610 NSLog(
@"Polyline has %lu points", (
unsigned long)polylineShape.points.count);
615 [_locationWindow addPolylineMapObject:polylineObject];
617 NSLog(
@"Added polyline map object");
621 NSArray *polylines = @[
635 for (NCPolylineMapObject *line in polylines) {
636 [_locationWindow addPolylineMapObject:line];
638 NSLog(
@"Added polyline with %lu points", (
unsigned long)line.polyline.points.count);
643 [_locationWindow removePolylineMapObject:polylineObject];
645 NSLog(
@"Removed polyline map object");
648 if (polylineObject != nil) {
651 NSArray *polylinePoints = @[
657 NCLocationPolyline *polyline = [[
NCLocationPolyline alloc] initWithPoints:polylinePoints];
659 NSLog(
@"Set polyline with %lu points: %@", (
unsigned long)polylinePoints.count, polylineSuccess ?
@"YES" :
@"NO");
665 NSLog(
@"Set polyline width to 3.0 pixels: %@", widthSuccess ?
@"YES" :
@"NO");
670 BOOL polylineColorSuccess = [
polylineObject setColorWithRed:0.0 green:1.0 blue:0.0 alpha:0.8];
671 NSLog(
@"Set polyline color to green with 80%% opacity: %@", polylineColorSuccess ?
@"YES" :
@"NO");
677 NSLog(
@"Set polyline rendering order to 1: %@", polylineOrderSuccess ?
@"YES" :
@"NO");
683 NSLog(
@"Set polyline cap type to ROUND: %@", capTypeSuccess ?
@"YES" :
@"NO");
688 BOOL joinTypeSuccess = [
polylineObject setJoinType:NCJoinTypeRound];
689 NSLog(
@"Set polyline join type to ROUND: %@", joinTypeSuccess ?
@"YES" :
@"NO");
695 NSLog(
@"Set polyline miter limit to 2.0: %@", miterLimitSuccess ?
@"YES" :
@"NO");
701 NSLog(
@"Set polyline outline width to 1.0 pixels: %@", outlineWidthSuccess ?
@"YES" :
@"NO");
706 BOOL outlineColorSuccess = [
polylineObject setOutlineColorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
707 NSLog(
@"Set polyline outline color to black: %@", outlineColorSuccess ?
@"YES" :
@"NO");
713 NSLog(
@"Set polyline outline alpha to 0.5: %@", outlineAlphaSuccess ?
@"YES" :
@"NO");
719 NSLog(
@"Set polyline outline rendering order to 0: %@", outlineOrderSuccess ?
@"YES" :
@"NO");
724 BOOL outlineCapTypeSuccess = [
polylineObject setOutlineCapType:NCCapTypeSquare];
725 NSLog(
@"Set polyline outline cap type to SQUARE: %@", outlineCapTypeSuccess ?
@"YES" :
@"NO");
730 BOOL outlineJoinTypeSuccess = [
polylineObject setOutlineJoinType:NCJoinTypeMiter];
731 NSLog(
@"Set polyline outline join type to MITER: %@", outlineJoinTypeSuccess ?
@"YES" :
@"NO");
736 BOOL outlineMiterLimitSuccess = [
polylineObject setOutlineMiterLimit:3.0];
737 NSLog(
@"Set polyline outline miter limit to 3.0: %@", outlineMiterLimitSuccess ?
@"YES" :
@"NO");
743 NSLog(
@"Set polyline visibility to true: %@", visibleSuccess ?
@"YES" :
@"NO");
748 NCMapObjectType objectType = polylineObject.mapObjectType;
749 NSLog(
@"Polyline map object type: %@", objectType);
755 NSLog(
@"Set polyline alpha to 0.7: %@", alphaSuccess ?
@"YES" :
@"NO");
761 NSLog(
@"Set polyline interactive to true: %@", interactiveSuccess ?
@"YES" :
@"NO");
767 NSLog(
@"Set polyline title to 'Polyline Object': %@", titleSuccess ?
@"YES" :
@"NO");
772 NSDictionary *customData = @{
@"key":
@"value",
@"number":
@"42"};
774 NSLog(
@"Set polyline custom data: %@", dataSuccess ?
@"YES" :
@"NO");
779 NSInteger objectId = polylineObject.id;
780 NSLog(
@"Polyline object ID: %ld", (
long)objectId);
785 NSString *objectTypeString = polylineObject.type;
786 NSLog(
@"Polyline object type: %@", objectTypeString);
791 NSDictionary *retrievedData = polylineObject.data;
792 NSLog(
@"Polyline custom data: %@", retrievedData);
801 NSLog(
@"--- Dotted Polyline Map Objects ---");
803 if (_locationWindow == nil) {
804 NSLog(
@"LocationWindow not available yet");
818 NSLog(
@"Created dotted polyline map object with %lu points", (
unsigned long)points.count);
823 NCLocationPolyline *dottedPolylineShape = dottedPolylineObject.polyline;
824 NSLog(
@"Dotted polyline has %lu points", (
unsigned long)dottedPolylineShape.points.count);
829 NSArray *dottedPoints = @[
835 NCLocationPolyline *dottedPolyline = [[
NCLocationPolyline alloc] initWithPoints:dottedPoints];
837 NSLog(
@"Set dotted polyline with %lu points: %@", (
unsigned long)dottedPoints.count, dottedSuccess ?
@"YES" :
@"NO");
843 NSLog(
@"Set dotted polyline color to purple with 80%% opacity: %@", colorSuccess ?
@"YES" :
@"NO");
849 NSLog(
@"Set dotted polyline width to 3.0 pixels: %@", widthSuccess ?
@"YES" :
@"NO");
855 NSLog(
@"Set dotted polyline rendering order to 2: %@", orderSuccess ?
@"YES" :
@"NO");
861 NSLog(
@"Enabled collision detection for dotted polyline: %@", collisionSuccess ?
@"YES" :
@"NO");
867 NSLog(
@"Set dotted polyline placement to CENTER: %@", placementSuccess ?
@"YES" :
@"NO");
873 NSLog(
@"Set dotted polyline placement min ratio to 0.5: %@", minRatioSuccess ?
@"YES" :
@"NO");
879 NSLog(
@"Set dotted polyline placement spacing to 10.0: %@", spacingSuccess ?
@"YES" :
@"NO");
885 NSLog(
@"Set dotted polyline rendering priority to 1: %@", prioritySuccess ?
@"YES" :
@"NO");
891 NSLog(
@"Set dotted polyline repeat distance to 20.0: %@", repeatDistanceSuccess ?
@"YES" :
@"NO");
897 NSLog(
@"Set dotted polyline repeat group to 1: %@", repeatGroupSuccess ?
@"YES" :
@"NO");
902 NCSize *size = [[
NCSize alloc] initWithWidth:16.0 height:16.0];
904 NSLog(
@"Set dotted polyline size to (%.1f, %.1f): %@", size.width, size.height, sizeSuccess ?
@"YES" :
@"NO");
910 NSLog(
@"Set dotted polyline visibility to true: %@", visibleSuccess ?
@"YES" :
@"NO");
915 NCMapObjectType objectType = dottedPolylineObject.mapObjectType;
916 NSLog(
@"Dotted polyline map object type: %@", objectType);
922 NSLog(
@"Set dotted polyline alpha to 0.8: %@", alphaSuccess ?
@"YES" :
@"NO");
928 NSLog(
@"Set dotted polyline interactive to true: %@", interactiveSuccess ?
@"YES" :
@"NO");
934 NSLog(
@"Set dotted polyline title to 'Dotted Polyline Object': %@", titleSuccess ?
@"YES" :
@"NO");
939 NSDictionary *customData = @{
@"key":
@"value",
@"number":
@"42"};
941 NSLog(
@"Set dotted polyline custom data: %@", dataSuccess ?
@"YES" :
@"NO");
946 NSInteger objectId = dottedPolylineObject.id;
947 NSLog(
@"Dotted polyline object ID: %ld", (
long)objectId);
952 NSString *objectTypeString = dottedPolylineObject.type;
953 NSLog(
@"Dotted polyline object type: %@", objectTypeString);
958 NSDictionary *retrievedData = dottedPolylineObject.data;
959 NSLog(
@"Dotted polyline custom data: %@", retrievedData);
964 [_locationWindow addDottedPolylineMapObject:dottedPolylineObject];
966 NSLog(
@"Added dotted polyline map object");
970 NSArray *dottedPolylines = @[
984 for (NCDottedPolylineMapObject *dottedLine in dottedPolylines) {
985 [_locationWindow addDottedPolylineMapObject:dottedLine];
987 NSLog(
@"Added dotted polyline with %lu points", (
unsigned long)dottedLine.polyline.points.count);
992 [_locationWindow removeDottedPolylineMapObject:dottedPolylineObject];
994 NSLog(
@"Removed dotted polyline map object");