Page 1 of 1

GMap Info Window does not work on any kind of overlay but a marker

Posted: 13 Aug 2022, 16:03
by warjaguur
Hi.

I want to display the GMap Info Window with a click on a polygon.
I have a map with only polygons and not one marker.
The GMap Info Window does not show
When I add a marker to the map, then the GMap Info Window shows (on the marker, not the clicked polygon)

View code is:

Code: Select all

 <p:gmap id="gmapMapa"
                                widgetVar="wgmap"
                                center="#{mapaBean.centroMapa}"
                                zoom="#{mapaBean.zoomMapa}" 
                                type="#{mapaBean.tipoMapa}" 
                                style=" height:100%;position:fixed; "
                                model="#{mapaBean.mapModel}"> 
                            <p:ajax event="overlaySelect" 
                                    listener="#{mapaBean.onOverlaySelect}"
                                    update="infoWindow"/>

                            <p:ajax event="pointSelect" 
                                    listener="#{mapaBean.onPointSelect}" 
                                    update="@this txtMapaCZ" 
                                    rendered="#{verCasoBean.casoSeleccionado != null}"/>
                            <p:ajax event="stateChange"
                                    listener="#{mapaBean.stateChangeMapa}"/>
                            <p:gmapInfoWindow id="infoWindow">
                                <p:outputPanel style="text-align: center; display: block; margin: auto">
                                    <h:outputText value="#{mapaBean.overlayData}"/>
                                    
                                </p:outputPanel>
                            </p:gmapInfoWindow>
                        </p:gmap>
bean code for overlay select:

Code: Select all

 public void onOverlaySelect(OverlaySelectEvent event) {
        
        Overlay lay = event.getOverlay();
         
        overlayData = (String)lay.getData(); 
    }

What can I do?, thank you.

Using:
Wildfly 26
JSF 2.3
PrimeFaces 10.0
NetBeans 13

Re: GMap Info Window does not work on any kind of overlay but a marker

Posted: 13 Aug 2022, 19:29
by jepsar