SHARE
TWEET

Untitled

a guest Jun 25th, 2019 106 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. NMADynamicPenalty *penalty = [[NMADynamicPenalty alloc] init];
  2. for (int w = 0; w < 19; w++){
  3.       float latitude = 29 + (w / 5) + (arc4random_uniform(100) / 100.0);
  4.       float longitude = -66 - w - (arc4random_uniform(100) / 100.0);
  5.       NMAGeoCoordinates *topRight = [[NMAGeoCoordinates alloc] initWithLatitude:latitude longitude:longitude];
  6.       NMAGeoCoordinates *topLeft = [[NMAGeoCoordinates alloc] initWithLatitude:latitude longitude:(longitude - 0.25)];
  7.       NMAGeoCoordinates *bottomRight = [[NMAGeoCoordinates alloc] initWithLatitude:(latitude - 0.25) longitude:longitude];
  8.       NMAGeoCoordinates *bottomLeft = [[NMAGeoCoordinates alloc] initWithLatitude:(latitude - 0.25) longitude:(longitude - 0.25)];
  9.       NMAGeoPolygon *polygon = [[NMAGeoPolygon alloc] init];
  10.       [polygon addPoint:topRight];
  11.       [polygon addPoint:topLeft];
  12.       [polygon addPoint:bottomLeft];
  13.       [polygon addPoint: bottomRight];
  14.       NMAMapPolygon *mapPolyGon = [[NMAMapPolygon alloc] initWithPolygon:polygon];
  15.       [penalty addBannedArea:mapPolyGon];
  16.     }
  17.     NMAGeoCoordinates *topRight = [[NMAGeoCoordinates alloc] initWithLatitude:40.147209 longitude:-74.648863];
  18.     NMAGeoCoordinates *topLeft = [[NMAGeoCoordinates alloc] initWithLatitude:40.145059 longitude:-74.726632];
  19.     NMAGeoCoordinates *bottomRight = [[NMAGeoCoordinates alloc] initWithLatitude:40.074601 longitude:-74.649898];
  20.     NMAGeoCoordinates *bottomLeft = [[NMAGeoCoordinates alloc] initWithLatitude:40.079852 longitude:-74.735551];
  21.     NMAGeoPolygon *polygon = [[NMAGeoPolygon alloc] init];
  22.     [polygon addPoint:topRight];
  23.     [polygon addPoint:topLeft];
  24.     [polygon addPoint:bottomLeft];
  25.     [polygon addPoint: bottomRight];
  26.     NMAMapPolygon *mapPolyGon = [[NMAMapPolygon alloc] initWithPolygon:polygon];
  27.     [penalty addBannedArea:mapPolyGon];
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top