Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First, you'll want to move to the develop branch on github. That's version 2.2 which is just about to be released.</p> <p>I've added an example in the test app that does exactly this.</p> <p><img src="https://i.stack.imgur.com/BdcsR.png" alt="enter image description here"></p> <p>Here's how we pull that off.</p> <pre><code>- (void)addLinesLon:(float)lonDelta lat:(float)latDelta color:(UIColor *)color { NSMutableArray *vectors = [[NSMutableArray alloc] init]; NSDictionary *desc = @{kMaplyColor: color, kMaplySubdivType: kMaplySubdivSimple, kMaplySubdivEpsilon: @(0.001), kMaplyVecWidth: @(4.0), kMaplyDrawPriority: @(1000)}; // Longitude lines for (float lon = -180;lon &lt; 180;lon += lonDelta) { MaplyCoordinate coords[3]; coords[0] = MaplyCoordinateMakeWithDegrees(lon, -90); coords[1] = MaplyCoordinateMakeWithDegrees(lon, 0); coords[2] = MaplyCoordinateMakeWithDegrees(lon, +90); MaplyVectorObject *vec = [[MaplyVectorObject alloc] initWithLineString:coords numCoords:3 attributes:nil]; [vectors addObject:vec]; } // Latitude lines for (float lat = -90;lat &lt; 90;lat += latDelta) { MaplyCoordinate coords[5]; coords[0] = MaplyCoordinateMakeWithDegrees(-180, lat); coords[1] = MaplyCoordinateMakeWithDegrees(-90, lat); coords[2] = MaplyCoordinateMakeWithDegrees(0, lat); coords[3] = MaplyCoordinateMakeWithDegrees(90, lat); coords[4] = MaplyCoordinateMakeWithDegrees(+180, lat); MaplyVectorObject *vec = [[MaplyVectorObject alloc] initWithLineString:coords numCoords:5 attributes:nil]; [vectors addObject:vec]; } latLonObj = [baseViewC addVectors:vectors desc:desc]; } </code></pre> <p>WhirlyGlobe-Maply 2.2 adds a few tricks to vector rendering and subdivision. You can now tell the toolkit to subdivide lines up to an epsilon to make them acceptable. We can also render one thing on top of another without worrying about z buffering. So there you go, it's pretty easy now.</p> <p>The only real trickery here is that we have to break the lines into pieces. We need at least three points or the subdivision logic will just detect a degenerate case. The 5 point lines for latitude works some error test logic.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload