Snippets

Piotr Szrajber Geospatial Portal - fix navigation toolbar buttons after adding/removing buttons to the "Fancy0" toolbar

Created by Piotr Szrajber
/**
 * Problem: Geospatial Portal 2016 has some hardcoded logic for managing 3D controls in the navigation toolbar
 * that depends on positions of the buttons.
 *
 * Workaround: change the code below so that button positions match your layout and put it in js/MapConfig.js or another javascript file
 * 
 * 2017-03-24 Piotr Szrajber <piotr.szrajber@hexagongeospatial.com>
 */
Sys.Application.add_init(function() {
    Intergraph.WebSolutions.Core.WebClient.Controls.Map.MapControlContainerBase.prototype._refreshNaviToolbar = function(newMapControl) {
        var itemsPanel = Ext.getCmp("fancyItemsPanel");
        if (!itemsPanel)
            return;
        var items = itemsPanel.getTopToolbar().items;
        if (newMapControl === "WCMapControl") {

            //TODO: change this logic so that the button order fits your project

            if ($util.isMsEdge() && this._enable3DInEdge === false)
                items.get(0).hide();
            items.get(3).show();
            items.get(5).hide();
            items.get(6).show(); //zoom history
        } else {
            items.get(3).hide();
            items.get(5).show();
            items.get(6).hide();
        }
    }
});

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.