[Users] GeoExt.Popup Does Not Point to the Feature Clicked

dan at inlet.geol.sc.edu dan at inlet.geol.sc.edu
Tue Jan 11 12:32:03 CET 2011


I'd double check that you have popup.css installed and referenced in your
code. That is where gx-popup-anc lives.

Dan
> Thank you for your reply Dan.  I am going to assume that I do, since
> nothing
> else has appeared to be broken/missing on my map..
>
> elshae
>
> On Mon, Jan 10, 2011 at 2:26 PM, <dan at inlet.geol.sc.edu> wrote:
>
>> Make sure you have the resources copied over and the CSS file pointing
>> to
>> the correct spot. The chevron that attaches to the popup is accessed
>> through the css file.
>> > Hello GeoExt List,
>> >
>> > I am using a GeoExt.Popup to display my feature info.  All is going
>> well,
>> > except I'd like my popup to point to the feature clicked on the WMS
>> layer
>> > as
>> > shown in the examples.  In my case the popup comes up as a square box
>> with
>> > no point on the bottom to indicate exactly which point was clicked.
>> I've
>> > looked at several examples and have checked my configuration time and
>> > again
>> > and do not see what I am missing...
>> >
>> > var info = new OpenLayers.Control.WMSGetFeatureInfo({
>> >                         url: 'http://localhost:8080/geoserver/wms',
>> >                         layerUrls: ["
>> > http://localhost:8080/geoserver/gwc/service/wms"],
>> >                         title: 'Identify features by clicking',
>> >                         layers: [tibet_placenames, chn_bridges,
>> > tib_bridges,
>> > chn_countys, tib_countys, chn_farms, tib_farms, chn_glaciers,
>> > tib_glaciers,
>> > chn_grazing, tib_grazing, chn_hwyCrew, tib_hwyCrew, chn_hospitals,
>> > tib_hospitals, chn_lakes, tib_lakes, chn_monastaries, tib_monastaries,
>> > chn_pass, tib_pass, chn_rivers, tib_rivers, chn_townships,
>> tib_townships,
>> > chn_villages, tib_villages],
>> >                         queryVisible: true,
>> >                         eventListeners: {
>> >                             getfeatureinfo: function(event){
>> >
>> >                                  popup = new GeoExt.Popup({
>> >                                      title: "Popup",
>> >                                      //location:
>> > map.getLonLatFromPixel(event.xy),
>> >                                      location: new
>> >
>> OpenLayers.LonLat(mapPanel.map.getLonLatFromPixel(event.xy)).transform(new
>> > OpenLayers.Projection("EPSG:4326"), new
>> > OpenLayers.Projection("EPSG:900913")),
>> >                                      lonlat:
>> > mapPanel.map.getLonLatFromPixel(event.xy),
>> >                                      maximizable: true,
>> >                                      collapsible: true,
>> >                                      map: mapPanel.map,
>> >                                      anchored: true,
>> >                                      html: '<div id="popupWrap"><div
>> > id="popupTop"><h4>Place Info</h4></div><div id ="popupText"
>> > class="popupText">'+ event.text + redesignHTML(event.text) +
>> '</div><div
>> > class="popupPhoto"><img
>> > src="http://localhost/mapScripts/Photos/lhasa.jpeg"
>> > /></div><div id="popupFooter"><br /><br /><a
>> > href="http://www.trace.org">Trace
>> > Website</a></div></div>',
>> >                                      listeners: {
>> >                                          close: function() {
>> >                                              // closing a popup
>> destroys
>> > it,
>> > but our reference is truthy
>> >                                              popup = null;
>> >                                          }
>> >                                      }
>> >                                  });
>> >
>> >                                 // since the popup is anchored,
>> calling
>> > show
>> > will move popup to this location
>> >                                 popup.show();
>> >
>> >                             }//end getfeatureinfo
>> >                          }//end eventListeners
>> >                     });//end OpenLayers.Control.WMSGetFeatureInfo
>> >
>> >                     //Add control to map
>> >                     mapPanel.map.addControl(info);
>> >                     info.activate();
>> >
>> > If anyone understands what I could be missing please pass on the
>> > knowledge,
>> > I'd really appreciate it :)
>> >
>> > elshae
>> > _______________________________________________
>> > Users mailing list
>> > Users at geoext.org
>> > http://www.geoext.org/cgi-bin/mailman/listinfo/users
>> >
>>
>>
>>
>




More information about the Users mailing list