This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I'd like to know who's using WhirlyGlobe 1.2, 2.0 or the Component and what they're doing. | |
So speak up! | |
-Steve G |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create an empty globe and tie it in to the view hierarchy | |
globeViewC = [[WhirlyGlobeViewController alloc] init]; | |
globeViewC.delegate = self; | |
[self.view addSubview:globeViewC.view]; | |
globeViewC.view.frame = self.view.bounds; | |
[self addChildViewController:globeViewC]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is a nice base layer with water and elevation, but no labels or boundaries | |
MaplyQuadEarthWithRemoteTiles *layer = [[MaplyQuadEarthWithRemoteTiles alloc] initWithBaseURL:@"http://a.tiles.mapbox.com/v3/mousebird.map-2ebn78d1/" ext:@"png" minZoom:0 maxZoom:12]; | |
[globeViewC addLayer:layer]; | |
// Let's start up over San Francisco, center of the universe | |
[globeViewC animateToPosition:MaplyCoordinateMakeWithDegrees(-122.4192, 37.7793) time:1.0]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Let's start up over San Francisco, center of the universe | |
[globeViewC animateToPosition:MaplyCoordinateMakeWithDegrees(-122.4192, 37.7793) time:1.0]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)globeViewController:(WhirlyGlobeViewController *)viewC didTapAt:(WGCoordinate)coord | |
{ | |
// We need degrees for the query, even if we work in radians internally | |
float lat = coord.y * 180.0 / M_PI; | |
float lon = coord.x * 180.0 / M_PI; | |
// We want the geometry and a couple of attributes for just one feature under the point | |
NSString *account = @"mousebird"; | |
NSString *admin0Table = @"table_10m_admin_0_map_subunits"; | |
NSString *queryStr = [NSString stringWithFormat: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add an admin0 (country, basically) outline and label | |
- (void)addCountry:(MaplyVectorObject *)vecs | |
{ | |
if (!vecs) | |
return; | |
// Add the the vectors to the globe with a line width a color and other parameters | |
[globeViewC addVectors:@[vecs] desc: | |
@{kMaplyColor: [UIColor whiteColor],kMaplyVecWidth: @(5.0),kMaplyDrawOffset: @(4.0),kMaplyFade: @(1.0)}]; | |
// But hey, what about a label? Let's figure out where it should go. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MaplyPlateCarree *coordSys = [[MaplyPlateCarree alloc] initFullCoverage]; | |
MaplyWMSTileSource *tileSource = [[MaplyWMSTileSource alloc] initWithBaseURL:@"http://raster.nationalmap.gov/ArcGIS/services/Orthoimagery/USGS_EDC_Ortho_NAIP/ImageServer/WMSServer" layers:@[@"0"] coordSys:coordSys minZoom:0 maxZoom:16 tileSize:256]; | |
tileSource.transparent = true; | |
MaplyQuadEarthTilesLayer *layer = [[MaplyQuadEarthTilesLayer alloc] initWithCoordSystem:coordSys tileSource:tileSource]; | |
layer.handleEdges = true; | |
layer.cacheDir = thisCacheDir; | |
[baseViewC addLayer:layer]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* A wrapper around the data we need to draw a single | |
OpenGL ES related object. | |
*/ | |
@interface SimpleGLObject : NSObject | |
// The buffer in OpenGL driver space containing the vertices | |
@property GLuint vertexBuffer; | |
// Vertex arrays contain the state to draw our object | |
@property GLuint vertexArray; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ViewController.m | |
// NSMeetupExample | |
// | |
// Created by [email protected] on 8/6/13. | |
// | |
#import "ViewController.h" | |
#import "SimpleGLObject.h" | |
#import "FlexiVertexBuffer.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// SimpleGLObject.h | |
// NSMeetupExample | |
// | |
// Created by [email protected] on 8/6/13. | |
// | |
#import <UIKit/UIKit.h> | |
/* A wrapper around the data we need to draw a single |
OlderNewer