Skip to content

Conversation

na9da
Copy link
Collaborator

@na9da na9da commented Jul 7, 2025

What this PR does

  • Apply clipping rectangle in tiled mode. This reduces the number of requests made in tiled mode.
  • Adds clipToRectangle trait if we want to turn off the rectangle clipping
  • Fix a few reactivity issues that resulted in reloading of layers when unrelated traits change.
  • Proxy imageryprovider requests

Test me

  1. Fewer FeatureServer requests when loading layers in this branch vs main. I found this makes some noticeable difference on slower servers.
  2. Load this layer in main, once fully loaded, click collapse all in the workbench, see that the layer gets re-loaded (due to change in unrelated traits). Try the same with this branch, it shouldn't react to changes in unrelated traits.

Checklist

  • There are unit tests to verify my changes are correct or unit tests aren't applicable (if so, write quick reason why unit tests don't exist)
  • I've updated relevant documentation in doc/.
  • I've updated CHANGES.md with what I changed.
  • I've provided instructions in the PR description on how to test this PR.

na9da added 10 commits July 3, 2025 22:01
This is because metadata result changes on each call to loadMetadata()
which happens often. This can cause imageryProvider to recompute unessecarily.
This is required to avoid unesseccary recompute of imageryProvider
when doing things like collapsing an item on workbench.
Comment on lines +139 to +141
if (!this.strata.has(ArcGisFeatureServerStratum.stratumName)) {
return undefined;
}
Copy link
Collaborator Author

@na9da na9da Jul 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

loadMetadatResult returns a new Result object after each call to loadMetadata which causes this method to recompute unnecessarily. Instead check if the strata exists.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Memoize outFields etc. This is also required to stop the imageryProvider from re-comping when for example a user strata gets added to the object.

Copy link
Member

@nf-s nf-s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Only issue is that requests to https://services1.arcgis.com are now being proxied through TerriaJS-server - and it is very slow. So we need to add arcgis.com in corsDomains I think - or remove it from allowProxyFor

@na9da
Copy link
Collaborator Author

na9da commented Jul 7, 2025

Thanks @nf-s. Good point. I have created a PR here to remove arcgis.com from proxied list - TerriaJS/TerriaMap#756

@na9da na9da merged commit 774cc10 into main Jul 7, 2025
9 checks passed
@na9da na9da deleted the fix-feature-server branch July 7, 2025 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants