You are here: > ESRI Forums > arcims product discussion conference > Thread Replies

ArcIMS Product Discussion Conference

ArcIMS: HTML Viewer forum

Update active layer in ArcIMS   Matt O'Keeffe Apr 08, 2009
Re: Update active layer in ArcIMS   Bertin Yao KOUADIO Apr 25, 2009
Re: Update active layer in ArcIMS   Matt O'Keeffe Apr 27, 2009
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Update active layer in ArcIMS 
Author Matt O'Keeffe 
Date Apr 08, 2009 
Message Hi all,

We have a heavily customised ArcIMS application which we use to show demographic point and polygon data.

Recently the custodian of the system requested that I add in functionality to allow the user to drag and drop a box to select multiple points or polygons. The existing functionality was calling the IdentifyAll tool which meant you could only click one point on the map, whereas the new tool that I have added in uses the SelectBox tool which can select multiple objects.

The new tool works fine but I am having problems ensuring that a layer is active in the window when the tool is clicked.

The problem is that our TOC is, again, heavily customised and removes the need to click refresh in the TOC in order to switch on/off layers or make them active. There is a line of code that makes a layer visible and active as soon as the checkbox for that layer is clicked. Along with this code, there is an else statement (i.e. when a box is unchecked), that switches the layer off. However, the last layer that was checked remains active even if you uncheck it in the TOC.

So if you switch on layer A and then switch on layer B but then switch off layer B and try to use the select tool, ArcIMS still has layer B as the active layer and the select tool wont work. I need to make layer A (essentially the one before last layer that was active) the new active layer.

I have made a number of changes to the HTML, AXL and JavaScript that the site relies on, but the TOC was built prior to my arrival six months ago and despite my best efforts, I can't figure out how to 'refresh' the active layer in the map frame after one has been switched off.

Happy to provide screen shots or code if required.

Many thanks in advance.

Matt 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Update active layer in ArcIMS 
Author Bertin Yao KOUADIO 
Date Apr 25, 2009 
Message Hi,
If I understand, Layer B is off, unvisible but active!
If so, then I would say that there might probably be a piece of code that clearly defaults the active layer to the last layer switched on when the page loads. That code can be anywhere but
I would suggest to look in the activelayer frame or in the tool frame.
Can you post the code that switches a layer on and makes it active along with the code in the "Else" statement?

 
  Yao 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Update active layer in ArcIMS 
Author Matt O'Keeffe 
Date Apr 27, 2009 
Message Here is the code (attached) which makes a layer active/visible if checked but only invisible if unchecked.

The function resides in the head section of a heavily customised toc.htm

I can post the whole htm page if needs be.

Many thanks,

Matt 
 
	//global reference to mapframe
	var t = parent.MapFrame;

	function layerName(theFormRef) {
		var theLayerNumber = -1;
		var theLayer = theFormRef.value;
		
		for (var i=0;i<t.LayerID.length;i++) {
	   		if (t.LayerName[i] == theLayer){
	   	   		theLayerNumber = i
	   		}
		}
		if (theFormRef.checked) {
			t.LayerVisible[theLayerNumber] = 1;
			//activating layer, NB! raster layers needs to be excluded
			setActiveLayer(theLayerNumber);
		} else {
			t.LayerVisible[theLayerNumber] = 0;
		}
		t.sendMapXML();
	}