Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
b5df7f7003
1 changed files with 10 additions and 9 deletions
|
@ -203,13 +203,12 @@ public class TileSourceManager {
|
||||||
public static void createMetaInfoFile(File dir, TileSourceTemplate tm, boolean override) throws IOException {
|
public static void createMetaInfoFile(File dir, TileSourceTemplate tm, boolean override) throws IOException {
|
||||||
File metainfo = new File(dir, ".metainfo"); //$NON-NLS-1$
|
File metainfo = new File(dir, ".metainfo"); //$NON-NLS-1$
|
||||||
Map<String, String> properties = new LinkedHashMap<String, String>();
|
Map<String, String> properties = new LinkedHashMap<String, String>();
|
||||||
if (tm instanceof BeanShellTileSourceTemplate) {
|
if (tm.getRule() != null && tm.getRule().length() > 0) {
|
||||||
properties.put("rule", RULE_BEANSHELL);
|
properties.put("rule", tm.getRule());
|
||||||
}
|
}
|
||||||
if (tm.getUrlTemplate() == null && !RULE_YANDEX_TRAFFIC.equalsIgnoreCase(tm.getRule())) {
|
if(tm.getUrlTemplate() != null) {
|
||||||
return;
|
properties.put("url_template", tm.getUrlTemplate());
|
||||||
}
|
}
|
||||||
properties.put("url_template", tm.getUrlTemplate());
|
|
||||||
|
|
||||||
properties.put("ext", tm.getTileFormat());
|
properties.put("ext", tm.getTileFormat());
|
||||||
properties.put("min_zoom", tm.getMinimumZoomSupported() + "");
|
properties.put("min_zoom", tm.getMinimumZoomSupported() + "");
|
||||||
|
@ -221,11 +220,13 @@ public class TileSourceManager {
|
||||||
if (tm.isEllipticYTile()) {
|
if (tm.isEllipticYTile()) {
|
||||||
properties.put("ellipsoid", tm.isEllipticYTile() + "");
|
properties.put("ellipsoid", tm.isEllipticYTile() + "");
|
||||||
}
|
}
|
||||||
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(metainfo)));
|
if (override || !metainfo.exists()) {
|
||||||
for (String key : properties.keySet()) {
|
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(metainfo)));
|
||||||
writer.write("[" + key + "]\n" + properties.get(key) + "\n");
|
for (String key : properties.keySet()) {
|
||||||
|
writer.write("[" + key + "]\n" + properties.get(key) + "\n");
|
||||||
|
}
|
||||||
|
writer.close();
|
||||||
}
|
}
|
||||||
writer.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isTileSourceMetaInfoExist(File dir){
|
public static boolean isTileSourceMetaInfoExist(File dir){
|
||||||
|
|
Loading…
Reference in a new issue