Style JSON configuration on map snapshotter (#11976)
* [core, android, darwin] - add style JSON configuration on MapSnapshotter
This commit is contained in:
@@ -86,6 +86,7 @@ public class MapSnapshotter {
|
||||
private int width;
|
||||
private int height;
|
||||
private String styleUrl = Style.MAPBOX_STREETS;
|
||||
private String styleJson;
|
||||
private LatLngBounds region;
|
||||
private CameraPosition cameraPosition;
|
||||
private boolean showLogo = true;
|
||||
@@ -111,6 +112,15 @@ public class MapSnapshotter {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param styleJson The style json to use
|
||||
* @return the mutated {@link Options}
|
||||
*/
|
||||
public Options withStyleJson(String styleJson) {
|
||||
this.styleJson = styleJson;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param region the region to show in the snapshot.
|
||||
* This is applied after the camera position
|
||||
@@ -208,7 +218,7 @@ public class MapSnapshotter {
|
||||
String programCacheDir = context.getCacheDir().getAbsolutePath();
|
||||
|
||||
nativeInitialize(this, fileSource, options.pixelRatio, options.width,
|
||||
options.height, options.styleUrl, options.region, options.cameraPosition,
|
||||
options.height, options.styleUrl, options.styleJson, options.region, options.cameraPosition,
|
||||
options.showLogo, programCacheDir);
|
||||
}
|
||||
|
||||
@@ -462,7 +472,7 @@ public class MapSnapshotter {
|
||||
|
||||
protected native void nativeInitialize(MapSnapshotter mapSnapshotter,
|
||||
FileSource fileSource, float pixelRatio,
|
||||
int width, int height, String styleUrl,
|
||||
int width, int height, String styleUrl, String styleJson,
|
||||
LatLngBounds region, CameraPosition position,
|
||||
boolean showLogo, String programCacheDir);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user