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
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 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 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 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 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 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 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
NSData *styleData = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"MapzenGLStyle" ofType:@"json"]]; | |
thisCacheDir = [NSString stringWithFormat:@"%@/mapzen-vectiles",cacheDir]; | |
MapzenSource *mzSource = [[MapzenSource alloc] | |
initWithBase:@"http://vector.mapzen.com/osm" | |
layers:@[@"all"] | |
// Note: Go get your own API key | |
apiKey:@"vector-tiles-05s8a-0" | |
sourceType:MapzenSourcePBF | |
styleData:styleData |
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
// Test a ground overlay-like thing | |
{ | |
UIImage *imgImage = [[UIImage alloc] | |
initWithData:[NSData dataWithContentsOfURL: | |
[NSURL URLWithString:@"http://radar.weather.gov/ridge/RadarImg/N0Z/MUX_N0Z_0.gif"]]]; | |
MaplySticker *mstick = [[MaplySticker alloc] init]; | |
mstick.image = imgImage; | |
mstick.ll = MaplyCoordinateMakeWithDegrees(-126.253365, 33.147724); | |
mstick.ur = MaplyCoordinateMakeWithDegrees(-117.526093, 41.147724); | |
[theViewC addStickers:@[mstick] desc:nil]; |
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
NSString *tileCacheDir = [NSString stringWithFormat:@"%@/%@",self.home.appCacheDir,cacheName]; | |
[MaplyVectorTiles StartRemoteVectorTiles:tileURL cacheDir:tileCacheDir viewC:self.home.baseViewC block: | |
^(MaplyVectorTiles *vecTiles) | |
{ | |
if (vecTiles) | |
{ | |
MaplyQuadPagingLayer *layer = [[MaplyQuadPagingLayer alloc] | |
initWithCoordSystem:[[MaplySphericalMercator alloc] initWebStandard] | |
delegate:vecTiles]; | |
layer.numSimultaneousFetches = 8; |
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
// Polluting the global name space with spherical mercator extents | |
var xMin = -20037508.34; | |
var yMin = -20037508.34; | |
var xMax = 20037508.34; | |
var yMax = 20037508.34; | |
var xSpan = xMax - xMin; | |
var ySpan = yMax - yMin; | |
// Current center of the queries | |
var centerLon = -75.20896911621094; |