org.zkoss.gmaps
Class Gmaps

java.lang.Object
  extended by org.zkoss.zk.ui.AbstractComponent
      extended by org.zkoss.zk.ui.HtmlBasedComponent
          extended by org.zkoss.zul.impl.XulElement
              extended by org.zkoss.gmaps.Gmaps
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, org.zkoss.zk.ui.Component, org.zkoss.zk.ui.sys.ComponentCtrl

public class Gmaps
extends org.zkoss.zul.impl.XulElement

The component used to represent <a href="http://www.google.com/apis/maps/">Google Maps</a>

Version:
$Revision: 1.6 $ $Date: 2006/03/31 08:38:55 $
Author:
henrichen
See Also:
Serialized Form

Nested Class Summary
protected  class Gmaps.ExtraCtrl
          A utility class to implement AbstractComponent.getExtraCtrl().
 
Field Summary
 
Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent
RS_NO_DISPLAY, RS_NO_HEIGHT, RS_NO_WIDTH
 
Fields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
 
Constructor Summary
Gmaps()
           
 
Method Summary
 java.lang.Object clone()
           
 void closeInfo()
          Close the currently opened info window.
 Ginfo getInfo()
          Returns the currently opened info window of this Google Maps (might be Gmarker or Ginfo).
 MapitemRenderer getItemRenderer()
          Returns the renderer to render given data object, or null if the default renderer is used.
 double getLat()
          Returns the current latitude of the Maps center.
 double getLng()
          Returns the currrent longitude of the Maps center.
 java.lang.String getMapType()
          Get the current Map Type.
 MapModel getModel()
          Returns the Maps model associated with this Maps, or null if this Maps is not associated with any Maps data model.
 double getNeLat()
          Returns the bounded north east latitude.
 double getNeLng()
          Returns the bounded north east longitude.
 java.lang.String getOuterAttrs()
          Internal Use Only.
 org.zkoss.zk.ui.Component getSelectedItem()
          Returns the selected item (can be Gmarker, Gpolyline, or Gpolygon).
 double getSwLat()
          Returns the bounded south west latitude.
 double getSwLng()
          Returns the bounded south west longitude.
 int getZoom()
          Returns the current zoom level.
 boolean insertBefore(org.zkoss.zk.ui.Component child, org.zkoss.zk.ui.Component insertBefore)
           
 boolean isContinuousZoom()
          Returns whether enable continuous zoom effects, default to false.
 boolean isDoubleClickZoom()
          Returns whether enable zoom in-out via mouse double click, default to false.
 boolean isEnableDragging()
          Returns whether enable dragging maps by mouse, default to true.
 boolean isEnableGoogleBar()
          Returns whether show the Google Search Bar on the Map, default to false.
 boolean isHybrid()
          Returns whether support hybrid map, default to true.
 boolean isNormal()
          Returns whether support normal map, default to true.
 boolean isPhysical()
          Returns whether support physical map, default to false.
 boolean isSatellite()
          Returns whether support satellite map, default to true.
 boolean isScrollWheelZoom()
          Returns whether enable zoom in-out via mouse scroll wheel, default to false.
 boolean isShowLargeCtrl()
          Returns whether show the large Google Maps Control.
 boolean isShowOverviewCtrl()
          Returns whether show the Google Maps overview Control, default to false.
 boolean isShowScaleCtrl()
          Returns whether show the Google Maps scale Control, default to false.
 boolean isShowSmallCtrl()
          Returns whether show the large Google Maps Control.
 boolean isShowTypeCtrl()
          Returns whether show the Google Maps type Control.
 boolean isShowZoomCtrl()
          Returns whether show the small zoom Google Maps Control.
