Gmaps"

From Documentation
Line 52: Line 52:
 
! <center>Name</center>
 
! <center>Name</center>
 
! <center>Event Type</center>
 
! <center>Event Type</center>
 +
|-
 +
| <center><tt>onSelect</tt></center>
 +
| '''Event:''' <javadoc>org.zkoss.zk.ui.event.SelectEvent</javadoc>
 +
Notifies one that the user has selected a new item(can be [[ZK_Component_Reference/Diagrams_and_Reports/Gmaps/Ginfo | Ginfo]], [[ZK_Component_Reference/Diagrams_and_Reports/Gmaps/Gpolyline | Gpolyline]], or [[ZK_Component_Reference/Diagrams_and_Reports/Gmaps/Gpolygon | Gpolygon]]) in the gmaps.
 
|-
 
|-
 
| <center><tt>onInfoChange</tt></center>
 
| <center><tt>onInfoChange</tt></center>
| [[ZK_Component_Reference/Events/InfoChangeEvent | InfoChangeEvent]]
+
| '''Event:''' [[ZK_Component_Reference/Events/InfoChangeEvent | InfoChangeEvent]]
  
<tt>'''Description:''' Notifies that the current open information window has changed(opened/closed)</tt>
+
Notifies that the current open information window has changed(opened/closed)
  
 
|-
 
|-
 
| <center><tt>onMapDrop</tt></center>
 
| <center><tt>onMapDrop</tt></center>
| [[ZK_Component_Reference/Events/MapDropEvent | MapDropEvent]]
+
| '''Event:''' [[ZK_Component_Reference/Events/MapDropEvent | MapDropEvent]]
  
<tt>'''Description:''' Notifies that some component is dragged and dropped on the gmaps or gmarker component with latitude and longitude information.</tt>
+
Notifies that some component is dragged and dropped on the gmaps or gmarker component with latitude and longitude information.
  
 
|-
 
|-
 
| <center><tt>onMapClick, onMapDoubleClick, onMapRightClick</tt></center>
 
| <center><tt>onMapClick, onMapDoubleClick, onMapRightClick</tt></center>
| [[ZK_Component_Reference/Events/MapMouseEvent | MapMouseEvent]]
+
| '''Event:''' [[ZK_Component_Reference/Events/MapMouseEvent | MapMouseEvent]]
  
<tt>'''Description:''' Notifies that some mouse action has been applied on the gmaps or gmarker component with latitude and longitude information.</tt>
+
Notifies that some mouse action has been applied on the gmaps or gmarker component with latitude and longitude information.
  
 
|-
 
|-
 
| <center><tt>onMapMove</tt></center>
 
| <center><tt>onMapMove</tt></center>
| [[ZK_Component_Reference/Events/MapMoveEvent | MapMoveEvent]]
+
| '''Event:''' [[ZK_Component_Reference/Events/MapMoveEvent | MapMoveEvent]]
  
<tt>'''Description:''' Notifies that the view center (latitude, longitude) of the gmaps has been moved.</tt>
+
Notifies that the view center (latitude, longitude) of the gmaps has been moved.
  
 
|-
 
|-
 
| <center><tt>onMapTypeChange</tt></center>
 
| <center><tt>onMapTypeChange</tt></center>
| [[ZK_Component_Reference/Events/MapTypeChangeEvent | MapTypeChangeEvent]]
+
| '''Event:''' [[ZK_Component_Reference/Events/MapTypeChangeEvent | MapTypeChangeEvent]]
  
<tt>'''Description:''' Notifies that the map type of the gmaps has been changed.</tt>
+
Notifies that the map type of the gmaps has been changed.
  
 
|-
 
|-
 
| <center><tt>onMapZoom</tt></center>
 
| <center><tt>onMapZoom</tt></center>
| [[ZK_Component_Reference/Events/MapZoomEvent | MapZoomEvent]]
+
| '''Event:''' [[ZK_Component_Reference/Events/MapZoomEvent | MapZoomEvent]]
  
<tt>'''Description:''' Notifies that the zoom level of the gmaps has been changed.</tt>
+
Notifies that the zoom level of the gmaps has been changed.
  
 
|}
 
|}
 +
*Inherited Supported Events: [[ZK_Component_Reference/Base_Components/XulElement#Supported_Events | XulElement]]
  
 
=Supported Children=
 
=Supported Children=

Revision as of 03:39, 23 November 2010

Gmaps

  • Demonstration: Gmaps
  • Java API: N/A
  • JavaScript API: N/A
  • Style Guide: N/A

Employment/Purpose

Components: gmaps, ginfo, gmarker, gpolyline, gpolygon, gimage, and gscreen.

A gmaps is a maps component that wraps the famous Google Maps service that you can control it and embedded it in your ZK web application page in pure Java. Inside a gmaps, you can manipulate your maps and add contents to the maps and create convenient locality related web application. You can add ginfo to represent an anchored information window for the maps. You can add multiple gmarkers to indicate special locations. You can add gpolyline and gpolygon to indicate a path or an area. You can also overlay gimage and gscreen to indicate very special places.

Example

ZKComRef Gmaps Example.png


 <window title="Gmaps Demo" border="normal" width="508px">
	<script type="text/javascript" content="zk.googleAPIkey='Your-Google-API-Key'"/>
	<gmaps id="mymap" width="500px" height="300px" showSmallCtrl="true">
		<ginfo id="myinfo" open="true">
			<![CDATA[
				Hello, <a href="http://www.zkoss.org">ZK</a>.
			]]>
		</ginfo>
		
		<gmarker id="mymark" lat="37.4410" lng="-122.1490">
			<![CDATA[
				Hello, <a href="http://www.zkoss.org">ZK</a> on top of Gmarker.
			]]>
		</gmarker>
		
		<attribute name="onMapClick">
			Gmarker gmarker = event.getGmarker();
			if (gmarker != null) {
				gmarker.setOpen(true);
			}
		</attribute>
	</gmaps>
 </window>

Supported Events

Name
Event Type
onSelect
Event: SelectEvent

Notifies one that the user has selected a new item(can be Ginfo, Gpolyline, or Gpolygon) in the gmaps.

onInfoChange
Event: InfoChangeEvent

Notifies that the current open information window has changed(opened/closed)

onMapDrop
Event: MapDropEvent

Notifies that some component is dragged and dropped on the gmaps or gmarker component with latitude and longitude information.

onMapClick, onMapDoubleClick, onMapRightClick
Event: MapMouseEvent

Notifies that some mouse action has been applied on the gmaps or gmarker component with latitude and longitude information.

onMapMove
Event: MapMoveEvent

Notifies that the view center (latitude, longitude) of the gmaps has been moved.

onMapTypeChange
Event: MapTypeChangeEvent

Notifies that the map type of the gmaps has been changed.

onMapZoom
Event: MapZoomEvent

Notifies that the zoom level of the gmaps has been changed.

Supported Children

* Ginfo,  Gmarker, Gpolyline, Gpolygon, Gimage, Gscreen

Use Cases

Version Description Example Location
     

Version History

Last Update : 2010/11/23


Version Date Content
     



Last Update : 2010/11/23

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.