Jump to content
  • IronPython script to Toggle Map Controls Visibility


    This article contains a script that creates a shortcut allowing you to easily turn on/off map controls for Layer Selection, Navigation, Search Field, Interaction Mode, and Scale

    Introduction

    Use this script to create a shortcut allowing you to easily turn on/off map controls for Layer Selection, Navigation, Search Field, Interaction Mode, and Scale

    Code Snippet

    # Copyright © 2019. TIBCO Software Inc.  Licensed under TIBCO BSD-style license.
    
    # Author - Neil Kanungo, TIBCO Software, April 2019
    
    from Spotfire.Dxp.Application.Visuals.Maps import MapChart
    
    myMap = vis.As[MapChart]() #vis is a Visualization script parameter set to your map
    
    # Toogle Map Controls; remove code lines not needed
    myMap.ShowDescription = not myMap.ShowDescription #Chart Description
    myMap.ShowInteractionMode = not myMap.ShowInteractionMode #Map interaction modes (lasso, radius, rectangle, reset view extents)
    myMap.ShowLayerHandler = not myMap.ShowLayerHandler #Layer selection dropdown menu
    myMap.ShowNavigationControls = not myMap.ShowNavigationControls #Navigation Controls
    myMap.ShowScale = not myMap.ShowScale #map scale at bottom left
    myMap.ShowSearchField = not myMap.ShowSearchField #Search Field
    
    # more features at: https://docs.tibco.com/pub/doc_remote/sfire_dev/area/doc/api/TIB_sfire-analyst_api/?topic=html/T_Spotfire_Dxp_Data_DataTable.htm
     

    Example

    toggle_controls(1).thumb.gif.ca37db57d352344675460ccc4678092c.gif

    License: TIBCO BSD-Style License

     

     


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...