Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix an issue where a custom source would have "&" for the first query parameter instead of "?" #45

Merged
merged 3 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/ant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,14 @@ on:
branches:
- master
- $default-branch
schedule:
- cron: "1 5 * * 6"
workflow_dispatch:

jobs:
call-workflow:
strategy:
matrix:
josm-revision: ["", "r18877"]
uses: JOSM/JOSMPluginAction/.github/workflows/ant.yml@v1
uses: JOSM/JOSMPluginAction/.github/workflows/ant.yml@v2
with:
java-version: 17
josm-revision: ${{ matrix.josm-revision }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reports.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ permissions:

jobs:
call-workflow:
uses: JOSM/JOSMPluginAction/.github/workflows/reports.yaml@v1
uses: JOSM/JOSMPluginAction/.github/workflows/reports.yaml@v2
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
Expand Down Expand Up @@ -130,14 +131,20 @@ protected String getRequestForBbox(double lon1, double lat1, double lon2, double
final var tile = TileXYZ.tileFromBBox(lon1, lat1, lon2, lat2);
return getRequestForTile(tile);
}
return url.replace("{bbox}", Double.toString(lon1) + ',' + lat1 + ',' + lon2 + ',' + lat2)
var current = url.replace("{bbox}", Double.toString(lon1) + ',' + lat1 + ',' + lon2 + ',' + lat2)
.replace("{xmin}", Double.toString(lon1)).replace("{ymin}", Double.toString(lat1))
.replace("{xmax}", Double.toString(lon2)).replace("{ymax}", Double.toString(lat2))
+ (crop ? "&crop_bbox=" + DetectTaskingManagerUtils.getTaskingManagerBounds().toBBox().toStringCSV(",")
: "")
+ (this.info.getSourceType() == MapWithAIType.ESRI_FEATURE_SERVER && !this.info.isConflated()
? "&resultOffset=" + this.start
: "");
.replace("{xmax}", Double.toString(lon2)).replace("{ymax}", Double.toString(lat2));
boolean hasQuery = !Optional.ofNullable(URI.create(current).getRawQuery()).map(String::isEmpty).orElse(true);

if (crop) {
current += (hasQuery ? '&' : '?') + "crop_bbox="
+ DetectTaskingManagerUtils.getTaskingManagerBounds().toBBox().toStringCSV(",");
hasQuery = true;
}
if (this.info.getSourceType() == MapWithAIType.ESRI_FEATURE_SERVER && !this.info.isConflated()) {
current += (hasQuery ? '&' : '?') + "resultOffset=" + this.start;
}
return current;
}

private String getRequestForTile(TileXYZ tile) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,11 @@ public void loadDefaults(boolean clearCache, ForkJoinPool worker, boolean fastFa
if (this.finishListenerListenerList == null) {
this.finishListenerListenerList = ListenerList.create();
}
boolean running = this.finishListenerListenerList.hasListeners();
if (listener != null) {
this.finishListenerListenerList.addListener(listener);
}
if (running) {
return;
}
if (worker == null) {
Expand Down