Skip to content

Commit 0b3779e

Browse files
Add new callback for madeLegendTool (NASA-AMMOS#858)
* Add new callback for madeLegendTool * chore: bump version to 4.2.7-20260203 [version bump] --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 6e957a7 commit 0b3779e

File tree

5 files changed

+12
-4
lines changed

5 files changed

+12
-4
lines changed

configure/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "configure",
3-
"version": "4.2.6-20260128",
3+
"version": "4.2.7-20260203",
44
"homepage": "./configure/build",
55
"private": true,
66
"dependencies": {

docs/pages/APIs/JavaScript/Main/Main.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ window.mmgisAPI.updateLayersTime();
608608

609609
### addEventListener(eventName, functionReference)
610610

611-
This function adds a map event or MMGIS action listener added using the MMGIS API. This function takes in one of the following events: `onPan`, `onZoom`, `onClick`, `toolChange`, `layerVisibilityChange`. The MMGIS action listener (`toolChange`, `layerVisibilityChange`, `websocketChange`, `toggleSeparatedTool`, `newActiveFeature`) functions are called with an `event` parameter.
611+
This function adds a map event or MMGIS action listener added using the MMGIS API. This function takes in one of the following events: `onPan`, `onZoom`, `onClick`, `toolChange`, `layerVisibilityChange`. The MMGIS action listener (`toolChange`, `layerVisibilityChange`, `websocketChange`, `toggleSeparatedTool`, `newActiveFeature`, `layersToolHeaderStateChange`, `madeLegendTool`) functions are called with an `event` parameter.
612612

613613
#### Function parameters
614614

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mmgis",
3-
"version": "4.2.6-20260128",
3+
"version": "4.2.7-20260203",
44
"description": "A web-based mapping and localization solution for science operation on planetary missions.",
55
"homepage": "build",
66
"repository": {

src/essence/Tools/Legend/LegendTool.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ var LegendTool = {
4040
})
4141

4242
this.made = true
43+
44+
let _event = new CustomEvent('madeLegendTool', {
45+
detail: {
46+
made: true,
47+
},
48+
})
49+
document.dispatchEvent(_event)
4350
},
4451
destroy: function () {
4552
this.MMWebGISInterface.separateFromMMWebGIS()

src/essence/mmgisAPI/mmgisAPI.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,7 @@ var mmgisAPI_ = {
421421
'toggleSeparatedTool',
422422
'newActiveFeature',
423423
'layersToolHeaderStateChange',
424+
'madeLegendTool',
424425
]
425426
return validEvents.includes(eventName)
426427
},
@@ -691,7 +692,7 @@ var mmgisAPI = {
691692
getVisibleLayers: mmgisAPI_.getVisibleLayers,
692693

693694
/** addEventListener - adds map event or MMGIS action listener.
694-
* @param {string} - eventName - name of event to add listener to. Available events: onPan, onZoom, onClick, toolChange, layerVisibilityChange, toggleSeparatedTool, newActiveFeature
695+
* @param {string} - eventName - name of event to add listener to. Available events: onPan, onZoom, onClick, toolChange, layerVisibilityChange, toggleSeparatedTool, newActiveFeature, layersToolHeaderStateChange, madeLegendTool
695696
696697
* @param {function} - functionReference - function reference to listener event callback function. null value removes all functions for a given eventName
697698

0 commit comments

Comments
 (0)