protected  java.lang.Object newExtraCtrl()
           
 void onChildRemoved(org.zkoss.zk.ui.Component child)
           
 void openInfo(Ginfo info)
          Open the specified Ginfo or Gmarker.
 void panTo(double lat, double lng)
          Pan to the new center of the Google Maps.
 void setCenter(double lat, double lng)
          Sets the center of the Google Maps.
 void setContinuousZoom(boolean b)
          Sets whether enable continuous zoom effects, default to false.
 void setDoubleClickZoom(boolean b)
          Sets whether enable zoom in-out via mouse double click, default to false.
 void setEnableDragging(boolean b)
          Sets whether enable dragging maps by mouse, default to true.
 void setEnableGoogleBar(boolean b)
          Sets whether show the Google Search Bar on the Map, default to false.
 void setHybrid(boolean b)
          Sets whether support hybrid map, default to true.
 void setItemRenderer(MapitemRenderer renderer)
          Sets the renderer which is used to render each Mapitem if getModel() is not null.
 void setLat(double lat)
          Sets the current latitude of the Maps center.
 void setLng(double lng)
          Sets the current longitude of the Maps center.
 void setMapType(java.lang.String mapType)
          Set the map type (normal, satellite, hybrid, physical), default is normal.
 void setModel(MapModel model)
          Sets the model associated with this Maps.
 void setNormal(boolean b)
          Sets whether support normal map, default to true.
 void setPhysical(boolean b)
          Sets whether support physical map, default to false.
 void setSatellite(boolean b)
          Sets whether support satellite map, default to true.
 void setScrollWheelZoom(boolean b)
          Sets whether enable zoom in-out via mouse scroll wheel, default to false.
 void setSelectedItem(org.zkoss.zk.ui.Component item)
          Set the selected item (can be Gmarker, Gpolyline, or Gpolygon).
 void setShowLargeCtrl(boolean b)
          Sets whether show the large Google Maps Control.
 void setShowOverviewCtrl(boolean b)
          Sets whether show the Google Maps overview Control, default to false.
 void setShowScaleCtrl(boolean b)
          Sets whether show the Google Maps scale Control.
 void setShowSmallCtrl(boolean b)
          Sets whether show the small Google Maps Control.
 void setShowTypeCtrl(boolean b)
          Sets whether show the Google Maps type Control.
 void setShowZoomCtrl(boolean b)
          Sets whether show the small zoom Google Maps Control.
 void setZoom(int zoom)
          Sets zoom level.
 
Methods inherited from class org.zkoss.zul.impl.XulElement
getAction, getActionAttrs, getAllOnClickAttrs, getContext, getInnerAttrs, getPopup, getTooltip, setAction, setContext, setPopup, setTooltip
 
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
focus, getDraggable, getDroppable, getHeight, getLeft, getRealSclass, getRealStyle, getRealStyleFlags, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZIndex, setClass, setDraggable, setDroppable, setHeight, setLeft, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZIndex
 
Methods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addAnnotation, addEventHandler, addEventListener, addForward, addForward, addMoved, addSharedAnnotationMap, addSharedEventHandlerMap, appendAsapAttr, appendChild, applyProperties, containsVariable, detach, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttributes, getAttributes, getChildren, getDefinition, getDesktop, getEventHandler, getExtraCtrl, getFellow, getFellowIfAny, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getMoldURI, getNamespace, getNextSibling, getPage, getParent, getPreviousSibling, getPropagatee, getRoot, getSpaceOwner, getUuid, getVariable, invalidate, isAsapRequired, isChildable, isListenerAvailable, isVisible, onChildAdded, onDrawNewChild, onPageAttached, onPageDetached, onWrongValue, redraw, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, response, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setComponentDefinition, setId, setMold, setPage, setPageBefore, setParent, setVariable, setVisible, smartUpdate, smartUpdate, smartUpdate, smartUpdateDeferred, toString, unsetVariable
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Gmaps

public Gmaps()
Method Detail

setCenter

public void setCenter(double lat,
                      double lng)
Sets the center of the Google Maps.

Parameters:
lat - latitude of the Google Maps center
lng - longitude of the Google Maps center

setLat

public void setLat(double lat)
Sets the current latitude of the Maps center.

Parameters:
lat - latitude of the Google Maps center

getLat

public double getLat()
Returns the current latitude of the Maps center.

Returns:
the current latitude of the Maps center.

setLng

public void setLng(double lng)
Sets the current longitude of the Maps center.

Parameters:
lng - the current longitude of the Maps center.

getLng

public double getLng()
Returns the currrent longitude of the Maps center.

Returns:
the currrent longitude of the Maps center.

getSwLat

public double getSwLat()
Returns the bounded south west latitude.

Returns:
the bounded south west latitude.
Since:
2.0_8

getSwLng

public double getSwLng()
Returns the bounded south west longitude.

Returns:
the bounded south west longitude.
Since:
2.0_8

getNeLat

public double getNeLat()
Returns the bounded north east latitude.

Returns:
the bounded north east latitude.
Since:
2.0_8

getNeLng

public double getNeLng()
Returns the bounded north east longitude.

Returns:
the bounded north east longitude.
Since:
2.0_8

panTo

public void panTo(double lat,
                  double lng)
Pan to the new center of the Google Maps.

Parameters:
lat - latitude of the Google Maps center
lng - longitude of the Google Maps center

setZoom

public void setZoom(int zoom)
Sets zoom level.

Parameters:
zoom - the zoom level (0-18)

getZoom

