Add witty caption |
Anyway, you can do WMS now in your WhirlyGlobe or Maply app.
The Code
All this is in WhirlyGlobe-Maply 2.2, a rather massive update to the toolkit I'll be publishing shortly. It's in the develop branch if you're feeling frisky.
Here's how you'd add the NAIP ortho quads to your globe (or map).
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]; |
- Create a coordinate system that describes good old WGS84 lat/lon.
- Setting up a tile source to point to the WMS end point.
- Starting a new layer which uses that tile source.
Incidentally, you can write your own tile sources now. The code for MaplyWMSTileSource is pretty simple and it lives at the Component level. That means it's entirely Objective-C.