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
|
|
@ -38,6 +38,7 @@ dependencies {
|
||||||
implementation 'com.github.pedrovgs:renderers:3.3.3'
|
implementation 'com.github.pedrovgs:renderers:3.3.3'
|
||||||
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:8.6.2'
|
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:8.6.2'
|
||||||
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-localization-v8:0.11.0'
|
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-localization-v8:0.11.0'
|
||||||
|
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-scalebar-v9:0.4.0'
|
||||||
implementation 'com.github.deano2390:MaterialShowcaseView:1.2.0'
|
implementation 'com.github.deano2390:MaterialShowcaseView:1.2.0'
|
||||||
implementation 'com.dinuscxj:circleprogressbar:1.1.1'
|
implementation 'com.dinuscxj:circleprogressbar:1.1.1'
|
||||||
implementation 'com.karumi:dexter:5.0.0'
|
implementation 'com.karumi:dexter:5.0.0'
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,8 @@ import com.mapbox.mapboxsdk.maps.MapView;
|
||||||
import com.mapbox.mapboxsdk.maps.MapboxMap;
|
import com.mapbox.mapboxsdk.maps.MapboxMap;
|
||||||
import com.mapbox.mapboxsdk.maps.Style;
|
import com.mapbox.mapboxsdk.maps.Style;
|
||||||
import com.mapbox.mapboxsdk.maps.UiSettings;
|
import com.mapbox.mapboxsdk.maps.UiSettings;
|
||||||
|
import com.mapbox.pluginscalebar.ScaleBarOptions;
|
||||||
|
import com.mapbox.pluginscalebar.ScaleBarPlugin;
|
||||||
import com.pedrogomez.renderers.RVRendererAdapter;
|
import com.pedrogomez.renderers.RVRendererAdapter;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
@ -239,8 +241,19 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
|
||||||
.zoom(ZOOM_LEVEL)
|
.zoom(ZOOM_LEVEL)
|
||||||
.build();
|
.build();
|
||||||
mapBoxMap.setCameraPosition(cameraPosition);
|
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