Skip to content

Commit 6ba4e0b

Browse files
committed
Mult-layer MVT style support
1 parent 4d0e2fa commit 6ba4e0b

33 files changed

+1762
-291
lines changed

src/main/java/de/blau/android/Map.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@ public void setUpLayers(@NonNull Context ctx) {
223223
TileLayerSource backgroundSource = TileLayerSource.get(ctx, contentId, true);
224224
if (backgroundSource != null) {
225225
if (backgroundSource.getTileType() == TileType.MVT) {
226-
layer = new de.blau.android.layer.mvt.MapOverlay(this, new VectorTileRenderer());
226+
layer = new de.blau.android.layer.mvt.MapOverlay(this, new VectorTileRenderer(), false);
227+
((MapTilesOverlayLayer<?>) layer).setRendererInfo(backgroundSource);
227228
} else {
228229
layer = new MapTilesLayer<Bitmap>(this, backgroundSource, null, new MapTilesLayer.BitmapTileRenderer());
229230
}
@@ -233,13 +234,16 @@ public void setUpLayers(@NonNull Context ctx) {
233234
TileLayerSource overlaySource = TileLayerSource.get(ctx, contentId, true);
234235
if (overlaySource != null) {
235236
if (overlaySource.getTileType() == TileType.MVT) {
236-
layer = new de.blau.android.layer.mvt.MapOverlay(this, new VectorTileRenderer());
237+
layer = new de.blau.android.layer.mvt.MapOverlay(this, new VectorTileRenderer(), true);
237238
} else {
238239
layer = new MapTilesOverlayLayer<Bitmap>(this, new MapTilesLayer.BitmapTileRenderer());
239240
}
240241
((MapTilesOverlayLayer<?>) layer).setRendererInfo(overlaySource);
241242
}
242243
break;
244+
case MVT:
245+
// unused for now
246+
break;
243247
case PHOTO:
244248
layer = new de.blau.android.layer.photos.MapOverlay(this);
245249
break;
@@ -390,7 +394,7 @@ public MapViewLayer getLayer(int index) {
390394
/**
391395
* Get the top visible imagery layer for a type
392396
*
393-
* @param type the type (typically LayerType.Imagery or OVERLAYIMAGERY)
397+
* @param type the type (typically LayerType.BACKGROUNDIMAGERY or OVERLAYIMAGERY)
394398
* @return the layer or null
395399
*/
396400
@Nullable
@@ -1191,7 +1195,7 @@ public List<String> getImageryNames() {
11911195
for (MapViewLayer osmvo : imageryLayers) {
11921196
if (osmvo instanceof MapTilesLayer && osmvo.isVisible()) {
11931197
result.add(((MapTilesLayer<?>) osmvo).getTileLayerConfiguration().getName());
1194-
if (!(osmvo instanceof MapTilesOverlayLayer)) {
1198+
if (osmvo.getType() != LayerType.OVERLAYIMAGERY) {
11951199
// not an overlay -> not transparent so nothing below it is visible
11961200
break;
11971201
}

src/main/java/de/blau/android/contract/MimeTypes.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public final class MimeTypes {
1717
public static final String WMS_EXCEPTION_XML_SUBTYPE = "vnd.ogc.se_xml";
1818
public static final String TEXT_TYPE = "text";
1919
public static final String MVT_SUBTYPE = "vnd.mapbox-vector-tile";
20+
public static final String X_PROTOBUF_SUBTYPE = "x-protobuf";
2021

2122
/**
2223
* Private constructor

src/main/java/de/blau/android/dialogs/ImageryListAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public ImageryViewHolder(@NonNull View v) {
4444
*
4545
* @param names an array with imagery names
4646
* @param currentId an array with imagery ids
47-
* @param isOverlay the current imagery id
47+
* @param isOverlay true if overlay should be displayed
4848
* @param buttonLayoutParams layout params for the RadioButtons
4949
* @param groupChangeListener a listener to call when a RadioButton has been selected
5050
*/

0 commit comments

Comments
 (0)