• Settings
    • Locale
    • Change the locale of the datepicker, schedule and client side validation messages.

      Language
      English
      English
      English
      French
      German
      German
      German
      Italian
      Korean
      Spanish
      Catalan
      Dutch
      Portuguese
      Portuguese
      Arabic
      Arabic
      Bulgarian
      Bangla
      Bosnian
      Czech
      Greek
      Estonian
      Persian
      Finnish
      Danish
      Hindi
      Indonesian
      Icelandic
      Croatian
      Japanese
      Hungarian
      Hebrew
      Georgian
      Central Kurdish
      Khmer
      Kyrgyz
      Kazakh
      Lithuanian
      Latvian
      Malay
      Norwegian
      Polish
      Romanian
      Russian
      Slovak
      Slovenian
      Serbian
      Serbian
      Swedish
      Thai
      Turkish
      Ukrainian
      Uzbek
      Vietnamese
      Chinese
      Chinese
  • Resources

GMap Info Window

When a marker is selected, an info window can be displayed to provide detailed information.

Gmap Tag Documentation

GMap component is built on Google Maps API Version 3 and is highly integrated with Faces and enhanced with AJAX capabilities.

NameTypeRequiredDefaultDescription
id String false generated Unique identifier of the component in a namingContainer.
rendered boolean false true Boolean value to specify the rendering of the component, when set to false component will not be rendered.
binding UIComponent false generated An EL expression referring to a server side UIComponent instance in a backing bean.
widgetVar String false generated ('widget_' + componentClientId) Name of the client side widget.
apiKey String false Google Maps API key.
apiVersion String false weekly Google Maps API version.
center String true Center point of the map.
disableDefaultUI boolean false false Disables default UI controls.
disableDoubleClickZoom boolean false false Disables zooming on mouse double click.
draggable boolean false true Defines draggability of map.
fitBounds boolean false false Defines if center and zoom should be calculated automatically to contain all markers on the map.
libraries String false Comma-separated list of additional Google Maps libraries to load.
mapId String false DEMO_MAP_ID Google Maps map ID, required by AdvancedMarkerElement. DEMO_MAP_ID is for testing only, use your own map ID in production.
mapTypeControl boolean false true Defines visibility of map type control.
model MapModel false An org.primefaces.model.MapModel instance.
navigationControl boolean false true Defines visibility of navigation control.
onPointClick String false Javascript callback to execute when a point on map is clicked.
scrollWheel boolean false true Controls scrollwheel zooming on the map.
streetView boolean false false Controls street view support.
style String false Inline style of the component.
styleClass String false Style class of the component.
type String true There are four types of maps available: roadmap, satellite, hybrid, and terrain.
zoom int true 8 Defines the initial zoom level.
Loading...
Tag DocumentationNew DocumentationNew Documentation JSDoc Basic Event Markers Selection Add Markers Draggable InfoWindow Polylines Polygons Circles Rectangles StreetView Controls Geocode Dialog

Usage


<script src="https://maps.google.com/maps/api/js?key=AIzaSyCvCDkYieuUBmMWon_mfLAfjuaeuosuqow&amp;sensor=false"></script>

<div class="card">
    <h:form prependId="false">
        <p:gmap id="gmap" center="36.890257,30.707417" zoom="13" type="HYBRID"
                model="#{infoWindowView.advancedModel}" style="width:100%;height:400px">

            <p:ajax event="overlaySelect" listener="#{infoWindowView.onMarkerSelect}"/>

            <p:gmapInfoWindow id="infoWindow">
                <p:outputPanel style="text-align: center; display: block; margin: auto">

                    <p:graphicImage name="/demo/images/antalya/#{infoWindowView.marker.data}" height="150"/>
                    <br/>
                    <h:outputText value="#{infoWindowView.marker.title}"/>

                </p:outputPanel>
            </p:gmapInfoWindow>
        </p:gmap>

        <!-- Preload for demo -->
        <p:outputPanel style="display:none">
            <p:graphicImage name="/demo/images/antalya/konyaalti.png"/>
            <p:graphicImage name="/demo/images/antalya/ataturkparki.png"/>
            <p:graphicImage name="/demo/images/antalya/kaleici.png"/>
            <p:graphicImage name="/demo/images/antalya/karaalioglu.png"/>
        </p:outputPanel>
    </h:form>
</div>