2013-06-02 104 views

回答

2

我认为,如果没有使用JavaScript是不可能的。

您可以访问谷歌地图在primeface组件在JS,然后手动添加所有的听众来处理与矩形:

//<![CDATA[ 
function initMap(){ 
    var map = gmtls.getMap(); 
    //and now add listeners like: 
    google.maps.event.addListener(map, 'mousedown', function(mEvent) { 
     //and body of the listener 
    }); 
} 
//]]> 

<h:body onload="initMap();"> 
    <center> 
     <h:form> 
      <p:gmap widgetVar="gmtls" center="41.381542, 2.122893" zoom="15" type="hybrid" style="width:600px;height:400px" /> 
     </h:form> 
    </center> 
</h:body>