DrawPolygonActivity
| PolygonHolesActivity
| SatelliteLandSelectActivity
| RevealedPolygonHoleOutlineActivity
style.addSource(new GeoJsonSource("source-id", Polygon.fromLngLats(POINTS)));
style.addLayerBelow(new FillLayer("layer-id", "source-id").withProperties(
fillColor(Color.parseColor("#3bb2d0"))), "settlement-label"
);
style.addSource(new GeoJsonSource("source-id",
Feature.fromGeometry(Polygon.fromOuterInner(outerLineString, innerList))));
FillLayer polygonFillLayer = new FillLayer("layer-id", "source-id")
.withProperties(fillColor(BLUE_COLOR));
style.addLayer(polygonFillLayer);
HeatmapActivity
CircleLayerClusteringActivity
| ImageClusteringActivity
loadedMapStyle.addSource(
// Point to GeoJSON data. This example visualizes all M1.0+ earthquakes from
// 12/22/15 to 1/21/16 as logged by USGS' Earthquake hazards program.
new GeoJsonSource(EARTHQUAKE_SOURCE_ID,
new URI("https://www.mapbox.com/mapbox-gl-js/assets/earthquakes.geojson"),
new GeoJsonOptions()
.withCluster(true)
.withClusterMaxZoom(14)
.withClusterRadius(50)
)
);
StyleCirclesCategoricallyActivity
style.addSource(new VectorSource(
"ethnicity-source",
"http://api.mapbox.com/v4/examples.8fgz4egr.json?access_token=" + Mapbox.getAccessToken()
));
CircleLayer circleLayer = new CircleLayer("population", "ethnicity-source");
circleLayer.setSourceLayer("sf2010");
circleLayer.withProperties(
circleRadius(
interpolate(
exponential(1.75f),
zoom(),
stop(12, 2f),
stop(22, 180f)
)),
circleColor(
match(get("ethnicity"), rgb(0, 0, 0),
stop("white", rgb(251, 176, 59)),
stop("Black", rgb(34, 59, 83)),
stop("Hispanic", rgb(229, 94, 94)),
stop("Asian", rgb(59, 178, 208)),
stop("Other", rgb(204, 204, 204))
))
);
style.addLayer(circleLayer);
MultipleGeometriesActivity
countryPolygonFillLayer.setFilter(eq(literal("$type"), literal("Polygon")));
individualCirclesLayer.setFilter(eq(literal("$type"), literal("Point")));
InfoWindowSymbolLayerActivity
GenerateViewIconTask
SymbolCollisionDetectionActivity
// 文字和图标都可以设置忽略放置和允许重叠
singleLayer.setProperties(
adjustTextIgnorePlacement ? textIgnorePlacement(checked) : textAllowOverlap(checked),
adjustIconIgnorePlacement ? iconIgnorePlacement(checked) : iconAllowOverlap(checked)
);