[fusion-users] Map Name as a parameter for FUSION

Mark Gardner Mark.Gardner at interworks.com
Wed Feb 3 11:49:50 EST 2010


We did this as well, since we were making dynamic changes to the layer definitions to account for different filters. Only way that I was able to do it was make some changes in the core fusion files to change the params loaded. Here's a patch of what I did. I am using a single file setup so the application definition is built into the js, which allows me to change it dynamically on the page. Here's what I do on my page.

    window.onload = function() {
       var mapNames = Fusion.getQueryParam("mapnames");
       if (mapNames != "")
           addMapNames(mapNames.split(","));
    }

    function addMapNames(mapNames) {
        var maps = Fusion.appDefJson.ApplicationDefinition.MapSet[0].MapGroup[0].Map;
        for (var i = 0; i < maps.length; i++)
            maps[i].Extension[0].Options[0].MapName = [mapNames[i]];

        if (mapNames.length < maps.length)
            Fusion.appDefJson.ApplicationDefinition.MapSet[0].MapGroup[0].Map = maps.slice(mapNames.length - 1, maps.length - mapNames.length);
    }

Hope it helps, Mark

-----Original Message-----
From: fusion-users-bounces at lists.osgeo.org [mailto:fusion-users-bounces at lists.osgeo.org] On Behalf Of Rodolfo Moreno
Sent: Wednesday, February 03, 2010 9:43 AM
To: fusion-users at lists.osgeo.org
Subject: [fusion-users] Map Name as a parameter for FUSION


Hi all, I know that a map definition can be passed as parameter in fusion
viewer(theme parameter). However in my case I would prefer to pass the
mapname as parameter. Is it possible? 
my use case is the following:
- I have a site with many pages. The user enter to the page where the fusion
viewer is loaded by default, it means without parameters. thus fusion
creates the map object (based on the mapdefinition of the appDefinition.xml)
and creates the map name too.
- Next the user could create other session layers through the task pane by
doing theming.
- Followed the user could go to other page and next come back to the page
where the fusion viewer is. In this moment the user should see the map such
as he/she left it. In this case it wuold be better load the fusion viewer
with the mapname as a parameter for both things: first because with the
mapname we can obtain the map with all modifications that the user did (e.g.
add layers) and second because we would avoid to create another map object
and hence we would consume less resources.

Regards,

-----
Rodolfo Moreno
CivilEng

-- 
View this message in context: http://n2.nabble.com/Map-Name-as-a-parameter-for-FUSION-tp4507840p4507840.html
Sent from the Fusion Users mailing list archive at Nabble.com.
_______________________________________________
fusion-users mailing list
fusion-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/fusion-users
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MapName.patch
Type: application/octet-stream
Size: 20343 bytes
Desc: MapName.patch
Url : http://lists.osgeo.org/pipermail/fusion-users/attachments/20100203/7fc1b0ec/MapName-0001.obj


More information about the fusion-users mailing list