new polygonFeature(arg) → {geo.webgl.polygonFeature}
- Description:
Create a new instance of webgl.polygonFeature.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
arg |
geo.polygonFeature.spec |
Returns:
Extends
Members
idle
- Description:
Getter for the idle state. Read only.
- Source:
- Inherited From:
Properties:
Name | Type | Description |
---|---|---|
idle |
boolean |
|
Getter for the idle state. Read only.
ready
- Source:
- Inherited From:
Properties:
Name | Type | Description |
---|---|---|
ready |
boolean |
|
Methods
actors() → {Array.<vgl.actor>}
- Description:
List vgl actors.
- Source:
Returns:
The list of actors.
- Type
- Array.<vgl.actor>
addChild(child) → {this}
- Description:
Add a child (or an array of children) to the object.
- Source:
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
child |
geo.object | Array.<geo.object> | A child object or array of child objects. |
Returns:
- Type
- this
addPromise(promise) → {this}
- Description:
Add the promise here and also propagate up the scene tree.
- Source:
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
promise |
Promise | A promise object. |
Returns:
- Type
- this
bin(valopt, actualValueopt) → {number|this}
- Description:
Get/Set bin of the feature. The bin number is used to determine the order of multiple features on the same layer. It has no effect except on the webgl renderer. A negative value hides the feature without stopping interaction with it. Otherwise, features with higher bin numbers are drawn above those with lower bin numbers. If two features have the same bin number, their order relative to one another is indeterminate and may be unstable.
- Source:
- Inherited From:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
val |
number |
<optional> |
The new bin number. If |
actualValue |
boolean |
<optional> |
If truthy and |
Returns:
The current bin number or a reference to this
.
- Type
- number | this
boxSearch(lowerLeft, upperRight, optsopt, gcsopt) → {geo.feature.searchResult}
- Description:
Search for features contained within a rectangular region.
- Source:
- Inherited From:
Parameters:
Name | Type | Attributes | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
lowerLeft |
geo.geoPosition | Lower-left corner. |
|||||||||||
upperRight |
geo.geoPosition | Upper-right corner. |
|||||||||||
opts |
object |
<optional> |
Additional search options. Properties
|
||||||||||
gcs |
string | geo.transform | null |
<optional> |
Input gcs. |
Returns:
An object with a list of features and feature indices that are located at the specified point.
buildTime(valopt) → {geo.timestamp|this}
- Description:
Get/Set timestamp of last time a build happened.
- Source:
- Inherited From:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
val |
geo.timestamp |
<optional> |
The new build timestamp object or |
Returns:
- Type
- geo.timestamp | this
children() → {Array.<geo.object>}
- Description:
Get an array of the child objects.
- Source:
- Inherited From:
Returns:
A copy of the array of child objects.
- Type
- Array.<geo.object>
data(argopt) → {geo.polygonFeature|object}
- Description:
Get/set data.
- Source:
- Inherited From:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
object |
<optional> |
if specified, use this for the data and return the feature. If not specified, return the current data. |
Returns:
- Type
- geo.polygonFeature | object
dataTime(valopt) → {geo.timestamp|this}
- Description:
Get/Set timestamp of data change.
- Source:
- Inherited From:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
val |
geo.timestamp |
<optional> |
The new data timestamp object or |
Returns:
- Type
- geo.timestamp | this
dependentFeatures(argopt) → {Array.<geo.feature>|this}
- Description:
Get/Set a list of dependent features. Dependent features have their visibility changed at the same time as the feature.
- Source:
- Inherited From:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
Array.<geo.feature> |
<optional> |
If specified, the new list of dependent features. Otherwise, return the current list of dependent features. |
Returns:
The current list of dependent features or
a reference to this
.
- Type
- Array.<geo.feature> | this
draw() → {object}
- Description:
Redraw the object.
- Source:
- Inherited From:
Returns:
The results of the superclass draw function.
- Type
- object
featureGcsToDisplay(c) → {geo.screenPosition}
- Description:
Convert from the feature's gcs coordinates to display coordinates.
- Source:
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
c |
geo.geoPosition | The input coordinate to convert. |
Returns:
Display space coordinates.
- Type
- geo.screenPosition
fromPolygonList(poly, optsopt) → {this}
- Description:
Set the data, position accessor, and polygon accessor to use a list of polygons.
- Source:
- Inherited From:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
poly |
geo.polygonList | A list of polygons. |
|
opts |
geo.util.polyop.spec |
<optional> |
Ignored. |
Returns:
- Type
- this
gcs(valopt, nullable) → {string|this}
- Description:
Get/Set the projection of the feature.
- Source:
- Inherited From:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
val |
string |
<optional> <nullable> |
If |
Returns:
A string used by geo.transform
. If the
map interface gcs is in use, that value will be returned. If the gcs
is set, return the current class instance.
- Type
- string | this
geoIsOn(event, handleropt) → {boolean}
- Description:
Report if an event handler is bound to this object.
- Source:
- Inherited From:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
event |
string | Array.<string> | An event or list of events to check. |
|
handler |
function |
<optional> |
A function that might be bound. If
|
Returns:
true if any of the specified events are bound to the specified handler.
- Type
- boolean
geoOff(eventopt, argopt, nullable) → {this}
- Description:
Remove handlers from one event or an array of events. If no event is provided all handlers will be removed.
- Source:
- Inherited From:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
event |
string | Array.<string> |
<optional> |
An event or a list of events from
|
arg |
function | Array.<function()> |
<optional> <nullable> |
A function or array of functions to remove from the events or a falsy value to remove all handlers from the events. |
Returns:
- Type
- this
geoOn(event, handler) → {this}
- Description:
Bind an event handler to this object.
- Source:
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
event |
string | An event from |
handler |
function | A function that is called when |
Returns:
- Type
- this
geoOnce(event, handler) → {function}
- Description:
Bind an event handler to this object that will fire once and then deregister itself.
- Source:
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
event |
string | An event from |
handler |
function | A function that is called when |
Returns:
The actual bound handler. This is a wrapper around the handler that was passed to the function.
- Type
- function
geoTrigger(event, args, childrenOnlyopt) → {this}
- Description:
Trigger an event (or events) on this object and call all handlers.
- Source:
- Inherited From:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
event |
string | The event to trigger. |
|
args |
object | Arbitrary argument to pass to the handler. |
|
childrenOnly |
boolean |
<optional> |
If truthy, only propagate down the tree. |
Returns:
- Type
- this
layer() → {geo.layer}
- Description:
Get the layer referenced by the feature.
- Source:
- Inherited From:
Returns:
The layer associated with the feature.
- Type
- geo.layer
modified() → {object}
- Description:
Update the timestamp to the next global timestamp value. Mark sub-features as modified, too.
- Source:
- Inherited From:
Returns:
The results of the superclass modified function.
- Type
- object
mouseOverOrderClosestBorder(evt)
- Description:
If the selectionAPI is on, then setting
this.geoOn(geo.event.feature.mouseover_order, this.mouseOverOrderClosestBorder)
will make it so that the mouseon events prefer the polygon with the closet border, including hole edges.
- Source:
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
evt |
geo.event | The event; this should be triggered from
|
mouseOverOrderHighestIndex(evt)
- Description:
If the selectionAPI is on, then setting
this.geoOn(geo.event.feature.mouseover_order, this.mouseOverOrderHighestIndex)
will make it so that the mouseon events prefer the highest index feature.
- Source:
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
evt |
geo.event | The event; this should be triggered from
|
onIdle(handler) → {this}
- Description:
Bind a handler that will be called one time when all internal promises are resolved. If there are no outstanding promises, this is invoked synchronously.
- Source:
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
handler |
function | A function taking no arguments. |
Returns:
- Type
- this
parent(argopt) → {this|geo.sceneObject}
- Description:
Get/set parent of the object.
- Source:
- Inherited From:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
geo.sceneObject |
<optional> |
The new parent or |
Returns:
- Type
- this | geo.sceneObject
pointSearch(coordinate, gcsopt) → {object}
- Description:
Point search method for selection api. Returns markers containing the given point.
- Source:
- Inherited From:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
coordinate |
geo.geoPosition | point to search for. |
|
gcs |
string | geo.transform | null |
<optional> |
Input gcs. |
Returns:
An object with index
: a list of polygon indices, and
found
: a list of polygons that contain the specified coordinate.
- Type
- object
polygon(valopt) → {object|function|this}
- Description:
Get/set polygon accessor.
- Source:
- Inherited From:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
val |
object | function |
<optional> |
If not specified, return the current
polygon accessor. If specified, use this for the polygon accessor and
return |
Returns:
The current polygon accessor or this feature.
- Type
- object | function | this
polygonCoordinates() → {Array.<geo.polygonObject>}
- Description:
Get the set of normalized polygon coordinates.
- Source:
- Inherited From:
Returns:
An array of polygon positions. Each has
outer
and inner
if it has any coordinates, or is undefined
.
- Type
- Array.<geo.polygonObject>
polygonSearch(poly, optsopt, gcsopt) → {object}
- Description:
Returns polygons that are contained in the given polygon. This could fail to return polygons that are less than their stroke width outside of the specified polygon and whose vertices are not near the selected polygon.
- Source:
- Inherited From:
Parameters:
Name | Type | Attributes | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
poly |
geo.polygonObject | A polygon as an array of coordinates or an
object with |
|||||||||||
opts |
object |
<optional> |
Additional search options. Properties
|
||||||||||
gcs |
string | geo.transform | null |
<optional> |
Input gcs. |
Returns:
An object with index
: a list of polygon indices,
found
: a list of polygons within the polygon, and extra
: an object
with index keys containing an object with a partial
key and a boolean
value to indicate if the polygon is on the specified polygon's border.
- Type
- object
position(valopt) → {geo.geoPosition|this}
- Description:
Get/Set position accessor.
- Source:
- Inherited From:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
val |
geo.geoPosition | function |
<optional> |
If not specified, return the
current position accessor. If specified, use this for the position
accessor and return |
Returns:
The current position or this feature.
- Type
- geo.geoPosition | this
rdpSimplifyData(data, toleranceopt, posFuncopt, polyFuncopt, returnDataopt) → {this|array}
- Description:
Take a set of data, reduce the number of vertices per polygon using the Ramer–Douglas–Peucker algorithm, and use the result as the new data. This changes the instance's data, the position accessor, and the polygon accessor.
- Source:
- Inherited From:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
data |
array | A new data array. |
||
tolerance |
number |
<optional> |
The maximum variation allowed in map.gcs units. A value of zero will only remove perfectly collinear points. If not specified, this is set to a half display pixel at the map's current zoom level. |
|
posFunc |
function |
<optional> |
this.style.get('position')
|
The function to get the position of each vertex. |
polyFunc |
function |
<optional> |
this.style.get('polygon')
|
The function to get each polygon. |
returnData |
boolean |
<optional> |
false
|
If truthy, return the new data array rather than modifying the feature. |
Returns:
- Type
- this | array
removeChild(child) → {this}
- Description:
Remove a child (or array of children) from the object.
- Source:
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
child |
geo.object | Array.<geo.object> | A child object or array of child objects. |
Returns:
- Type
- this
removePromise(promise) → {this}
- Description:
Remove the promise here and also propagate up the scene tree.
- Source:
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
promise |
Promise | A promise object. |
Returns:
- Type
- this
renderer() → {geo.renderer}
- Description:
Get the renderer used by the feature.
- Source:
- Inherited From:
Returns:
The renderer used to render the feature.
- Type
- geo.renderer
selectionAPI(argopt, directopt) → {boolean|string|this}
- Description:
Get/Set if the selection API is enabled for this feature.
- Source:
- Inherited From:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg |
boolean | string |
<optional> |
|
direct |
boolean |
<optional> |
If |
Returns:
Either the selectionAPI state or the feature instance.
- Type
- boolean | string | this
style(arg1opt, arg2opt) → {object|this}
- Description:
Get/Set style used by the feature. This calls the super function, then checks if strokes are required.
See the style specification
styleSpec
for available styles.
- Source:
- Inherited From:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arg1 |
string | object |
<optional> |
If |
arg2 |
* |
<optional> |
If |
Returns:
Either the entire style object, the value of a specific style, or the current class instance.
- Type
- object | this
style.get(keyopt) → {function|object}
- Description:
A uniform getter that always returns a function even for constant styles. This can also return all defined styles as functions in a single object.
If the style
key
is a color, the returned function will also coerce the result to be ageo.geoColorObject
.
- Source:
- Inherited From:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
key |
string |
<optional> |
If defined, return a function for the named style. Otherwise, return an object with a function for all defined styles. |
Returns:
Either a function for the named style or an object with functions for all defined styles.
- Type
- function | object
timestamp() → {number}
- Description:
Get time.
- Source:
- Inherited From:
Returns:
The timestamp. This is 0 if the timestamp has never been modified.
- Type
- number
toPolygonList(optsopt) → {geo.polygonList}
- Description:
Return the polygons as a polygon list: an array of polygons, each of which is an array of polylines, each of which is an array of points, each of which is a 2-tuple of numbers.
- Source:
- Inherited From:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
opts |
geo.util.polyop.spec |
<optional> |
Ignored. |
Returns:
A list of polygons.
- Type
- geo.polygonList
updateStyleFromArray(keyOrObject, styleArray, refreshopt) → {this}
- Description:
Set style(s) from array(s). For each style, the array should have one value per data item. The values are not converted or validated. Color values should be
geo.geoColorObject
s. If invalid values are given the behavior is undefined. For some feature styles, if the first entry of an array is itself an array, then each entry of the array is expected to be an array, and values are used from these subarrays. This allows a style to apply, for instance, per vertex of a data item rather than per data item.
- Source:
- Inherited From:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
keyOrObject |
string | object | Either the name of a single style or an object where the keys are the names of styles and the values are each arrays. |
||
styleArray |
array | If keyOrObject is a string, an array of values for the style. If keyOrObject is an object, this parameter is ignored. |
||
refresh |
boolean |
<optional> |
false
|
|
Returns:
The feature instance.
- Type
- this
updateTime(valopt) → {geo.timestamp|this}
- Description:
Get/Set timestamp of last time an update happened.
- Source:
- Inherited From:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
val |
geo.timestamp |
<optional> |
The new update timestamp object or
|
Returns:
- Type
- geo.timestamp | this
visible(valopt, directopt) → {boolean|this}
- Description:
Get/Set the visibility of the feature.
- Source:
- Inherited From:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
val |
boolean |
<optional> |
A boolean to change the visibility, or |
direct |
boolean |
<optional> |
If |
Returns:
Either the visibility (if getting) or the feature (if setting).
- Type
- boolean | this
(inner) createGLPolygons(onlyStyle)
- Description:
Create and style the triangles needed to render the polygons.
There are several optimizations to do less work when possible. If only styles have changed, the triangulation is not recomputed, nor is the geometry re-transformed. If styles use static values (rather than functions), they are only calculated once. If a polygon reports that it has a uniform style, then styles are only calculated once for that polygon (the uniform property may be different per polygon or per update). Array.map is slower in Chrome that using a loop, so loops are used in places that would be conceptually served by maps.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
onlyStyle |
boolean | if true, use the existing geometry and just recalculate the style. |