<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2912" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi, all</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><FONT size=2>
<P>I have following problem:</P>
<P>I am trying to obtain the value of a field, but is null</P>
<P>is The variable </FONT><FONT face="Times New Roman"><FONT
size=3>features.length is zero, how can I resolv this
problem?</FONT></P></FONT></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV>
<DIV><FONT face=Arial size=2>function setHTML(response)
{<BR> var format = new
OpenLayers.Format.GML();<BR> var
features = format.read(response.responseXML ||
response.responseText);<BR> for
(var i=0, len=features.length; i<len; i++)
{<BR>
var feature =
features[i];<BR>
for (attribute in feature.attributes)
{<BR>
var value =
feature.attributes[attribute];<BR>
console.log(attribute + ": " +
value);<BR>
}<BR>
}<BR>}<BR></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> tiled = new
OpenLayers.Layer.WMS(<BR>
"topp:cuba - Tiled", "<A
href="http://deltha:8080/geoserver/wms">http://deltha:8080/geoserver/wms</A>",<BR>
{<BR>
width:
'800',<BR>
srs:
'EPSG:4267',<BR>
layers:
'topp:cuba',<BR>
height:
'300',<BR>
styles:
'',<BR>
format:
'image/png',<BR>
tiled:
'true',<BR>
tilesOrigin :
"-86.09241054242432,19.388371083287836"<BR>
},<BR>
{buffer: 0}
<BR>
);</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> // support
GetFeatureInfo<BR>
map.events.register('click', map, function (e)
{<BR>
document.getElementById('nodelist').innerHTML = "Loading... please
wait...";<BR>
var url =
map.layers[0].getFullRequestString(<BR>
{<BR>
REQUEST:
"GetFeatureInfo",<BR>
EXCEPTIONS:
"application/vnd.ogc.se_xml",<BR>
BBOX:
map.getExtent().toBBOX(),<BR>
X:
e.xy.x,<BR>
Y:
e.xy.y,<BR>
INFO_FORMAT:
'application/vnd.ogc.se_xml',<BR>
QUERY_LAYERS:
map.layers[0].params.LAYERS,<BR>
FEATURE_COUNT:
50,<BR>
WIDTH:
map.size.w,<BR>
HEIGHT:
map.size.h<BR>
},<BR>
"<A
href="http://deltha:8080/geoserver/wms">http://deltha:8080/geoserver/wms</A>"<BR>
);<BR>
OpenLayers.loadURL(url, '', this, setHTML,
setHTML);<BR>
OpenLayers.Event.stop(e);<BR>
});</FONT></DIV></DIV><br>___________________________________<br>
Dirección de Comunicaciones<br>
Grupo Empresarial GEOCUBA<br>
Este mensaje esta libre de virus. <br>
Revisado por Kaspersky Antivirus<br>
----------------------------------------------------------------------<br>
Definition count: 2618974
Definition date: 9/23/2009
SecurityPlus version: 3.0.5
<br>
</BODY></HTML>