[OpenLayers-Users] problem with open up popup with WMSGetFeatureInfo control

Andreas Hocevar ahocevar at opengeo.org
Mon Dec 10 00:59:57 PST 2012


When using the text/html format, you do not need the default format
(OpenLayers.Format.WMSGetFeatureInfo) to parse your features. So when
configuring your OpenLayers.Control.WMSGetFeatureInfo, set the
following format:

format: {read: function(doc) {return doc; }}

Andreas.

On Fri, Dec 7, 2012 at 5:11 PM, Karina Guardado <kguardado at gmail.com> wrote:
> Hi everybody,
>
> I'm using the WMSGetFeatureInfo control with openlayers 2.11 and mapfish,
> mapserver, linux Debian. When I click on a point I get the popup with the
> information but can not close the popup. I have tried with a few layers and
> there is no problem but when using more then it is not possible to close the
> popup box. I have review the layers and are ok so I think the problem is
> with the control WMSGetFeatureInfo.
> Is there a limit of layers I can use with this control? or is a problem with
> the apache or something else?
>
> Here is the code I'm using.
>
> Thanks in advance. Regards.
>
> toolbar.addControl(new OpenLayers.Control.WMSGetFeatureInfo({
>                   url:
> 'http://200.13.186.56/cgi-bin/mapserv?MAP=/var/www/geo/pages/client/opamssmapfile.map&',
>                   title: 'Identify features by clicking',
>                   queryVisible: true,
>                   infoFormat:'text/html',
>                   click: 'true',
>                   layers: [infecos, infcasasalud, infalbergues,
> infcentronutre, infhospitales, infsibasis, infhogarespera, infpromotor,
> AgisECOS, Municipios, MuniMesoamerica, infecosmesoamerica, proyconstruccion,
> proyequipamiento, proyconstruccionAvance, proyequipamientoAvance,
> ProyConstruccionPrides, ProyequipamientoPrides,
> ProyConstruccionAvancePrides, ProyequipamientoAvancePrides, RegionOriental,
> RegionParacentral, RegionCentral, RegionOccidental,
> RegionMetropolitana,MicroredAtiquizaya, MicroredCaraSucia,
> MicroredGuaymango, MicroredJujutla,
> MicroredAtiquizayaMuni,MicroredAhuachapanMuni, MicroredCaraSuciaMuni,
> MicroredGuaymangoMuni, MicroredJujutlaMuni,infecosAtiquizaya,
> infhospitalesAtiquizaya, infecosAhuachapan, infhospitalesAhuachapan,
> infecosCaraSucia, infhospitalesCaraSucia, infecosGuaymango,
> infhospitalesGuaymango, infecosJujutla, infhospitalesJujutla,
> MicroredSonsonate, MicroredSonzacate, MicroredAcajutla, MicroredIzalco,
> MicroredLourdesColon, MicroredSonsonateMuni, infecosSonsonate,
> infhospitalesSonsonate, MicroredSonzacateMuni, infecosSonzacate,
> infhospitalesSonzacate,MicroredAcajutlaMuni, infecosAcajutla,
> infhospitalesAcajutla, MicroredIzalcoMuni, infecosIzalco,
> infhospitalesIzalco,MicroredLourdesColonMuni, infecosLourdesColon,
> infhospitalesLourdesColon, MicroredMetapan, MicroredTexistepeque,
> MicroredElcongo, MicroredTomasPineda, MicroredChalchuapa,
> MicroredMetapanMuni, infecosMetapan, infhospitalesMetapan,
> MicroredTexistepequeMuni, infecosTexistepeque, infhospitalesTexistepeque,
> MicroredElcongoMuni, infecosElcongo, infhospitalesElcongo,
> MicroredTomasPinedaMuni, infecosTomasPineda, infhospitalesTomasPineda,
> MicroredChalchuapaMuni, infecosChalchuapa, infhospitalesChalchuapa,
> MicroredPerquin, MicroredOsicala, MicroredSanFranciscoGotera,
> MicroredSensembra, MicroredPerquinMuni, infecosPerquin,
> infhospitalesPerquin, MicroredOsicalaMuni, infecosOsicala,
> infhospitalesOsicala, MicroredSanFranciscoGoteraMuni,
> infecosSanFranciscoGotera, infhospitalesSanFranciscoGotera,
> MicroredSensembraMuni, infecosSensembra, infhospitalesSensembra],
>                   eventListeners: {
>                   getfeatureinfo: function(event) {
>                   map.addPopup(new OpenLayers.Popup.FramedCloud(
>                         \"chicken\",
>                         map.getLonLatFromPixel(event.xy),
>                         null,
>                         event.text,
>                         null,
>                         true
>                     ));
>                    }
>                }
>              },{
>             isDefault: true,
>             title: 'Info'
>         }),
>         {
>             iconCls: 'query',
>             toggleGroup: 'map'
>         });
>
>
> Karina Guardado
> El Salvador
>
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>



-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.


More information about the Users mailing list