XYZ tile source support - Cannot setActive of undefined

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

XYZ tile source support - Cannot setActive of undefined

RenoSun
Hi All,

I am trying to use the XYZ tile source support, and it works well using
Fusion. However, I record the base map option using URL parameter, and the
Fusion will setActive the base map based on the URL parameter using
following codes:

        if (getParamFromTop("baseMap") !== '' && getParamFromTop("baseMap")
!== null && typeof this.menuItems[getParamFromTop("baseMap")] !==
"undefined") {
            this.menuItems[getParamFromTop("baseMap")].setActive(true);
        }
        else {
            this.setBasemap(this.defaultBasemap);
        }

I will not be able to setActive of the undefined item from the menuItems.

I think it maybe because we do not have XYZ options set up as default
options of the menuItems dynamically as following:
    refreshSettings: function() {
        this.baseMaps = {};
        this.defaultBasemap = null;
        this.menuItems = {};
        this.options = {
            'G_NORMAL_MAP': null,
            'G_SATELLITE_MAP': null,
            'G_HYBRID_MAP': null,
            'G_PHYSICAL_MAP': null,
            'Road': null,
            'Aerial': null,
            'AerialWithLabels': null,
            'Mapnik': null,
            'TransportMap': null,
            'CycleMap': null,
            'None': null
        };
    },

Also, the setBasemap: function (baseMap) will not work neither:
Error Details:
Exception occurred in AJAX callback.
Message: Cannot read property 'oLayerOL' of undefined
Location: undefined (undefined)

Hope to get this work.



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: XYZ tile source support - Cannot setActive of undefined

RenoSun
Problem solved by making sure all the XYZ tile source names are having no
space in them or replacing space with underscore.



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users