This file contains hidden or 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
| nasaLayers = | |
| [{ | |
| name: "Mapbox Satellite", | |
| url: "http://a.tiles.mapbox.com/v3/examples.map-zyt2v9k2.json", | |
| base: true | |
| }, | |
| { name: "MODIS/Terra TrueColor", | |
| url: "http://map1.vis.earthdata.nasa.gov/wmts-webmerc/MODIS_Terra_CorrectedReflectance_TrueColor/default/{Time}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpg", | |
| minzoom: 1, | |
| maxzoom: 9, |
This file contains hidden or 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
| NSMutableArray *markers = [NSMutableArray array]; | |
| UIImage *pinImage = [UIImage imageNamed:@"map_pin"]; | |
| // Work through the locations | |
| for (unsigned int ii=0;ii<howMany;ii++) | |
| { | |
| LocationInfo *location = &locations[ii]; | |
| MaplyScreenMarker *marker = [[MaplyScreenMarker alloc] init]; | |
| marker.image = pinImage; |
This file contains hidden or 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 proj4Str = "+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +units=m +no_defs" | |
| let coordSys = MaplyProj4CoordSystem(string: proj4Str) | |
| var bbox = MaplyBoundingBox() | |
| bbox.ll.x = 1393.0196 | |
| bbox.ll.y = 12494.9764 | |
| bbox.ur.x = 671196.3657 | |
| bbox.ur.y = 1230275.0454 | |
| coordSys.setBounds(bbox) |
This file contains hidden or 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
| /** @brief Interpolate a new state between the given states A and B. | |
| @details This does a simple interpolation (lat/lon, not great circle) between the two animation states. | |
| */ | |
| + (nonnull WhirlyGlobeViewControllerAnimationState *)Interpolate:(double)t from:(WhirlyGlobeViewControllerAnimationState *__nonnull)stateA to:(WhirlyGlobeViewControllerAnimationState *__nonnull)stateB; |
This file contains hidden or 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
| func insertClusteredMarkers(compB : NSArray, theBaseView: MaplyBaseViewController) { | |
| let size = CGSizeMake(32, 32) | |
| let image = UIImage (named: "alcohol-shop-24@2x") | |
| var markers = [MaplyScreenMarker]() | |
| for object in compB { | |
| let marker = MaplyScreenMarker() | |
| marker.image = image | |
| marker.loc = (object as! MaplyVectorObject).center() | |
| marker.size = size | |
| marker.userObject = object.userObject |
This file contains hidden or 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
| func insertClusteredMarkers(compB : NSArray, theBaseView: MaplyBaseViewController) { | |
| let size = CGSizeMake(32, 32) | |
| let image = UIImage (named: "alcohol-shop-24@2x") | |
| var markers = [MaplyScreenMarker]() | |
| for object in compB { | |
| let marker = MaplyScreenMarker() | |
| marker.image = image | |
| marker.loc = (object as! MaplyVectorObject).center() | |
| marker.size = size | |
| marker.userObject = object.userObject |
This file contains hidden or 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
| func createLayer(baseView: MaplyBaseViewController) -> (MaplyQuadImageTilesLayer) { | |
| let precipTileSource = MaplyMultiplexTileSource(sources: tileSources) | |
| // Create a precipitation layer that animates | |
| let precipLayer = MaplyQuadImageTilesLayer(tileSource: precipTileSource!) | |
| precipLayer?.imageDepth = UInt32(tileSources.count) | |
| precipLayer?.animationPeriod = 1.0 | |
| precipLayer?.imageFormat = MaplyQuadImageFormat.ImageUByteRed | |
| precipLayer?.numSimultaneousFetches = 4 | |
| precipLayer?.handleEdges = false | |
| precipLayer?.coverPoles = false |
This file contains hidden or 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 test case that displays an animated weather layer on top of | |
| // the standard Geography Class basemap. | |
| // This is part of the AutoTester in the WhirlyGlobe-Maply repo. | |
| class AnimatedBasemapTestCase: MaplyTestCase { | |
| // Use Geography Class as the base layer | |
| let geographyClass = GeographyClassTestCase() | |
| let cacheDir = NSSearchPathForDirectoriesInDomains(.CachesDirectory, .UserDomainMask, true)[0] | |
| var tileSources = [MaplyRemoteTileInfo]() |
This file contains hidden or 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
| pod 'WhirlyGlobe', :http => 'https://s3-us-west-1.amazonaws.com/whirlyglobemaplydistribution/iOS_daily_builds/WhirlyGlobe-Maply_Nightly_latest.zip' |
This file contains hidden or 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
| // Set up a cache directory | |
| String cacheDirName = "stamen_watercolor"; | |
| File cacheDir = new File(getActivity().getCacheDir(), cacheDirName); | |
| cacheDir.mkdir(); | |
| // Set up the a remote tile source and point it at Stamen Watercolor | |
| RemoteTileSource remoteTileSource = new RemoteTileSource(new RemoteTileInfo("http://tile.stamen.com/watercolor/", "png", 0, 18)); | |
| remoteTileSource.setCacheDir(cacheDir); | |
| QuadImageTileLayer baseLayer = new QuadImageTileLayer(baseController, new SphericalMercatorCoordSystem(), remoteTileSource); |