Skip to content

Commit

Permalink
Only allow one of [belowLayerId, aboveLayerId] to be set at a time
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasVautherin committed Jun 22, 2023
1 parent c0959e3 commit ddf2df1
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,11 @@ private void initializeSourcesAndLayers(GeoJsonOptions geoJsonOptions) {
geoJsonSource = coreElementProvider.getSource(geoJsonOptions);
layer = coreElementProvider.getLayer();
style.addSource(geoJsonSource);

if (belowLayerId != null && aboveLayerId != null) {
throw new RuntimeException("At most one of belowLayerId and aboveLayerId can be set, not both!");
}

if (belowLayerId != null) {
style.addLayerBelow(layer, belowLayerId);
} else if (aboveLayerId != null) {
Expand Down

0 comments on commit ddf2df1

Please sign in to comment.