public int getZoom()
Returns the current zoom level.

Returns:
the current zoom level.

setShowLargeCtrl

public void setShowLargeCtrl(boolean b)
Sets whether show the large Google Maps Control.

Parameters:
b - true to show the large Google Maps Control.

isShowLargeCtrl

public boolean isShowLargeCtrl()
Returns whether show the large Google Maps Control.

Returns:
whether show the large Google Maps Control.

setShowSmallCtrl

public void setShowSmallCtrl(boolean b)
Sets whether show the small Google Maps Control.

Parameters:
b - true to show the small Google Maps Control.

isShowSmallCtrl

public boolean isShowSmallCtrl()
Returns whether show the large Google Maps Control.

Returns:
whether show the large Google Maps Control.

setShowZoomCtrl

public void setShowZoomCtrl(boolean b)
Sets whether show the small zoom Google Maps Control.

Parameters:
b - true to show the small zoom Google Maps Control.
Since:
2.0_7

isShowZoomCtrl

public boolean isShowZoomCtrl()
Returns whether show the small zoom Google Maps Control.

Returns:
whether show the small zoom Google Maps Control.
Since:
2.0_7

setShowTypeCtrl

public void setShowTypeCtrl(boolean b)
Sets whether show the Google Maps type Control.

Parameters:
b - true to show the Google Maps type Control.

isShowTypeCtrl

public boolean isShowTypeCtrl()
Returns whether show the Google Maps type Control.

Returns:
whether show the Google Maps type Control.

setShowScaleCtrl

public void setShowScaleCtrl(boolean b)
Sets whether show the Google Maps scale Control.

Parameters:
b - true to show the Google Maps scale Control.
Since:
2.0_7

isShowScaleCtrl

public boolean isShowScaleCtrl()
Returns whether show the Google Maps scale Control, default to false.

Returns:
whether show the Google Maps scale Control.
Since:
2.0_7

setShowOverviewCtrl

public void setShowOverviewCtrl(boolean b)
Sets whether show the Google Maps overview Control, default to false.

Parameters:
b - whether show the Google Maps overview Control.
Since:
2.0_7

isShowOverviewCtrl

public boolean isShowOverviewCtrl()
Returns whether show the Google Maps overview Control, default to false.

Returns:
whether show the Google Maps overview Control.
Since:
2.0_7

setNormal

public void setNormal(boolean b)
Sets whether support normal map, default to true.

Parameters:
b - whether support normal map, default to true.
Since:
2.0_7

isNormal

public boolean isNormal()
Returns whether support normal map, default to true.

Returns:
whether support normal map.
Since:
2.0_7

setSatellite

public void setSatellite(boolean b)
Sets whether support satellite map, default to true.

Parameters:
b - whether support satellite map, default to true.
Since:
2.0_7

isSatellite

public boolean isSatellite()
Returns whether support satellite map, default to true.

Returns:
whether support satellite map.
Since:
2.0_7

setHybrid

public void setHybrid(boolean b)
Sets whether support hybrid map, default to true.

Parameters:
b - whether support hybrid map, default to true.
Since:
2.0_7

isHybrid

public boolean isHybrid()
Returns whether support hybrid map, default to true.

Returns:
whether support hybrid map.
Since:
2.0_7

setPhysical

public void setPhysical(boolean b)
Sets whether support physical map, default to false.

Parameters:
b - whether support physical map, default to false.
Since:
2.0_7

isPhysical

public boolean isPhysical()
Returns whether support physical map, default to false.

Returns:
whether support physical map, default to false.
Since:
2.0_7

getMapType

public java.lang.String getMapType()
Get the current Map Type.

Returns:
the current Map Type.

setMapType

public void setMapType(java.lang.String mapType)
Set the map type (normal, satellite, hybrid, physical), default is normal. This implementation always set since we don't know what the current MapType is in browser side.

Parameters:
mapType - (normal, satellite, hybrid, physical), default is normal.

setEnableDragging

public void setEnableDragging(boolean b)
Sets whether enable dragging maps by mouse, default to true.

Parameters:
b - true to enable dragging maps by mouse.
Since:
2.0_7

isEnableDragging

public boolean isEnableDragging()
Returns whether enable dragging maps by mouse, default to true.

Returns:
true to enable dragging maps by mouse.
Since:
2.0_7

setContinuousZoom

public void setContinuousZoom(boolean b)
Sets whether enable continuous zoom effects, default to false.

Parameters:
b - true to enable continuous zoom effects.
Since:
2.0_7

isContinuousZoom

public boolean isContinuousZoom()
Returns whether enable continuous zoom effects, default to false.

