Fix onTokenMove not being called when lib: tokens are off the Token layer #4363
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Identify the Bug or Feature request
Fixes #3581
Description of the Change
The culprit was that the
TokensAdded
andTokensRemoved
events were only be called with Token-layer tokens and not for stamps (difference betweenZone.getTokens()
vsZone.getAllTokens()
). This has been rectified.There were several other places that had the same mistake and I've taken the opportunity to update them. As such, there will be slightly different behaviour for those places that have been updated. Changes unlikely to be observed by a user I've marked as [minor], while the others may still not be important but can be easily observed:
createToken()
,copyToken()
, andcopyTokens()
to check the new exposed area GUID against all tokens.test.run()
to findtest:
tokens on all layers.selectTokens()
to select on the current layer rather than the Token layer when no parameters are given.getInfo("client")
to includelib:
andimage:
tokens not on the Token layer.MapTool.tokens.getMapTokens()
to return all tokens, not just those on the token layer.MapTool.clientInfo.libraryTokens()
to return alllib:
tokens, not just those on the token layer.setProperties
handler to find theZone
for aToken
even if theToken
is not on the Token layer.Possible Drawbacks
Various bits have slightly different behaviour, can impact frameworks that are relying on functionality being specific to the Token layer.
Documentation Notes
I believe this change actually brings all these bits into alignment with their documentation.
Release Notes
lib:
token events and various other behaviours regarding tokens not on the Token layer.This change is