<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 13px; ">Hi,</div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 13px; ">Itīs probably pretty easy to do, but I canīt find a good way to do this.</div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 13px; ">With this code the map centers in on the feature and the fieldset is populated with the attributes of a grid (red)</div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></div><div style="color: black; font-family:
arial, helvetica, sans-serif; font-size: 13px; "><br></div><div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">// 1 x Click in grid</font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">                                </span>gridPanel.on('rowclick', function(){</font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">                                </span>gridPanel.getSelectionModel().each(function(rec){</font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">                                </span>var feature = rec.get("feature");</font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">                                </span><font class="Apple-style-span"
color="#FF007F">InfoPanel.getForm().loadRecord(rec);</font></font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">                                </span>mapPanel.map.setCenter(feature.geometry.getBounds().getCenterLonLat(), 12);</font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">                                        </span>})</font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"><span class="Apple-tab-span" style="white-space: pre; ">                                </span>});</font></div></div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 13px; ">This is the code to create the popup</div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></div><div
style="color: black; font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></div><div style="color: black; font-family: arial, helvetica, sans-serif; "><div style="font-size: 10pt; "><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">// register a listener for the feature selection and unselection</font></div><div style="font-size: 10pt; "><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"> layer.events.on({</font></div><div style="font-size: 10pt; "><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"> featureselected: function(event){</font></div><div style="font-size: 10pt; "><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">
popup = new GeoExt.Popup({</font></div><div style="font-size: 10pt; "><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"> title: "Feature Attributes",</font></div><div style="font-size: 10pt; "><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"> feature: event.feature,</font></div><div style="font-size: 10pt; "><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"> collapsible: true,</font></div><div style="font-size: 10pt; "><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">
layout: "fit",</font></div><div style="font-size: 10pt; "><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"> height: 330,</font></div><div style="font-size: 10pt; "><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">                                                        </span>panIn: true,</font></div><div style="font-size: 10pt; "><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"> width: 270,</font></div><div style="font-size: 10pt; "><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">                                                        </span>unpinnable: true,</font></div><div style="font-size: 10pt; "><font
class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"> border: false,</font></div><div style="font-size: 10pt; "><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"> listeners: {</font></div><div style="font-size: 10pt; "><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"> close: function(){</font></div><div style="font-size: 10pt; "><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"> select.unselectAll();</font></div><div
style="font-size: 10pt; "><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"> }</font></div><div style="font-size: 10pt; "><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"> },</font></div><div style="font-size: 10pt; "><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"> items: [new Ext.grid.PropertyGrid({</font></div><div style="font-size: 10pt; "><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"> autoHeight:
true,</font></div><div style="font-size: 10pt; "><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"> source: event.feature.attributes</font></div><div style="font-size: 10pt; "><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"> })]</font></div><div style="font-size: 10pt; "><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"> </font></div><div style="font-size: 10pt; "><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"> });</font></div><div style="font-size: 10pt;
"><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"> popup.show();</font></div><div style="font-size: 10pt; "><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"> </font></div><div style="font-size: 10pt; "><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"> },</font></div><div style="font-size: 10pt; "><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"> featureunselected: function(event){</font></div><div style="font-size: 10pt; "><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"> popup.destroy();</font></div><div
style="font-size: 10pt; "><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"> }</font></div><div style="font-size: 10pt; "><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"> </font></div><div style="font-size: 10pt; "><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"> });</font></div></div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 13px; ">I want to fill the form also by clicking on the vector features, but cannot see how to do it. I have tried
many things, but they all fail.</div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 13px; ">Could anyone see what I have to do?</div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 13px; ">yours,</div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 13px; ">Robert</div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></div><div style="position: fixed; color: black; font-family: arial, helvetica, sans-serif; font-size: 13px; "></div>
</div></body></html>