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

UI Components for JSF
Post Reply
warjaguur
Posts: 5
Joined: 20 Apr 2015, 23:03

13 Aug 2022, 16:03

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
Using:
Wildfly 26
JSF 2.3
PrimeFaces 10.0
NetBeans 13

jepsar
Posts: 166
Joined: 03 Sep 2014, 11:41
Location: NL / BE
Contact:

13 Aug 2022, 19:29

PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub: https://github.com/jepsar
Spotify: 90s Rave, Acid, Trance, House

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 17 guests