[fusion-users] RE: MapServer Transparent PNG Layers

Mark Gardner Mark.Gardner at interworksinc.com
Fri Oct 23 16:29:08 EDT 2009


I'm not sure on how to fix the overlay map order issue but I was able to correct the legend issue with the maps that I am working with by changing the Legend.js widget source. Here are my changes:

    renderLegend: function(r) {
        this.bIsDrawn = false;
        this.clear();

        if (this.showRootFolder) {
            this.oRoot.itemLabelobj.innerHTML = this.getMap().getMapTitle();
        }

        if (this.showMapFolder) {
            this.renderGroup(this.layerRoot);
        } else {
            for (var i = 0; i < this.layerRoot.groups.length; i++)
                this.renderGroup(this.layerRoot.groups[i]);
        }

        this.bIsDrawn = true;
        this.update();
    },

    renderGroup: function(group) {
        if (!group.legend) {
            group.legend = {};
            group.legend.treeItem = this.oRoot;
        }
        for (var i = 0; i < group.groups.length; i++) {
            this.processMapGroup(group.groups[i], this.oRoot);
        }
        for (var i = 0; i < group.layers.length; i++) {
            this.processMapLayer(group.layers[i], this.oRoot);
        }
    }

It might not be correctly done since I am fairly new to fusion, but it gets the job done. Hope it helps :).

-----Original Message-----
From: fusion-users-bounces at lists.osgeo.org [mailto:fusion-users-bounces at lists.osgeo.org] On Behalf Of Nolte, Tim
Sent: Friday, October 23, 2009 3:00 PM
To: fusion-users at lists.osgeo.org
Subject: [fusion-users] MapServer Transparent PNG Layers

I'm attempting to user multiple MapServer maps using transparent PNGs so that the end-user perception is that things load much faster. I'm running into two problems:

1.) The 4 defined maps are not stacking correctly, getting my last map
(points.map) underneath one of the others (us_streets.map). But what is interesting is that this behavior is not consistent, sometimes they are in the right order but sometimes they are not.

		<MapGroup id="mapserver" xsi:type="MapType">
			<Map xsi:type="MapLayerType">
				<Type>MapServer</Type>
				<SingleTile>true</SingleTile>
				<Extension xsi:type="CustomContentType">
	
<MapFile>/export/home/www/ipcs/map/basemap.map</MapFile>
					<Options>
	
<isBaseLayer>true</isBaseLayer>
					</Options>
				</Extension>
			</Map>
			<Map xsi:type="MapLayerType">
				<Type>MapServer</Type>
				<SingleTile>true</SingleTile>
				<Extension xsi:type="CustomContentType">
	
<MapFile>/export/home/www/ipcs/map/regions.map</MapFile>
					<Options>
	
<isBaseLayer>false</isBaseLayer>
					</Options>
				</Extension>
			</Map>
			<Map xsi:type="MapLayerType">
				<Type>MapServer</Type>
				<SingleTile>true</SingleTile>
				<Extension xsi:type="CustomContentType">
	
<MapFile>/export/home/www/ipcs/map/us_streets.map</MapFile>
					<Options>
	
<isBaseLayer>false</isBaseLayer>
					</Options>
				</Extension>
			</Map>
			<Map xsi:type="MapLayerType">
				<Type>MapServer</Type>
				<SingleTile>true</SingleTile>
				<Extension xsi:type="CustomContentType">
	
<MapFile>/export/home/www/ipcs/map/points.map</MapFile>
					<Options>
	
<isBaseLayer>false</isBaseLayer>
					</Options>
				</Extension>
			</Map>
		</MapGroup>

		<MapWidget xsi:type="WidgetType">
			<Name>Map</Name>
			<Type>Map</Type>
			<StatusText>The map.</StatusText>
			<Extension xsi:type="CustomContentType">
	
<MenuContainer>MapContextMenu</MenuContainer>
			</Extension>
			<MapId>mapserver</MapId>
		</MapWidget>

2.) When I try the above map setup the Legend sort of breaks. I have to set ShowMapFolder to 'true' in order to even get something more then just the first group of the base layer to show up in the Legend. Also most of the individual layers with their legend symbols show up, with the exception of the few layers that I have condition CLASSes on. I'm attaching 2 screen shots as examples. Does anyone have any ideas how to fix this?

		<Widget xsi:type="WidgetType">
			<Name>Legend</Name>
			<Type>Legend</Type>
			<StatusText/>
			<Extension xsi:type="CustomContentType">
	
<HideInvisibleLayers>true</HideInvisibleLayers>
				<ShowRootFolder>false</ShowRootFolder>
				<ShowMapFolder>true</ShowMapFolder>
				<GroupInfoIcon/>
			</Extension>
		</Widget>

----
Timothy J Nolte - tnolte at ilpcs.com
Network Planning Engineer

iPCS Wireless, Inc.
4717 Broadmoor Ave, Suite G
Kentwood, MI 49512

Office: 616-656-5163
PCS:    616-706-2438
Fax:    616-554-6484
Web: www.ipcswirelessinc.com


More information about the fusion-users mailing list