Fix gpx layer
This commit is contained in:
parent
c7e709f59d
commit
ea11568028
3 changed files with 22 additions and 2 deletions
|
@ -24,7 +24,9 @@ import net.osmand.plus.dashboard.DashboardOnMap.DashboardType;
|
|||
import net.osmand.plus.poi.PoiUIFilter;
|
||||
import net.osmand.plus.rastermaps.OsmandRasterMapsPlugin;
|
||||
import net.osmand.plus.render.RendererRegistry;
|
||||
import net.osmand.plus.views.GPXLayer;
|
||||
import net.osmand.plus.views.OsmandMapTileView;
|
||||
import net.osmand.plus.views.RouteLayer;
|
||||
import net.osmand.plus.views.corenative.NativeCoreContext;
|
||||
import gnu.trove.list.array.TIntArrayList;
|
||||
import net.osmand.core.android.MapRendererContext;
|
||||
|
@ -191,6 +193,14 @@ public class ConfigureMapMenu {
|
|||
protected void refreshMapComplete(final MapActivity activity) {
|
||||
activity.getMyApplication().getResourceManager().getRenderer().clearCache();
|
||||
activity.updateMapSettings();
|
||||
GPXLayer gpx = activity.getMapView().getLayerByClass(GPXLayer.class);
|
||||
if(gpx != null) {
|
||||
gpx.updateLayerStyle();
|
||||
}
|
||||
RouteLayer rte = activity.getMapView().getLayerByClass(RouteLayer.class);
|
||||
if(rte != null) {
|
||||
rte.updateLayerStyle();
|
||||
}
|
||||
activity.getMapView().refreshMap(true);
|
||||
}
|
||||
|
||||
|
|
|
@ -129,6 +129,10 @@ public class GPXLayer extends OsmandMapLayer implements ContextMenuLayer.IContex
|
|||
}
|
||||
|
||||
|
||||
public void updateLayerStyle() {
|
||||
cachedHash = -1;
|
||||
}
|
||||
|
||||
private int updatePaints(int color, boolean routePoints, boolean currentTrack, DrawSettings nightMode, RotatedTileBox tileBox){
|
||||
RenderingRulesStorage rrs = view.getApplication().getRendererRegistry().getCurrentSelectedRenderer();
|
||||
final boolean isNight = nightMode != null && nightMode.isNightMode();
|
||||
|
@ -139,11 +143,11 @@ public class GPXLayer extends OsmandMapLayer implements ContextMenuLayer.IContex
|
|||
if (rrs != null) {
|
||||
RenderingRuleSearchRequest req = new RenderingRuleSearchRequest(rrs);
|
||||
req.setBooleanFilter(rrs.PROPS.R_NIGHT_MODE, isNight);
|
||||
CommonPreference<Boolean> p = view.getSettings().getCustomRenderBooleanProperty("currentTrackColor");
|
||||
CommonPreference<String> p = view.getSettings().getCustomRenderProperty("currentTrackColor");
|
||||
if(p != null && p.isSet()) {
|
||||
RenderingRuleProperty ctColor = rrs.PROPS.get("currentTrackColor");
|
||||
if(ctColor != null) {
|
||||
req.setBooleanFilter(ctColor, p.get());
|
||||
req.setStringFilter(ctColor, p.get());
|
||||
}
|
||||
}
|
||||
String additional = "";
|
||||
|
|
|
@ -104,6 +104,9 @@ public class RouteLayer extends OsmandMapLayer {
|
|||
initUI();
|
||||
}
|
||||
|
||||
public void updateLayerStyle() {
|
||||
cachedHash = -1;
|
||||
}
|
||||
|
||||
private void updatePaints(DrawSettings nightMode, RotatedTileBox tileBox){
|
||||
RenderingRulesStorage rrs = view.getApplication().getRendererRegistry().getCurrentSelectedRenderer();
|
||||
|
@ -503,6 +506,9 @@ public class RouteLayer extends OsmandMapLayer {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue