|
@@ -248,18 +248,6 @@ |
|
@@ -248,18 +248,6 @@ |
248
|
return bounds;
|
248
|
return bounds;
|
249
|
}
|
249
|
}
|
250
|
|
250
|
|
251
|
-- (BOOL)coversFullWorld
|
|
|
252
|
-{
|
|
|
253
|
- RMSphericalTrapezium ownBounds = [self latitudeLongitudeBoundingBox];
|
|
|
254
|
- RMSphericalTrapezium defaultBounds = kMBTilesDefaultLatLonBoundingBox;
|
|
|
255
|
-
|
|
|
256
|
- if (ownBounds.southWest.longitude <= defaultBounds.southWest.longitude + 10 &&
|
|
|
257
|
- ownBounds.northEast.longitude >= defaultBounds.northEast.longitude - 10)
|
|
|
258
|
- return YES;
|
|
|
259
|
-
|
|
|
260
|
- return NO;
|
|
|
261
|
-}
|
|
|
262
|
-
|
|
|
263
|
- (NSString *)legend
|
251
|
- (NSString *)legend
|
264
|
{
|
252
|
{
|
265
|
__block NSString *legend;
|
253
|
__block NSString *legend;
|
|
@@ -281,6 +269,57 @@ |
|
@@ -281,6 +269,57 @@ |
281
|
return legend;
|
269
|
return legend;
|
282
|
}
|
270
|
}
|
283
|
|
271
|
|
|
|
272
|
+- (CLLocationCoordinate2D)centerCoordinate
|
|
|
273
|
+{
|
|
|
274
|
+ __block CLLocationCoordinate2D centerCoordinate = CLLocationCoordinate2DMake(0, 0);
|
|
|
275
|
+
|
|
|
276
|
+ [queue inDatabase:^(FMDatabase *db)
|
|
|
277
|
+ {
|
|
|
278
|
+ FMResultSet *results = [db executeQuery:@"select value from metadata where name = 'center'"];
|
|
|
279
|
+
|
|
|
280
|
+ [results next];
|
|
|
281
|
+
|
|
|
282
|
+ if ([results stringForColumn:@"value"] && [[[results stringForColumn:@"value"] componentsSeparatedByString:@","] count] >= 2)
|
|
|
283
|
+ centerCoordinate = CLLocationCoordinate2DMake([[[[results stringForColumn:@"value"] componentsSeparatedByString:@","] objectAtIndex:1] doubleValue],
|
|
|
284
|
+ [[[[results stringForColumn:@"value"] componentsSeparatedByString:@","] objectAtIndex:0] doubleValue]);
|
|
|
285
|
+
|
|
|
286
|
+ [results close];
|
|
|
287
|
+ }];
|
|
|
288
|
+
|
|
|
289
|
+ return centerCoordinate;
|
|
|
290
|
+}
|
|
|
291
|
+
|
|
|
292
|
+- (float)centerZoom
|
|
|
293
|
+{
|
|
|
294
|
+ __block CGFloat centerZoom = [self minZoom];
|
|
|
295
|
+
|
|
|
296
|
+ [queue inDatabase:^(FMDatabase *db)
|
|
|
297
|
+ {
|
|
|
298
|
+ FMResultSet *results = [db executeQuery:@"select value from metadata where name = 'center'"];
|
|
|
299
|
+
|
|
|
300
|
+ [results next];
|
|
|
301
|
+
|
|
|
302
|
+ if ([results stringForColumn:@"value"] && [[[results stringForColumn:@"value"] componentsSeparatedByString:@","] count] >= 3)
|
|
|
303
|
+ centerZoom = [[[[results stringForColumn:@"value"] componentsSeparatedByString:@","] objectAtIndex:2] floatValue];
|
|
|
304
|
+
|
|
|
305
|
+ [results close];
|
|
|
306
|
+ }];
|
|
|
307
|
+
|
|
|
308
|
+ return centerZoom;
|
|
|
309
|
+}
|
|
|
310
|
+
|
|
|
311
|
+- (BOOL)coversFullWorld
|
|
|
312
|
+{
|
|
|
313
|
+ RMSphericalTrapezium ownBounds = [self latitudeLongitudeBoundingBox];
|
|
|
314
|
+ RMSphericalTrapezium defaultBounds = kMBTilesDefaultLatLonBoundingBox;
|
|
|
315
|
+
|
|
|
316
|
+ if (ownBounds.southWest.longitude <= defaultBounds.southWest.longitude + 10 &&
|
|
|
317
|
+ ownBounds.northEast.longitude >= defaultBounds.northEast.longitude - 10)
|
|
|
318
|
+ return YES;
|
|
|
319
|
+
|
|
|
320
|
+ return NO;
|
|
|
321
|
+}
|
|
|
322
|
+
|
284
|
- (void)didReceiveMemoryWarning
|
323
|
- (void)didReceiveMemoryWarning
|
285
|
{
|
324
|
{
|
286
|
NSLog(@"*** didReceiveMemoryWarning in %@", [self class]);
|
325
|
NSLog(@"*** didReceiveMemoryWarning in %@", [self class]);
|