Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Nautical-based Marine style by Adam (quantenschaum) (TODO import strings.xml from Android) #3732

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions OsmAnd.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,7 @@
78AC698E23AB7BE1006C3DDE /* left_menu_configure_screen@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 78AC698923AB7BE0006C3DDE /* left_menu_configure_screen@2x.png */; };
78D57B8B238D2FFD0068CF48 /* ic_custom_hillshade@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 78D57B87238D2FFC0068CF48 /* ic_custom_hillshade@2x.png */; };
78D57B8D238D2FFD0068CF48 /* ic_custom_hillshade@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 78D57B88238D2FFD0068CF48 /* ic_custom_hillshade@3x.png */; };
818F239B2C04EBF100A488C9 /* marine.render.xml in Resources */ = {isa = PBXBuildFile; fileRef = 818F239A2C04EBF000A488C9 /* marine.render.xml */; };
81AE516126298A3600BDF947 /* libGeographicLib_STATIC.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 81AE516026298A3600BDF947 /* libGeographicLib_STATIC.a */; };
840C9FB61CF353C500F2F991 /* ic_coordinates_location@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 84BA1DCF1CF338E400BF3D96 /* ic_coordinates_location@2x.png */; };
840C9FB81CF353C800F2F991 /* ic_coordinates_location@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 84BA1DD01CF338E400BF3D96 /* ic_coordinates_location@3x.png */; };
Expand Down Expand Up @@ -4286,6 +4287,7 @@
78AC698923AB7BE0006C3DDE /* left_menu_configure_screen@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "left_menu_configure_screen@2x.png"; path = "Resources/Icons/left_menu_configure_screen@2x.png"; sourceTree = "<group>"; };
78D57B87238D2FFC0068CF48 /* ic_custom_hillshade@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "ic_custom_hillshade@2x.png"; path = "Resources/Icons/ic_custom_hillshade@2x.png"; sourceTree = "<group>"; };
78D57B88238D2FFD0068CF48 /* ic_custom_hillshade@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "ic_custom_hillshade@3x.png"; path = "Resources/Icons/ic_custom_hillshade@3x.png"; sourceTree = "<group>"; };
818F239A2C04EBF000A488C9 /* marine.render.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = marine.render.xml; path = ../resources/rendering_styles/marine.render.xml; sourceTree = "<group>"; };
81AE516026298A3600BDF947 /* libGeographicLib_STATIC.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libGeographicLib_STATIC.a; sourceTree = BUILT_PRODUCTS_DIR; };
8401FCF61EE46B7F00238915 /* ca */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ca; path = ca.lproj/Localizable.strings; sourceTree = "<group>"; };
8401FCF71EE46C2600238915 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -9732,6 +9734,7 @@
84630FC81A8E1947005B39F2 /* styles */ = {
isa = PBXGroup;
children = (
818F239A2C04EBF000A488C9 /* marine.render.xml */,
DA73EF7329A3B5410071935D /* publictransportroutes.addon.render.xml */,
DAF50C6F299D111B006AAF2E /* osmassistant.addon.render.xml */,
DAF50C6B299BB269006AAF2E /* routes.addon.render.xml */,
Expand Down Expand Up @@ -14565,6 +14568,7 @@
8A755A5321CBF92400E42699 /* ic_live_unlimited_downloads@2x.png in Resources */,
DA23424423477F33003911B8 /* ic_custom_route@3x.png in Resources */,
8431E78F1B383A190063C9AF /* ic_average_speed@3x.png in Resources */,
818F239B2C04EBF100A488C9 /* marine.render.xml in Resources */,
97BCFBEA287D9152003AFFB2 /* ic_custom_shop_bag_48@2x.png in Resources */,
DA22DC5E25C05F130070FFCA /* ic_custom_split_before@2x.png in Resources */,
DA5A827226C563A700F274C7 /* OAFilledButtonCell.xib in Resources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ - (void) setupView
continue;
if ([mapStyleInfo[@"title"] isEqualToString:NAUTICAL_RENDER] && ![iapHelper.nautical isActive])
continue;
if ([mapStyleInfo[@"title"] isEqualToString:MARINE_RENDER] && ![iapHelper.nautical isActive])
continue;
if ([item.mapSource.resourceId isEqualToString:@"mapnik.render.xml"] && ![_app.data.lastMapSource isEqual:item.mapSource])
continue;
if ([item.mapSource.resourceId hasSuffix:RENDER_ADDON])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ - (void)generateData
continue;
if ([mapStyleInfo[@"title"] isEqualToString:NAUTICAL_RENDER] && ![iapHelper.nautical isActive])
continue;
if ([mapStyleInfo[@"title"] isEqualToString:MARINE_RENDER] && ![iapHelper.nautical isActive])
continue;

item.resourceType = OsmAndResourceType::MapStyle;
item.resource = resource;
Expand Down
2 changes: 2 additions & 0 deletions Sources/QuickAction/Actions/OAMapStyleAction.mm
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ - (void)commonInit
continue;
if ([mapStyleInfo[@"title"] isEqualToString:NAUTICAL_RENDER] && ![iapHelper.nautical isActive])
continue;
if ([mapStyleInfo[@"title"] isEqualToString:MARINE_RENDER] && ![iapHelper.nautical isActive])
continue;

sourceMapping[mapSource.name] = mapSource;
}
Expand Down
1 change: 1 addition & 0 deletions Sources/Rendering/OARendererRegistry.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#define TOURING_VIEW @"Touring view (contrast and details)"
#define WINTER_SKI_RENDER @"Winter and ski"
#define NAUTICAL_RENDER @"Nautical"
#define MARINE_RENDER @"Marine"
#define TOPO_RENDER @"Topo"
#define OSM_CARTO_RENDER @"OSM-carto"
#define OFFROAD_RENDER @"Offroad"
Expand Down
12 changes: 8 additions & 4 deletions Sources/Rendering/OARendererRegistry.mm
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ @implementation OARendererRegistry
LIGHTRS_RENDER: [NSString stringWithFormat:@"LightRS%@", RENDERER_INDEX_EXT],
UNIRS_RENDER: [NSString stringWithFormat:@"UniRS%@", RENDERER_INDEX_EXT],
NAUTICAL_RENDER: [NSString stringWithFormat:@"nautical%@", RENDERER_INDEX_EXT],
MARINE_RENDER: [NSString stringWithFormat:@"marine%@", RENDERER_INDEX_EXT],
WINTER_SKI_RENDER: [NSString stringWithFormat:@"skimap%@", RENDERER_INDEX_EXT],
OFFROAD_RENDER: [NSString stringWithFormat:@"offroad%@", RENDERER_INDEX_EXT],
DESERT_RENDER: [NSString stringWithFormat:@"desert%@", RENDERER_INDEX_EXT],
Expand Down Expand Up @@ -141,6 +142,7 @@ + (NSDictionary *)getMapStyleInfo:(NSString *)renderer
stylesTitlesOffline = @{
@"default" : DEFAULT_RENDER,
@"nautical" : NAUTICAL_RENDER,
@"marine" : MARINE_RENDER,
@"Ski-map" : WINTER_SKI_RENDER,
UNIRS_RENDER : UNIRS_RENDER,
@"Touring-view_(more-contrast-and-details).render" : TOURING_VIEW,
Expand Down Expand Up @@ -169,14 +171,16 @@ + (int)getSortIndexForTitle:(NSString *)title
return 4;
else if ([title isEqualToString:NAUTICAL_RENDER])
return 5;
else if ([title isEqualToString:OFFROAD_RENDER])
else if ([title isEqualToString:MARINE_RENDER])
return 6;
else if ([title isEqualToString:DESERT_RENDER])
else if ([title isEqualToString:OFFROAD_RENDER])
return 7;
else if ([title isEqualToString:SNOWMOBILE_RENDER])
else if ([title isEqualToString:DESERT_RENDER])
return 8;
else
else if ([title isEqualToString:SNOWMOBILE_RENDER])
return 9;
else
return 10;
}

@end