This commit is contained in:
Victor Shcherb 2013-07-22 02:01:13 +02:00
parent 756d2ce7a0
commit 5aeac12128
3 changed files with 5 additions and 4 deletions

View file

@ -206,7 +206,7 @@ public class TileSourceManager {
if (tm instanceof BeanShellTileSourceTemplate) {
properties.put("rule", RULE_BEANSHELL);
}
if (tm.getUrlTemplate() == null) {
if (tm.getUrlTemplate() == null && !RULE_YANDEX_TRAFFIC.equalsIgnoreCase(tm.getRule())) {
return;
}
properties.put("url_template", tm.getUrlTemplate());

View file

@ -158,7 +158,7 @@ public class ContextMenuLayer extends OsmandMapLayer {
textView.getBackground().getPadding(padding);
}
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);
int minw = closeButton.getDrawable().getMinimumWidth();

View file

@ -70,17 +70,18 @@ public class YandexTrafficAdapter extends MapTileAdapter {
int end = str.indexOf("\"", start); //$NON-NLS-1$
// exception case
if (start < 0 || end < 0) {
log.info("Timestamp wasn't updated " + str); //$NON-NLS-1$
return;
}
String newTimestamp = str.substring(start, end);
lastTimestampUpdated = System.currentTimeMillis();
Algorithms.closeStream(in);
Algorithms.closeStream(out);
log.info("Timestamp updated"); //$NON-NLS-1$
log.info("Timestamp updated to " + newTimestamp); //$NON-NLS-1$
if (!newTimestamp.equals(mTimestamp)) {
mTimestamp = newTimestamp;
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);
clearCache();
this.layer.setMapForMapTileAdapter(template, this);