O'Reilly logo

PrimeFaces Cookbook - Second Edition by Oleg Varaksin, Mert Çalışkan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Enabling InfoWindow and streetView on maps

The gmap component uses the gmapInfoWindow helper component to display a component that renders two markers with an information window attached.

How to do it…

A basic definition of gmap with the information window is given here:

<p:gmap id="withInformation" center="41.106261, 29.057465"
  zoom="10" type="roadmap" style="width:600px;height:400px"
  model="#{mapBean.markerModel}">
  <p:ajax event="overlaySelect" 
    listener="#{mapBean.selectMarker}" />
  <p:gmapInfoWindow id="infoWindow">
    <p:graphicImage 
      value="/resources/images/map/#{mapBean.selectedMarker.data}" />
  </p:gmapInfoWindow>
</p:gmap>

The visual output is shown here:

There's more…

It is possible to enable the street view by setting the streetView attribute to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required