Authored by Joseph G

Made map renderer work again using an image-based renderer

//
// CoreAnimationRenderer.h
// RouteMe
//
// Created by Joseph Gentle on 9/09/08.
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface CoreAnimationRenderer : NSObject {
}
@end
... ...
//
// CoreAnimationRenderer.m
// RouteMe
//
// Created by Joseph Gentle on 9/09/08.
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
#import "CoreAnimationRenderer.h"
@implementation CoreAnimationRenderer
@end
... ...
... ... @@ -10,7 +10,7 @@
#import "Mercator.h"
#import "Tile.h"
@class TiledLayerController;
@class ScreenProjection;
@interface FractalTileProjection : NSObject {
// Maximum zoom for which our tile server stores images
... ... @@ -44,9 +44,12 @@
-(TileRect) projectRect: (MercatorRect)mercatorRect AtScale:(float)scale;
// This is a helper for projectRect above. Much simpler for the caller.
//-(TileRect) project: (ScreenProjection*)screen;
-(TileRect) project: (ScreenProjection*)screen;
-(int) normaliseZoom: (float) zoom;
-(float) calculateZoomFromScale: (float) scale;
-(int) calculateNormalisedZoomFromScale: (float) scale;
-(float) calculateScaleFromZoom: (float) zoom;
@end
... ...
... ... @@ -7,7 +7,7 @@
//
#import "FractalTileProjection.h"
#import "TiledLayerController.h"
#import "ScreenProjection.h"
#import <math.h>
@implementation FractalTileProjection
... ... @@ -28,9 +28,9 @@
return self;
}
-(float) normaliseZoom: (float) zoom
-(int) normaliseZoom: (float) zoom
{
float normalised_zoom = roundf(zoom);
int normalised_zoom = roundf(zoom);
//16;
if (normalised_zoom > maxZoom)
normalised_zoom = maxZoom;
... ... @@ -40,12 +40,12 @@
return normalised_zoom;
}
-(float) limitFromNormalisedZoom: (float) zoom
-(float) limitFromNormalisedZoom: (int) zoom
{
return exp2f(zoom);
}
-(TilePoint) projectInternal: (MercatorPoint)mercator AtNormalisedZoom:(float)zoom Limit:(float) limit
-(TilePoint) projectInternal: (MercatorPoint)mercator AtNormalisedZoom:(int)zoom Limit:(float) limit
{
TilePoint tile;
double x = (mercator.x - bounds.origin.x) / bounds.size.width * limit;
... ... @@ -71,7 +71,7 @@
-(TileRect) projectRect: (MercatorRect)mercator AtZoom:(float)zoom
{
float normalised_zoom = [self normaliseZoom:zoom];
int normalised_zoom = [self normaliseZoom:zoom];
float limit = [self limitFromNormalisedZoom:normalised_zoom];
TileRect rect;
... ... @@ -94,17 +94,22 @@
{
return [self projectRect:mercatorRect AtZoom:[self calculateZoomFromScale:scale]];
}
/*
-(TileRect) project: (ScreenProjection*)screen;
{
return [self projectRect:[screen bounds] AtScale:[screen scale]];
}*/
return [self projectRect:[screen mercatorBounds] AtScale:[screen scale]];
}
-(float) calculateZoomFromScale: (float) scale
{ // zoom = log2(bounds.width/tileSideLength) - log2(s)
return scaleFactor - log2(scale);
}
-(int) calculateNormalisedZoomFromScale: (float) scale
{
return [self normaliseZoom:[self calculateZoomFromScale:scale]];
}
-(float) calculateScaleFromZoom: (float) zoom
{
return bounds.size.width / 256 / exp2(zoom);
... ...
... ... @@ -8,7 +8,7 @@
<string key="IBDocument.HIToolboxVersion">352.00</string>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="34"/>
<integer value="39"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
... ... @@ -22,33 +22,28 @@
<object class="IBProxyObject" id="815241450">
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
</object>
<object class="IBUIView" id="169245649">
<object class="IBUIView" id="508481256">
<reference key="NSNextResponder"/>
<int key="NSvFlags">292</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBUIView" id="187254117">
<reference key="NSNextResponder" ref="169245649"/>
<object class="IBUIView" id="757058351">
<reference key="NSNextResponder" ref="508481256"/>
<int key="NSvFlags">274</int>
<string key="NSFrameSize">{320, 460}</string>
<reference key="NSSuperview" ref="169245649"/>
<reference key="NSSuperview" ref="508481256"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
<object class="NSColorSpace" key="NSCustomColorSpace" id="375442540">
<int key="NSID">2</int>
</object>
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MSAwLjQ3MTcyMjUxIDAuMzg4OTIwMDcAA</bytes>
</object>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<bool key="IBUIMultipleTouchEnabled">YES</bool>
</object>
</object>
<string key="NSFrameSize">{320, 460}</string>
<reference key="NSSuperview"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC4yNQA</bytes>
<reference key="NSCustomColorSpace" ref="375442540"/>
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4yNzAyNjc2NyAxIDAuMTY5OTg3OTgAA</bytes>
</object>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
</object>
... ... @@ -60,9 +55,9 @@
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">view</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="169245649"/>
<reference key="destination" ref="508481256"/>
</object>
<int key="connectionID">32</int>
<int key="connectionID">40</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
... ... @@ -83,23 +78,23 @@
<string type="base64-UTF8" key="objectName">RmlsZSdzIE93bmVyA</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">28</int>
<reference key="object" ref="169245649"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="187254117"/>
</object>
<int key="objectID">-2</int>
<reference key="object" ref="815241450"/>
<reference key="parent" ref="360949347"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="815241450"/>
<int key="objectID">39</int>
<reference key="object" ref="508481256"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="757058351"/>
</object>
<reference key="parent" ref="360949347"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">34</int>
<reference key="object" ref="187254117"/>
<reference key="parent" ref="169245649"/>
<int key="objectID">41</int>
<reference key="object" ref="757058351"/>
<reference key="parent" ref="508481256"/>
</object>
</object>
</object>
... ... @@ -109,18 +104,16 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<string>-1.CustomClassName</string>
<string>-2.CustomClassName</string>
<string>28.CustomClassName</string>
<string>28.IBEditorWindowLastContentRect</string>
<string>28.IBPluginDependency</string>
<string>34.CustomClassName</string>
<string>34.IBPluginDependency</string>
<string>39.IBEditorWindowLastContentRect</string>
<string>39.IBPluginDependency</string>
<string>41.CustomClassName</string>
<string>41.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>MainViewController</string>
<string>UIResponder</string>
<string>MainView</string>
<string>{{568, 425}, {320, 460}}</string>
<string>{{14, 685}, {320, 460}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>MapView</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
... ... @@ -146,20 +139,12 @@
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">36</int>
<int key="maxID">41</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">MainView</string>
<string key="superclassName">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">MainView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">MainViewController</string>
<string key="superclassName">UIViewController</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
... ... @@ -170,6 +155,19 @@
<object class="IBPartialClassDescription">
<string key="className">MapView</string>
<string key="superclassName">UIView</string>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSMutableArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>renderer</string>
<string>tileSource</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>id</string>
<string>id</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">MapView.h</string>
... ...
//
// MapRenderer.h
// RouteMe
//
// Created by Joseph Gentle on 8/09/08.
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "Mercator.h"
@class MapView;
@class ScreenProjection;
@interface MapRenderer : NSObject
{
ScreenProjection *screenProjection;
MapView *view;
}
- (id) initWithView: (MapView *)view;
- (void)drawRect:(CGRect)rect;
-(void) moveToMercator: (MercatorPoint) point;
-(void) moveToLatLong: (CLLocationCoordinate2D) point;
- (void)moveBy: (CGSize) delta;
- (void)zoomByFactor: (float) zoomFactor Near:(CGPoint) center;
- (void)setNeedsDisplay;
@property (readwrite) double scale;
@end
... ...
//
// MapRenderer.m
// RouteMe
//
// Created by Joseph Gentle on 9/09/08.
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
#import "MapRenderer.h"
#import "ScreenProjection.h"
#import "FractalTileProjection.h"
#import "MapView.h"
#import "TileSource.h"
@implementation MapRenderer
- (id) initWithView: (MapView *)_view
{
if (![super init])
return nil;
view = _view;
screenProjection = [[ScreenProjection alloc] initWithBounds:[view bounds]];
CLLocationCoordinate2D here;
here.latitude = -33.9464;
here.longitude = 151.2381;
[screenProjection setScale:[[[view tileSource] tileProjection] calculateScaleFromZoom:16]];
[self moveToLatLong:here];
return self;
}
- (void)drawRect:(CGRect)rect
{ }
-(void) moveToMercator: (MercatorPoint) point
{
[screenProjection moveToMercator:point];
}
-(void) moveToLatLong: (CLLocationCoordinate2D) point
{
[screenProjection moveToLatLong:point];
}
- (void)moveBy: (CGSize) delta
{
[screenProjection moveBy:delta];
[self setNeedsDisplay];
}
- (void)zoomByFactor: (float) zoomFactor Near:(CGPoint) center
{
[screenProjection zoomByFactor:zoomFactor Near:center];
[self setNeedsDisplay];
}
- (void)setNeedsDisplay
{
[view setNeedsDisplay];
}
- (double) scale
{
return [screenProjection scale];
}
- (void) setScale: (double) scale
{
[screenProjection setScale:scale];
}
@end
... ...
... ... @@ -8,31 +8,31 @@
#import <UIKit/UIKit.h>
//#import "MapRenderer.h"
//#import "TileSource.h"
typedef struct {
CGPoint center;
float averageDistanceFromCenter;
} GestureDetails;
@class TileSource;
@class TiledLayerController;
@protocol TileSource;
@class MapRenderer;
//@class TileSource;
//@class TileImageSet;
@interface MapView : UIView {
id tileSource;
TiledLayerController *screenProjection;
float zoom;
id<TileSource> tileSource;
MapRenderer *renderer;
bool enableDragging;
bool enableZoom;
// double lastZoomDistance;
// This is basically a one-object allocation pool.
// TileImageSet *imageSet;
GestureDetails lastGesture;
}
@property (assign, readwrite) bool enableDragging;
@property (assign, readwrite) bool enableZoom;
@property (assign, readwrite, nonatomic) bool enableDragging;
@property (assign, readwrite, nonatomic) bool enableZoom;
@property (retain, readwrite, nonatomic) id<TileSource> tileSource;
@end
... ...
... ... @@ -11,13 +11,15 @@
#import "TileImage.h"
#import "Tile.h"
//#import "TileImageSet.h"
#import "TiledLayerController.h"
//#import "TiledLayerController.h"
#import "FractalTileProjection.h"
#import "MemoryCache.h"
#import "QuartzRenderer.h"
@implementation MapView
@synthesize enableDragging, enableZoom;
@synthesize enableDragging, enableZoom, tileSource;
-(void) makeTileSource
{
... ... @@ -28,11 +30,22 @@
tileSource = [[MemoryCache alloc] initWithParentSource:tileSource Capacity:20];
}
-(void) makeProjection
-(void) makeRenderer
{
if (screenProjection != nil)
if (tileSource == nil)
{
[self makeTileSource];
}
if (renderer != nil)
return;
renderer = [[QuartzRenderer alloc] initWithView:self];
}
/*
-(void) makeProjection
{
if (tileSource == nil)
[self makeTileSource];
... ... @@ -47,7 +60,7 @@
here.longitude = 151.2381;
[screenProjection setScale:[[tileSource tileProjection] calculateScaleFromZoom:18]];
[screenProjection centerLatLong:here Animate: NO];
}
}*/
-(void) configureCaching
{
... ... @@ -64,18 +77,14 @@
[newCache release];
}
}
/*
-(void) recalculateImageSet
{
NSLog(@"recalc");
TileRect tileRect = [[tileSource tileProjection] project:screenProjection];
[imageSet assembleFromRect:tileRect FromImageSource:tileSource ToDisplayWithSize:[self bounds].size WithTileDelegate: self];
}*/
-(void) initValues
{
renderer = nil;
tileSource = nil;
[self makeTileSource];
[self makeProjection];
[self makeRenderer];
// imageSet = [[TileImageSet alloc] init];
... ... @@ -84,6 +93,11 @@
// [self recalculateImageSet];
if (enableZoom)
[self setMultipleTouchEnabled:TRUE];
[renderer setNeedsDisplay];
[[NSURLCache sharedURLCache] removeAllCachedResponses];
}
... ... @@ -102,12 +116,16 @@
-(void) dealloc
{
[tileSource release];
[screenProjection release];
// [imageSet release];
[renderer release];
[super dealloc];
}
- (void)drawRect:(CGRect)rect
{
[renderer drawRect: rect];
}
/*
- (void)drawRect:(CGRect)rect {
// imageSet = [tileSource tileImagesForScreen: screenProjection];
... ... @@ -118,14 +136,9 @@
}
[imageSet draw];
[self setNeedsDisplay];
// [self setNeedsDisplay];
}*/
- (void)tileDidFinishLoading: (TileImage *)image
{
[self setNeedsDisplay];
}
- (GestureDetails) getGestureDetails: (NSSet*) touches
{
GestureDetails gesture;
... ... @@ -143,7 +156,6 @@
gesture.center.x /= [touches count];
gesture.center.y /= [touches count];
/// NSLog(@"center = %.0f,%.0f dist = %f", gesture.center.x, gesture.center.y, gesture.averageDistanceFromCenter);
for (UITouch *touch in touches)
{
CGPoint location = [touch locationInView: self];
... ... @@ -154,8 +166,9 @@
// NSLog(@"delta = %.0f, %.0f distance = %f", dx, dy, sqrtf((dx*dx) + (dy*dy)));
gesture.averageDistanceFromCenter += sqrtf((dx*dx) + (dy*dy));
}
gesture.averageDistanceFromCenter /= [touches count];
gesture.averageDistanceFromCenter /= [touches count];
// NSLog(@"center = %.0f,%.0f dist = %f", gesture.center.x, gesture.center.y, gesture.averageDistanceFromCenter);
return gesture;
}
... ... @@ -176,28 +189,6 @@
lastGesture = [self getGestureDetails:[event allTouches]];
}
- (void)dragBy: (CGSize) delta TrySlideImages: (BOOL)trySlide
{
[screenProjection dragBy:delta];
/*
if (trySlide)
{
BOOL slideOk = [imageSet slideBy:delta Within:[self bounds]];
if (slideOk == NO)
{
[imageSet setNeedsRedraw];
}
}
else
{
[imageSet setNeedsRedraw];
}
[self setNeedsDisplay];
*/
}
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
if (enableDragging)
... ... @@ -211,20 +202,22 @@
if (enableZoom && [[event allTouches] count] > 1)
{
// Don't bother sliding the images. We'll need to regenerate the imageset anyway.
[self dragBy: delta TrySlideImages: NO];
// [self dragBy: delta TrySlideImages: NO];
[renderer moveBy:delta];
double zoomFactor = lastGesture.averageDistanceFromCenter / newGesture.averageDistanceFromCenter;
// lastZoomDistance = gesture.averageDistanceFromCenter;
// [imageSet setNeedsRedraw];
[screenProjection zoomByFactor: zoomFactor Near: newGesture.center];
[renderer zoomByFactor: zoomFactor Near: newGesture.center];
}
else
{
[self dragBy: delta TrySlideImages: YES];
// [self dragBy: delta TrySlideImages: YES];
[renderer moveBy:delta];
}
[self setNeedsDisplay];
// [self setNeedsDisplay];
lastGesture = newGesture;
}
... ...
/*
* MathUtils.c
* RouteMe
*
* Created by Joseph Gentle on 8/09/08.
* Copyright 2008 __MyCompanyName__. All rights reserved.
*
*/
#include "MathUtils.h"
CGRect ScaleCGRectAboutPoint(CGRect rect, float factor, CGPoint point)
{
factor = 1.0f / factor;
rect.origin.x = (rect.origin.x - point.x) * factor + point.x;
rect.origin.y = (rect.origin.y - point.y) * factor + point.y;
rect.size.width *= factor;
rect.size.height *= factor;
return rect;
}
CGRect TranslateCGRectBy(CGRect rect, CGSize delta)
{
rect.origin.x += delta.width;
rect.origin.y += delta.height;
return rect;
}
\ No newline at end of file
... ...
/*
* MathUtils.h
* RouteMe
*
* Created by Joseph Gentle on 8/09/08.
* Copyright 2008 __MyCompanyName__. All rights reserved.
*
*/
#ifndef _MATHUTILS_H_
#define _MATHUTILS_H_
#include <CoreGraphics/CGGeometry.h>
CGRect ScaleCGRectAboutPoint(CGRect rect, float factor, CGPoint point);
CGRect TranslateCGRectBy(CGRect rect, CGSize delta);
#endif
\ No newline at end of file
... ...
//
// QuartzRenderer.h
// RouteMe
//
// Created by Joseph Gentle on 8/09/08.
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "MapRenderer.h"
@class ScreenProjection;
@class MapView;
@class TileImageSet;
@interface QuartzRenderer : MapRenderer {
// This is basically a one-object allocation pool.
TileImageSet *imageSet;
}
@end
... ...
//
// QuartzRenderer.m
// RouteMe
//
// Created by Joseph Gentle on 8/09/08.
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
#import "QuartzRenderer.h"
#import "TileImageSet.h"
#import "MapView.h"
#import "FractalTileProjection.h"
#import "TileSource.h"
#import "ScreenProjection.h"
@implementation QuartzRenderer
- (id) initWithView: (MapView *)_view
{
if (![super initWithView:_view])
return nil;
imageSet = [[TileImageSet alloc] init];
return self;
}
-(void) recalculateImageSet
{
// NSLog(@"recalc");
TileRect tileRect = [[[view tileSource] tileProjection] project:screenProjection];
[imageSet assembleFromRect:tileRect FromImageSource:[view tileSource] ToDisplayIn:[view bounds] WithTileDelegate:self];
}
- (void)drawRect:(CGRect)rect
{
[imageSet draw];
}
- (void)setNeedsDisplay
{
int loadedZoom = [imageSet loadedZoom];
float scale = [screenProjection scale];
int properZoom = [[[view tileSource] tileProjection] calculateNormalisedZoomFromScale:scale];
if (![imageSet containsRect:[view bounds]]
|| loadedZoom != properZoom)
{
// NSLog(@"loadedZoom = %d properZoom = %d", loadedZoom, properZoom);
// CGRect bounds = [view bounds];
// NSLog(@"view bounds: %f x %f %f x %f", bounds.origin.x, bounds.origin.y, bounds.size.width, bounds.size.height);
// CGRect loadedBounds = [imageSet loadedBounds];
// NSLog(@"loadedBounds: %f x %f %f x %f", loadedBounds.origin.x, loadedBounds.origin.y, loadedBounds.size.width, loadedBounds.size.height);
[self recalculateImageSet];
}
[super setNeedsDisplay];
}
- (void)moveBy: (CGSize) delta
{
[super moveBy:delta];
[imageSet moveBy:delta];
[self setNeedsDisplay];
}
- (void)zoomByFactor: (float) zoomFactor Near:(CGPoint) center
{
[super zoomByFactor:zoomFactor Near:center];
[imageSet zoomByFactor:zoomFactor Near:center];
[self setNeedsDisplay];
}
- (void)tileDidFinishLoading: (TileImage *)image
{
[view setNeedsDisplay];
}
@end
... ...
... ... @@ -7,6 +7,14 @@
objects = {
/* Begin PBXBuildFile section */
B87626CA0E7529BE0024B9C5 /* ScreenProjection.h in Headers */ = {isa = PBXBuildFile; fileRef = B87626C80E7529BE0024B9C5 /* ScreenProjection.h */; };
B87626CB0E7529BE0024B9C5 /* ScreenProjection.m in Sources */ = {isa = PBXBuildFile; fileRef = B87626C90E7529BE0024B9C5 /* ScreenProjection.m */; };
B87626D00E752A010024B9C5 /* MapRenderer.h in Headers */ = {isa = PBXBuildFile; fileRef = B87626CE0E752A010024B9C5 /* MapRenderer.h */; };
B87626D70E752E6E0024B9C5 /* QuartzRenderer.h in Headers */ = {isa = PBXBuildFile; fileRef = B87626D50E752E6E0024B9C5 /* QuartzRenderer.h */; };
B87626D80E752E6E0024B9C5 /* QuartzRenderer.m in Sources */ = {isa = PBXBuildFile; fileRef = B87626D60E752E6E0024B9C5 /* QuartzRenderer.m */; };
B87626E90E7562620024B9C5 /* TileImageSet.m in Sources */ = {isa = PBXBuildFile; fileRef = B89428260E6BEA390080B2F5 /* TileImageSet.m */; };
B87626F10E75654C0024B9C5 /* MathUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = B87626EF0E75654C0024B9C5 /* MathUtils.h */; };
B87626F20E75654C0024B9C5 /* MathUtils.c in Sources */ = {isa = PBXBuildFile; fileRef = B87626F00E75654C0024B9C5 /* MathUtils.c */; };
B894284D0E6BEAB20080B2F5 /* ImagesAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = B894284B0E6BEAB20080B2F5 /* ImagesAppDelegate.m */; };
B894284E0E6BEAB20080B2F5 /* RootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B894284C0E6BEAB20080B2F5 /* RootViewController.m */; };
B89428510E6BEABC0080B2F5 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = B89428500E6BEABC0080B2F5 /* main.m */; };
... ... @@ -24,6 +32,9 @@
B8A51E910E6D7192006AA8E2 /* TileCache.m in Sources */ = {isa = PBXBuildFile; fileRef = B8A51E900E6D7192006AA8E2 /* TileCache.m */; };
B8A522590E6E84F3006AA8E2 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B8A522580E6E84F3006AA8E2 /* QuartzCore.framework */; };
B8A5225D0E6E8508006AA8E2 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B8A522580E6E84F3006AA8E2 /* QuartzCore.framework */; };
B8A5C87A0E757FC8005509DE /* MapRenderer.m in Sources */ = {isa = PBXBuildFile; fileRef = B8A5C8790E757FC8005509DE /* MapRenderer.m */; };
B8A5C8860E758250005509DE /* CoreAnimationRenderer.h in Headers */ = {isa = PBXBuildFile; fileRef = B8A5C8840E758250005509DE /* CoreAnimationRenderer.h */; };
B8A5C8870E758250005509DE /* CoreAnimationRenderer.m in Sources */ = {isa = PBXBuildFile; fileRef = B8A5C8850E758250005509DE /* CoreAnimationRenderer.m */; };
B8D9B0640E6BEBCC00EDA368 /* FlipsideView.m in Sources */ = {isa = PBXBuildFile; fileRef = B89428440E6BEA3A0080B2F5 /* FlipsideView.m */; };
B8D9B0BD0E6BECD400EDA368 /* pj_tsfn.c in Sources */ = {isa = PBXBuildFile; fileRef = B89428140E6BEA390080B2F5 /* pj_tsfn.c */; };
B8D9B0BE0E6BECD400EDA368 /* PJ_tmerc.c in Sources */ = {isa = PBXBuildFile; fileRef = B89427AC0E6BEA390080B2F5 /* PJ_tmerc.c */; };
... ... @@ -234,6 +245,13 @@
/* Begin PBXFileReference section */
1D6058910D05DD3D006BFB54 /* RouteMe.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RouteMe.app; sourceTree = BUILT_PRODUCTS_DIR; };
B87626C80E7529BE0024B9C5 /* ScreenProjection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScreenProjection.h; sourceTree = "<group>"; };
B87626C90E7529BE0024B9C5 /* ScreenProjection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ScreenProjection.m; sourceTree = "<group>"; };
B87626CE0E752A010024B9C5 /* MapRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MapRenderer.h; sourceTree = "<group>"; };
B87626D50E752E6E0024B9C5 /* QuartzRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QuartzRenderer.h; sourceTree = "<group>"; };
B87626D60E752E6E0024B9C5 /* QuartzRenderer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QuartzRenderer.m; sourceTree = "<group>"; };
B87626EF0E75654C0024B9C5 /* MathUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathUtils.h; sourceTree = "<group>"; };
B87626F00E75654C0024B9C5 /* MathUtils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = MathUtils.c; sourceTree = "<group>"; };
B89427840E6BEA390080B2F5 /* p_series.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = p_series.c; sourceTree = "<group>"; };
B89427850E6BEA390080B2F5 /* bch2bps.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = bch2bps.c; sourceTree = "<group>"; };
B89427860E6BEA390080B2F5 /* pj_inv.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = pj_inv.c; sourceTree = "<group>"; };
... ... @@ -440,6 +458,9 @@
B8A51E730E6D6171006AA8E2 /* loading.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = loading.png; sourceTree = "<group>"; };
B8A51E900E6D7192006AA8E2 /* TileCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TileCache.m; sourceTree = "<group>"; };
B8A522580E6E84F3006AA8E2 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
B8A5C8790E757FC8005509DE /* MapRenderer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MapRenderer.m; sourceTree = "<group>"; };
B8A5C8840E758250005509DE /* CoreAnimationRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreAnimationRenderer.h; sourceTree = "<group>"; };
B8A5C8850E758250005509DE /* CoreAnimationRenderer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CoreAnimationRenderer.m; sourceTree = "<group>"; };
B8D9B0B70E6BEC1900EDA368 /* libproj4.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libproj4.a; sourceTree = BUILT_PRODUCTS_DIR; };
B8D9B17D0E6BF0D600EDA368 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
B8D9B17E0E6BF0DD00EDA368 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = "<group>"; };
... ... @@ -498,7 +519,6 @@
29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
isa = PBXGroup;
children = (
B8A522140E6E74FC006AA8E2 /* Gunk */,
B894285B0E6BEAE40080B2F5 /* Frameworks */,
B89428520E6BEAC70080B2F5 /* Resources */,
B89428480E6BEA970080B2F5 /* Application Support */,
... ... @@ -509,11 +529,66 @@
19C28FACFE9D520D11CA2CBB /* Products */,
B8D9B17D0E6BF0D600EDA368 /* README */,
B8D9B17E0E6BF0DD00EDA368 /* LICENSE */,
B8A522580E6E84F3006AA8E2 /* QuartzCore.framework */,
);
name = CustomTemplate;
sourceTree = "<group>";
};
B87626CC0E7529CF0024B9C5 /* Renderers */ = {
isa = PBXGroup;
children = (
B87626D30E752B640024B9C5 /* Quartz Renderer */,
B8A5C8780E757E95005509DE /* Core Animation Renderer */,
B87626D20E752B280024B9C5 /* Tiled Layer Renderer */,
B87626C80E7529BE0024B9C5 /* ScreenProjection.h */,
B87626C90E7529BE0024B9C5 /* ScreenProjection.m */,
B87626CE0E752A010024B9C5 /* MapRenderer.h */,
B8A5C8790E757FC8005509DE /* MapRenderer.m */,
);
name = Renderers;
sourceTree = "<group>";
};
B87626D20E752B280024B9C5 /* Tiled Layer Renderer */ = {
isa = PBXGroup;
children = (
B89428390E6BEA3A0080B2F5 /* TiledLayerController.h */,
B894283A0E6BEA3A0080B2F5 /* TiledLayerController.m */,
);
name = "Tiled Layer Renderer";
sourceTree = "<group>";
};
B87626D30E752B640024B9C5 /* Quartz Renderer */ = {
isa = PBXGroup;
children = (
B89428250E6BEA390080B2F5 /* TileImageSet.h */,
B89428260E6BEA390080B2F5 /* TileImageSet.m */,
B87626D50E752E6E0024B9C5 /* QuartzRenderer.h */,
B87626D60E752E6E0024B9C5 /* QuartzRenderer.m */,
);
name = "Quartz Renderer";
sourceTree = "<group>";
};
B87626D40E752DF30024B9C5 /* Cache */ = {
isa = PBXGroup;
children = (
B89428270E6BEA390080B2F5 /* TileCache.h */,
B8A51E900E6D7192006AA8E2 /* TileCache.m */,
B89428280E6BEA390080B2F5 /* MemoryCache.h */,
B89428290E6BEA390080B2F5 /* MemoryCache.m */,
B894282A0E6BEA390080B2F5 /* FileCache.h */,
B894282B0E6BEA390080B2F5 /* FileCache.m */,
);
name = Cache;
sourceTree = "<group>";
};
B87626EE0E7565350024B9C5 /* Utilities */ = {
isa = PBXGroup;
children = (
B87626EF0E75654C0024B9C5 /* MathUtils.h */,
B87626F00E75654C0024B9C5 /* MathUtils.c */,
);
name = Utilities;
sourceTree = "<group>";
};
B89427830E6BEA390080B2F5 /* proj4 */ = {
isa = PBXGroup;
children = (
... ... @@ -676,10 +751,10 @@
B894281C0E6BEA390080B2F5 /* Map View */ = {
isa = PBXGroup;
children = (
B87626EE0E7565350024B9C5 /* Utilities */,
B87626CC0E7529CF0024B9C5 /* Renderers */,
B894283B0E6BEA3A0080B2F5 /* MapView.h */,
B894283C0E6BEA3A0080B2F5 /* MapView.m */,
B89428390E6BEA3A0080B2F5 /* TiledLayerController.h */,
B894283A0E6BEA3A0080B2F5 /* TiledLayerController.m */,
B89428300E6BEA390080B2F5 /* Projections */,
B89428210E6BEA390080B2F5 /* Tile Management */,
B894281D0E6BEA390080B2F5 /* Tile Source */,
... ... @@ -700,15 +775,10 @@
B89428210E6BEA390080B2F5 /* Tile Management */ = {
isa = PBXGroup;
children = (
B87626D40E752DF30024B9C5 /* Cache */,
B89428220E6BEA390080B2F5 /* Tile.h */,
B89428230E6BEA390080B2F5 /* TileImage.h */,
B89428240E6BEA390080B2F5 /* TileImage.m */,
B89428270E6BEA390080B2F5 /* TileCache.h */,
B8A51E900E6D7192006AA8E2 /* TileCache.m */,
B89428280E6BEA390080B2F5 /* MemoryCache.h */,
B89428290E6BEA390080B2F5 /* MemoryCache.m */,
B894282A0E6BEA390080B2F5 /* FileCache.h */,
B894282B0E6BEA390080B2F5 /* FileCache.m */,
B894282C0E6BEA390080B2F5 /* TileProxy.h */,
B894282D0E6BEA390080B2F5 /* TileProxy.m */,
B894282E0E6BEA390080B2F5 /* WebTileImage.h */,
... ... @@ -784,6 +854,7 @@
B894285B0E6BEAE40080B2F5 /* Frameworks */ = {
isa = PBXGroup;
children = (
B8A522580E6E84F3006AA8E2 /* QuartzCore.framework */,
B894285C0E6BEB020080B2F5 /* Foundation.framework */,
B894285D0E6BEB020080B2F5 /* CoreLocation.framework */,
B894285E0E6BEB020080B2F5 /* CoreGraphics.framework */,
... ... @@ -792,13 +863,13 @@
name = Frameworks;
sourceTree = "<group>";
};
B8A522140E6E74FC006AA8E2 /* Gunk */ = {
B8A5C8780E757E95005509DE /* Core Animation Renderer */ = {
isa = PBXGroup;
children = (
B89428250E6BEA390080B2F5 /* TileImageSet.h */,
B89428260E6BEA390080B2F5 /* TileImageSet.m */,
B8A5C8840E758250005509DE /* CoreAnimationRenderer.h */,
B8A5C8850E758250005509DE /* CoreAnimationRenderer.m */,
);
name = Gunk;
name = "Core Animation Renderer";
sourceTree = "<group>";
};
/* End PBXGroup section */
... ... @@ -840,6 +911,11 @@
B8D9B20D0E6BFA7F00EDA368 /* OpenStreetMapsSource.h in Headers */,
B8D9B20E0E6BFA7F00EDA368 /* Mercator.h in Headers */,
B8D9B27D0E6D460500EDA368 /* FileTileImage.h in Headers */,
B87626CA0E7529BE0024B9C5 /* ScreenProjection.h in Headers */,
B87626D00E752A010024B9C5 /* MapRenderer.h in Headers */,
B87626D70E752E6E0024B9C5 /* QuartzRenderer.h in Headers */,
B87626F10E75654C0024B9C5 /* MathUtils.h in Headers */,
B8A5C8860E758250005509DE /* CoreAnimationRenderer.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
... ... @@ -1116,6 +1192,12 @@
B8D9B1FE0E6BFA7500EDA368 /* OpenStreetMapsSource.m in Sources */,
B8D9B27E0E6D460500EDA368 /* FileTileImage.m in Sources */,
B8A51E910E6D7192006AA8E2 /* TileCache.m in Sources */,
B87626CB0E7529BE0024B9C5 /* ScreenProjection.m in Sources */,
B87626D80E752E6E0024B9C5 /* QuartzRenderer.m in Sources */,
B87626E90E7562620024B9C5 /* TileImageSet.m in Sources */,
B87626F20E75654C0024B9C5 /* MathUtils.c in Sources */,
B8A5C87A0E757FC8005509DE /* MapRenderer.m in Sources */,
B8A5C8870E758250005509DE /* CoreAnimationRenderer.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
... ...
... ... @@ -271,11 +271,13 @@
<key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key>
<array>
<string>29B97314FDCFA39411CA2CEA</string>
<string>B8A522140E6E74FC006AA8E2</string>
<string>B894285B0E6BEAE40080B2F5</string>
<string>B89428520E6BEAC70080B2F5</string>
<string>B89428420E6BEA3A0080B2F5</string>
<string>B894281C0E6BEA390080B2F5</string>
<string>B87626CC0E7529CF0024B9C5</string>
<string>B87626D30E752B640024B9C5</string>
<string>B89428300E6BEA390080B2F5</string>
<string>B89428210E6BEA390080B2F5</string>
<string>19C28FACFE9D520D11CA2CBB</string>
<string>1C37FBAC04509CD000000102</string>
<string>1C37FAAC04509CD000000102</string>
... ... @@ -284,9 +286,9 @@
<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
<array>
<array>
<integer>25</integer>
<integer>23</integer>
<integer>18</integer>
<integer>40</integer>
<integer>37</integer>
<integer>16</integer>
<integer>0</integer>
</array>
</array>
... ... @@ -312,7 +314,7 @@
<real>244</real>
</array>
<key>RubberWindowFrame</key>
<string>4 55 1916 1123 0 0 1920 1178 </string>
<string>7 55 1916 1123 0 0 1920 1178 </string>
</dict>
<key>Module</key>
<string>PBXSmartGroupTreeModule</string>
... ... @@ -330,7 +332,7 @@
<key>PBXProjectModuleGUID</key>
<string>1CE0B20306471E060097A5F4</string>
<key>PBXProjectModuleLabel</key>
<string>Projection.m</string>
<string>TileImageSet.m</string>
<key>PBXSplitModuleInNavigatorKey</key>
<dict>
<key>Split0</key>
... ... @@ -338,11 +340,11 @@
<key>PBXProjectModuleGUID</key>
<string>1CE0B20406471E060097A5F4</string>
<key>PBXProjectModuleLabel</key>
<string>Projection.m</string>
<string>TileImageSet.m</string>
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
<string>B87626BB0E75264E0024B9C5</string>
<string>B8A5C8760E757DDF005509DE</string>
<key>history</key>
<array>
<string>B89429560E6BEB760080B2F5</string>
... ... @@ -360,18 +362,14 @@
<string>B8D9B18D0E6BF23900EDA368</string>
<string>B8D9B18E0E6BF23900EDA368</string>
<string>B8D9B18F0E6BF23900EDA368</string>
<string>B8D9B1900E6BF23900EDA368</string>
<string>B8D9B1910E6BF23900EDA368</string>
<string>B8D9B1920E6BF23900EDA368</string>
<string>B8D9B1930E6BF23900EDA368</string>
<string>B8D9B1940E6BF23900EDA368</string>
<string>B8D9B1CE0E6BF97F00EDA368</string>
<string>B8D9B1CF0E6BF97F00EDA368</string>
<string>B8D9B2170E6BFBF700EDA368</string>
<string>B8D9B2450E6BFE0C00EDA368</string>
<string>B8D9B2460E6BFE0C00EDA368</string>
<string>B8D9B2750E6D152500EDA368</string>
<string>B8D9B2870E6D486700EDA368</string>
<string>B8A51E9F0E6D73CC006AA8E2</string>
<string>B8A51EAA0E6D73CC006AA8E2</string>
<string>B8A51FAE0E6D7AAA006AA8E2</string>
... ... @@ -379,34 +377,48 @@
<string>B8A51FD90E6D7BEB006AA8E2</string>
<string>B8A51FE70E6D8604006AA8E2</string>
<string>B8A51FE90E6D8604006AA8E2</string>
<string>B8A51FEA0E6D8604006AA8E2</string>
<string>B8A51FEE0E6D8604006AA8E2</string>
<string>B8A5200F0E6D8F42006AA8E2</string>
<string>B8A520220E6D9456006AA8E2</string>
<string>B8A520230E6D9456006AA8E2</string>
<string>B8A5202E0E6DE7A1006AA8E2</string>
<string>B8A5206F0E6E39AD006AA8E2</string>
<string>B8A520700E6E39AD006AA8E2</string>
<string>B8A520D90E6E4ED0006AA8E2</string>
<string>B8A520DA0E6E4ED0006AA8E2</string>
<string>B8A520DB0E6E4ED0006AA8E2</string>
<string>B8A521F50E6E74AB006AA8E2</string>
<string>B8A5225F0E6E850D006AA8E2</string>
<string>B8A522600E6E850D006AA8E2</string>
<string>B8A522610E6E850D006AA8E2</string>
<string>B8A522620E6E850D006AA8E2</string>
<string>B8A522630E6E850D006AA8E2</string>
<string>B8A522640E6E850D006AA8E2</string>
<string>B8A522660E6E850D006AA8E2</string>
<string>B8A522670E6E850D006AA8E2</string>
<string>B8A522680E6E850D006AA8E2</string>
<string>B8A5233F0E6E86CE006AA8E2</string>
<string>B8A523400E6E86CE006AA8E2</string>
<string>B876256D0E70FC160024B9C5</string>
<string>B876258A0E70FF340024B9C5</string>
<string>B87625930E7100790024B9C5</string>
<string>B876261E0E74CE460024B9C5</string>
<string>B87626210E74CE460024B9C5</string>
<string>B87627050E7566990024B9C5</string>
<string>B87627060E7566990024B9C5</string>
<string>B87627070E7566990024B9C5</string>
<string>B876270A0E7566990024B9C5</string>
<string>B876270C0E7566990024B9C5</string>
<string>B876270D0E7566990024B9C5</string>
<string>B87627170E7566990024B9C5</string>
<string>B87627190E7566990024B9C5</string>
<string>B876283B0E756CAE0024B9C5</string>
<string>B876283E0E756CAE0024B9C5</string>
<string>B87628400E756CAE0024B9C5</string>
<string>B8A5C7690E756F6B005509DE</string>
<string>B8A5C76A0E756F6B005509DE</string>
<string>B8A5C76B0E756F6B005509DE</string>
<string>B8A5C76C0E756F6B005509DE</string>
<string>B8A5C76D0E756F6B005509DE</string>
<string>B8A5C78B0E757042005509DE</string>
<string>B8A5C78C0E757042005509DE</string>
<string>B8A5C7A80E757175005509DE</string>
<string>B8A5C7CD0E75745C005509DE</string>
<string>B8A5C7CE0E75745C005509DE</string>
<string>B8A5C7D00E75745C005509DE</string>
<string>B8A5C7D20E75745C005509DE</string>
<string>B8A5C81A0E757738005509DE</string>
<string>B8A5C81B0E757738005509DE</string>
<string>B8A5C8510E757B48005509DE</string>
<string>B8A5C8520E757B48005509DE</string>
<string>B8A5C8530E757B48005509DE</string>
<string>B8A5C85F0E757BC9005509DE</string>
<string>B8A5C8680E757D29005509DE</string>
<string>B8A5C8690E757D29005509DE</string>
</array>
<key>prevStack</key>
<array>
... ... @@ -471,6 +483,107 @@
<string>B8A51F020E6D73CC006AA8E2</string>
<string>B8A520160E6D8F42006AA8E2</string>
<string>B8A520300E6DE7A1006AA8E2</string>
<string>B876271D0E7566990024B9C5</string>
<string>B876271E0E7566990024B9C5</string>
<string>B876272B0E7566990024B9C5</string>
<string>B87627510E7566990024B9C5</string>
<string>B87627520E7566990024B9C5</string>
<string>B87628090E7566990024B9C5</string>
<string>B876280C0E7566990024B9C5</string>
<string>B87628770E756CAE0024B9C5</string>
<string>B8A5C76E0E756F6B005509DE</string>
<string>B8A5C76F0E756F6B005509DE</string>
<string>B8A5C7700E756F6B005509DE</string>
<string>B8A5C7710E756F6B005509DE</string>
<string>B8A5C7720E756F6B005509DE</string>
<string>B8A5C7730E756F6B005509DE</string>
<string>B8A5C7740E756F6B005509DE</string>
<string>B8A5C77D0E756FA7005509DE</string>
<string>B8A5C78E0E757042005509DE</string>
<string>B8A5C78F0E757042005509DE</string>
<string>B8A5C7980E7570A0005509DE</string>
<string>B8A5C7990E7570A0005509DE</string>
<string>B8A5C79E0E7570BB005509DE</string>
<string>B8A5C79F0E7570BB005509DE</string>
<string>B8A5C7AB0E757175005509DE</string>
<string>B8A5C7AC0E757175005509DE</string>
<string>B8A5C7AD0E757175005509DE</string>
<string>B8A5C7AE0E757175005509DE</string>
<string>B8A5C7AF0E757175005509DE</string>
<string>B8A5C7BA0E75726C005509DE</string>
<string>B8A5C7BB0E75726C005509DE</string>
<string>B8A5C7BC0E75726C005509DE</string>
<string>B8A5C7BD0E75726C005509DE</string>
<string>B8A5C7BE0E75726C005509DE</string>
<string>B8A5C7BF0E75726C005509DE</string>
<string>B8A5C7C00E75726C005509DE</string>
<string>B8A5C7C10E75726C005509DE</string>
<string>B8A5C7C20E75726C005509DE</string>
<string>B8A5C7D50E75745C005509DE</string>
<string>B8A5C7D60E75745C005509DE</string>
<string>B8A5C7D70E75745C005509DE</string>
<string>B8A5C7D80E75745C005509DE</string>
<string>B8A5C7D90E75745C005509DE</string>
<string>B8A5C7DA0E75745C005509DE</string>
<string>B8A5C7DB0E75745C005509DE</string>
<string>B8A5C7DC0E75745C005509DE</string>
<string>B8A5C7DD0E75745C005509DE</string>
<string>B8A5C7DE0E75745C005509DE</string>
<string>B8A5C7DF0E75745C005509DE</string>
<string>B8A5C7E00E75745C005509DE</string>
<string>B8A5C7E10E75745C005509DE</string>
<string>B8A5C7E20E75745C005509DE</string>
<string>B8A5C7E30E75745C005509DE</string>
<string>B8A5C7E40E75745C005509DE</string>
<string>B8A5C7E50E75745C005509DE</string>
<string>B8A5C7E60E75745C005509DE</string>
<string>B8A5C7E70E75745C005509DE</string>
<string>B8A5C7E80E75745C005509DE</string>
<string>B8A5C7E90E75745C005509DE</string>
<string>B8A5C7EA0E75745C005509DE</string>
<string>B8A5C7EB0E75745C005509DE</string>
<string>B8A5C7EC0E75745C005509DE</string>
<string>B8A5C7ED0E75745C005509DE</string>
<string>B8A5C7EE0E75745C005509DE</string>
<string>B8A5C7EF0E75745C005509DE</string>
<string>B8A5C7F00E75745C005509DE</string>
<string>B8A5C7F10E75745C005509DE</string>
<string>B8A5C7F20E75745C005509DE</string>
<string>B8A5C7F30E75745C005509DE</string>
<string>B8A5C7F40E75745C005509DE</string>
<string>B8A5C7F50E75745C005509DE</string>
<string>B8A5C7F60E75745C005509DE</string>
<string>B8A5C8120E7575BA005509DE</string>
<string>B8A5C81D0E757738005509DE</string>
<string>B8A5C81E0E757738005509DE</string>
<string>B8A5C81F0E757738005509DE</string>
<string>B8A5C8200E757738005509DE</string>
<string>B8A5C8210E757738005509DE</string>
<string>B8A5C8220E757738005509DE</string>
<string>B8A5C8230E757738005509DE</string>
<string>B8A5C8240E757738005509DE</string>
<string>B8A5C8250E757738005509DE</string>
<string>B8A5C8260E757738005509DE</string>
<string>B8A5C8270E757738005509DE</string>
<string>B8A5C8280E757738005509DE</string>
<string>B8A5C8290E757738005509DE</string>
<string>B8A5C82A0E757738005509DE</string>
<string>B8A5C83C0E757986005509DE</string>
<string>B8A5C83D0E757986005509DE</string>
<string>B8A5C83E0E757986005509DE</string>
<string>B8A5C83F0E757986005509DE</string>
<string>B8A5C8480E757A06005509DE</string>
<string>B8A5C84D0E757A20005509DE</string>
<string>B8A5C8560E757B48005509DE</string>
<string>B8A5C8570E757B48005509DE</string>
<string>B8A5C8580E757B48005509DE</string>
<string>B8A5C8590E757B48005509DE</string>
<string>B8A5C85A0E757B48005509DE</string>
<string>B8A5C8610E757BC9005509DE</string>
<string>B8A5C86A0E757D29005509DE</string>
<string>B8A5C86B0E757D29005509DE</string>
<string>B8A5C86C0E757D29005509DE</string>
<string>B8A5C86D0E757D29005509DE</string>
</array>
</dict>
<key>SplitCount</key>
... ... @@ -484,7 +597,7 @@
<key>Frame</key>
<string>{{0, 0}, {1628, 965}}</string>
<key>RubberWindowFrame</key>
<string>4 55 1916 1123 0 0 1920 1178 </string>
<string>7 55 1916 1123 0 0 1920 1178 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
... ... @@ -504,7 +617,7 @@
<key>Frame</key>
<string>{{0, 970}, {1628, 112}}</string>
<key>RubberWindowFrame</key>
<string>4 55 1916 1123 0 0 1920 1178 </string>
<string>7 55 1916 1123 0 0 1920 1178 </string>
</dict>
<key>Module</key>
<string>XCDetailModule</string>
... ... @@ -528,9 +641,9 @@
</array>
<key>TableOfContents</key>
<array>
<string>B87626B30E7526490024B9C5</string>
<string>B8A5C73A0E756E6E005509DE</string>
<string>1CE0B1FE06471DED0097A5F4</string>
<string>B87626B40E7526490024B9C5</string>
<string>B8A5C73B0E756E6E005509DE</string>
<string>1CE0B20306471E060097A5F4</string>
<string>1CE0B20506471E060097A5F4</string>
</array>
... ... @@ -664,11 +777,15 @@
<integer>5</integer>
<key>WindowOrderList</key>
<array>
<string>B8A5C74B0E756E98005509DE</string>
<string>B8A5C7450E756E6E005509DE</string>
<string>1CD10A99069EF8BA00B06720</string>
<string>B89426BA0E6BE9980080B2F5</string>
<string>/Users/sineltor/src/catchme/Project/RouteMe/RouteMe.xcodeproj</string>
<string>1C78EAAD065D492600B07095</string>
</array>
<key>WindowString</key>
<string>4 55 1916 1123 0 0 1920 1178 </string>
<string>7 55 1916 1123 0 0 1920 1178 </string>
<key>WindowToolsV3</key>
<array>
<dict>
... ... @@ -684,12 +801,14 @@
<key>Dock</key>
<array>
<dict>
<key>BecomeActive</key>
<true/>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>1CD0528F0623707200166675</string>
<key>PBXProjectModuleLabel</key>
<string></string>
<string>ScreenProjection.h</string>
<key>StatusBarVisibility</key>
<true/>
</dict>
... ... @@ -698,7 +817,7 @@
<key>Frame</key>
<string>{{0, 0}, {896, 361}}</string>
<key>RubberWindowFrame</key>
<string>98 97 896 739 0 0 1920 1178 </string>
<string>2052 415 896 739 1920 300 1440 900 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
... ... @@ -722,7 +841,7 @@
<key>Frame</key>
<string>{{0, 366}, {896, 332}}</string>
<key>RubberWindowFrame</key>
<string>98 97 896 739 0 0 1920 1178 </string>
<string>2052 415 896 739 1920 300 1440 900 </string>
</dict>
<key>Module</key>
<string>PBXBuildResultsModule</string>
... ... @@ -745,18 +864,18 @@
<key>TableOfContents</key>
<array>
<string>B89426BA0E6BE9980080B2F5</string>
<string>B87626240E74CE460024B9C5</string>
<string>B8A5C73C0E756E6E005509DE</string>
<string>1CD0528F0623707200166675</string>
<string>XCMainBuildResultsModuleGUID</string>
</array>
<key>ToolbarConfiguration</key>
<string>xcode.toolbar.config.buildV3</string>
<key>WindowString</key>
<string>98 97 896 739 0 0 1920 1178 </string>
<string>2052 415 896 739 1920 300 1440 900 </string>
<key>WindowToolGUID</key>
<string>B89426BA0E6BE9980080B2F5</string>
<key>WindowToolIsVisible</key>
<false/>
<true/>
</dict>
<dict>
<key>FirstTimeWindowDisplayed</key>
... ... @@ -787,8 +906,8 @@
<string>yes</string>
<key>sizes</key>
<array>
<string>{{0, 0}, {597, 409}}</string>
<string>{{597, 0}, {717, 409}}</string>
<string>{{0, 0}, {871, 577}}</string>
<string>{{871, 0}, {1045, 577}}</string>
</array>
</dict>
<key>VerticalSplitView</key>
... ... @@ -803,8 +922,8 @@
<string>yes</string>
<key>sizes</key>
<array>
<string>{{0, 0}, {1314, 409}}</string>
<string>{{0, 409}, {1314, 357}}</string>
<string>{{0, 0}, {1916, 577}}</string>
<string>{{0, 577}, {1916, 504}}</string>
</array>
</dict>
</dict>
... ... @@ -824,34 +943,34 @@
<key>DebugSTDIOWindowFrame</key>
<string>{{200, 200}, {500, 300}}</string>
<key>Frame</key>
<string>{{0, 0}, {1314, 766}}</string>
<string>{{0, 0}, {1916, 1081}}</string>
<key>PBXDebugSessionStackFrameViewKey</key>
<dict>
<key>DebugVariablesTableConfiguration</key>
<array>
<string>Name</string>
<real>120</real>
<real>245</real>
<string>Value</string>
<real>85</real>
<string>Summary</string>
<real>487</real>
<real>690</real>
</array>
<key>Frame</key>
<string>{{597, 0}, {717, 409}}</string>
<string>{{871, 0}, {1045, 577}}</string>
<key>RubberWindowFrame</key>
<string>2008 393 1314 807 1920 300 1440 900 </string>
<string>4 56 1916 1122 0 0 1920 1178 </string>
</dict>
<key>RubberWindowFrame</key>
<string>2008 393 1314 807 1920 300 1440 900 </string>
<string>4 56 1916 1122 0 0 1920 1178 </string>
</dict>
<key>Module</key>
<string>PBXDebugSessionModule</string>
<key>Proportion</key>
<string>766pt</string>
<string>1081pt</string>
</dict>
</array>
<key>Proportion</key>
<string>766pt</string>
<string>1081pt</string>
</dict>
</array>
<key>Name</key>
... ... @@ -865,22 +984,22 @@
<key>TableOfContents</key>
<array>
<string>1CD10A99069EF8BA00B06720</string>
<string>B87626B50E7526490024B9C5</string>
<string>B8A5C73D0E756E6E005509DE</string>
<string>1C162984064C10D400B95A72</string>
<string>B87626B60E7526490024B9C5</string>
<string>B87626B70E7526490024B9C5</string>
<string>B87626B80E7526490024B9C5</string>
<string>B87626B90E7526490024B9C5</string>
<string>B87626BA0E7526490024B9C5</string>
<string>B8A5C73E0E756E6E005509DE</string>
<string>B8A5C73F0E756E6E005509DE</string>
<string>B8A5C7400E756E6E005509DE</string>
<string>B8A5C7410E756E6E005509DE</string>
<string>B8A5C7420E756E6E005509DE</string>
</array>
<key>ToolbarConfiguration</key>
<string>xcode.toolbar.config.debugV3</string>
<key>WindowString</key>
<string>2008 393 1314 807 1920 300 1440 900 </string>
<string>4 56 1916 1122 0 0 1920 1178 </string>
<key>WindowToolGUID</key>
<string>1CD10A99069EF8BA00B06720</string>
<key>WindowToolIsVisible</key>
<true/>
<false/>
</dict>
<dict>
<key>Identifier</key>
... ... @@ -1010,18 +1129,18 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
<string>{{0, 0}, {628, 570}}</string>
<string>{{0, 0}, {981, 712}}</string>
<key>RubberWindowFrame</key>
<string>2660 419 628 611 1920 300 1440 900 </string>
<string>2289 447 981 753 1920 300 1440 900 </string>
</dict>
<key>Module</key>
<string>PBXDebugCLIModule</string>
<key>Proportion</key>
<string>570pt</string>
<string>712pt</string>
</dict>
</array>
<key>Proportion</key>
<string>570pt</string>
<string>712pt</string>
</dict>
</array>
<key>Name</key>
... ... @@ -1035,13 +1154,13 @@
<key>TableOfContents</key>
<array>
<string>1C78EAAD065D492600B07095</string>
<string>B876262B0E74CE460024B9C5</string>
<string>B8A5C7430E756E6E005509DE</string>
<string>1C78EAAC065D492600B07095</string>
</array>
<key>ToolbarConfiguration</key>
<string>xcode.toolbar.config.consoleV3</string>
<key>WindowString</key>
<string>2660 419 628 611 1920 300 1440 900 </string>
<string>2289 447 981 753 1920 300 1440 900 </string>
<key>WindowToolGUID</key>
<string>1C78EAAD065D492600B07095</string>
<key>WindowToolIsVisible</key>
... ...
This diff could not be displayed because it is too large.
//
// ScreenProjection.h
// Images
//
// Created by Joseph Gentle on 28/08/08.
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "Mercator.h"
#import <CoreLocation/CoreLocation.h>
@interface ScreenProjection : NSObject {
MercatorPoint topLeft;
// Bounds of the screen in pixels
CGRect bounds;
// Scale is how many meters in 1 pixel. Larger scale means bigger things are smaller on the screen.
// Scale of 1 means 1 pixel == 1 meter.
// Scale of 10 means 1 pixel == 10 meters.
double scale;
}
-(id) initWithBounds: (CGRect) bounds;
-(void) moveToMercator: (MercatorPoint) point;
-(void) moveToLatLong: (CLLocationCoordinate2D) point;
- (void)moveBy: (CGSize) delta;
// Center given in screen coordinates.
- (void)zoomByFactor: (float) factor Near:(CGPoint) center;
- (void)zoomBy: (float) factor;
-(CGPoint) projectMercatorPoint: (MercatorPoint) point;
-(CGRect) projectMercatorRect: (MercatorRect) rect;
-(MercatorPoint) projectInversePoint: (CGPoint) point;
-(MercatorRect) projectInverseRect: (CGRect) rect;
-(MercatorRect) mercatorBounds;
@property (assign, readwrite) double scale;
//@property (assign, readwrite) CGSize viewSize;
@end
... ...
//
// ScreenProjection.m
// Images
//
// Created by Joseph Gentle on 28/08/08.
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
#import "ScreenProjection.h"
@implementation ScreenProjection
-(id) initWithBounds: (CGRect) _bounds
{
if (![super init])
return nil;
bounds = _bounds;
topLeft.x = 0;
topLeft.y = 0;
scale = 1;
return self;
}
-(void) moveToMercator: (MercatorPoint) point
{
topLeft = point;
topLeft.x -= bounds.size.width * scale / 2;
topLeft.y -= bounds.size.height * scale / 2;
}
-(void) moveToLatLong: (CLLocationCoordinate2D) point;
{
[self moveToMercator:[Mercator toMercator:point]];
}
-(void) moveBy: (CGSize) delta
{
topLeft.x -= delta.width * scale;
topLeft.y += delta.height * scale;
}
-(void) zoomByFactor: (float) zoomFactor Near:(CGPoint) center
{
// NSLog(@"zoomBy: %f", zoomFactor);
topLeft.x += center.x * scale;
topLeft.y += (bounds.size.height - center.y) * scale;
scale *= zoomFactor;
topLeft.x -= center.x * scale;
topLeft.y -= (bounds.size.height - center.y) * scale;
}
- (void)zoomBy: (float) factor
{
scale *= factor;
}
-(CGPoint) projectMercatorPoint: (MercatorPoint) mercator
{
CGPoint point;
point.x = (mercator.x - topLeft.x) / scale;
point.y = -(mercator.y - topLeft.y) / scale;
return point;
}
-(CGRect) projectMercatorRect: (MercatorRect) mercator
{
CGRect rect;
rect.origin = [self projectMercatorPoint: mercator.origin];
mercator.size.width = rect.size.width / scale;
mercator.size.height = rect.size.height / scale;
return rect;
}
-(MercatorPoint) projectInversePoint: (CGPoint) point
{
MercatorPoint mercator;
mercator.x = (scale * point.x) + topLeft.x;
mercator.y = -(scale * point.y) + topLeft.y;
return mercator;
}
-(MercatorRect) projectInverseRect: (CGRect) rect
{
MercatorRect mercator;
mercator.origin = [self projectInversePoint: rect.origin];
mercator.size.width = rect.size.width * scale;
mercator.size.height = rect.size.height * scale;
return mercator;
}
-(MercatorRect) mercatorBounds
{
MercatorRect rect;
rect.origin = topLeft;
rect.size.width = bounds.size.width * scale;
rect.size.height = bounds.size.height * scale;
return rect;
}
@synthesize scale;
@end
... ...
... ... @@ -10,27 +10,39 @@
#import "Tile.h"
@class TileImage;
@class TileSource;
@protocol TileSource;
@interface TileImageSet : NSObject {
// Set of locatedtileimages
NSMutableSet *images;
NSMutableSet *buffer;
BOOL dirty;
// BOOL dirty;
CGRect loadedBounds;
int loadedZoom;
// This fixes an image resizing bug which causes thin lines along image borders
BOOL nudgeTileSize;
}
-(id) initFromRect:(TileRect) rect FromImageSource: (TileSource*)source ToDisplayWithSize:(CGSize)screenBounds WithTileDelegate: (id)delegate;
-(id) initFromRect:(TileRect) rect FromImageSource: (id<TileSource>)source ToDisplayIn:(CGRect)bounds WithTileDelegate: (id)delegate;
-(void) dealloc;
// Invalidate all current image data.
-(void) setNeedsRedraw;
//-(void) setNeedsRedraw;
-(BOOL) needsRedraw;
//-(BOOL) needsRedraw;
// Slide all images by amount. Returns whether images still fill bounds.
-(BOOL) slideBy: (CGSize) amount Within: (CGRect)bounds;
- (void)moveBy: (CGSize) delta;
- (void)zoomByFactor: (float) zoomFactor Near:(CGPoint) center;
-(void) assembleFromRect:(TileRect) rect FromImageSource: (TileSource*)source ToDisplayWithSize:(CGSize)viewSize WithTileDelegate: (id)delegate;
@property (readonly, nonatomic) CGRect loadedBounds;
@property (readonly, nonatomic) int loadedZoom;
@property (readwrite, assign, nonatomic) BOOL nudgeTileSize;
-(BOOL) containsRect: (CGRect)bounds;
-(void) assembleFromRect:(TileRect) rect FromImageSource: (id<TileSource>)source ToDisplayIn:(CGRect)bounds WithTileDelegate: (id)delegate;
-(void) draw;
@end
... ...
... ... @@ -10,14 +10,17 @@
#import "TileImage.h"
#import "TileSource.h"
#import "MathUtils.h"
@implementation TileImageSet
-(id) initFromRect:(TileRect) rect FromImageSource: (TileSource*)source ToDisplayWithSize:(CGSize)size WithTileDelegate: (id)delegate
@synthesize loadedBounds, loadedZoom, nudgeTileSize;
-(id) initFromRect:(TileRect) rect FromImageSource: (id<TileSource>)source ToDisplayIn:(CGRect)bounds WithTileDelegate: (id)delegate
{
if (![self init])
return nil;
[self assembleFromRect:rect FromImageSource: source ToDisplayWithSize: size WithTileDelegate: delegate];
[self assembleFromRect:rect FromImageSource: source ToDisplayIn:bounds WithTileDelegate: delegate];
return self;
}
... ... @@ -25,9 +28,11 @@
{
if (![super init])
return nil;
dirty = YES;
// dirty = YES;
images = [[NSMutableSet alloc] init];
buffer = [[NSMutableSet alloc] init];
loadedBounds = CGRectMake(0, 0, 0, 0);
nudgeTileSize = YES;
return self;
}
... ... @@ -39,21 +44,16 @@
[buffer release];
[super dealloc];
}
/*
-(void) setNeedsRedraw
{/*
for (TileImage *image in images)
{
[image cancelLoading];
}
*/
{
dirty = YES;
}
-(BOOL) needsRedraw
{
return dirty;
}
}*/
-(void) swapBuffers
{
... ... @@ -62,7 +62,7 @@
buffer = temp;
}
-(void) assembleFromRect:(TileRect) rect FromImageSource: (TileSource*)source ToDisplayWithSize:(CGSize)viewSize WithTileDelegate: (id)delegate
-(void) assembleFromRect:(TileRect) rect FromImageSource: (id<TileSource>)source ToDisplayIn:(CGRect)bounds WithTileDelegate: (id)delegate
{
[self swapBuffers];
... ... @@ -70,67 +70,79 @@
t.zoom = rect.origin.tile.zoom;
// ... Should be the same as equivalent calculation for height.
float pixelsPerTile = viewSize.width / rect.size.width;
float pixelsPerTile = bounds.size.width / rect.size.width;
CGRect screenLocation;
screenLocation.size.width = pixelsPerTile;
screenLocation.size.height = pixelsPerTile;
for (t.x = (rect.origin.tile.x); t.x <= (int)(rect.origin.tile.x + (rect.origin.offset.x + rect.size.width)); t.x++)
// Corrects a bug in quartz's resizing code
if (nudgeTileSize)
{
screenLocation.size.width += 0.5;
screenLocation.size.height += 0.5;
}
for (t.x = (rect.origin.tile.x); t.x <= (rect.origin.tile.x + (int)(rect.origin.offset.x + rect.size.width)); t.x++)
{
for (t.y = (rect.origin.tile.y); t.y <= (int)(rect.origin.tile.y + (rect.origin.offset.y + rect.size.height)); t.y++)
for (t.y = (rect.origin.tile.y); t.y <= (rect.origin.tile.y + (int)(rect.origin.offset.y + rect.size.height)); t.y++)
{
TileImage *image = [source tileImage:t];
[image increaseLoadingPriority];
[image setDelegate:delegate];
screenLocation.origin.x = (-rect.origin.offset.x + (t.x - rect.origin.tile.x)) * pixelsPerTile;
screenLocation.origin.y = (-rect.origin.offset.y + (t.y - rect.origin.tile.y)) * pixelsPerTile;
screenLocation.origin.x = bounds.origin.x + (t.x - (rect.origin.offset.x + rect.origin.tile.x)) * pixelsPerTile;
screenLocation.origin.y = bounds.origin.y + (t.y - (rect.origin.offset.y + rect.origin.tile.y)) * pixelsPerTile;
// NSLog(@"screenLocation from %f to %f", screenLocation.origin.x, screenLocation.origin.x + screenLocation.size.width);
image.screenLocation = screenLocation;
[images addObject:image];
}
}
loadedBounds.origin.x = bounds.origin.x - (rect.origin.offset.x * pixelsPerTile);
loadedBounds.origin.y = bounds.origin.y - (rect.origin.offset.y * pixelsPerTile);
loadedBounds.size.width = (1 + (int)(rect.size.width + rect.origin.offset.x)) * pixelsPerTile;
loadedBounds.size.height = (1 + (int)(rect.size.height + rect.origin.offset.x)) * pixelsPerTile;
loadedZoom = rect.origin.tile.zoom;
for (TileImage *image in buffer)
{
[image decreaseLoadingPriority];
}
[buffer removeAllObjects];
dirty = NO;
// dirty = NO;
}
-(BOOL) slideBy: (CGSize) amount Within: (CGRect)bounds
- (void)moveBy: (CGSize) delta
{
BOOL coversTop = NO, coversBottom = NO, coversLeft = NO, coversRight = NO;
for (TileImage *image in images)
{
CGRect location = image.screenLocation;
location.origin.x += amount.width;
location.origin.y += amount.height;
if (location.origin.x <= bounds.origin.x)
coversLeft = YES;
if (location.origin.y <= bounds.origin.y)
coversTop = YES;
if (location.origin.x + location.size.width >= bounds.origin.x + bounds.size.width)
coversRight = YES;
if (location.origin.y + location.size.height >= bounds.origin.y + bounds.size.height)
coversBottom = YES;
location = TranslateCGRectBy(location, delta);
image.screenLocation = location;
}
// NSLog(@"coversTop = %d, coversBottom = %d, coversLeft = %d, coversRight = %d", coversTop, coversBottom, coversLeft, coversRight);
BOOL fullCoverage = coversTop && coversBottom && coversLeft && coversRight;
if (fullCoverage == NO)
dirty = YES;
loadedBounds = TranslateCGRectBy(loadedBounds, delta);
}
- (void)zoomByFactor: (float) zoomFactor Near:(CGPoint) center
{
for (TileImage *image in images)
{
CGRect location = image.screenLocation;
location = ScaleCGRectAboutPoint(location, zoomFactor, center);
image.screenLocation = location;
}
return fullCoverage;
loadedBounds = ScaleCGRectAboutPoint(loadedBounds, zoomFactor, center);
}
-(BOOL) containsRect: (CGRect)bounds
{
return CGRectContainsRect(loadedBounds, bounds);
}
-(void) draw
... ...
... ... @@ -16,7 +16,7 @@
@class TiledLayerController;
@class TileCache;
@protocol TileSource
@protocol TileSource <NSObject>
-(TileImage *) tileImage: (Tile) tile;
-(FractalTileProjection*) tileProjection;
... ...