Jump to content
  • IronPython script to Toggle Map Autozoom


    This article provides an IronPython script to Toggle Map Autozoom

    Introduction

    This script allows you to turn on/off a particular map's autozoom setting. Note this can be done natively by right-clicking a map visualization and selecting/deselecting "Autozoom" but using an IronPython script with an Action Control may make the capability more visible to less experienced Spotfire consumers.

    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 AutoZoom
    myMap.AutoZoom = not myMap.AutoZoom
    myMap.ShowNavigationControls = not myMap.ShowNavigationControls #optional; shows navigation controls when autozoom is off
     

    Example

    toggle_autozoom.thumb.gif.85478003474518719f722e396cef1570.gif

    License: TIBCO BSD-Style License

     

     


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...