Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Fixed black x icons showing in circle clustering example #1257

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,6 @@ private void addClusteredGeoJsonSource(@NonNull Style loadedMapStyle) {
Timber.e("Check the URL %s", uriSyntaxException.getMessage());
}


// Use the earthquakes GeoJSON source to create three layers: One layer for each cluster category.
// Each point range gets a different fill color.
int[][] layers = new int[][] {
new int[] {150, ContextCompat.getColor(this, R.color.mapboxRed)},
new int[] {20, ContextCompat.getColor(this, R.color.mapboxGreen)},
new int[] {0, ContextCompat.getColor(this, R.color.mapbox_blue)}
};

//Creating a marker layer for single data points
SymbolLayer unclustered = new SymbolLayer("unclustered-points", "earthquakes");

Expand All @@ -189,8 +180,17 @@ private void addClusteredGeoJsonSource(@NonNull Style loadedMapStyle) {
)
)
);
unclustered.setFilter(has("mag"));
loadedMapStyle.addLayer(unclustered);

// Use the earthquakes GeoJSON source to create three layers: One layer for each cluster category.
// Each point range gets a different fill color.
int[][] layers = new int[][] {
new int[] {150, ContextCompat.getColor(this, R.color.mapboxRed)},
new int[] {20, ContextCompat.getColor(this, R.color.mapboxGreen)},
new int[] {0, ContextCompat.getColor(this, R.color.mapbox_blue)}
};

for (int i = 0; i < layers.length; i++) {
//Add clusters' circles
CircleLayer circles = new CircleLayer("cluster-" + i, "earthquakes");
Expand Down