<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3627" name=GENERATOR>
<DIV dir=ltr align=left><SPAN class=527413515-23102009><FONT face=Arial color=#0000ff size=2>Hi Marc,</FONT></SPAN></DIV><SPAN class=527413515-23102009>
<DIV dir=ltr align=left><BR><FONT face=Arial color=#0000ff size=2>Thanks for
your response. Turns out the answer to my problem was pretty simple.
I changed INFO/FORMAT to "text/html" in the getfeatureinfo request in my
script. Also made the same change to my mapfile in the Metadata sections
for the WEB and LAYER sections. Then figured out that I need<SPAN class=527413515-23102009>ed</SPAN> to create a separate .html file that controls
the format of my popup display. This html file is referenced in the
mapfile<SPAN class=527413515-23102009> as the TEMPLATE
parameter</SPAN>:</FONT></DIV>
<DIV dir=ltr align=left><SPAN class=527413515-23102009><FONT face=Arial color=#0000ff size=2>.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=527413515-23102009><FONT face=Arial color=#0000ff size=2>.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=527413515-23102009><FONT face=Arial color=#0000ff size=2>.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2>DATA
'HomeTaxlots2'<BR> STATUS
OFF<BR> TYPE
POLYGON<BR> STATUS
ON<BR> DUMP
TRUE<BR> LABELITEM
"TAXLOT"<BR> TEMPLATE
/ms4w/apache/htdocs/taxlot_poly_attr3.html</FONT></DIV>
<DIV dir=ltr align=left><SPAN class=527413515-23102009><FONT face=Arial color=#0000ff size=2>.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=527413515-23102009><FONT face=Arial color=#0000ff size=2>.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=527413515-23102009><FONT face=Arial color=#0000ff size=2>.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=527413515-23102009><FONT face=Arial color=#0000ff size=2>and here's my "taxlot_poly_attr3.html" that formats the
popup fields:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=527413515-23102009><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=527413515-23102009><FONT face=Arial color=#0000ff size=2><table style='font-size:.8em'><BR><tr><td
width="12">Map:</td><td
width="100">[MAPNUMBER]</td></tr><BR>
<tr><td>Lot:</td><td>[TAXLOT]</td></tr><BR>
<tr><td>Owner:</td><td>[OWNNAME]</td></tr></FONT></SPAN></DIV>
<DIV> </DIV>
<DIV dir=ltr align=left><SPAN class=527413515-23102009><FONT face=Arial color=#0000ff size=2></table><BR></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=527413515-23102009><FONT face=Arial color=#0000ff size=2>Cress</FONT></SPAN></DIV>
<DIV dir=ltr align=left></SPAN> </DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Marc Jansen-2 (via Nabble)
[mailto:<a href="http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3879484&i=0" target="_top" rel="nofollow">[hidden email]</a>] <BR><B>Sent:</B> Saturday,
October 10, 2009 4:52 AM<BR><B>To:</B> BATES Cress A (Lane
Cty)<BR><B>Subject:</B> Re: [OpenLayers-Users] Popup Attribute Display
format<BR></FONT><BR></DIV>
<DIV></DIV>Hi Cress, <BR><BR>Play around with the INFO_FORMAT-parameter of the
<BR>getFeatureInfo-Request. E.g. "application/vnd.ogc.gml" would perhaps be
<BR>better suited. <BR><BR>INFO_FORMAT: 'application/vnd.ogc.gml',
<BR><BR>Afterwards look at the response and try to parse/read the servers'
<BR>answer using a proper OpenLayers.Format. With the parsed info you can
<BR>build any HTML you want and insert it into the popup. <BR><BR>Regards,
<BR>Marc <BR><BR><BR><BR>Cress B. schrieb:
<DIV class=shrinkable-quote><div class='shrinkable-quote'><BR>> Hi all, <BR>> <BR>> I'm now using a
WMS mapfile to display tax lot polygons and want to have a <BR>> popup
display when the user clicks on the tax lot. I've successfully gotten
<BR>> the popup to work using the getfeatureinfo method. I can control
which <BR>> items appear in the popup with "wms_include_items" in the
Metadata portion <BR>> of the Layer in my mapfile. But I'm having
trouble figuring out how to <BR>> format the display of those items in the
popup. Currently the popup has the <BR>> attrubutes basically all run
together as one long string. I would like to <BR>> show each attribute
name and value on a separate line within the popup. <BR>> <BR>> Any help
would be GREATLY appreciated, including an example if possible. <BR>>
<BR>> code snip: <BR>> <BR>> var createPopup =
function(response) { <BR>> var lonlat = map.getLonLatFromViewPortPx(this.xy);
<BR>> var popup = new
OpenLayers.Popup.FramedCloud( <BR>>
"info",lonlat, null, response.responseText,null,true);
<BR>> popup.setBackgroundColor("#c1cdc1"); <BR>> popup.setOpacity(0.7);
<BR>> map.addPopup(popup, true /* exclusive */);
<BR>> <BR>> function onFeatureUnselect(event) { <BR>>
var feature = event.feature; <BR>>
if(feature.popup) { <BR>>
map.removePopup(feature.popup); <BR>>
feature.popup.destroy(); <BR>>
delete feature.popup;
<BR>> } <BR>> } <BR>>
}; <BR>> <BR>> map.events.register('click',
map, function (e) { <BR>> var url =
wms.getFullRequestString({ <BR>>
REQUEST:
"GetFeatureInfo", <BR>>
EXCEPTIONS:
"application/vnd.ogc.se_xml", <BR>>
BBOX:
wms.map.getExtent().toBBOX(), <BR>>
X: e.xy.x, <BR>>
Y: e.xy.y, <BR>>
INFO_FORMAT:
'text/plain', <BR>>
QUERY_LAYERS: 'taxlots', <BR>>
WIDTH: wms.map.size.w, <BR>>
HEIGHT:
wms.map.size.h}, <BR>>
<BR>> "<A href="http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apache/htdocs/homeinfo_wms_v02.map&SERVICE=WMS&VERSION=1.1.1" target=_top rel="nofollow">http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apache/htdocs/homeinfo_wms_v02.map&SERVICE=WMS&VERSION=1.1.1</A>");
<BR>> <BR>>
OpenLayers.loadURL(url, '',e, createPopup); <BR>>
OpenLayers.Event.stop(e); <BR>> <BR>> Thanks, <BR>>
<BR>> Cress <BR>>
</DIV></div>_______________________________________________ <BR>Users mailing list
<BR><A href="http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3799529&i=0" target=_top rel="nofollow">[hidden email]</A> <BR><A href="http://openlayers.org/mailman/listinfo/users" target=_top rel="nofollow">http://openlayers.org/mailman/listinfo/users</A><BR>
<br><hr align="left" width="300">
View this message in context: <a href="http://n2.nabble.com/Popup-Attribute-Display-format-tp3795578p3879484.html">RE: [OpenLayers-Users] Popup Attribute Display format</a><br>
Sent from the <a href="http://n2.nabble.com/OpenLayers-Users-f1822463.html">OpenLayers Users mailing list archive</a> at Nabble.com.<br>