Ayeps / gmaps4jsf

Automatically exported from code.google.com/p/gmaps4jsf
0 stars 0 forks source link

Polygon events are propagated multiple times when they are created in a list #197

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I want to identify the click on a polygon.
the problem is that every time the page is loaded, the event processclick is 
invoked for all polygons.
how can I implement this?

      <script type="text/javascript">
        function processClick(id) {
              alert(id);
         }        
      </script>
        <ui:repeat value="#{mapsheetsHome.rawDataTracks}" var="track">
          <m:polygon lineWidth="1" hexFillColor="#0000FF" hexStrokeColor="#0033FF">
            <m:point latitude="#{mapsheetsHome.rad2deg(track.latNearBegin.doubleValue())}" longitude="#{mapsheetsHome.rad2deg(track.longNearBegin.doubleValue())}"/>
            <m:point latitude="#{mapsheetsHome.rad2deg(track.latFarBegin.doubleValue())}" longitude="#{mapsheetsHome.rad2deg(track.longFarBegin.doubleValue())}"/>
            <m:point latitude="#{mapsheetsHome.rad2deg(track.latFarEnd.doubleValue())}" longitude="#{mapsheetsHome.rad2deg(track.longFarEnd.doubleValue())}"/>
            <m:point latitude="#{mapsheetsHome.rad2deg(track.latNearEnd.doubleValue())}" longitude="#{mapsheetsHome.rad2deg(track.longNearEnd.doubleValue())}"/>
            <m:point latitude="#{mapsheetsHome.rad2deg(track.latNearBegin.doubleValue())}" longitude="#{mapsheetsHome.rad2deg(track.longNearBegin.doubleValue())}"/>
            <m:eventListener eventName="click" jsFunction="processClick('#{track.trackNumberTime}')"/>
          </m:polygon>
        </ui:repeat>                

thanks.

Original issue reported on code.google.com by Hazem.sa...@gmail.com on 14 Jun 2013 at 6:51