Namespace GEarthExtensions#dom
Defined in: extensions.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Contains DOM builder functions (buildXX) and DOM
manipulation/traversal functions.
|
Method Attributes | Method Name and Description |
---|---|
<static> |
GEarthExtensions#dom.buildCamera(point, options)
Creates a new camera object with the given parameters.
|
<static> |
GEarthExtensions#dom.buildDocument(children, options)
Creates a new document with the given parameters.
|
<static> |
GEarthExtensions#dom.buildFolder(children, options)
Creates a new folder with the given parameters.
|
<static> |
GEarthExtensions#dom.buildGroundOverlay(icon, options)
Creates a new ground overlay with the given parameters.
|
<static> |
GEarthExtensions#dom.buildLinearRing(path, options)
Creates a new linear ring geometry with the given parameters.
|
<static> |
GEarthExtensions#dom.buildLineString(path, options)
Creates a new line string geometry with the given parameters.
|
<static> |
GEarthExtensions#dom.buildLineStringPlacemark(lineString, options)
Convenience method to build a linestring placemark.
|
<static> |
GEarthExtensions#dom.buildLink(href, options)
Creates a new link object with the given parameters.
|
<static> |
GEarthExtensions#dom.buildLookAt(point, options)
Creates a new lookat object with the given parameters.
|
<static> |
GEarthExtensions#dom.buildModel(link, options)
Creates a new model geometry with the given parameters.
|
<static> |
GEarthExtensions#dom.buildMultiGeometry(geometries, options)
Creates a new multi-geometry with the given parameters.
|
<static> |
GEarthExtensions#dom.buildNetworkLink(link, options)
Creates a new network link with the given parameters.
|
<static> |
GEarthExtensions#dom.buildPlacemark(options)
Creates a new placemark with the given parameters.
|
<static> |
GEarthExtensions#dom.buildPoint(point, options)
Creates a new point geometry with the given parameters.
|
<static> |
GEarthExtensions#dom.buildPointPlacemark(point, options)
Convenience method to build a point placemark.
|
<static> |
GEarthExtensions#dom.buildPolygon(polygon, options)
Creates a new polygon geometry with the given parameters.
|
<static> |
GEarthExtensions#dom.buildPolygonPlacemark(polygon, options)
Convenience method to build a polygon placemark.
|
<static> |
GEarthExtensions#dom.buildRegion(options)
Creates a new region with the given parameters.
|
<static> |
GEarthExtensions#dom.buildScreenOverlay(icon, options)
Creates a new screen overlay with the given parameters.
|
<static> |
GEarthExtensions#dom.buildStyle(options)
Creates a new style with the given parameters.
|
<static> |
GEarthExtensions#dom.clearFeatures()
Removes all top-level features from the Earth object's DOM.
|
<static> |
GEarthExtensions#dom.computeBounds(object)
Computes the latitude/longitude bounding box for the given object.
|
<static> |
GEarthExtensions#dom.getObjectById(id, options)
Gets the object in the Earth DOM with the given id.
|
<static> |
GEarthExtensions#dom.removeObject(object)
Removes the given object from the Earth object's DOM.
|
<static> |
GEarthExtensions#dom.setVec2(vec2, options)
Sets the given KmlVec2 object to the point defined in the options.
|
<static> |
GEarthExtensions#dom.walk(options)
Walks a KML object, calling a given visit function for each object in
the KML DOM.
|
Namespace Detail
GEarthExtensions#dom
Contains DOM builder functions (buildXX) and DOM
manipulation/traversal functions.
Method Detail
<static>
{KmlCamera}
GEarthExtensions#dom.buildCamera(point, options)
Creates a new camera object with the given parameters.
- Parameters:
- {PointSpec} point Optional
- The point at which to place the camera.
- {Object} options
- The parameters of the camera object to create.
- {PointSpec} options.point
- The point at which to place the camera.
- {Boolean} options.copy Optional, Default: false
- Whether or not to copy parameters from the existing view if they aren't explicitly specified in the options.
- {Number} options.heading Optional
- The camera heading/direction.
- {Number} options.tilt Optional
- The camera tilt.
- {Number} options.range Optional
- The camera roll.
<static>
{KmlDocument}
GEarthExtensions#dom.buildDocument(children, options)
Creates a new document with the given parameters.
- Parameters:
- {KmlFeature[]} children Optional
- The children of this document.
- {Object} options
- The parameters of the document to create.
- {String} options.name Optional
- The name of the feature.
- {Boolean} options.visibility Optional
- Whether or not the feature should be visible.
- {String} options.description Optional
- An HTML description for the feature; may be used as balloon text.
- {KmlFeature[]} options.children Optional
- The children of this document.
<static>
{KmlFolder}
GEarthExtensions#dom.buildFolder(children, options)
Creates a new folder with the given parameters.
- Parameters:
- {KmlFeature[]} children Optional
- The children of this folder.
- {Object} options
- The parameters of the folder to create.
- {String} options.name Optional
- The name of the feature.
- {Boolean} options.visibility Optional
- Whether or not the feature should be visible.
- {String} options.description Optional
- An HTML description for the feature; may be used as balloon text.
- {KmlFeature[]} options.children Optional
- The children of this folder.
<static>
{KmlGroundOverlay}
GEarthExtensions#dom.buildGroundOverlay(icon, options)
Creates a new ground overlay with the given parameters.
- Parameters:
- {String} icon Optional
- The URL of the overlay image.
- {Object} options
- The parameters of the ground overlay to create.
- {String} options.name Optional
- The name of the feature.
- {Boolean} options.visibility Optional
- Whether or not the feature should be visible.
- {String} options.description Optional
- An HTML description for the feature.
- {String} options.color Optional
- A color to apply on the overlay.
- {String} options.icon Optional
- The URL of the overlay image.
- {Number} options.drawOrder Optional
- The drawing order of the overlay; overlays with higher draw orders appear on top of those with lower draw orders.
- {Number} options.altitude Optional
- The altitude of the ground overlay, in meters.
- {KmlAltitudeModeEnum} options.altitudeMode Optional
- The altitude mode of the ground overlay.
- {Object} options.box
- The bounding box for the overlay.
- {Number} options.box.north
- The north latitude for the overlay.
- {Number} options.box.east
- The east longitude for the overlay.
- {Number} options.box.south
- The south latitude for the overlay.
- {Number} options.box.west
- The west longitude for the overlay.
- {Number} options.box.rotation Optional
- The rotation, in degrees, of the overlay.
<static>
{KmlLinearRing}
GEarthExtensions#dom.buildLinearRing(path, options)
Creates a new linear ring geometry with the given parameters.
- Parameters:
- {PathOptions|geo.Path|KmlLinearRing} path Optional
- The path data. Anything that can be passed to the geo.Path constructor. The first coordinate doesn't need to be repeated at the end.
- {Object} options
- The parameters of the linear ring to create.
- {PathOptions|geo.Path|KmlLinearRing} options.path
- The path data. Anything that can be passed to the geo.Path constructor. The first coordinate doesn't need to be repeated at the end.
- {KmlAltitudeModeEnum} options.altitudeMode Optional
- The altitude mode of the geometry.
- {Boolean} options.extrude Optional
- Whether or not the geometry should extrude down to the Earth's surface.
- {Boolean} options.tessellate Optional
- Whether or not the geometry should be tessellated (i.e. contour to the terrain).
<static>
{KmlLineString}
GEarthExtensions#dom.buildLineString(path, options)
Creates a new line string geometry with the given parameters.
- Parameters:
- {PathOptions|geo.Path|KmlLineString} path Optional
- The path data. Anything that can be passed to the geo.Path constructor.
- {Object} options
- The parameters of the line string to create.
- {PathOptions|geo.Path|KmlLineString} options.path
- The path data. Anything that can be passed to the geo.Path constructor.
- {KmlAltitudeModeEnum} options.altitudeMode Optional
- The altitude mode of the geometry.
- {Boolean} options.extrude Optional
- Whether or not the geometry should extrude down to the Earth's surface.
- {Boolean} options.tessellate Optional
- Whether or not the geometry should be tessellated (i.e. contour to the terrain).
<static>
GEarthExtensions#dom.buildLineStringPlacemark(lineString, options)
Convenience method to build a linestring placemark.
- Parameters:
- {LineStringOptions|KmlLineString} lineString
- The line string geometry.
- {Object} options
- The parameters of the placemark to create.
<static>
{KmlLink}
GEarthExtensions#dom.buildLink(href, options)
Creates a new link object with the given parameters.
- Parameters:
- {String} href Optional
- The link href.
- {Object} options
- The link parameters.
- {String} options.href Optional
- The link href.
- {KmlRefreshModeEnum} options.refreshMode Optional
- The link refresh mode.
- {Number} options.refreshInterval Optional
- The link refresh interval, in seconds.
- {KmlViewRefreshModeEnum} options.viewRefreshMode Optional
- The view-based refresh mode.
<static>
{KmlLookAt}
GEarthExtensions#dom.buildLookAt(point, options)
Creates a new lookat object with the given parameters.
- Parameters:
- {PointSpec} point Optional
- The point to look at.
- {Object} options
- The parameters of the lookat object to create.
- {PointSpec} options.point
- The point to look at.
- {Boolean} options.copy Optional, Default: false
- Whether or not to copy parameters from the existing view if they aren't explicitly specified in the options.
- {Number} options.heading Optional
- The lookat heading/direction.
- {Number} options.tilt Optional
- The lookat tilt.
- {Number} options.range Optional
- The range of the camera (distance from the lookat point).
<static>
{KmlModel}
GEarthExtensions#dom.buildModel(link, options)
Creates a new model geometry with the given parameters.
- Parameters:
- {LinkOptions|KmlLink} link Optional
- The remote link this model should use.
- {Object} options
- The parameters of the model to create.
- {LinkOptions|KmlLink} options.link Optional
- The remote link this model should use.
- {KmlAltitudeModeEnum} options.altitudeMode Optional
- The altitude mode of the geometry.
- {PointOptions|geo.Point} options.location Optional
- The location of the model.
- {Number|Number[]} options.scale Optional
- The scale factor of the model, either as a constant scale, or a 3-item array for x, y, and z scale.
- {Object} options.orientation Optional
- The orientation of the model.
- {Number} options.orientation.heading Optional
- The model heading.
- {Number} options.orientation.tilt Optional
- The model tilt.
- {Number} options.orientation.roll Optional
- The model roll.
<static>
{KmlMultiGeometry}
GEarthExtensions#dom.buildMultiGeometry(geometries, options)
Creates a new multi-geometry with the given parameters.
- Parameters:
- {KmlGeometry[]} geometries Optional
- The child geometries.
- {Object} options
- The parameters of the multi-geometry to create.
- {KmlGeometry[]} options.geometries Optional
- The child geometries.
<static>
{KmlNetworkLink}
GEarthExtensions#dom.buildNetworkLink(link, options)
Creates a new network link with the given parameters.
- Parameters:
- {LinkOptions} link Optional
- An object describing the link to use for this network link.
- {Object} options
- The parameters of the network link to create.
- {String} options.name Optional
- The name of the feature.
- {Boolean} options.visibility Optional
- Whether or not the feature should be visible.
- {String} options.description Optional
- An HTML description for the feature; may be used as balloon text.
- {LinkOptions} options.link Optional
- The link to use.
- {Boolean} options.flyToView Optional
- Whether or not to fly to the default view of the network link'd content.
- {Boolean} options.refreshVisibility Optional
- Whether or not a refresh should reset the visibility of child features.
<static>
{KmlPlacemark}
GEarthExtensions#dom.buildPlacemark(options)
Creates a new placemark with the given parameters.
- Parameters:
- {Object} options
- The parameters of the placemark to create.
- {String} options.name Optional
- The name of the feature.
- {Boolean} options.visibility Optional
- Whether or not the feature should be visible.
- {String} options.description Optional
- An HTML description for the feature; may be used as balloon text.
- {PointOptions|KmlPoint} options.point Optional
- A point geometry to use in the placemark.
- {LineStringOptions|KmlLineString} options.lineString Optional
- A line string geometry to use in the placemark.
- {LinearRingOptions|KmlLinearRing} options.linearRing Optional
- A linear ring geometry to use in the placemark.
- {PolygonOptions|KmlPolygon} options.polygon Optional
- A polygon geometry to use in the placemark.
- {ModelOptions|KmlModel} options.model Optional
- A model geometry to use in the placemark.
- {MultiGeometryOptions|KmlMultiGeometry} options.multiGeometry Optional
- A multi-geometry to use in the placemark.
- {KmlGeometry[]} options.geometries Optional
- An array of geometries to add to the placemark.
- {KmlAltitudeModeEnum} options.altitudeMode Optional
- A convenience property for the placemark geometry's altitude mode.
- {String} options.stockIcon Optional
- A convenience property to set the point placemark's icon to a stock icon, e.g. 'paddle/wht-blank'. Stock icons reside under 'http://maps.google.com/mapfiles/kml/...'.
- {StyleOptions|KmlStyleSelector} options.style Optional
- The style to use for this placemark. See also GEarthExtensions.dom.buildStyle.
- {StyleOptions|KmlStyleSelector} options.highlightStyle Optional
- The highlight style to use for this placemark. If this option is used, the style and highlightStyle form a style map.
- {IconStyleOptions} options.icon Optional
- A convenience property to build the point placemark's icon style from the given options.
- {String} options.stockIcon Optional
- A convenience property to set the point placemark's icon to a stock icon, e.g. 'paddle/wht-blank'. Stock icons reside under 'http://maps.google.com/mapfiles/kml/...'.
<static>
{KmlPoint}
GEarthExtensions#dom.buildPoint(point, options)
Creates a new point geometry with the given parameters.
- Parameters:
- {PointOptions|geo.Point|KmlPoint} point Optional
- The point data. Anything that can be passed to the geo.Point constructor.
- {Object} options
- The parameters of the point object to create.
- {PointOptions|geo.Point|KmlPoint} options.point
- The point data. Anything that can be passed to the geo.Point constructor.
- {KmlAltitudeModeEnum} options.altitudeMode Optional
- The altitude mode of the geometry.
- {Boolean} options.extrude Optional
- Whether or not the geometry should extrude down to the Earth's surface.
<static>
GEarthExtensions#dom.buildPointPlacemark(point, options)
Convenience method to build a point placemark.
- Parameters:
- {PointOptions|KmlPoint} point
- The point geometry.
- {Object} options
- The parameters of the placemark to create.
<static>
{KmlPolygon}
GEarthExtensions#dom.buildPolygon(polygon, options)
Creates a new polygon geometry with the given parameters.
- Parameters:
- {PolygonOptions|geo.Polygon|KmlPolygon} polygon Optional
- The polygon data. Anything that can be passed to the geo.Polygon constructor.
- {Object} options
- The parameters of the polygon to create.
- {PolygonOptions|geo.Polygon|KmlPolygon} options.polygon
- The polygon data. Anything that can be passed to the geo.Polygon constructor.
- {KmlAltitudeModeEnum} options.altitudeMode Optional
- The altitude mode of the geometry.
- {Boolean} options.extrude Optional
- Whether or not the geometry should extrude down to the Earth's surface.
- {Boolean} options.tessellate Optional
- Whether or not the geometry should be tessellated (i.e. contour to the terrain).
<static>
GEarthExtensions#dom.buildPolygonPlacemark(polygon, options)
Convenience method to build a polygon placemark.
- Parameters:
- {PolygonOptions|KmlPolygon} polygon
- The polygon geometry.
- {Object} options
- The parameters of the placemark to create.
<static>
{KmlRegion}
GEarthExtensions#dom.buildRegion(options)
Creates a new region with the given parameters.
- Parameters:
- {Object} options
- The parameters of the region to create.
- {String} options.box
- The bounding box of the region, defined by either N/E/S/W, or center+span, and optional altitudes.
- {Number} options.box.north Optional
- The north latitude for the region.
- {Number} options.box.east Optional
- The east longitude for the region.
- {Number} options.box.south Optional
- The south latitude for the region.
- {Number} options.box.west Optional
- The west longitude for the region.
- {PointOptions|geo.Point} options.box.center Optional
- The center point for the region's bounding box.
- {Number|Number[]} options.box.span Optional
- If using center+span region box definition, this is either a number indicating both latitude and longitude span, or a 2-item array defining [latSpan, lngSpan].
- {Number} options.box.minAltitude Optional
- The low altitude for the region.
- {Number} options.box.maxAltitude Optional
- The high altitude for the region.
- {KmlAltitudeModeEnum} options.box.altitudeMode Optional
- The altitude mode of the region, pertaining to min and max altitude.
- {Number[]} options.lod Optional
- An array of values indicating the LOD range for the region. The array can either contain 2 values, i.e. [minLodPixels, maxLodPixels], or 4 values to indicate fade extents, i.e. [minLodPixels, minFadeExtent, maxFadeExtent, maxLodPixels].
<static>
{KmlScreenOverlay}
GEarthExtensions#dom.buildScreenOverlay(icon, options)
Creates a new screen overlay with the given parameters.
- Parameters:
- {String} icon Optional
- The URL of the overlay image.
- {Object} options
- The parameters of the screen overlay to create.
- {String} options.name Optional
- The name of the feature.
- {Boolean} options.visibility Optional
- Whether or not the feature should be visible.
- {String} options.description Optional
- An HTML description for the feature.
- {String} options.color Optional
- A color to apply on the overlay.
- {String} options.icon Optional
- The URL of the overlay image.
- {Number} options.drawOrder Optional
- The drawing order of the overlay; overlays with higher draw orders appear on top of those with lower draw orders.
- {Vec2Src} options.overlayXY Optional
- The registration point in the overlay that will be placed at the given screenXY point and potentially rotated about. This object will be passed to GEarthExtensions#dom.setVec2. The default is the top left of the overlay. Note that the behavior of overlayXY in GEarthExtensions is KML-correct; whereas in the Earth API overlayXY and screenXY are swapped.
- {Vec2Src} options.screenXY
- The position in the plugin window that the screen overlay should appear at. This object will be passed to GEarthExtensions#dom.setVec2. Note that the behavior of overlayXY in GEarthExtensions is KML-correct; whereas in the Earth API overlayXY and screenXY are swapped.
- {Vec2Src} options.size
- The size of the overlay. This object will be passed to GEarthExtensions#dom.setVec2.
- {KmlAltitudeModeEnum} options.altitudeMode Optional
- The altitude mode of the ground overlay.
- {Number} options.rotation Optional
- The rotation of the overlay, in degrees.
<static>
{KmlStyle}
GEarthExtensions#dom.buildStyle(options)
Creates a new style with the given parameters.
- Parameters:
- {Object} options
- The style parameters.
- {String|Object} options.icon Optional
- The icon href or an icon object literal.
- {String} options.icon.href Optional
- The icon href.
- {String} options.icon.stockIcon Optional
- A convenience property to set the icon to a stock icon, e.g. 'paddle/wht-blank'. Stock icons reside under 'http://maps.google.com/mapfiles/kml/...'.
- {Number} options.icon.scale Optional
- The icon scaling factor.
- {ColorSpec} options.icon.color Optional
- The color of the icon.
- {ColorSpec} options.icon.opacity Optional
- The opacity of the icon, between 0.0 and 1.0. This is a convenience property, since opacity can be defined in the color.
- {Vec2Options|KmlVec2} options.icon.hotSpot Optional
- The hot sopt of the icon, as a KmlVec2, or as an options literal to pass to3 GEarthExtensions.dom.setVec2.
- {ColorSpec|Object} options.label Optional
- The label color or a label object literal.
- {Number} options.label.scale Optional
- The label scaling factor.
- {ColorSpec} options.label.color Optional
- The color of the label.
- {ColorSpec} options.icon.opacity Optional
- The opacity of the label, between 0.0 and 1.0. This is a convenience property, since opacity can be defined in the color.
- {ColorSpec|Object} options.line Optional
- The line color or a line object literal.
- {Number} options.line.width Optional
- The line width.
- {ColorSpec} options.line.color Optional
- The line color.
- {ColorSpec} options.icon.opacity Optional
- The opacity of the line, between 0.0 and 1.0. This is a convenience property, since opacity can be defined in the color.
- {ColorSpec|Object} options.poly Optional
- The polygon color or a polygon style object literal.
- {Boolean} options.poly.fill Optional
- Whether or not the polygon will be filled.
- {Boolean} options.poly.outline Optional
- Whether or not the polygon will have an outline.
- {ColorSpec} options.poly.color Optional
- The color of the polygon fill.
- {ColorSpec} options.icon.opacity Optional
- The opacity of the polygon, between 0.0 and 1.0. This is a convenience property, since opacity can be defined in the color.
- {ColorSpec|Object} options.balloon Optional
- The balloon bgColor or a balloon style object literal.
- {Boolean} options.balloon.bgColor Optional
- The balloon background color.
- {Boolean} options.balloon.textColor Optional
- The balloon text color.
- {String} options.balloon.text Optional
- The balloon text template.
<static>
GEarthExtensions#dom.clearFeatures()
Removes all top-level features from the Earth object's DOM.
<static>
{geo.Bounds}
GEarthExtensions#dom.computeBounds(object)
Computes the latitude/longitude bounding box for the given object.
Note that this method walks the object's DOM, so may have poor performance
for large objects.
- Parameters:
- {KmlFeature|KmlGeometry} object
- The feature or geometry whose bounds should be computed.
<static>
GEarthExtensions#dom.getObjectById(id, options)
Gets the object in the Earth DOM with the given id.
- Parameters:
- {String} id
- The id of the object to retrieve.
- {Object} options Optional
- An options literal.
- {Boolean} options.recursive Optional, Default: true
- Whether or not to walk the entire object (true) or just its immediate children (false).
- {KmlObject} options.rootObject Optional
- The root of the KML object hierarchy to search. The default is to search the entire Earth Plugin DOM.
- Returns:
- Returns the object with the given id, or null if it was not found.
<static>
GEarthExtensions#dom.removeObject(object)
Removes the given object from the Earth object's DOM.
- Parameters:
- {KmlObject} object
- The object to remove.
<static>
GEarthExtensions#dom.setVec2(vec2, options)
Sets the given KmlVec2 object to the point defined in the options.
- Parameters:
- {KmlVec2} vec2
- The object to set, for example a screen overlay's screenXY.
- {Object|KmlVec2} options
- The options literal defining the point, or an existing KmlVec2 object to copy.
- {Number|String} options.left Optional
- The left offset, in pixels (i.e. 5), or as a percentage (i.e. '25%').
- {Number|String} options.top Optional
- The top offset, in pixels or a string percentage.
- {Number|String} options.right Optional
- The right offset, in pixels or a string percentage.
- {Number|String} options.bottom Optional
- The bottom offset, in pixels or a string percentage.
- {Number|String} options.width Optional
- A convenience parameter specifying width, only useful for screen overlays, in pixels or a string percentage.
- {Number|String} options.height Optional
- A convenience parameter specifying height, only useful for screen overlays, in pixels or a string percentage.
<static>
GEarthExtensions#dom.walk(options)
Walks a KML object, calling a given visit function for each object in
the KML DOM. The lone argument must be either a visit function or an
options literal.
NOTE: walking the DOM can have pretty poor performance on very large
hierarchies, as first time accesses to KML objects from JavaScript
incur some overhead in the API.
- Parameters:
- {Object} options Optional
- The walk options:
- {Function} options.visitCallback
- The function to call upon visiting a node in the DOM. The 'this' variable in the callback function will be bound to the object being visited. The lone argument passed to this function will be an object literal for the call context. To get the current application-specific call context, use the 'current' property of the context object. To set the context for all child calls, set the 'child' property of the context object.To prevent walking the children of the current object, set the 'walkChildren' property of the context object to false. To stop the walking process altogether, return false in the function.
- {KmlObject} options.rootObject Optional
- The root of the KML object hierarchy to walk. The default is to walk the entire Earth Plugin DOM.
- {Boolean} options.features Optional, Default: true
- Descend into feature containers?
- {Boolean} options.geometries Optional, Default: false
- Descend into geometry containers?
- {Object} options.rootContext Optional
- The application-specific context to pass to the root item.