|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.zkoss.zk.ui.AbstractComponent org.zkoss.zk.ui.HtmlBasedComponent org.zkoss.zul.impl.XulElement org.zkoss.gmaps.Gpolyline
public class Gpolyline
Google Maps support Gpolyline.
Nested Class Summary | |
---|---|
protected static class |
Gpolyline.Tuple
|
Nested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
---|
org.zkoss.zk.ui.HtmlBasedComponent.ExtraCtrl |
Field Summary | |
---|---|
protected java.lang.String |
_encodedLevels
|
protected java.lang.String |
_encodedPolyline
|
protected java.util.List |
_points
|
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 | |
---|---|
Gpolyline()
|
Method Summary | |
---|---|
void |
addPoint(double lat,
double lng,
int level)
Add polyline axix point. |
protected int |
e5(double db)
|
protected static java.lang.String |
encodeInt(int x)
|
protected static java.lang.String |
encodeLatLng(int e5)
|
java.lang.String |
getColor()
Line color in form of #RRGGBB, default to #808080. |
java.lang.String |
getEncodedLevels()
|
java.lang.String |
getEncodedPolyline()
|
int |
getNumLevels()
Returns the number of polyline levels. |
int |
getOpacity()
line opacity 0 - 100, default to 50. |
java.lang.String |
getOuterAttrs()
Returns the HTML attributes for this tag. |
int |
getWeight()
line weight(width) 1 - 10, default to 5. |
int |
getZoomFactor()
Returns the zoomFactor (zoomFactor change per the numLevels). |
boolean |
isChildable()
Default: not childable. |
void |
setColor(java.lang.String color)
Line color in form of #RRGGBB, default to #808080. |
void |
setNumLevels(int numLevels)
Sets the number of polyline levels. |
void |
setOpacity(int opacity)
line opacity 0 - 100, default to 50. |
void |
setPoints(java.lang.String points)
Set polyline in lat,lng,level tuple(double, double, int); e.g. |
void |
setWeight(int weight)
line weight(width) 1 - 10, default to 5. |
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, newExtraCtrl, 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, clone, 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, insertBefore, invalidate, isAsapRequired, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, 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 |
Methods inherited from interface org.zkoss.zk.ui.Component |
---|
addEventListener, addForward, addForward, appendChild, applyProperties, clone, containsVariable, detach, getAttribute, getAttribute, getAttributes, getAttributes, getChildren, getDefinition, getDesktop, getFellow, getFellowIfAny, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNamespace, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getSpaceOwner, getUuid, getVariable, insertBefore, invalidate, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onDrawNewChild, onPageAttached, onPageDetached, redraw, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, response, setAttribute, setAttribute, setId, setMold, setPage, setPageBefore, setParent, setVariable, setVisible, smartUpdate, smartUpdateDeferred, unsetVariable |
Field Detail |
---|
protected java.util.List _points
protected java.lang.String _encodedPolyline
protected java.lang.String _encodedLevels
Constructor Detail |
---|
public Gpolyline()
Method Detail |
---|
public void addPoint(double lat, double lng, int level)
Note the polyline "level" does not correspond directly to a zoom level but they are related. More accurately, the numLevels parameter divides up the existing zoom levels (currently 18) into groups of zoom levels and polyline level is confined by the numLevels. For example, the default numLevels value is 4, so the polyline level can be 0 to 3 only. The Google maps zoom levels are grouped together into the following 4 levels (determined by numLevels):
Polyline Level | Zoom Levels |
Level 0 | Zoom levels 0-5 |
Level 1 | Zoom levels 6-10 |
Level 2 | Zoom levels 11-14 |
Level 3 | Zoom levels 15-18 |
An polyline level value of 3 in this case would ensure that a point appears in all zoom level, while a level of 0 will ignore points specified beyond zoom level 5. The endpoints of a polyline should often be set to the largest encoded level, to ensure that the endpoints will appear in all zoom levels and the line is drawn correctly.
A general rule is that whenever the level of the end point is greater or equal to the current Gmaps level, that end point is appeared; otherwise, it should be skipped.
lat
- the latitudelng
- the longtitudelevel
- the polyline level(default to 0 - 3)public void setPoints(java.lang.String points)
points
- public java.lang.String getEncodedPolyline()
protected int e5(double db)
public java.lang.String getEncodedLevels()
protected static java.lang.String encodeLatLng(int e5)
protected static java.lang.String encodeInt(int x)
public java.lang.String getOuterAttrs()
Used only for component development, not for application developers.
getOuterAttrs
in class org.zkoss.zul.impl.XulElement
public java.lang.String getColor()
public void setColor(java.lang.String color)
color
- the color to setpublic int getWeight()
public void setWeight(int weight)
weight
- the weight to setpublic int getOpacity()
public void setOpacity(int opacity)
opacity
- the line opacity to setpublic int getNumLevels()
public void setNumLevels(int numLevels)
numLevels
- the number of levels.public int getZoomFactor()
public boolean isChildable()
isChildable
in interface org.zkoss.zk.ui.Component
isChildable
in class org.zkoss.zk.ui.AbstractComponent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |