Fix bugs
This commit is contained in:
parent
756d2ce7a0
commit
5aeac12128
3 changed files with 5 additions and 4 deletions
|
@ -206,7 +206,7 @@ public class TileSourceManager {
|
||||||
if (tm instanceof BeanShellTileSourceTemplate) {
|
if (tm instanceof BeanShellTileSourceTemplate) {
|
||||||
properties.put("rule", RULE_BEANSHELL);
|
properties.put("rule", RULE_BEANSHELL);
|
||||||
}
|
}
|
||||||
if (tm.getUrlTemplate() == null) {
|
if (tm.getUrlTemplate() == null && !RULE_YANDEX_TRAFFIC.equalsIgnoreCase(tm.getRule())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
properties.put("url_template", tm.getUrlTemplate());
|
properties.put("url_template", tm.getUrlTemplate());
|
||||||
|
|
|
@ -158,7 +158,7 @@ public class ContextMenuLayer extends OsmandMapLayer {
|
||||||
textView.getBackground().getPadding(padding);
|
textView.getBackground().getPadding(padding);
|
||||||
}
|
}
|
||||||
int w = BASE_TEXT_SIZE;
|
int w = BASE_TEXT_SIZE;
|
||||||
int h = (int) ((textView.getPaint().getTextSize() + 4) * textView.getLineCount());
|
int h = (int) ((textView.getPaint().getTextSize() * 1.3f) * textView.getLineCount());
|
||||||
|
|
||||||
textView.layout(0, -padding.bottom, w, h + padding.top);
|
textView.layout(0, -padding.bottom, w, h + padding.top);
|
||||||
int minw = closeButton.getDrawable().getMinimumWidth();
|
int minw = closeButton.getDrawable().getMinimumWidth();
|
||||||
|
|
|
@ -70,17 +70,18 @@ public class YandexTrafficAdapter extends MapTileAdapter {
|
||||||
int end = str.indexOf("\"", start); //$NON-NLS-1$
|
int end = str.indexOf("\"", start); //$NON-NLS-1$
|
||||||
// exception case
|
// exception case
|
||||||
if (start < 0 || end < 0) {
|
if (start < 0 || end < 0) {
|
||||||
|
log.info("Timestamp wasn't updated " + str); //$NON-NLS-1$
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String newTimestamp = str.substring(start, end);
|
String newTimestamp = str.substring(start, end);
|
||||||
lastTimestampUpdated = System.currentTimeMillis();
|
lastTimestampUpdated = System.currentTimeMillis();
|
||||||
Algorithms.closeStream(in);
|
Algorithms.closeStream(in);
|
||||||
Algorithms.closeStream(out);
|
Algorithms.closeStream(out);
|
||||||
log.info("Timestamp updated"); //$NON-NLS-1$
|
log.info("Timestamp updated to " + newTimestamp); //$NON-NLS-1$
|
||||||
if (!newTimestamp.equals(mTimestamp)) {
|
if (!newTimestamp.equals(mTimestamp)) {
|
||||||
mTimestamp = newTimestamp;
|
mTimestamp = newTimestamp;
|
||||||
TileSourceTemplate template = new TileSourceTemplate(YANDEX_PREFFIX + mTimestamp,
|
TileSourceTemplate template = new TileSourceTemplate(YANDEX_PREFFIX + mTimestamp,
|
||||||
"http://jgo.maps.yandex.net/tiles?l=trf&x={1}&y={2}&z={0}&tm=" + mTimestamp, ".png", 17, 7, 256, 8, 18000);
|
"http://jgo.maps.yandex.net/1.1/tiles?l=trf,trfe&x={1}&y={2}&z={0}&tm=" + mTimestamp, ".png", 17, 7, 256, 8, 18000);
|
||||||
template.setEllipticYTile(true);
|
template.setEllipticYTile(true);
|
||||||
clearCache();
|
clearCache();
|
||||||
this.layer.setMapForMapTileAdapter(template, this);
|
this.layer.setMapForMapTileAdapter(template, this);
|
||||||
|
|
Loading…
Reference in a new issue