mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
* scalebar added in map * changes reverted in .idea/Project.xml * magic numbers replaced with constants for scalebar * Default setting for scaling unit * Default setting for scalebar refresh interval * Reformatted code for adding scalebar * dimen values for scalebar params
This commit is contained in:
parent
af131a9792
commit
bdb61dfda6
2 changed files with 15 additions and 1 deletions
|
|
@ -52,6 +52,8 @@ import com.mapbox.mapboxsdk.maps.MapView;
|
|||
import com.mapbox.mapboxsdk.maps.MapboxMap;
|
||||
import com.mapbox.mapboxsdk.maps.Style;
|
||||
import com.mapbox.mapboxsdk.maps.UiSettings;
|
||||
import com.mapbox.pluginscalebar.ScaleBarOptions;
|
||||
import com.mapbox.pluginscalebar.ScaleBarPlugin;
|
||||
import com.pedrogomez.renderers.RVRendererAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
|
@ -239,8 +241,19 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
|
|||
.zoom(ZOOM_LEVEL)
|
||||
.build();
|
||||
mapBoxMap.setCameraPosition(cameraPosition);
|
||||
});
|
||||
|
||||
ScaleBarPlugin scaleBarPlugin = new ScaleBarPlugin(mapView, mapBoxMap);
|
||||
int color = isDarkTheme ? R.color.bottom_bar_light : R.color.bottom_bar_dark;
|
||||
ScaleBarOptions scaleBarOptions = new ScaleBarOptions(getContext())
|
||||
.setTextColor(color)
|
||||
.setTextSize(R.dimen.description_text_size)
|
||||
.setBarHeight(R.dimen.tiny_gap)
|
||||
.setBorderWidth(R.dimen.miniscule_margin)
|
||||
.setMarginTop(R.dimen.tiny_padding)
|
||||
.setMarginLeft(R.dimen.tiny_padding)
|
||||
.setTextBarMargin(R.dimen.tiny_padding);
|
||||
scaleBarPlugin.create(scaleBarOptions);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue