Mario
Mario

Reputation: 13

PrimeFaces gmap change default view

I am new using primefaces gmap control. Im try to change the default view (satellite) to map view. But it always render on satellite view. I can change this view using mapTypeControl buttons, but I want change this before control display to the user. My control looks like:

<p:gmap   center="#{mapBean.center}" zoom="15" type="hybrid" style="width:100%;height:15em" model="#    {mapBean.model}" widgetVar="M1" />`

and my bean:

public class MapBackingBean {
private MapModel model = new DefaultMapModel();
private String center="8.989701,-79.516168";
  /**
 * Creates a new instance of MapBackingBean
 */
public MapBackingBean() {
    model.addOverlay(new Marker(new LatLng(8.989701,-79.516168), "Regency Tower"));
}
//getters and setters
}

Upvotes: 1

Views: 3691

Answers (1)

Rafe
Rafe

Reputation: 793

<p:gmap   center="#{mapBean.center}" zoom="15" type="ROADMAP" style="width:100%;height:15em" model="#    {mapBean.model}" widgetVar="M1" />

Change the type from hybrid (satellite view) to ROADMAP? (possibly requires lowercase)

Upvotes: 2

Related Questions