Skip to content

Commit

Permalink
Merge pull request #1514 from opensrp/1513-fix-offline-map-download-403
Browse files Browse the repository at this point in the history
switch to mapbox, for offline download
  • Loading branch information
LZRS authored Sep 17, 2021
2 parents 0d60cd5 + 59e8d6b commit 384bc56
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion opensrp-reveal/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ android {
buildConfigField "long", "PULL_UNIQUE_IDS_MINUTES", '15'
buildConfigField "String", "ADMIN_PASSWORD_NOT_NEAR_STRUCTURES", '"AdminPass1"'
buildConfigField "float", "MY_LOCATION_BUFFER", '25'
buildConfigField "boolean", "VALIDATE_FAR_STRUCTURES", 'true'
buildConfigField "boolean", "VALIDATE_FAR_STRUCTURES", 'false'
buildConfigField "int", "RESOLVE_LOCATION_TIMEOUT_IN_SECONDS", '90'
buildConfigField "boolean", "DISPLAY_OUTSIDE_OPERATIONAL_AREA_MASK", 'false'
buildConfigField "boolean", "DISPLAY_DISTANCE_SCALE", 'true'
Expand Down
13 changes: 7 additions & 6 deletions opensrp-reveal/src/main/assets/map-download-style.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@
"features": []
}
},
"diimagery": {
"mapbox-streets": {
"url": "mapbox://mapbox.mapbox-streets-v8",
"type": "vector"
},
"mapbox-satellite": {
"url": "mapbox://mapbox.satellite",
"type": "raster",
"scheme": "tms",
"tiles": [
"https://access.maxar.com/earthservice/tmsaccess/tms/1.0.0/DigitalGlobe:ImageryTileService@EPSG:3857@png/{z}/{x}/{y}.png?connectId=DIGITAL_GLOBE_ID"
],
"tileSize": 256
},
"select-data": {
Expand All @@ -55,7 +56,7 @@
"id": "Thailand EarthWatch Imagery",
"type": "raster",
"metadata": {},
"source": "diimagery",
"source": "mapbox-satellite",
"layout": {},
"paint": {}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,12 +326,12 @@ interface BusinessStatusWrapper {
}

interface Map {
int MAX_SELECT_ZOOM_LEVEL = 16;
int MAX_SELECT_ZOOM_LEVEL = 13;
int SELECT_JURISDICTION_MAX_SELECT_ZOOM_LEVEL = 12;
int CLICK_SELECT_RADIUS = 24;
String NAME_PROPERTY = "name";
double DOWNLOAD_MAX_ZOOM = 21.0;
double DOWNLOAD_MIN_ZOOM = 13.5;
double DOWNLOAD_MAX_ZOOM = 15.0;
double DOWNLOAD_MIN_ZOOM = 1.0;
}

interface JsonForm {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,8 @@ public static void addBaseLayers(KujakuMapView kujakuMapView, Style style, Conte
MapBoxLayer mapBoxLayer = new MapBoxLayer();


baseLayerSwitcherPlugin.addBaseLayer(digitalGlobeLayer, true);
baseLayerSwitcherPlugin.addBaseLayer(mapBoxLayer, false);
baseLayerSwitcherPlugin.addBaseLayer(digitalGlobeLayer, false);
baseLayerSwitcherPlugin.addBaseLayer(mapBoxLayer, true);
kujakuMapView.getMbTilesHelper().setMBTileLayers(context, baseLayerSwitcherPlugin);

baseLayerSwitcherPlugin.show();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public class ListTasksActivityTest extends BaseUnitTest {
@Before
public void setUp() {
Context.bindtypes = new ArrayList<>();
listTasksActivity = Robolectric.buildActivity(ListTasksActivity.class).create().get();
listTasksActivity = Robolectric.buildActivity(ListTasksActivity.class).create().start().get();
myLocationButton = new ImageButton(listTasksActivity);
layerSwitcherFab = new ImageButton(listTasksActivity);
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
Expand Down

0 comments on commit 384bc56

Please sign in to comment.