[OpenLayers-Users] Nodelist Info not working

chris1211 chris at powerhousetechgrp.com
Sat Jan 19 16:46:25 EST 2008


I am trying to get the feature info from my map that has multi layers and
uses the layer switcher but all i get it a please wait the layer i need to
quarry is the Panels layer can some one please help. thanks
 function init(){
 var bounds = new
OpenLayers.Bounds(-88.55546395,36.1137137,-87.98201304999999,36.5199723);           
 map = new OpenLayers.Map('map', { controls: [] });
		map.addControl(new OpenLayers.Control.PanZoomBar());
            	map.addControl(new OpenLayers.Control.MouseToolbar());
		
		   
          // support GetFeatureInfo
          map.events.register('click', map, function (e) {
            OpenLayers.Util.getElement('nodelist').innerHTML = "Loading...
please wait...";
            var url =  map.layers[0].getFullRequestString({
                            REQUEST: "GetFeatureInfo",
                            EXCEPTIONS: "application/vnd.ogc.se_xml",
                            BBOX: map.getExtent().toBBOX(),
                            X: e.xy.x,
                            Y: e.xy.y,
                            INFO_FORMAT: 'text/html',
                            QUERY_LAYERS: map.layers[0].params.LAYERS,
                            FEATURE_COUNT: 50,
                            layers: 'Panels',
                            styles: '',
                            srs: 'EPSG:4326',
                            WIDTH: map.size.w,
                            HEIGHT: map.size.h},
                           
"http://hazards.fema.gov/wmsconnector/wmsconnector/Servlet/flood"
                            );
            OpenLayers.loadURL(url, '', this, setHTML, setHTML);
            Event.stop(e);
      });


            map.addControl(new
OpenLayers.Control.LayerSwitcher({'div':OpenLayers.Util.getElement('layerswitcher')}));

	    var hctiger_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS", 
                "http://13.0.0.150:8080/geoserver/wms",
                {layers: 'District 9 Homeland'},
{'displayInLayerSwitcher':false} );

            var zone_wms = new OpenLayers.Layer.WMS( "FEMA Flood Zones",
               
"http://hazards.fema.gov/wmsconnector/wmsconnector/Servlet/flood",
                {layers: "Flood_Hazard_Zones", transparent: "true", format:
"image/png" });
     map.addLayer(zone_wms);

            var panels_wms = new OpenLayers.Layer.WMS( "FEMA DFIRM Panels",
               
"http://hazards.fema.gov/wmsconnector/wmsconnector/Servlet/flood",
                {layers: "Panels", transparent: "true", format: "image/png"
});

          var precip_wms = new OpenLayers.Layer.WMS( "Total Storm Precip",
               
"http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/ntp.cgi?",
                {layers: "nexrad_stormtotal_precip", transparent: "true",
format: "image/png" },
		{isBaseLayer: false, opacity: 0.5}); 
	
		map.addLayer(precip_wms);

	 var nexrad_wms = new OpenLayers.Layer.WMS( "Current Nexrad Radar",
               
"http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi?",
                {layers: "nexrad-n0r-m05min", transparent: "true", format:
"image/png" }, 
            	{isBaseLayer: false, opacity: 0.5}); 		  
	
		map.addLayer(nexrad_wms);

	 var polywarn_wms = new OpenLayers.Layer.WMS( "NWS Polygon Warnings",
                "http://mesonet.agron.iastate.edu/cgi-bin/wms/us/wwa.cgi?",
                {layers: "warnings_p", transparent: "true", format:
"image/png" });

        map.addLayer(polywarn_wms);

  var zone = new OpenLayers.Layer.GML("Alert Zone Area", "zone.kml",
{format: OpenLayers.Format.KML});
map.addLayer(zone)

	zone_wms.setVisibility(true);
        panels_wms.setVisibility(false); 
	precip_wms.setVisibility(false);
	nexrad_wms.setVisibility(false);
	zone.setVisibility(true);

map.addLayers([hctiger_wms, zone_wms,
panels_wms,precip_wms,nexrad_wms,polywarn_wms,zone]);
map.setCenter(new OpenLayers.LonLat(-88.328666,36.301788), 11);
           
        }
    </script>
<title>Henry Co. EMA</title></head>
<body onLoad="init()">
  <h3 class="style2">Henry County EMA - Map Services Server </h3>
  <div id="layerswitcher" style="float:top; width: 20em;"></div>
    <div id="map"></div>
    <div id="docs">
      <p>Info and Desc.</p>
    </div>      
 <div id="nodelist">Click on the map to get feature infos</div>
</body>
</html>
-- 
View this message in context: http://www.nabble.com/Nodelist-Info-not-working-tp14975579p14975579.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list