Reference Table of Contents
CoStr
Map
Overlays
Events
Base
MVC
Drawing Library
zhupiter.CoStr.CoStrType class
Identifiers for CoStr types.
Constant
Constant | Description |
---|
NONE | Reserved. |
GMAP | Google Map CoString. |
CANVAS2D | HTML5 2D Canvas CoString. |
zhupiter.CoStr.Map class
CoString coordiante map/canvas.
Constructor
Constructor | Description |
---|
Map(coordianteDiv:Node, opts?:MapOptions) | Creates a new CoString map/canvas inside of the given HTML container, which is typically a DIV element. |
Methods
Methods | Return Value | Description |
---|
getBounds() | LatLngBounds|Bounds2D | Returns the lat/lng | x/y bounds of the current viewport. |
getCenter() | LatLng|Point2D | Returns the position displayed at the center of the map/canvas. |
getDiv() | Node | Returns the DIV object of coordinate map/canvas HTML container. |
getZoom() | number | Returns the current zoom level number. |
setCenter(latlng:LatLng|LatLngLiteral|Point2D) | None | Changes the center of the map/canvas. |
setOptions(options:MapOptions) | None | Changes the settings by a set of options. |
setZoom(zoom:number) | None | Changes the zoom level to the given number. |
getCoStrDrawingManager() | DrawingManager | Returns the cureent CoString drawing manager object of the map/canvas. |
getCoStrLang() | string | Returns the current CoString language of the map/canvas. Accepted values are 'en': English, 'cht': Tranditional Chinese, 'chs': Simple Chinese |
getCoStrType() | CoStrType | Returns the cureent CoString type of the map/canvas. |
getRawMap() | GMap | This method is only available for GMAP CoString type. Returns the current GMap object. |
getCoString(type:CoStrType) | string | Returns the current CoString of settings/objects of the map/canvas by the given CoString type. |
setCoStrDrawingManager(drawingManager:DrawingManager) | None | Changes the current CoStringdrawing manger to the given DrawingManager . |
setCoString(coString?:string, editable?:boolean) | None | Parsers the CoString and applys the settings and objects to the map/canvas. CoString is trying to get from the HTTP GET URL query string if not given. Editabling is enabled by default if DrawingManager is set. |
Events
Events | Arguments | Description |
---|
bounds_changed | None | This event is fired when the viewport bounds have changed. |
center_changed | None | This event is fired when the map/canvas center property changes. |
click | MouseEvent|MouseEvent2D | This event is fired when the user clicks on the map/canvas (but not when they click on a marker or infowindow). |
dblclick | MouseEvent|MouseEvent2D | This event is fired when the user double-clicks on the map/canvas. Note that the click event will also fire, right before this one. |
drag | None | This event is repeatedly fired while the user drags the map/canvas. |
dragend | None | This event is fired when the user stops dragging the map/canvas. |
dragstart | None | This event is fired when the user starts dragging the map/canvas. |
mousemove | MouseEvent|MouseEvent2D | This event is fired whenever the user's mouse moves over the map/canvas container. |
rightclick | MouseEvent|MouseEvent2D | This event is fired when the DOM contextmenu event is fired on the map/canvas container. |
zoom_changed | None | This event is fired when the map/canvas zoom property changes. |
zhupiter.CoStr.MapOptions object
Properties
Properties | Type | Description |
---|
center | LatLng|Point2D | The initial map/canvas center. Required. |
draggable | boolean | If false , prevents the map/canvas from being dragged. Dragging is enabled by default. |
zoom | number | The initial map/canvas zoom level. Required. |
coStrLang | string | The language used in the map/canvas. Required. 'en': English, 'cht': Tranditional Chinese, 'chs': Simple Chinese |
coStrMaxDecode | number | The maximum number of decoding objects. Default value is 0 for unlimit. |
coStrType | CoStrType | The CoString type of the map/canvas. Required. |
zhupiter.CoStr.Marker class
Constructor
Constructor | Description |
---|
Marker(opts?:MarkerOptions) | Creates a marker with the options specified. |
Methods
Methods | Return Value | Description |
---|
getClickable() | boolean | |
getCursor() | string | |
getDraggable() | boolean | |
getIcon() | string|Icon|Symbol | |
getMap() | Map | Returns the CoString map/canvas on which this Marker is attached. |
getOpacity() | number | |
getPosition() | LatLng|Point2D | |
getTitle() | string | |
getVisible() | boolean | |
getZIndex() | number | |
setClickable(flag:boolean) | None | |
setCursor(cursor:string) | None | |
setDraggable(flag:boolean) | None | |
setIcon(icon:string|Icon|Symbol) | None | |
setMap(map:Map) | None | Renders the Marker on the specified CoString map/canvas. If Map is set to null, the Marker will be removed. |
setOpacity(opacity:number) | None | |
setOptions(options:MarkerOptions) | None | |
setPosition(yx:LatLng|LatLngLiteral|Point2D) | None | |
setTitle(title:string) | None | |
setVisible(visible:boolean) | None | |
setZIndex(zIndex:number) | None | |
Events
Events | Arguments | Description |
---|
click | MouseEvent|MouseEvent2D | This event is fired when the marker icon was clicked. |
clickable_changed | None | This event is fired when the marker's clickable property changes. |
cursor_changed | None | This event is fired when the marker's cursor property changes. |
dblclick | MouseEvent|MouseEvent2D | This event is fired when the marker icon was double clicked. |
drag | MouseEvent|MouseEvent2D | This event is repeatedly fired while the user drags the marker. |
dragend | MouseEvent|MouseEvent2D | This event is fired when the user stops dragging the marker. |
draggable_changed | None | This event is fired when the marker's draggable property changes. |
dragstart | MouseEvent|MouseEvent2D | This event is fired when the user starts dragging the marker. |
mousedown | MouseEvent|MouseEvent2D | This event is fired for a mousedown on the marker. |
mouseout | MouseEvent|MouseEvent2D | This event is fired when the mouse leaves the area of the marker icon. |
mouseover | MouseEvent|MouseEvent2D | This event is fired when the mouse enters the area of the marker icon. |
mouseup | MouseEvent|MouseEvent2D | This event is fired for a mouseup on the marker. |
position_changed | None | This event is fired when the marker position property changes. |
rightclick | MouseEvent|MouseEvent2D | This event is fired for a rightclick on the marker. |
title_changed | None | This event is fired when the marker title property changes. |
visible_changed | None | This event is fired when the marker's visible property changes. |
zindex_changed | None | This event is fired when the marker's zIndex property changes. |
zhupiter.CoStr.MarkerOptions object
Properties
Properties | Type | Description |
---|
clickable | boolean | If true , the Marker receives mouse and touch events. Default value is true . |
cursor | string | Mouse cursor to show on hover |
draggable | boolean | If true , the Marker can be dragged. Default value is false if the map's DrawingManager is NOT set. |
icon | string|Icon|Symbol | Icon for the foreground. If a string is provided, it is treated as though it were an Icon with the string as url. |
opacity | number | The Marker's opacity between 0.0 and 1.0. |
position | LatLng|Point2D | Marker position. Required. |
title | string | Rollover text |
visible | boolean | If true , the Marker is visible |
zIndex | number | All markers are displayed on the map/canvas in order of their zIndex, with higher values displaying in front of markers with lower values. |
coStrMap | Map | CoString map/canvas on which to display Marker. |
zhupiter.CoStr.InfoWindow class
Constructor
Constructor | Description |
---|
InfoWindow(opts?:InfoWindowOptions) | Creates an info window marker with the given options. |
Methods
Methods | Return Value | Description |
---|
getClickable() | boolean | |
getContent() | string|Node | |
getCursor() | string | |
getDraggable() | boolean | |
getIcon() | string|Icon|Symbol | |
getMap() | Map | Returns the CoString map/canvas on which this InfoWindow is attached. |
getOpacity() | number | |
getPosition() | LatLng|Point2D | |
getTitle() | string | |
getVisible() | boolean | |
getZIndex() | number | |
setClickable(flag:boolean) | None | |
setContent(content:string|Node) | None | |
setCursor(cursor:string) | None | |
setDraggable(flag:boolean) | None | |
setIcon(icon:string|Icon|Symbol) | None | |
setMap(map:Map) | None | Renders the InfoWindow on the specified CoString map/canvas. If Map is set to null, the InfoWindow will be removed. |
setOpacity(opacity:number) | None | |
setOptions(options:InfoWindowOptions) | None | |
setPosition(yx:LatLng|LatLngLiteral|Point2D) | None | |
setTitle(title:string) | None | |
setVisible(visible:boolean) | None | |
setZIndex(zIndex:number) | None | |
Events
Events | Arguments | Description |
---|
click | MouseEvent|MouseEvent2D | This event is fired when the marker icon was clicked. |
clickable_changed | None | This event is fired when the marker's clickable property changes. |
content_changed | None | This event is fired when the content property changes. |
cursor_changed | None | This event is fired when the marker's cursor property changes. |
dblclick | MouseEvent|MouseEvent2D | This event is fired when the marker icon was double clicked. |
drag | MouseEvent|MouseEvent2D | This event is repeatedly fired while the user drags the marker. |
dragend | MouseEvent|MouseEvent2D | This event is fired when the user stops dragging the marker. |
draggable_changed | None | This event is fired when the marker's draggable property changes. |
dragstart | MouseEvent|MouseEvent2D | This event is fired when the user starts dragging the marker. |
mousedown | MouseEvent|MouseEvent2D | This event is fired for a mousedown on the marker. |
mouseout | MouseEvent|MouseEvent2D | This event is fired when the mouse leaves the area of the marker icon. |
mouseover | MouseEvent|MouseEvent2D | This event is fired when the mouse enters the area of the marker icon. |
mouseup | MouseEvent|MouseEvent2D | This event is fired for a mouseup on the marker. |
position_changed | None | This event is fired when the marker position property changes. |
rightclick | MouseEvent|MouseEvent2D | This event is fired for a rightclick on the marker. |
title_changed | None | This event is fired when the marker title property changes. |
visible_changed | None | This event is fired when the marker's visible property changes. |
zindex_changed | None | This event is fired when the marker's zIndex property changes. |
zhupiter.CoStr.InfoWindowOptions object
Properties
Properties | Type | Description |
---|
clickable | boolean | If true , the InfoWindow receives mouse and touch events. Default value is true . |
cursor | string | Mouse cursor to show on hover |
draggable | boolean | If true , the InfoWindow can be dragged. Default value is false if the map's DrawingManager is NOT set. |
icon | string|Icon|Symbol | Icon for the foreground. If a string is provided, it is treated as though it were an Icon with the string as url. |
opacity | number | The InfoWindow's opacity between 0.0 and 1.0. |
position | LatLng|Point2D | InfoWindow position. Required. |
title | string | Rollover text |
visible | boolean | If true , the InfoWindow is visible |
zIndex | number | All markers are displayed on the map/canvas in order of their zIndex, with higher values displaying in front of markers with lower values. |
content | string | Content of InfoWindow. |
coStrMap | Map | CoString map/canvas on which to display InfoWindow. |
zhupiter.CoStr.Polyline class
Constructor
Constructor | Description |
---|
Polyline(opts?:PolylineOptions) | Create a polyline using the passed PolylineOptions, which specify both the path of the polyline and the stroke style to use when drawing the polyline. |
Methods
Methods | Return Value | Description |
---|
getDraggable() | boolean | Returns whether this Polyline can be dragged by the user. |
getEditable() | boolean | Returns whether this Polyline can be edited by the user. |
getMap() | Map | Returns the CoString map/canvas on which this Polyline is attached. |
getPath() | MVCArray.<LatLng|Point2D> | Retrieves the first path. |
getVisible() | boolean | Returns whether this Polyline is visible on the map/canvas. |
setDraggable(draggable:boolean) | None | If set to true , the user can drag this Polyline over the map. |
setEditable(editable:boolean) | None | If set to true , the user can edit this Polyline by dragging the control points shown at the vertices (and on each segment). |
setMap(map:Map) | None | Renders the Polyline on the specified CoString map/canvas. If Map is set to null, the Polyline will be removed. |
setOptions(options:PolylineOptions) | None | |
setPath(path:MVCArray.<LatLng|Point2D>|Array.<LatLng|LatLngLiteral|Point2D>) | None | Sets the first path. |
setVisible(visible:boolean) | None | Hides this Polyline if set to false . |
Events
Events | Arguments | Description |
---|
click | PolyMouseEvent|MouseEvent2D | This event is fired when the DOM click event is fired on the Polyline. |
dblclick | PolyMouseEvent|MouseEvent2D | This event is fired when the DOM dblclick event is fired on the Polyline. |
drag | MouseEvent|MouseEvent2D | This event is repeatedly fired while the user drags the Polyline. |
dragend | MouseEvent|MouseEvent2D | This event is fired when the user stops dragging the Polyline. |
dragstart | MouseEvent|MouseEvent2D | This event is fired when the user starts dragging thePolyline. |
mousedown | PolyMouseEvent|MouseEvent2D | This event is fired when the DOM mousedown event is fired on the Polyline. |
mousemove | PolyMouseEvent|MouseEvent2D | This event is fired when the DOM mousemove event is fired on the Polyline. |
mouseout | PolyMouseEvent|MouseEvent2D | This event is fired on Polyline mouseout. |
mouseover | PolyMouseEvent|MouseEvent2D | This event is fired on Polyline mouseover. |
mouseup | PolyMouseEvent|MouseEvent2D | This event is fired when the DOM mouseup event is fired on the Polyline. |
rightclick | PolyMouseEvent|MouseEvent2D | This event is fired when the Polyline is right-clicked on. |
zhupiter.CoStr.PolylineOptions object
Properties
Properties | Type | Description |
---|
clickable | boolean | Indicates whether this Polyline handles mouse events. Defaults to true . |
draggable | boolean | If set to true , the user can drag this Polyline over the map/canvas. Defaults to false . |
editable | boolean | If set to true , the user can edit this Polyline by dragging the control points shown at the vertices (and on each segment). Defaults to false . |
path | MVCArray.<LatLng|Point2D>|Array.<LatLng|LatLngLiteral|Point2D> | The ordered sequence of coordinates of the Polyline. |
strokeColor | string | The stroke color. All CSS3 colors are supported except for extended named colors. |
strokeOpacity | number | The stroke opacity between 0.0 and 1.0. |
strokeWeight | number | The stroke width in pixels. |
visible | boolean | Whether this Polyline is visible on the map. Defaults to true . |
zIndex | number | The zIndex compared to other polys. |
coStrMap | Map | CoString map/canvas on which to display Polyline. |
zhupiter.CoStr.Polygon class
Constructor
Methods
Methods | Return Value | Description |
---|
getDraggable() | boolean | Returns whether this Polygon can be dragged by the user. |
getEditable() | boolean | Returns whether this Polygon can be edited by the user. |
getMap() | Map | Returns the CoString map/canvas on which this Polygon is attached. |
getPath() | MVCArray.<LatLng|Point2D> | Retrieves the first path. |
getVisible() | boolean | Returns whether this Polygon is visible on the map/canvas. |
setDraggable(draggable:boolean) | None | If set to true , the user can drag this Polygon over the map. |
setEditable(editable:boolean) | None | If set to true , the user can edit this Polygon by dragging the control points shown at the vertices (and on each segment). |
setMap(map:Map) | None | Renders the Polygon on the specified CoString map/canvas. If Map is set to null, the Polygon will be removed. |
setOptions(options:PolygonOptions) | None | |
setPath(path:MVCArray.<LatLng|Point2D>|Array.<LatLng|LatLngLiteral|Point2D>) | None | Sets the first path. |
setVisible(visible:boolean) | None | Hides this Polygon if set to false . |
Events
Events | Arguments | Description |
---|
click | PolyMouseEvent|MouseEvent2D | This event is fired when the DOM click event is fired on the Polygon. |
dblclick | PolyMouseEvent|MouseEvent2D | This event is fired when the DOM dblclick event is fired on the Polygon. |
drag | MouseEvent|MouseEvent2D | This event is repeatedly fired while the user drags the Polygon. |
dragend | MouseEvent|MouseEvent2D | This event is fired when the user stops dragging the Polygon. |
dragstart | MouseEvent|MouseEvent2D | This event is fired when the user starts dragging thePolygon. |
mousedown | PolyMouseEvent|MouseEvent2D | This event is fired when the DOM mousedown event is fired on the Polygon. |
mousemove | PolyMouseEvent|MouseEvent2D | This event is fired when the DOM mousemove event is fired on the Polygon. |
mouseout | PolyMouseEvent|MouseEvent2D | This event is fired on Polygon mouseout. |
mouseover | PolyMouseEvent|MouseEvent2D | This event is fired on Polygon mouseover. |
mouseup | PolyMouseEvent|MouseEvent2D | This event is fired when the DOM mouseup event is fired on the Polygon. |
rightclick | PolyMouseEvent|MouseEvent2D | This event is fired when the Polygon is right-clicked on. |
zhupiter.CoStr.PolygonOptions object
Properties
Properties | Type | Description |
---|
clickable | boolean | Indicates whether this Polygon handles mouse events. Defaults to true . |
draggable | boolean | If set to true , the user can drag this Polygon over the map/canvas. Defaults to false . |
editable | boolean | If set to true , the user can edit this Polygon by dragging the control points shown at the vertices (and on each segment). Defaults to false . |
fillColor | string | The fill color. All CSS3 colors are supported except for extended named colors. |
fillOpacity | number | The fill opacity between 0.0 and 1.0 |
path | MVCArray.<LatLng|Point2D>|Array.<LatLng|LatLngLiteral|Point2D> | The ordered sequence of coordinates of the Polygon. |
strokeColor | string | The stroke color. All CSS3 colors are supported except for extended named colors. |
strokeOpacity | number | The stroke opacity between 0.0 and 1.0. |
strokeWeight | number | The stroke width in pixels. |
visible | boolean | Whether this Polygon is visible on the map. Defaults to true . |
zIndex | number | The zIndex compared to other polys. |
coStrMap | Map | CoString map/canvas on which to display Polygon. |
zhupiter.CoStr.Line class
Constructor
Methods
Methods | Return Value | Description |
---|
getDraggable() | boolean | Returns whether this Line can be dragged by the user. |
getEditable() | boolean | Returns whether this Line can be edited by the user. |
getMap() | Map | Returns the CoString map/canvas on which this Line is attached. |
getVisible() | boolean | Returns whether this Line is visible on the map/canvas. |
setDraggable(draggable:boolean) | None | If set to true , the user can drag this Line over the map. |
setEditable(editable:boolean) | None | If set to true , the user can edit this Line by dragging the control points shown at the vertices (and on each segment). |
setMap(map:Map) | None | Renders the Line on the specified CoString map/canvas. If Map is set to null, the Line will be removed. |
setOptions(options:LineOptions) | None | |
setVisible(visible:boolean) | None | Hides this Line if set to false . |
Events
Events | Arguments | Description |
---|
click | PolyMouseEvent|MouseEvent2D | This event is fired when the DOM click event is fired on the Line. |
dblclick | PolyMouseEvent|MouseEvent2D | This event is fired when the DOM dblclick event is fired on the Line. |
drag | MouseEvent|MouseEvent2D | This event is repeatedly fired while the user drags the Line. |
dragend | MouseEvent|MouseEvent2D | This event is fired when the user stops dragging the Line. |
dragstart | MouseEvent|MouseEvent2D | This event is fired when the user starts dragging theLine. |
mousedown | PolyMouseEvent|MouseEvent2D | This event is fired when the DOM mousedown event is fired on the Line. |
mousemove | PolyMouseEvent|MouseEvent2D | This event is fired when the DOM mousemove event is fired on the Line. |
mouseout | PolyMouseEvent|MouseEvent2D | This event is fired on Line mouseout. |
mouseover | PolyMouseEvent|MouseEvent2D | This event is fired on Line mouseover. |
mouseup | PolyMouseEvent|MouseEvent2D | This event is fired when the DOM mouseup event is fired on the Line. |
rightclick | PolyMouseEvent|MouseEvent2D | This event is fired when the Line is right-clicked on. |
zhupiter.CoStr.LineOptions object
Properties
Properties | Type | Description |
---|
clickable | boolean | Indicates whether this Line handles mouse events. Defaults to true . |
draggable | boolean | If set to true , the user can drag this Line over the map/canvas. Defaults to false . |
editable | boolean | If set to true , the user can edit this Line by dragging the control points shown at the vertices (and on each segment). Defaults to false . |
path | MVCArray.<LatLng|Point2D>|Array.<LatLng|LatLngLiteral|Point2D> | The ordered sequence of coordinates of the Line. |
strokeColor | string | The stroke color. All CSS3 colors are supported except for extended named colors. |
strokeOpacity | number | The stroke opacity between 0.0 and 1.0. |
strokeWeight | number | The stroke width in pixels. |
visible | boolean | Whether this Line is visible on the map. Defaults to true . |
zIndex | number | The zIndex compared to other polys. |
coStrMap | Map | CoString map/canvas on which to display Line. |
zhupiter.CoStr.Triangle class
Constructor
Methods
Methods | Return Value | Description |
---|
getDraggable() | boolean | Returns whether this Triangle can be dragged by the user. |
getEditable() | boolean | Returns whether this Triangle can be edited by the user. |
getMap() | Map | Returns the CoString map/canvas on which this Triangle is attached. |
getPath() | MVCArray.<LatLng|Point2D> | Retrieves the first path. |
getVisible() | boolean | Returns whether this Triangle is visible on the map/canvas. |
setDraggable(draggable:boolean) | None | If set to true , the user can drag this Triangle over the map. |
setEditable(editable:boolean) | None | If set to true , the user can edit this Triangle by dragging the control points shown at the vertices (and on each segment). |
setMap(map:Map) | None | Renders the Triangle on the specified CoString map/canvas. If Map is set to null, the Triangle will be removed. |
setOptions(options:TriangleOptions) | None | |
setPath(path:MVCArray.<LatLng|Point2D>|Array.<LatLng|LatLngLiteral|Point2D>) | None | Sets the first path. |
setVisible(visible:boolean) | None | Hides this Triangle if set to false . |
Events
Events | Arguments | Description |
---|
click | PolyMouseEvent|MouseEvent2D | This event is fired when the DOM click event is fired on the Triangle. |
dblclick | PolyMouseEvent|MouseEvent2D | This event is fired when the DOM dblclick event is fired on the Triangle. |
drag | MouseEvent|MouseEvent2D | This event is repeatedly fired while the user drags the Triangle. |
dragend | MouseEvent|MouseEvent2D | This event is fired when the user stops dragging the Triangle. |
dragstart | MouseEvent|MouseEvent2D | This event is fired when the user starts dragging theTriangle. |
mousedown | PolyMouseEvent|MouseEvent2D | This event is fired when the DOM mousedown event is fired on the Triangle. |
mousemove | PolyMouseEvent|MouseEvent2D | This event is fired when the DOM mousemove event is fired on the Triangle. |
mouseout | PolyMouseEvent|MouseEvent2D | This event is fired on Triangle mouseout. |
mouseover | PolyMouseEvent|MouseEvent2D | This event is fired on Triangle mouseover. |
mouseup | PolyMouseEvent|MouseEvent2D | This event is fired when the DOM mouseup event is fired on the Triangle. |
rightclick | PolyMouseEvent|MouseEvent2D | This event is fired when the Triangle is right-clicked on. |
zhupiter.CoStr.TriangleOptions object
Properties
Properties | Type | Description |
---|
clickable | boolean | Indicates whether this Triangle handles mouse events. Defaults to true . |
draggable | boolean | If set to true , the user can drag this Triangle over the map/canvas. Defaults to false . |
editable | boolean | If set to true , the user can edit this Triangle by dragging the control points shown at the vertices (and on each segment). Defaults to false . |
fillColor | string | The fill color. All CSS3 colors are supported except for extended named colors. |
fillOpacity | number | The fill opacity between 0.0 and 1.0 |
path | MVCArray.<LatLng|Point2D>|Array.<LatLng|LatLngLiteral|Point2D> | The ordered sequence of coordinates of the Triangle. |
strokeColor | string | The stroke color. All CSS3 colors are supported except for extended named colors. |
strokeOpacity | number | The stroke opacity between 0.0 and 1.0. |
strokeWeight | number | The stroke width in pixels. |
visible | boolean | Whether this Triangle is visible on the map. Defaults to true . |
zIndex | number | The zIndex compared to other polys. |
coStrMap | Map | CoString map/canvas on which to display Triangle. |
zhupiter.CoStr.Rectangle class
Constructor
Methods
Methods | Return Value | Description |
---|
getBounds() | LatLngBounds|Bounds2D | Returns the bounds of this rectangle. |
getDraggable() | boolean | Returns whether this Rectangle can be dragged by the user. |
getEditable() | boolean | Returns whether this Rectangle can be edited by the user. |
getMap() | Map | Returns the CoString map/canvas on which this Rectangle is attached. |
getVisible() | boolean | Returns whether this Rectangle is visible on the map/canvas. |
setBounds(bounds:LatLngBounds|Bounds2D) | None | Sets the bounds of this rectangle. |
setDraggable(draggable:boolean) | None | If set to true , the user can drag this Rectangle over the map. |
setEditable(editable:boolean) | None | If set to true , the user can edit this Rectangle by dragging the control points shown at the vertices (and on each segment). |
setMap(map:Map) | None | Renders the Rectangle on the specified CoString map/canvas. If Map is set to null, the Rectangle will be removed. |
setOptions(options:RectangleOptions) | None | |
setVisible(visible:boolean) | None | Hides this Rectangle if set to false . |
Events
Events | Arguments | Description |
---|
bounds_changed | None | This event is fired when the rectangle's bounds are changed. |
click | MouseEvent|MouseEvent2D | This event is fired when the DOM click event is fired on the Rectangle. |
dblclick | MouseEvent|MouseEvent2D | This event is fired when the DOM dblclick event is fired on the Rectangle. |
drag | MouseEvent|MouseEvent2D | This event is repeatedly fired while the user drags the Rectangle. |
dragend | MouseEvent|MouseEvent2D | This event is fired when the user stops dragging the Rectangle. |
dragstart | MouseEvent|MouseEvent2D | This event is fired when the user starts dragging theRectangle. |
mousedown | MouseEvent|MouseEvent2D | This event is fired when the DOM mousedown event is fired on the Rectangle. |
mousemove | MouseEvent|MouseEvent2D | This event is fired when the DOM mousemove event is fired on the Rectangle. |
mouseout | MouseEvent|MouseEvent2D | This event is fired on Rectangle mouseout. |
mouseover | MouseEvent|MouseEvent2D | This event is fired on Rectangle mouseover. |
mouseup | MouseEvent|MouseEvent2D | This event is fired when the DOM mouseup event is fired on the Rectangle. |
rightclick | MouseEvent|MouseEvent2D | This event is fired when the Rectangle is right-clicked on. |
zhupiter.CoStr.RectangleOptions object
Properties
Properties | Type | Description |
---|
bounds | LatLngBounds|Bounds2D | The bounds. |
clickable | boolean | Indicates whether this Rectangle handles mouse events. Defaults to true . |
draggable | boolean | If set to true , the user can drag this Rectangle over the map/canvas. Defaults to false . |
editable | boolean | If set to true , the user can edit this Rectangle by dragging the control points shown at the vertices (and on each segment). Defaults to false . |
fillColor | string | The fill color. All CSS3 colors are supported except for extended named colors. |
fillOpacity | number | The fill opacity between 0.0 and 1.0 |
map | Map | Map on which to display Rectangle. |
strokeColor | string | The stroke color. All CSS3 colors are supported except for extended named colors. |
strokeOpacity | number | The stroke opacity between 0.0 and 1.0. |
strokeWeight | number | The stroke width in pixels. |
visible | boolean | Whether this Rectangle is visible on the map. Defaults to true . |
zIndex | number | The zIndex compared to other polys. |
coStrMap | Map | CoString map/canvas on which to display Rectangle. |
zhupiter.CoStr.Circle class
Constructor
Constructor | Description |
---|
Circle(opts?:CircleOptions) | Create a circle using the passed CircleOptions, which specify the center, radius, and style. |
Methods
Methods | Return Value | Description |
---|
getBounds() | LatLngBounds|Bounds2D | Gets the bounds of this Circle. |
getCenter() | LatLng|Point2D | Returns the center of this Circle. |
getDraggable() | boolean | Returns whether this Circle can be dragged by the user. |
getEditable() | boolean | Returns whether this Circle can be edited by the user. |
getMap() | Map | Returns the CoString map/canvas on which this Circle is attached. |
getRadius() | number | Returns the radius of this circle (in meters). |
getVisible() | boolean | Returns whether this Circle is visible on the map/canvas. |
setCenter(center:LatLng|LatLngLiteral|Point2D) | None | Sets the center of this Circle. |
setDraggable(draggable:boolean) | None | If set to true , the user can drag this Circle over the map. |
setEditable(editable:boolean) | None | If set to true , the user can edit this Circle by dragging the control points shown at the vertices (and on each segment). |
setMap(map:Map) | None | Renders the Circle on the specified CoString map/canvas. If Map is set to null, the Circle will be removed. |
setOptions(options:CircleOptions) | None | |
setRadius(radius:number) | None | Sets the radius of this circle (in meters). |
setVisible(visible:boolean) | None | Hides this Circle if set to false . |
Events
Events | Arguments | Description |
---|
center_changed | None | This event is fired when the circle's center is changed. |
click | MouseEvent|MouseEvent2D | This event is fired when the DOM click event is fired on the Circle. |
dblclick | MouseEvent|MouseEvent2D | This event is fired when the DOM dblclick event is fired on the Circle. |
drag | MouseEvent|MouseEvent2D | This event is repeatedly fired while the user drags the Circle. |
dragend | MouseEvent|MouseEvent2D | This event is fired when the user stops dragging the Circle. |
dragstart | MouseEvent|MouseEvent2D | This event is fired when the user starts dragging theCircle. |
mousedown | MouseEvent|MouseEvent2D | This event is fired when the DOM mousedown event is fired on the Circle. |
mousemove | MouseEvent|MouseEvent2D | This event is fired when the DOM mousemove event is fired on the Circle. |
mouseout | MouseEvent|MouseEvent2D | This event is fired on Circle mouseout. |
mouseover | MouseEvent|MouseEvent2D | This event is fired on Circle mouseover. |
mouseup | MouseEvent|MouseEvent2D | This event is fired when the DOM mouseup event is fired on the Circle. |
radius_changed | None | This event is fired when the circle's radius is changed. |
rightclick | MouseEvent|MouseEvent2D | This event is fired when the Circle is right-clicked on. |
zhupiter.CoStr.CircleOptions object
Properties
Properties | Type | Description |
---|
center | LatLng|Point2D | The center |
clickable | boolean | Indicates whether this Circle handles mouse events. Defaults to true . |
draggable | boolean | If set to true , the user can drag this Circle over the map/canvas. Defaults to false . |
editable | boolean | If set to true , the user can edit this Circle by dragging the control points shown at the vertices (and on each segment). Defaults to false . |
fillColor | string | The fill color. All CSS3 colors are supported except for extended named colors. |
fillOpacity | number | The fill opacity between 0.0 and 1.0 |
map | Map | Map on which to display Circle. |
radius | number | The radius in meters on the Earth's surface |
strokeColor | string | The stroke color. All CSS3 colors are supported except for extended named colors. |
strokeOpacity | number | The stroke opacity between 0.0 and 1.0. |
strokeWeight | number | The stroke width in pixels. |
visible | boolean | Whether this Circle is visible on the map. Defaults to true . |
zIndex | number | The zIndex compared to other polys. |
coStrMap | Map | CoString map/canvas on which to display Circle. |
zhupiter.CoStr.CoStrEventListener object
This class is opaque. It has no methods and no constructor. Its instances are returned from addListener(), addDomListener() and are eventually passed back to removeListener().
zhupiter.CoStr.event namespace
Static Methods
Static Methods | Return Value | Description |
---|
addDomListener(instance:Object, eventName:string, handler:Function, capture?:boolean) | CoStrEvantListener | Cross browser event handler registration. This listener is removed by calling removeListener(handle) for the handle that is returned by this function. |
addDomListenerOnce(instance:Object, eventName:string, handler:Function, capture?:boolean) | CoStrEvantListener | Wrapper around addDomListener that removes the listener after the first event. |
addListener(instance:Object, eventName:string, handler:Function) | CoStrEvantListener | Adds the given listener function to the given event name for the given object instance. Returns an identifier for this listener that can be used with removeListener(). |
addListenerOnce(instance:Object, eventName:string, handler:Function) | CoStrEvantListener | Like addListener, but the handler removes itself after handling the first event. |
removeListener(listener:CoStrEvantListener) | None | Removes the given listener, which should have been returned by addListener above. |
zhupiter.CoStr.MouseEvent2D object
Properties
Properties | Type | Description |
---|
xy | Point2D | The x/y that was below the cursor when the event occurred. |
zhupiter.CoStr.Point2D class
A Point2D is a point in two-dimensional coordinates: x and y. Used in CANVAS2D
CoString type.
Constructor
Constructor | Description |
---|
Point2D(x:number, y:number) | Creates a Point2D object representing a two-dimensional point. Note the ordering of x and y. |
Methods
Methods | Return Value | Description |
---|
equals(other:Point2D) | boolean | Compares two Point2D points. |
x() | number | Returns the x in pixels. |
y() | number | Returns the y in pixels. |
toString() | string | Converts to string representation. |
update(point:Point2D) | None | Updates the x/y values according to the input point . |
updateXY(x:number, y:number) | None | Updates the x/y values for this Point2D. |
Properties
Properties | Type | Description |
---|
fX | number | The X coordinate |
fY | number | The Y coordinate |
zhupiter.CoStr.Bounds2D class
A Bounds2D instance represents a rectangle in two-dimensional coordinates. Used in CANVAS2D
CoString type.
Constructor
Constructor | Description |
---|
Bounds2D(sw?:Point2D, ne?:Point2D) | Constructs a rectangle from the points at its south-west and north-east corners. |
Methods
Methods | Return Value | Description |
---|
contains(xy:Point2D) | boolean | Returns true if the given x/y is in this bounds. |
equals(other:Bounds2D) | boolean | Returns true if this bounds approximately equals the given bounds. |
getCenter() | Point2D | Computes the center of this Bounds2D |
getNorthEast() | Point2D | Returns the north-east corner of this bounds. |
getSouthWest() | Point2D | Returns the south-west corner of this bounds. |
update(bounds:Bounds2D) | None | Updates this bounds according to the input bounds . |
updateXyBounds(swx:number, swy:number, nex:number, ney:number) | None | Updates the south-west corner x/y and north-east corner x/y values for this Bounds2D. |
zhupiter.CoStr.MVCArray class
Constructor
Constructor | Description |
---|
MVCArray(array?:Array) | A mutable MVC Array. |
Methods
Methods | Return Value | Description |
---|
clear() | None | Removes all elements from the array. |
forEach(callback:function(*, number)) | None | Iterate over each element, calling the provided callback. The callback is called for each element like: callback(element, index). |
getArray() | Array | Returns a reference to the underlying Array. |
getAt(i:number) | * | Returns the element at the specified index. |
getLength() | number | Returns the number of elements in this array. |
insertAt(i:number, elem:*) | None | Inserts an element at the specified index. |
pop() | * | Removes the last element of the array and returns that element. |
push(elem:*) | number | Adds one element to the end of the array and returns the new length of the array. |
removeAt(i:number) | * | Removes an element from the specified index. |
setAt(i:number, elem:*) | None | Sets an element at the specified index. |
zhupiter.CoStr.drawing.DrawingManager class
Constructor
Constructor | Description |
---|
DrawingManager(options?:DrawingManagerOptions) | Creates a DrawingManager that allows users to draw overlays on the map/canvas, and switch between the type of overlay to be drawn with a drawing control. |
Methods
Methods | Return Value | Description |
---|
getDrawingMode() | OverlayType | Returns the DrawingManager 's drawing mode. |
getFillColor() | string | Returns the current fill color for new overlays. |
getFillOpacity() | number | Returns the current fill opacity for new overlays. |
getMap() | Map | Returns the CoString Map to which the DrawingManager is attached, which is the CoString Map on which the overlays created will be placed. |
getRawMap() | GMap | This method is only available for GMAP CoString type. Returns the current GMap object. |
getStrokeColor() | string | Returns the current stroke color for new overlays. |
getStrokeOpacity() | number | Returns the current stroke opacity for new overlays. |
getStrokeWeight() | number | Returns the current stroke weight in pixels for new overlays. |
setDrawingMode(drawingMode:OverlayType) | None | Changes the DrawingManager 's drawing mode, which defines the type of overlay to be added on the map/canvas. Accepted values are MARKER , POLYGON , POLYLINE , RECTANGLE , CIRCLE , INFO , LINE , TRIANGLE , HAND or DELETE . |
setFillColor(color:string) | None | Sets the current fill color for new overlays. |
setFillOpacity(opacity:number) | None | Sets the current fill opacity for new overlays. |
setMap(map:Map) | None | Attaches the DrawingManager object to the specified CoString Map . |
setOptions(options:DrawingManagerOptions) | None | Sets the DrawingManager 's options. |
setStrokeColor(color:string) | None | Sets the current stroke color for new overlays. |
setStrokeOpacity(opacity:number) | None | Sets the current stroke opacity for new overlays. |
setStrokeWeight(weight:number) | None | Sets the current stroke weight in pixels for new overlays. |
zhupiter.CoStr.drawing.DrawingManagerOptions object
Properties
Properties | Type | Description |
---|
continuousDrawing | boolean | If set to false , the frawing mode is changed to HAND operation after drawing a shape. |
coStrDmDiv | DIV | CoString DrawingManaer DIV HTML container |
coStrDrawingControls | array.<ControlType> | The drawing controls that want to be enabled are added into the array. Accepted values are MODES, STROKE, FILL, and WEIGHT. All controls are enabled if this property is not set. |
coStrDrawingModes | ayyay.<OverlayType> | The drawing modes that want to be enabled are added into the array. Accepted values are MARKER, POLYLINE, POLYGON, RECTANGLE, CIRCLE, INFO, LINE, TRIANGLE, HAND, and DELETE. All modes are enabled if this property is not set. |
coStrDrawingMode | OverlayType | Initial selected drawing mode of DrawingManager . Defaults to HAND operation. |
coStrLang | string | The language used in the DrawingManager . Accepted values are 'en': English, 'cht': Tranditional Chinese, 'chs': Simple Chinese |
coStrMap | Map | The CoString Map to which the DrawingManager is attached, which is the Map on which the overlays created will be placed. Required. |
draggable | boolean | If set to true , the user can drag this DrawingManager . Defaults to false . |
fillColor | string | Initial fill color of DrawingManager |
fillOpacity | number | Initial fill opacity of DrawingManager |
strokeColor | string | Initial stroke color of DrawingManager |
strokeOpacity | number | Initial stroke opacity of DrawingManager |
strokeWeight | number | Initial stroke weight of DrawingManager |
zhupiter.CoStr.drawing.OverlayType class
Constant
Constant | Description |
---|
MARKER | Maerker overlay |
POLYLINE | Polyline overlay |
POLYGON | Polygon overlay |
RECTANGLE | Rectenagle overlay |
CIRCLE | Circle overlay |
INFO | InfoWindow Marker overlay |
LINE | Line overlay |
TRIANGLE | Triangle overlay |
HAND | Hand operation |
DELETE | Delete operation |
zhupiter.CoStr.drawing.ControlType class
Constant
Constant | Description |
---|
MODES | DrawingModes control of OverlayType |
STROKE | Stroke control |
FILL | Fill Control |
WEIGHT | Stroke weight control |