Authored by Thomas Rasch

Merge branch 'develop' into release

//
// OpenStreetMapsSource.h
//
// Copyright (c) 2008-2009, Route-Me Contributors
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
#import "RMAbstractWebMapSource.h"
/*!
\brief Subclass of RMAbstractMercatorWebSource for access to the Open Street Map project's development server.
Provides key-based access to tiles from the Open Street Map project.
*/
@interface RMOpenStreetMapSource : RMAbstractWebMapSource {
}
@end
... ...
//
// OpenStreetMapsSource.m
//
// Copyright (c) 2008-2009, Route-Me Contributors
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
#import "RMOpenStreetMapSource.h"
@implementation RMOpenStreetMapSource
- (id)init
{
if (!(self = [super init]))
return nil;
// http://wiki.openstreetmap.org/index.php/FAQ#What_is_the_map_scale_for_a_particular_zoom_level_of_the_map.3F
[self setMaxZoom:18];
[self setMinZoom:1];
return self;
}
- (NSURL *)URLForTile:(RMTile)tile
{
NSAssert4(((tile.zoom >= self.minZoom) && (tile.zoom <= self.maxZoom)),
@"%@ tried to retrieve tile with zoomLevel %d, outside source's defined range %f to %f",
self, tile.zoom, self.minZoom, self.maxZoom);
return [NSURL URLWithString:[NSString stringWithFormat:@"http://tile.openstreetmap.org/%d/%d/%d.png", tile.zoom, tile.x, tile.y]];
}
- (NSString *)uniqueTilecacheKey
{
return @"OpenStreetMap";
}
- (NSString *)shortName
{
return @"Open Street Map";
}
- (NSString *)longDescription
{
return @"Open Street Map, the free wiki world map, provides freely usable map data for all parts of the world, under the Creative Commons Attribution-Share Alike 2.0 license.";
}
- (NSString *)shortAttribution
{
return @"© OpenStreetMap CC-BY-SA";
}
-(NSString *)longAttribution
{
return @"Map data © OpenStreetMap, licensed under Creative Commons Share Alike By Attribution.";
}
@end
... ...
... ... @@ -52,7 +52,7 @@
#pragma mark -
@interface RMWebMapSource : RMAbstractMercatorTileSource {
@interface RMAbstractWebMapSource : RMAbstractMercatorTileSource {
NSOperationQueue *requestQueue;
}
... ...
... ... @@ -25,7 +25,7 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
#import "RMWebMapSource.h"
#import "RMAbstractWebMapSource.h"
#import "RMTileImage.h"
#import "RMTileCache.h"
... ... @@ -195,7 +195,7 @@
#pragma mark -
@implementation RMWebMapSource
@implementation RMAbstractWebMapSource
- (id)init
{
... ...
... ... @@ -36,8 +36,10 @@
126693040EB76C0B00E002D5 /* RMConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = 126692A00EB75C0A00E002D5 /* RMConfiguration.m */; };
1601410C133204D20043FCA3 /* RMCacheObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 1601410A133204D20043FCA3 /* RMCacheObject.h */; };
1601410D133204D20043FCA3 /* RMCacheObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 1601410B133204D20043FCA3 /* RMCacheObject.m */; };
16097D7B1330DEC60057F640 /* RMWebMapSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 16097D791330DEC60057F640 /* RMWebMapSource.h */; };
16097D7C1330DEC60057F640 /* RMWebMapSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 16097D7A1330DEC60057F640 /* RMWebMapSource.m */; };
1605FA15133221E9008E1B13 /* RMOpenStreetMapSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 1605FA13133221E9008E1B13 /* RMOpenStreetMapSource.h */; };
1605FA16133221E9008E1B13 /* RMOpenStreetMapSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 1605FA14133221E9008E1B13 /* RMOpenStreetMapSource.m */; };
16097D7B1330DEC60057F640 /* RMAbstractWebMapSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 16097D791330DEC60057F640 /* RMAbstractWebMapSource.h */; };
16097D7C1330DEC60057F640 /* RMAbstractWebMapSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 16097D7A1330DEC60057F640 /* RMAbstractWebMapSource.m */; };
16097E921330E0B10057F640 /* RMTileImageSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 16097E911330E0B10057F640 /* RMTileImageSet.h */; };
175701DE1323C2E900A5D314 /* NSUserDefaults+RouteMe.h in Headers */ = {isa = PBXBuildFile; fileRef = 175701DC1323C2E900A5D314 /* NSUserDefaults+RouteMe.h */; };
175701DF1323C2E900A5D314 /* NSUserDefaults+RouteMe.m in Sources */ = {isa = PBXBuildFile; fileRef = 175701DD1323C2E900A5D314 /* NSUserDefaults+RouteMe.m */; };
... ... @@ -193,8 +195,10 @@
12F2031E0EBB65E9003D7B6B /* RMMapViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RMMapViewDelegate.h; sourceTree = "<group>"; };
1601410A133204D20043FCA3 /* RMCacheObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RMCacheObject.h; sourceTree = "<group>"; };
1601410B133204D20043FCA3 /* RMCacheObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RMCacheObject.m; sourceTree = "<group>"; };
16097D791330DEC60057F640 /* RMWebMapSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RMWebMapSource.h; sourceTree = "<group>"; };
16097D7A1330DEC60057F640 /* RMWebMapSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RMWebMapSource.m; sourceTree = "<group>"; };
1605FA13133221E9008E1B13 /* RMOpenStreetMapSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RMOpenStreetMapSource.h; sourceTree = "<group>"; };
1605FA14133221E9008E1B13 /* RMOpenStreetMapSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RMOpenStreetMapSource.m; sourceTree = "<group>"; };
16097D791330DEC60057F640 /* RMAbstractWebMapSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RMAbstractWebMapSource.h; sourceTree = "<group>"; };
16097D7A1330DEC60057F640 /* RMAbstractWebMapSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RMAbstractWebMapSource.m; sourceTree = "<group>"; };
16097E911330E0B10057F640 /* RMTileImageSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RMTileImageSet.h; sourceTree = "<group>"; };
175701DC1323C2E900A5D314 /* NSUserDefaults+RouteMe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSUserDefaults+RouteMe.h"; sourceTree = "<group>"; };
175701DD1323C2E900A5D314 /* NSUserDefaults+RouteMe.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSUserDefaults+RouteMe.m"; sourceTree = "<group>"; };
... ... @@ -351,6 +355,17 @@
name = Configuration;
sourceTree = "<group>";
};
1605FA12133221E9008E1B13 /* Map sources */ = {
isa = PBXGroup;
children = (
D1437B33122869E400888DAE /* RMDBMapSource.h */,
D1437B32122869E400888DAE /* RMDBMapSource.m */,
1605FA13133221E9008E1B13 /* RMOpenStreetMapSource.h */,
1605FA14133221E9008E1B13 /* RMOpenStreetMapSource.m */,
);
path = "Map sources";
sourceTree = "<group>";
};
175701DB1323C2CF00A5D314 /* iOS Additions */ = {
isa = PBXGroup;
children = (
... ... @@ -540,10 +555,9 @@
B83E64EC0E80E73F001663B6 /* RMTileSource.h */,
C7A967500E8412930031BA75 /* RMAbstractMercatorTileSource.h */,
C7A967510E8412930031BA75 /* RMAbstractMercatorTileSource.m */,
16097D791330DEC60057F640 /* RMWebMapSource.h */,
16097D7A1330DEC60057F640 /* RMWebMapSource.m */,
D1437B33122869E400888DAE /* RMDBMapSource.h */,
D1437B32122869E400888DAE /* RMDBMapSource.m */,
16097D791330DEC60057F640 /* RMAbstractWebMapSource.h */,
16097D7A1330DEC60057F640 /* RMAbstractWebMapSource.m */,
1605FA12133221E9008E1B13 /* Map sources */,
);
name = "Tile Source";
sourceTree = "<group>";
... ... @@ -706,9 +720,10 @@
25757F4F1291C8640083D504 /* RMCircle.h in Headers */,
17F02BB11319BA4B00260C6B /* RouteMe.h in Headers */,
175701DE1323C2E900A5D314 /* NSUserDefaults+RouteMe.h in Headers */,
16097D7B1330DEC60057F640 /* RMWebMapSource.h in Headers */,
16097D7B1330DEC60057F640 /* RMAbstractWebMapSource.h in Headers */,
16097E921330E0B10057F640 /* RMTileImageSet.h in Headers */,
1601410C133204D20043FCA3 /* RMCacheObject.h in Headers */,
1605FA15133221E9008E1B13 /* RMOpenStreetMapSource.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
... ... @@ -929,8 +944,9 @@
D1437B36122869E400888DAE /* RMDBMapSource.m in Sources */,
25757F501291C8640083D504 /* RMCircle.m in Sources */,
175701DF1323C2E900A5D314 /* NSUserDefaults+RouteMe.m in Sources */,
16097D7C1330DEC60057F640 /* RMWebMapSource.m in Sources */,
16097D7C1330DEC60057F640 /* RMAbstractWebMapSource.m in Sources */,
1601410D133204D20043FCA3 /* RMCacheObject.m in Sources */,
1605FA16133221E9008E1B13 /* RMOpenStreetMapSource.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
... ... @@ -1136,6 +1152,7 @@
PREBINDING = NO;
RUN_CLANG_STATIC_ANALYZER = NO;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
STRIP_INSTALLED_PRODUCT = NO;
};
name = Debug;
... ... @@ -1162,6 +1179,7 @@
OTHER_LDFLAGS = "";
PREBINDING = NO;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
};
name = Release;
};
... ...
... ... @@ -150,7 +150,7 @@
B870568D0E67C32200CC2ED1 /* PJ_wink1.c in Sources */ = {isa = PBXBuildFile; fileRef = B87055ED0E67C32200CC2ED1 /* PJ_wink1.c */; };
B870568E0E67C32200CC2ED1 /* PJ_wink2.c in Sources */ = {isa = PBXBuildFile; fileRef = B87055EE0E67C32200CC2ED1 /* PJ_wink2.c */; };
B870568F0E67C32200CC2ED1 /* pj_zpoly1.c in Sources */ = {isa = PBXBuildFile; fileRef = B87055EF0E67C32200CC2ED1 /* pj_zpoly1.c */; };
B87056910E67C32200CC2ED1 /* proj_api.h in Headers */ = {isa = PBXBuildFile; fileRef = B87055F20E67C32200CC2ED1 /* proj_api.h */; settings = {ATTRIBUTES = (Public, ); }; };
B87056910E67C32200CC2ED1 /* proj_api.h in Headers */ = {isa = PBXBuildFile; fileRef = B87055F20E67C32200CC2ED1 /* proj_api.h */; settings = {ATTRIBUTES = (); }; };
B87056920E67C32200CC2ED1 /* proj_config.h in Headers */ = {isa = PBXBuildFile; fileRef = B87055F30E67C32200CC2ED1 /* proj_config.h */; settings = {ATTRIBUTES = (); }; };
B87056930E67C32200CC2ED1 /* proj_mdist.c in Sources */ = {isa = PBXBuildFile; fileRef = B87055F50E67C32200CC2ED1 /* proj_mdist.c */; };
B87056940E67C32200CC2ED1 /* proj_rouss.c in Sources */ = {isa = PBXBuildFile; fileRef = B87055F60E67C32200CC2ED1 /* proj_rouss.c */; };
... ... @@ -574,12 +574,12 @@
buildActionMask = 2147483647;
files = (
B87056020E67C32200CC2ED1 /* emess.h in Headers */,
B87056910E67C32200CC2ED1 /* proj_api.h in Headers */,
B87056050E67C32200CC2ED1 /* geocent.h in Headers */,
B870560A0E67C32200CC2ED1 /* geodesic.h in Headers */,
B87056130E67C32200CC2ED1 /* nad_list.h in Headers */,
B87056140E67C32200CC2ED1 /* org_proj4_Projections.h in Headers */,
B87056520E67C32200CC2ED1 /* pj_list.h in Headers */,
B87056910E67C32200CC2ED1 /* proj_api.h in Headers */,
B87056920E67C32200CC2ED1 /* proj_config.h in Headers */,
B87056950E67C32200CC2ED1 /* projects.h in Headers */,
);
... ... @@ -796,7 +796,6 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = Proj4_Prefix.pch;
GCC_WARN_UNUSED_VARIABLE = NO;
INSTALL_PATH = /usr/local/lib;
PRODUCT_NAME = Proj4;
};
name = Debug;
... ... @@ -810,7 +809,6 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = Proj4_Prefix.pch;
GCC_WARN_UNUSED_VARIABLE = NO;
INSTALL_PATH = /usr/local/lib;
PRODUCT_NAME = Proj4;
};
name = Release;
... ... @@ -831,6 +829,7 @@
PREBINDING = NO;
SDKROOT = iphoneos;
STRIP_INSTALLED_PRODUCT = NO;
SKIP_INSTALL = YES;
};
name = Debug;
};
... ... @@ -846,6 +845,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 3.0;
PREBINDING = NO;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
};
name = Release;
};
... ...