-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* rm refill-more-labels submodule * add refill-style submodule * 8.0.0 refill release * add ThemeColor and migrate RefillStyle to ThemedMapStyle * yaml generator for themes import * Inject ImportYamlGenerator into MapzenMap * checkstyle fixes and add javadocs for ThemeMapStyle * move private methods to bottom * Add theme methods to MapzenMap * rm rebase code * fix test * Rm unnecc methods * s/detailLevel/lod * defaults consistent w cartography docs
- Loading branch information
1 parent
93b8385
commit c781e9e
Showing
20 changed files
with
888 additions
and
58 deletions.
There are no files selected for viewing
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
Submodule refill-more-labels
deleted from
2325ec
Submodule refill-style
added at
a85ba8
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
42 changes: 42 additions & 0 deletions
42
core/src/main/java/com/mapzen/android/graphics/ImportYamlGenerator.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.mapzen.android.graphics; | ||
|
||
import com.mapzen.android.graphics.model.ThemeColor; | ||
import com.mapzen.android.graphics.model.ThemedMapStyle; | ||
|
||
/** | ||
* Handles creating fully qualified import yaml for a given {@link ThemedMapStyle} so that | ||
* it can be applied by {@link MapzenMap}. | ||
*/ | ||
class ImportYamlGenerator { | ||
|
||
/** | ||
* Creates import yaml string for a given theme, label level, detail level, and color. | ||
* @param themedMapStyle | ||
* @param labelLevel | ||
* @return | ||
*/ | ||
String getImportYaml(ThemedMapStyle themedMapStyle, int labelLevel, int detailLevel, | ||
ThemeColor color) { | ||
String labelFileName = new StringBuilder() | ||
.append("label-") | ||
.append(labelLevel) | ||
.append(".yaml") | ||
.toString(); | ||
String detailFileName = new StringBuilder() | ||
.append("detail-") | ||
.append(detailLevel) | ||
.append(".yaml") | ||
.toString(); | ||
String colorFileName = new StringBuilder() | ||
.append("color-") | ||
.append(color.toString()) | ||
.append(".yaml") | ||
.toString(); | ||
return "{ import: [ " | ||
+ themedMapStyle.getBaseStyleFilename() + ", " | ||
+ themedMapStyle.getThemesPath() + labelFileName + ", " | ||
+ themedMapStyle.getThemesPath() + detailFileName + ", " | ||
+ themedMapStyle.getThemesPath() + colorFileName | ||
+ " ] }"; | ||
} | ||
} |
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
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
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
Oops, something went wrong.