<div class="moz-text-flowed" style="font-family: -moz-fixed; font-size: 14px;" lang="x-western">
Hi all,
<br>
<br>i just started with GeoExt and OL, so its probably an easy (maybe 
stupid
<br><span class="moz-smiley-s3" title=";)"><span>;)</span></span> ) 
question. I already tried a lot of different code, but i don&#39;t get
<br>it working. Maybe someone can give me a hint.
<br>
<br>What i did is, i already got my application working with OSM as
<br>Baselayers and an GML with POI as an overlay. The GML is stored in 
an
<br>GridPanel, so i can select the POI over the map or the Panel. All 
fine,
<br>thanks to all the tutorials!
<br>Now i want OL to zoom to my POI when clicked. With the code below it
<br>zooms to the POI, but not in the middle. When i use map.setCenter, 
it
<br>zooms in the right direction but my POI are in the right or left 
corner
<br>of my map. When i use map.zoomToExtent(new OpenLayers.Bounds()) it 
zooms
<br>somewhere to the south-pole <span class="moz-smiley-s3" title=";)"><span>;)</span></span>. 
 As you can see i tried some different
<br>functions but it won&#39;t work.
<br>
<br>My second question is, how can i close (hide) the Popup, when a new 
POI
<br>is selected, at the moment you have to close them by your own. Some 
Code
<br>Snippets or advise would be perfect. If you need some more of my 
code
<br>just tell me.
<br>
<br>Thanks for any help!
<br>
<br>Ben
<br>
ps: sorry for possible double post, i don&#39;t know why my E-Mail from Saturday
 was not mailed to the list.<br>
<a href="http://www.geoext.org/pipermail/users/2010-June/000975.html">http://www.geoext.org/pipermail/users/2010-June/000975.html</a><br>
<br>
<br>--------Part of my Code---------------
<br>//Load GML
<br>                 layer = new 
OpenLayers.Layer.GML(&#39;GML&#39;,&#39;./daten/ows.gml&#39;, {
<br>                 projection: new OpenLayers.Projection(&quot;EPSG:4326&quot;),
<br>                 styleMap: ebbMap
<br>                 });
<br>
<br>
<br>//POPUP
<br>// create select feature control
<br>      var selectCtrl = new OpenLayers.Control.SelectFeature(layer);
<br>     var lonlat;
<br>     function createPopup(feature) {
<br>         popup = new GeoExt.Popup({
<br>             title: &#39;Kneipen Infos&#39;,
<br>             feature: feature,
<br>             width:250,
<br>             height:100,
<br>             html:  &quot;&lt;h2&gt;  Name: &quot; +<a href="http://feature.attributes.name">feature.attributes.name</a> + 
&quot;&lt;/h2&gt;
<br>Stadtteil: &quot; + feature.attributes.stadtteil, //Definition der 
Attribute
<br>             maximizable: false,
<br>             collapsible: true,
<br>             //lonlat: 
feature.geometry.getBounds().getCenterLonLat(),
<br>             //lonlat: feature.geometry.getCenterLonLat(),
<br>             //lonlat: feature.geometry.getBounds(),
<br>             listeners: {
<br>                &quot;close&quot;: function() {
<br>                 selectCtrl.unselect(this.feature);
<br>                 }
<br>                         }
<br>             },
<br>             //map.setCenter(new OpenLayers.LonLat(), 18)
<br>             //map.setCenter(new OpenLayers.Geometry.getCentroid(), 
18)
<br>             //map.zoomToExtent(new OpenLayers.Bounds(lonlat), 18)
<br>             map.setCenter(new OpenLayers.LonLat(), 18)
<br>
<br>             );
<br>         // unselect feature when the popup
<br>         // is closed
<br>         popup.on({
<br>             close: function() {
<br>                 if(OpenLayers.Util.indexOf(layer.selectedFeatures,
<br>                                            this.feature)&gt;  -1) {
<br>                     selectCtrl.unselect(this.feature);
<br>                 }
<br>             }
<br>         });
<br>         popup.show();
<br>     }
<br>
<br>             // create popup on &quot;featureselected&quot;
<br>             layer.events.on({
<br>                 featureselected: function(e) {
<br>                     createPopup(e.feature)
<br>
<br>                 }
<br>             });
<br>
<br>         /* On unselection the GeoExt-Popup closes */
<br>         function onFeatureUnselect(event) {
<br>             popup.destroy();
<br>             }
<br>
<br></div>