Returns:
true to enable continuous zoom effects.
Since:
2.0_7

setDoubleClickZoom

public void setDoubleClickZoom(boolean b)
Sets whether enable zoom in-out via mouse double click, default to false.

Parameters:
b - true to enable zoom in-out via mouse double clilck.
Since:
2.0_7

isDoubleClickZoom

public boolean isDoubleClickZoom()
Returns whether enable zoom in-out via mouse double click, default to false.

Returns:
true to enable zoom in-out via mouse double clilck.
Since:
2.0_7

setScrollWheelZoom

public void setScrollWheelZoom(boolean b)
Sets whether enable zoom in-out via mouse scroll wheel, default to false.

Parameters:
b - true to enable zoom in-out via mouse scroll wheel.
Since:
2.0_7

isScrollWheelZoom

public boolean isScrollWheelZoom()
Returns whether enable zoom in-out via mouse scroll wheel, default to false.

Returns:
true to enable zoom in-out via mouse scroll wheel.
Since:
2.0_7

setEnableGoogleBar

public void setEnableGoogleBar(boolean b)
Sets whether show the Google Search Bar on the Map, default to false.

Parameters:
b - true to show the Google Search Bar
Since:
2.0_7

isEnableGoogleBar

public boolean isEnableGoogleBar()
Returns whether show the Google Search Bar on the Map, default to false.

Returns:
true if show the Google Search Bar.
Since:
2.0_7

openInfo

public void openInfo(Ginfo info)
Open the specified Ginfo or Gmarker. The specified Ginfo must be child of this Gmaps.

Parameters:
info - the specified Ginfo or Gmarker.

closeInfo

public void closeInfo()
Close the currently opened info window.


getInfo

public Ginfo getInfo()
Returns the currently opened info window of this Google Maps (might be Gmarker or Ginfo).

Returns:
the currently opened Ginfo.

getModel

public MapModel getModel()
Returns the Maps model associated with this Maps, or null if this Maps is not associated with any Maps data model.

Returns:
the Maps model associated with this Maps
Since:
2.0_9

setModel

public void setModel(MapModel model)
Sets the model associated with this Maps. If a non-null model is assigned, no matter whether it is the same as the previous, it will always cause re-render.

Parameters:
model - the model to associated, or null to dis-associate any privious model.
Since:
2.0_9

getItemRenderer

public MapitemRenderer getItemRenderer()
Returns the renderer to render given data object, or null if the default renderer is used. Default renderer assume the given data object is a kind of Mapitem.

Returns:
the renderer to render given data.
Since:
2.0_9

setItemRenderer

public void setItemRenderer(MapitemRenderer renderer)
Sets the renderer which is used to render each Mapitem if getModel() is not null.

Note: changing a renderer will not cause the Maps to re-render. If you want it to re-render, you could assign the same model again(i.e., setModel(getModel()) ) or fire an MapDataEvent event.

Parameters:
renderer - the renderer, or null to use the default.
Since:
2.0_9

setSelectedItem

public void setSelectedItem(org.zkoss.zk.ui.Component item)
Set the selected item (can be Gmarker, Gpolyline, or Gpolygon).

Parameters:
item - the item to be selected.

getSelectedItem

public org.zkoss.zk.ui.Component getSelectedItem()
Returns the selected item (can be Gmarker, Gpolyline, or Gpolygon).

Returns:
the selected item.

getOuterAttrs

public java.lang.String getOuterAttrs()
Internal Use Only. Returns the HTML attributes for this tag.

Used only for component development, not for application developers.

Overrides:
getOuterAttrs in class org.zkoss.zul.impl.XulElement

insertBefore

public boolean insertBefore(org.zkoss.zk.ui.Component child,
                            org.zkoss.zk.ui.Component insertBefore)
Specified by:
insertBefore in interface org.zkoss.zk.ui.Component
Overrides:
insertBefore in class org.zkoss.zk.ui.AbstractComponent

onChildRemoved

public void onChildRemoved(org.zkoss.zk.ui.Component child)
Specified by:
onChildRemoved in interface org.zkoss.zk.ui.Component
Overrides:
onChildRemoved in class org.zkoss.zk.ui.AbstractComponent

clone

public java.lang.Object clone()
Specified by:
clone in interface org.zkoss.zk.ui.Component
Overrides:
clone in class org.zkoss.zk.ui.AbstractComponent

newExtraCtrl

protected java.lang.Object newExtraCtrl()
Overrides:
newExtraCtrl in class org.zkoss.zk.ui.HtmlBasedComponent


Copyright © 2005-2007 Potix Corporation. All Rights Reserved.