Revision history [back]

click to hide/show revision 1
initial version

answered 2009-10-08 01:21:41 +0800

jimmyshiau gravatar image jimmyshiau

http://www.zkoss.org/ ZK Team

you can try this

    <gmaps id="map" width="600px" height="360px" showLargeCtrl="true" showTypeCtrl="true" lat="40" lng="-73" zoom="8" >

        <attribute name="onMapClick"><![CDATA[
        mapClick();
//      Gmarker gmarker = event.getGmarker();
//      if (gmarker != null) {
//          markerClick();
//      }
    Component comp = event.getReference();
    if(comp == null) return;
    String id = comp.getId();
    if(id.equals(mymark.getId())){
        markerClick();
    }else if(id.equals(poly.getId())){
        polyClick();
    }else{
        mapClick();
    }


    ]]></attribute>

    <gmarker id="mymark" lat="40.0" lng="-73.1490">
        <attribute name="content">
            GMarker
        </attribute>
    </gmarker>

    <gpolygon id="poly" onClick="polyClick()"/>

</gmaps>

//jimmy

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More