Fusion

declare global namespace object for Fusion library to use

Summary
declare global namespace object for Fusion library to use
A set of utility classes that provide common tools for applications
A set of classes that implement the functionlity required for applications
A class to provide for event handling at application runtime
A set of classes to provide core funtionality
A set of classes that implement layer functionality for various server technologies.
Application scope constants
Initialize the Fusion application.
Initialize the Strings hash with the requested locale.
set the current initialization state of the application.
load any scripts that have been queued for loading.
Insert a new script into the loading queue.
Called when a script fails to load for some reason.
a script has loaded.
check if scripts have loaded.
asynchronously load the application definition.
the server has returned the application configuration file that contains enough information to bootstrap the application.
the server has returned the application configuration file that contains enough information to bootstrap the application.
the application failed to load the application configuration file.
convenience function to issue an XmlHttpRequest to the server relative to the Fusion installation.
trap exceptions produced in handling an ajax response.
Convert XML to JSON using a server-side script for requests that aren’t available in JSON.
Callback method to convert the XNR response into an actual json object and triggers the call to the callback method
return a map widget with the given name
return a map widget that is associated with the given DOM element by id.
return the map widget at the given index if there are more than one map elements specified in the AppDef
return a reference to a widget by the id of the DOM Element that it was created in.
returns the applicaiton’s absolute URL minus the filename.html part
returns the application’s absolute URL minus the filename.html part
returns individual elements out of the Fusion config.json file
Accessor to return the server-side script language
Accessor to return the URL of the redirect script
Accessor to return the broker object (for MapGuide only).
Marks a JavaScript file as required which puts it into the queue for loading during Fusion initialization.
Triggers the Fusion.Event.FUSION_ERROR and passes along the error object to the callback functions registered for this event.
returns index into the units array for the given unit name or abbreviation
imperial, metric, degrees or device units
Given a unit, this method returns the units name
Given a unit, this method returns the units abbreviation
Converts a length value from native units into meters.
Converts a length value from meters into native units.
Converts a length value from one unit system into another.
initializes the meters per unit values when a new map is loaded.
find the OpenLayers units identifier given the Fusion metersPerUnit value
Dynamically load a CSS stylesheet.
An initialization time function to parse the application URL parameters and stores them in an array.
Returns the query parameter value for a given parameter name
{String} Relative path of this script.
Return the path to this script for bootstrapping Fusion.
Pre-create a session to avoid the 401 Unauthorized dialog
The OpenLayers object provides a namespace for all things OpenLayers
{String} Relative path of this script.
Return the path to this script.
This is the old $() from prototype
Remove an object from an array.
Deprecated.
Seems to exist already in FF, but not in MOZ.
Modifies many properties of a DOM element all at once.
Creates a new div and optionally set some standard attributes.
Creates an img element with specific attribute values.
Deprecated.
Bound to image load events.
{String} The color tiles with load errors will turn.
{Integer} How many times should we try to reload an image before giving up? 
{Boolean} true if the png alpha hack is necessary and possible, false otherwise.
Checks whether it’s necessary (and possible) to use the png alpha hack which allows alpha transparency for png images under Internet Explorer.
Creates a new hashtable and copies over all the keys from the passed-in object, but storing them under an uppercased version of the key at which they were stored.
Takes an object and copies any properties that don’t exist from another properties, by analogy with OpenLayers.Util.extend() from Prototype.js.
{String} Default is ‘’.
{String} The fully formatted image location string
Execute functions until one of them doesn’t throw an error.
These could/should be made namespace aware?
{Number} The number of significant digits to retain to avoid floating point precision errors.
Convenience method to cast an object to a Number, rounded to the desired floating point precision.
Given two objects representing points with geographic coordinates, this calculates the distance between those points on the surface of an ellipsoid.
Parse the parameters from a URL or from the current page itself into a JavaScript Object.
Deprecated.
{Integer} The ever-incrementing count variable.
Create a unique identifier for this session.
{Object} Constant inches per unit -- borrowed from MapServer mapscale.c derivation of nautical miles from http://en.wikipedia.org/wiki/Nautical_mile Includes the full set of units supported by CS-MAP (http://trac.osgeo.org/csmap/) and PROJ.4 (http://trac.osgeo.org/proj/) The hardcoded table is maintain in a CS-MAP source code module named CSdataU.c The hardcoded table of PROJ.4 units are in pj_units.c.
{Integer} 72 (A sensible default)
Deprecated.
Calculates the position of an element on the page.
Test two URLs for equivalence.
Takes a url and removes everything after the ?
{String} A string which specifies which is the current browser in which we are running.
Renders the contentHTML offscreen to determine actual dimensions for popup sizing.
The OpenLayers.Console namespace is used for debugging and error logging.
OpenLayers custom string, number and function functions are described here.
Contains convenience functions for string manipulation.
Used to find tokens in a string.
Used to test strings as numbers.
Contains convenience functions for manipulating numbers.
Decimal separator to use when formatting numbers.
Thousands separator to use when formatting numbers.
Contains convenience functions for function manipulation.
Contains convenience functions for array manipulation.
Base class used to construct all other classes.
Deprecated.
Instances of this class represent a width/height pair
Create an instance of OpenLayers.Size
Return the string representation of a size object
Instances of this class represent bounding boxes.
{Number} Minimum horizontal coordinate.
{Number} Minimum vertical coordinate.
{Number} Maximum horizontal coordinate.
{Number} Maximum vertical coordinate.
{OpenLayers.LonLat} A cached center location.
Construct a new bounds object.
Create a cloned instance of this bounds.
Test a two bounds for equivalence.
Scales the bounds around a pixel or lonlat.
Get the opposite quadrant for a given quadrant string.
Tests if an element has the given CSS class name.
Add a CSS class name to an element.
Remove a CSS class name from an element.
Remove a CSS class name from an element if it exists.
This class represents a longitude and latitude pair
Create a new map location.
Return a readable string version of the lonlat
Alternative constructor that builds a new OpenLayers.LonLat from a parameter string
This class represents a screen coordinate, in x and y coordinates
Create a new OpenLayers.Pixel instance
Cast this object into a string
The icon represents a graphical icon on the screen.
{String} image url
{OpenLayers.Pixel} distance in pixels to offset the image when being rendered
{OpenLayers.Pixel} Function to calculate the offset (based on the size)
{DOMElement}
Creates an icon, which is an image tag in a div.
Nullify references and remove event listeners to prevent circular references and memory leaks
{OpenLayers.Icon} A fresh copy of the icon.
Move the div to the given pixel.
Erase the underlying image element.
Change the icon’s opacity
move icon to passed in px.
Hide or show the icon
A popup is a small div that can opened and closed on the map.
{OpenLayers.Events} custom event manager
{String} the unique identifier assigned to this popup.
{OpenLayers.LonLat} the position of this popup on the map
{DOMElement} the div that contains this popup.
{OpenLayers.Size} the width and height of the content.
{OpenLayers.Size} the width and height of the popup.
{String} An HTML string for this popup to display.
{String} the background color used by the popup.
{float} the opacity of this popup (between 0.0 and 1.0)
{String} the border size of the popup.
{DOMElement} a reference to the element that holds the content of the div.
{DOMElement} First and only child of ‘div’.
{DOMElement} the optional closer image
{String} The CSS class of the popup.
{String} The CSS class of the popup content div.
{int or OpenLayers.Bounds} An extra opportunity to specify internal padding of the content div inside the popup.
{Boolean} The hack for overflow in Firefox causes all elements to be re-drawn, which causes Flash elements to be re-initialized, which is troublesome.
To be removed in 3.0, this function merely helps us to deal with the case where the user may have set an integer value for padding, instead of an OpenLayers.Bounds object.
{OpenLayers.Map} this gets set in Map.js when the popup is added to the map
Create a popup.
nullify references to prevent circular references and memory leaks
Constructs the elements that make up the popup.
if the popup has a lonlat and its map members set, then have it move itself to its proper position
{Boolean} Boolean indicating whether or not the popup is visible
Toggles visibility of the popup.
Makes the popup visible.
Makes the popup invisible.
Used to adjust the size of the popup.
Sets the background color of the popup.
Sets the opacity of the popup.
Sets the border style of the popup.
Allows the user to set the HTML content of the popup.
Called when an image contained by the popup loaded.
Glorious, oh glorious hack in order to determine the css ‘padding’ of the contentDiv.
Pans the map such that the popup is totaly viewable (if necessary)
Registers events on the popup.
When mouse goes down within the popup, make a note of it locally, and then do not propagate the mousedown (but do so safely so that user can select text inside)
If the drag was started within the popup, then do not propagate the mousemove (but do so safely so that user can select text inside)
When mouse comes up within the popup, after going down in it, reset the flag, and then (once again) do not propagate the event, but do so safely so that user can select text inside
Ignore clicks, but allowing default browser handling
When mouse goes out of the popup set the flag to false so that if they let go and then drag back in, we won’t be confused.
Ignore double-clicks, but allowing default browser handling
Abstract vector layer protocol class.
{OpenLayers.Format} The format used by this protocol.
{Object} Any options sent to the constructor.
{Boolean} The creator of the protocol can set autoDestroy to false to fully control when the protocol is destroyed.
Abstract class for vector protocols.
Abort an ongoing request.
Protocols return Response objects to their users.
{String} The type of request this response corresponds to.
{Array({OpenLayers.Feature.Vector})} or {OpenLayers.Feature.Vector} The features returned in the response by the server.
{Array({OpenLayers.Feature.Vector})} or {OpenLayers.Feature.Vector} The features provided by the user and placed in the request by the protocol.
This is the base class for all renderers.
{DOMElement}
{DOMElement}
{Boolean} If the renderer is currently in a state where many things are changing, the ‘locked’ property is set to true.
{Float} cache of current map resolution
{OpenLayers.Map} Reference to the map -- this is set in Vector’s setMap()
Set the visible part of the layer.
Sets the size of the drawing surface.
Uses cached copy of resolution if available to minimize computing
Draw the feature.
Draw a geometry.
Function for drawing text labels.
Function for removing text labels.
Clear all vectors from the renderer.
Returns a feature id from an event on the renderer.
This is called by the layer to erase features
Remove a geometry from the renderer (by id).
moves this renderer’s root to a (different) renderer.
Gets the layer that this renderer’s output appears on.
Abstract vector layer strategy class.
{OpenLayers.Layer.Vector} The layer this strategy belongs to.
{Object} Any options sent to the constructor.
{Boolean} The control is active.
{Boolean} The creator of the strategy can set autoActivate to false to fully control when the protocol is activated and deactivated.
{Boolean} The creator of the strategy can set autoDestroy to false to fully control when the strategy is destroyed.
Abstract class for vector strategies.
Called to set the layer property.
Activate the strategy.
Deactivate the strategy.
Controls affect the display or behavior of the map.
{String}
{OpenLayers.Map} this gets set in the addControl() function in OpenLayers.Map
{DOMElement}
{OpenLayers.Control.TYPES} Controls can have a ‘type’.
{Boolean} By deafault, controls do not allow selection, because it may interfere with map dragging.
{string} This property is used for CSS related to the drawing of the Control.
{string} This property is used for showing a tooltip over the Control.
{Boolean} The control is active.
{OpenLayers.Events} Events instance for triggering control specific events.
{Array(String)} Supported application event types.
Create an OpenLayers Control.
The destroy method is used to perform any clean up before the control is dereferenced.
Set the map property for the control.
The draw method is called when the control is ready to be displayed on the page.
Sets the left and top style attributes to the passed in pixel coordinates.
Explicitly activates a control and it’s associated handler if one has been set.
Deactivates a control and it’s associated handler if any.
Internationalization namespace.
{String} Current language code to use in OpenLayers.
Since the popup is moving to a new px, it might need also to be moved relative to where the marker is.
The popup has been moved to a new relative location, so we may want to make some cosmetic adjustments to it.
A renderer based on the 2D ‘canvas’ drawing element.element
{Canvas} The canvas context object.
{Object} Internal object of feature/style pairs for use in redrawing the layer.
{Object} Geometry -> Feature lookup table.
Erase a geometry from the renderer.
Set the visible part of the layer.
Sets the size of the drawing surface.
Draw the feature.
Used when looping (in redraw) over the features; draws the canvas.
Called to draw External graphics.
Prepare the canvas for drawing by setting various global settings.
This method is only called by the renderer itself.
This method is only called by the renderer itself.
This method is only called by the renderer itself.
This method is only called by the renderer itself.
This method is only called by the renderer itself.
transform geographic xy into pixel xy
Clear all vectors from the renderer.
Returns a feature id from an event on the renderer.
This is called by the layer to erase features; removes the feature from the list, then redraws the layer.
The real ‘meat’ of the function: any time things have changed, redraw() can be called to loop over all the data and (you guessed it) redraw it.
{Object}
This class takes care of figuring out which order elements should be placed in the DOM based on given indexing methods.
{Integer} This is the largest-most z-index value for a node contained within the indexer.
{Array<String>} This is an array of node id’s stored in the order that they should show up on screen.
{Object} This is a hash that maps node ids to their z-index value stored in the indexer.
{Function} This is the function used to determine placement of of a new node within the indexer.
Determine the z-index for the current node if there isn’t one, and set the maximum value if we’ve found a new maximum.
These are the compare methods for figuring out where a new node should be placed within the indexer.
This compare method is used by other comparison methods.
This is another virtual class in that it should never be instantiated by itself as a Renderer.
{DOMElement}
{DOMElement}
{DOMElement}
{DOMElement}
{String}
{<OpenLayers.ElementIndexer>} An instance of OpenLayers.ElementsIndexer created upon initialization if the zIndexing or yOrdering options passed to this renderer’s constructor are set to true.
{String}
{String}
{Object}
Remove all the elements from the root
This function is in charge of asking the specific renderer which type of node to create for the given geometry and style.
Draw the geometry, creating new nodes, setting paths, setting style, setting featureId on the node.
Redraws the node using special ‘background’ style properties.
Given a node, draw a geometry on the specified layer.
Things that have do be done after the geometry node is appended to its parent node.
Virtual function for drawing Point Geometry.
Virtual function for drawing LineString Geometry.
Virtual function for drawing LinearRing Geometry.
Virtual function for drawing Polygon Geometry.
Virtual function for drawing Rectangle Geometry.
Virtual function for drawing Circle Geometry.
Virtual function for drawing Surface Geometry.
Removes a label
Erase a geometry from the renderer.
Create new node of the specified type, with the (optional) specified id.
moves this renderer’s root to a different renderer.
Gets the layer that this renderer’s output appears on.
Determines if a symbol cannot be rendered using drawCircle
Coordinate arrays for well known (named) symbols.
A simple strategy that requests features once and never requests new data.
Create a new Fixed strategy.
Activate the strategy: load data or add listener to load when visible
Deactivate the strategy.
Tells protocol to load data and unhooks the visibilitychanged event
Add all features to the layer.
{int} Interval in milliseconds between 2 steps
{int} Step counter
{int} Interval id returned by window.setInterval
{Boolean} Tells if the easing is currently playing
Creates a Tween.
Calls the appropriate easing method
Easing Equations by Robert Penner, http://www.robertpenner.com/easing/
The ArgParser control adds location bar querystring parsing functionality to an OpenLayers Map.
Set the map property for the control.
As soon as a baseLayer has been loaded, we center and zoom ...and remove the handler.
As soon as all the layers are loaded, cycle through them and hide or show them.
The PanZoom is a visible control, composed of a <OpenLayers.Control.PanPanel> and a <OpenLayers.Control.ZoomPanel>.
{Array(DOMElement)} Array of Button Divs
{Integer}
{Integer}
The ScaleLine displays a small line indicator representing the current map scale on the map.
{Integer} Maximum width of the scale line in pixels.
{String} Units for zoomed out on top bar.
{String} Units for zoomed in on top bar.
{String} Units for zoomed out on bottom bar.
{String} Units for zoomed in on bottom bar.
{DOMElement}
{DOMElement}
Create a new scale line control.
{DOMElement}
Given a number, round it down to the nearest 1,2,5 times a power of 10.
Update the size of the bars, and the labels they contain.
Utility functions for event handling.
{Object} A hashtable cache of the event observers.
{int}
{int}
{int}
{int}
{int}
{int}
{int}
{int}
{int}
Cross browser event element detection.
Determine whether event was caused by a left click.
Determine whether event was caused by a right mouse click.
Stops an event from propagating.
Given the id of an element to stop observing, cycle through the element’s cached observers, calling stopObserving on each one, skipping those entries which can no longer be removed.
Cycle through all the element entries in the events cache and call stopObservingElement on each.
{Array(String)} supported events
{Object} Hashtable of Array(Function): events listener functions
{Object} the code object issuing application events
{DOMElement} the DOM element receiving browser events
{Array(String)} list of support application events
{Function} bound event handler attached to elements
A version of <clearMouseCache> that is bound to this instance so that it can be used with OpenLayers.Event.observe and OpenLayers.Event.stopObserving.
Construct an OpenLayers.Events object.
Convenience method for registering listeners with a common scope.
Convenience method for unregistering listeners with a common scope.
Remove all listeners for a given event type.
Basically just a wrapper to the triggerEvent() function, but takes care to set a property ‘xy’ on the event with the current mouse position.
Base class for format reading/writing a variety of formats.
{Object} A reference to options passed to the constructor.
Instances of this class are not useful.
Read data from a string, and return an object whose type depends on the subclass.
Accept an object, and return a string.
Dictionary for English.
{Boolean} Has the popup been rounded yet?
The popup has been moved to a new relative location, in which case we will want to re-do the rico corners.
Always sets border to 0.
Update RICO corners according to the popup’s current relative postion.
{String} The proper corners string (“tr tl bl br”) for rico to round.
{Integer} 5.
Class for coordinate transforms between coordinate systems.
{Object} Proj4js.Proj instance.
{String}
This class offers several methods for interacting with a wrapped pro4js projection object.
Convert projection to string (getCode wrapper).
Test equality of two projection instances.
Destroy projection object.
Transforms is an object, with from properties, each of which may have a to property.
{String}
{String}
{Integer} Firefox has a limitation where values larger or smaller than about 15000 in an SVG document lock the browser up.
{Object} Hash with “x” and “y” properties
{Object} Cache for symbol sizes according to their svg coordinate space
{Boolean}
See #669 for more information
Transforms the SVG coordinate system
Sets the size of the drawing surface.
Use to set all the style attributes to a SVG node.
{DOMElement} The specific render engine’s root element
{DOMElement} The element to which we’ll add the symbol definitions
This method is only called by the renderer itself.
This method is only called by the renderer itself.
This method is only called by the renderer itself.
This method is only called by the renderer itself.
This method is only called by the renderer itself.
This method is only called by the renderer itself.
This method is only called by the renderer itself.
This method is only called by the renderer itself.
Given two points (one inside the valid range, and one outside), clips the line betweeen the two points so that the new points are both inside the valid range.
Finds the position of an svg node.
add a new symbol definition from the rendererer’s symbol hash
{Object}
{Object}
Render vector features in browsers with VML capability.
{String} XML Namespace URN
{DOMElement} node holding symbols.
{Object} Hash with “x” and “y” properties
Create a new VML renderer.
Set the renderer’s extent
Set the size of the drawing surface
Get the node type for a geometry and style
Use to set all the style attributes to a VML node.
If a point is to be styled with externalGraphic and rotation, VML fills cannot be used to display the graphic, because rotation of graphic fills is not supported by the VML implementation of Internet Explorer.
Some versions of Internet Explorer seem to be unable to set fillcolor and strokecolor to “none” correctly before the fill node is appended to a visible vml node.
Get the geometry’s bounds, convert it to our vml coordinate system, then set the node’s position, size, and local coordinate system.
Create a new node
Determine whether a node is of a given type
Create the renderer root
Create the main root element
Render a point
Render a circle.
Render a linestring.
Render a linearring
Render a line.
Render a polygon
Render a rectangle
This method is only called by the renderer itself.
moves this renderer’s root to a different renderer.
add a new symbol definition from the rendererer’s symbol hash
{Object}
This is a class designed to designate a single tile, however it is explicitly designed to do relatively little.
{Array(String)} Supported application event types
{String} null
{OpenLayers.Layer} layer the tile is attached to
{String} url of the request.
{OpenLayers.Pixel} Top Left pixel of the tile
{Boolean} Is the tile loading?
Constructor for a new OpenLayers.Tile instance.
Call immediately before destroying if you are listening to tile events, so that counters are properly handled if tile is still loading at destroy-time.
Clear whatever is currently in the tile, then return whether or not it should actually be re-drawn.
Reposition the tile.
Clear the tile of any bounds/position-related data so that it can be reused in a new location.
Take the pixel locations of the corner of the tile, and pass them to the base layer and ask for the location of those pixels, so that displaying tiles over Google works fine.
Show the tile only if it should be drawn.
Show the tile.
Hide the tile.
Read and write XML.
{Object} Mapping of namespace aliases to namespace URIs.
{Object} Mapping of namespace URI to namespace alias.
{String} The default namespace alias for creating element nodes.
Contains public functions, grouped by namespace prefix, that will be applied when a namespaced node is found matching the function name.
As a compliment to the readers property, this structure contains public writing functions grouped by namespace alias and named like the node names they produce.
{XMLDom} If this browser uses ActiveX, this will be set to a XMLDOM object.
Construct an XML parser.
Set a namespace alias and URI for the format.
Shorthand for creating namespaced elements with optional attributes and child text nodes.
Set multiple attributes given key value pairs from an object.
Shorthand for applying one of the named readers given the node namespace and local name.
Shorthand for applying the named readers to all children of a node.
Shorthand for applying one of the named writers and appending the results to a node.
Return this node or the next element node.
Base class to construct a higher-level handler for event sequences.
{String}
{Boolean}
{Event} This property references the last event handled by the handler.
Construct a handler.
Check the keyMask on the handler.
Trigger the control’s named callback with the given arguments
register an event on the map
unregister an event from the map
With each registered browser event, the handler sets its own evt property.
Deconstruct the handler.
If set as the <keyMask>, checkModifiers returns false if any key is down.
If set as the <keyMask>, checkModifiers returns false if Shift is down.
If set as the <keyMask>, checkModifiers returns false if Ctrl is down.
If set as the <keyMask>, checkModifiers returns false if Alt is down.
Instances of OpenLayers.Map are interactive maps embedded in a web page.
{Object} Base z-indexes for different classes of thing
{Array(String)} Supported application event types.
{String} Unique identifier for the map
{Boolean} For a base layer that supports it, allow the map resolution to be set to a value between one of the values in the resolutions array.
<maxResolution> auto.
{Boolean} The map is currently being dragged.
{OpenLayers.Size} Size of the main div (this.div)
{HTMLDivElement} The element that represents the map viewport
{OpenLayers.LonLat} The lonlat at which the later container was re-initialized (on-zoom)
{HTMLDivElement} The element that contains the layers.
{Array(OpenLayers.Control)} List of controls associated with the map.
{Array(OpenLayers.Popup)} List of popups associated with the map
{OpenLayers.LonLat} The current center of the map
{Float} The resolution of the map.
{Integer} The current zoom level of the map
{Float} The ratio of the current extent within which panning will tween.
{String} Used to store a unique identifier that changes when the map view changes.
{OpenLayers.Tween} Animated panning tween object, see panTo()
{Integer} The number of steps to be passed to the OpenLayers.Tween.start() method when the map is panned.
{OpenLayers.Bounds} Outside margin of the popup.
Constructor for a new OpenLayers.Map instance.
Function that is called to destroy the map on page unload.
When the map is destroyed, we need to stop listening to updateSize events: this method stores the function we need to unregister in non-IE browsers.
Reset each layer’s z-index based on layer’s array index
{OpenLayers.Size} A new OpenLayers.Size object with the dimensions of the map div
This function takes care to recenter the layerContainerDiv.
{Integer} 256 Default tile width (unless otherwise specified)
{Integer} 256 Default tile height (unless otherwise specified)
Instances of OpenLayers.Marker are a combination of a OpenLayers.LonLat and an OpenLayers.Icon.
{OpenLayers.Icon} The icon used by this marker.
{OpenLayers.LonLat} location of object
{OpenLayers.Events} the event handler.
{OpenLayers.Map} the map this marker is attached to
Calls draw on the icon, and returns that output.
Erases any drawn elements for this marker.
Move the marker to the new location.
{Boolean} Whether or not the marker is currently visible on screen.
Englarges the markers icon by the specified ratio.
Change the opacity of the marker by changin the opacity of its icon
Change URL of the Icon Image.
Hide or show the icon
Creates a default OpenLayers.Icon.
The OpenLayers.Request namespace contains convenience methods for working with XMLHttpRequests.
{Object} Default configuration for all requests.
Instances of OpenLayers.Tile.Image are used to manage the image tiles used by various layers.
{String} The URL of the image being requested.
{DOMElement} The div element which wraps the image.
{DOMElement} The image element is appended to the frame.
{Boolean} True if the png alpha hack needs to be applied on the layer’s div.
{Boolean} Is this tile a back buffer tile?
{Float} Used in transition code only.
{Boolean} Is this the first time the tile is being drawn? 
{OpenLayers.Tile} A clone of the tile used to create transition effects when the tile is moved or changes resolution.
Constructor for a new OpenLayers.Tile.Image instance.
Check that a tile should be drawn, and draw it.
Triggered by two different events, layer loadend, and tile loadend.
Internal function to actually initialize the image tile, position it correctly, and set its url.
Using the properties currenty set on the layer, position the tile correctly.
Clear the tile of any bounds/position-related data so that it can be reused in a new location.
Creates the imgDiv property on the tile.
Make sure that the image that just loaded is the one this tile is meant to display, since panning/zooming might have changed the tile’s URL in the meantime.
This method is invoked on tiles that are backBuffers for tiles in the grid.
Show the tile by showing its frame.
Hide the tile by hiding its frame.
The OverMap control creates a small overview map, useful to display the extent of a zoomed map and your main map and provide additional navigation options to the User.
{DOMElement} The DOM element that contains the overview map
{Object}
{Object}
Create a new overview map
Render the control in the browser.
Handle extent rectangle drag
Handle browser events
Unhide the control.
Hide all the contents of the control, shrink the size, add the maximize icon
Hide/Show the toggle depending on whether the control is minimized
Update the overview map after layers move.
Determines if the overview map is suitable given the extent and resolution of the main map.
Construct the map that this control contains
Updates the extent rectangle position and size to match the map extent
Updates the map extent to match the extent rectangle position and size
Set extent rectangle pixel bounds.
Get the rect bounds from the map bounds.
Get the map bounds from the rect bounds.
Get a map location from a pixel location
Get a pixel location from a map location
Features are combinations of geography and attributes.
{String}
{Object}
Constructor for features.
nullify references to prevent circular references and memory leaks
{Boolean} Whether or not the feature is currently visible on screen (based on its ‘lonlat’ property)
Based on the data associated with the Feature, create and return a marker object.
Destroys marker.
Creates a popup object created from the ‘lonlat’, ‘popupSize’, and ‘popupContentHTML’ properties set in this.data.
Destroys the popup created via createPopup.
A handler for mouse clicks.
{Number} The id of the timeout waiting to clear the delayedCall.
{OpenLayers.Pixel} The pixel location of the last mousedown.
{Number} The id of the right mouse timeout waiting to clear the <delayedEvent>.
Create a new click handler.
Handle mousedown.
Handle mouseup.
Handle rightclick.
Sets rightclickTimerId to null.
Handle dblclick.
Handle click.
Determine whether the event is within the optional pixel tolerance.
Clear the timer and set timerId to null.
Sets timerId to null.
The drag handler is used to deal with sequences of browser events related to dragging.
{Boolean} When a mousedown event is received, we want to record it, but not set ‘dragging’ until the mouse moves after starting.
{Boolean} Stop propagation of mousedown events from getting to listeners on the same element.
{Boolean}
{OpenLayers.Pixel} The last pixel location of the drag.
{OpenLayers.Pixel} The first pixel location of the drag.
{Function}
{Integer} In order to increase performance, an interval (in milliseconds) can be set to reduce the number of drag events called.
{String} The id of the timeout used for the mousedown interval.
Returns OpenLayers.Handler.Drag
This method is called during the handling of the mouse down event.
This method is called during the handling of the mouse move event.
This method is called during the handling of the mouse up event.
This method is called during the handling of the mouse out event.
Handle mousedown events
Handle mousemove events
Private.
Handle mouseup events
Handle mouseout events
The drag handler captures the click event.
Activate the handler.
Deactivate the handler.
Handler to respond to mouse events related to a drawn feature.
{Object} A object mapping the browser events to objects with callback keys for in and out.
{OpenLayers.Feature.Vector} The last feature that was hovered.
{OpenLayers.Feature.Vector} The last feature that was handled.
{OpenLayers.Pixel} The location of the last mousedown.
{OpenLayers.Pixel} The location of the last mouseup.
{Number} The number of pixels the mouse can move between mousedown and mouseup for the event to still be considered a click.
To restrict dragging to a limited set of geometry types, send a list of strings corresponding to the geometry class names.
{Boolean} If stopClick is set to true, handled clicks do not propagate to other click listeners.
{Boolean} If stopDown is set to true, handled mousedowns do not propagate to other mousedown listeners.
{Boolean} If stopUp is set to true, handled mouseups do not propagate to other mouseup listeners.
Handle mouse down.
Handle mouse up.
Handle click.
Handle mouse moves.
Handle dblclick.
Return true if the geometry type of the passed feature matches one of the geometry types in the geometryTypes array.
Call the callback keyed in the event map with the supplied arguments.
Turn on the handler.
Turn off the handler.
Moves the layer for this handler to the top, so mouse events can reach it.
Moves the layer back to the position determined by the map’s layers array.
The hover handler is to be used to emulate mouseovers on objects on the map that aren’t DOM elements.
Construct a hover handler.
Called when the mouse moves on the map.
Called when the mouse goes out of the map.
Determine whether the mouse move is within the optional pixel tolerance.
Clear the timer and set timerId to null.
Triggers pause callback.
Handler for wheel up/down events.
{function}
{OpenLayers.Pixel} mousePosition is necessary because evt.clientX/Y is buggy in Moz on wheel events, so we cache and use the value from the last mousemove.
Catch the wheel event and handle it xbrowserly
Given the wheel event, we carry out the appropriate zooming in or out, based on the ‘wheelDelta’ or ‘detail’ property of the event.
Update the stored mousePosition on every move.
{Float} The layer’s opacity.
{Array(String)} Supported application event types.
{Boolean} The layer’s images have an alpha channel.
{Boolean} The current map resolution is within the layer’s min/max range.
{OpenLayers.Pixel} For layers with a gutter, the image offset represents displacement due to the gutter.
{Object} An optional object whose properties will be set on the layer.
{Array} An immutable (that means don’t change it!)
Destroy is a destructor: this is to alleviate cyclic references which the Javascript garbage cleaner can not take care of on its own.
Set the map property for the layer.
Called at the end of the map.addLayer sequence.
This method’s responsibility is to set up the ‘resolutions’ array for the layer -- this array is what the layer will use to interface between the zoom levels of the map and the resolution display of the layer.
Calculates the max extent which includes all of the data for the layer.
{Integer} the z-index of this layer
This function will take a bounds, and if wrapDateLine option is set on the layer, it will return a bounds which is wrapped around the world.
{DOMElement}
Allow the user to change the box’s color and border width
{Boolean} Whether or not the marker is currently visible on screen.
Hide or show the icon
Standard-compliant (W3C) cross-browser implementation of the XMLHttpRequest object.
@param {} request
Parse XML into a doc structure
{Object} Transport mechanism for whichever browser we’re in, or false if none available.
{Integer}
{Object}
{Array}
Deprecated.
{Boolean}
{Boolean} -
If the optional onException function is set, execute it and then dispatch the call to any other listener registered for onException.
{Array(String)}
{Integer}
{String}
Wrapper function around XMLSerializer, which doesn’t exist/work in IE/Safari.
The DragPan control pans the map with a drag of the mouse.
{OpenLayers.Control.TYPES}
{Boolean} The map moved.
{Integer} The number of milliseconds that should ellapse before panning the map again.
Creates a Drag handler, using panMap and panMapDone as callbacks.
Finish the panning operation.
Vector features use the OpenLayers.Geometry classes as geometry description.
{String}
{OpenLayers.Bounds} The box bounding that feature’s geometry, that property can be set by an OpenLayers.Format object when deserializing the feature, so in most cases it represents an information set by the server.
{String}
{String} rendering intent currently being used
Create a vector feature.
nullify references to prevent circular references and memory leaks
Create a clone of this vector feature.
Determine whether the feature is within the map viewport.
Determins whether the feature intersects with the specified location.
Moves the feature and redraws it at its new location
Sets the new state
OpenLayers features can have a number of style attributes.
Handler for dragging a rectangle across the map.
{Object} Caches some box characteristics from css.
Remove the zoombox from the screen and nullify our reference to it.
Determines offset and box model for a box.
Handler to draw a regular polygon on the map.
{Float} The angle from the origin (mouse down) to the current mouse position, in radians.
{Boolean} The polygon has a fixed radius.
{OpenLayers.Feature.Vector} The currently drawn polygon feature
{OpenLayers.Layer.Vector} The temporary drawing layer
{OpenLayers.Geometry.Point} Location of the first mouse down
Create a new regular polygon handler.
Start drawing a new feature
Respond to drag move events
Finish drawing the feature
Finish drawing the feature.
Create the new polygon geometry.
Modify the polygon geometry in place.
Calculate the angle based on settings.
Finish the geometry and call the “done” callback.
Trigger the control’s named callback with the given arguments
Base class for 3rd party layers.
{Boolean} EventPaned layers are always base layers, by necessity.
{DOMElement} A reference to the element that controls the events.
{Object} This is the object which will be used to load the 3rd party library in the case of the google layer, this will be of type GMap, in the case of the ve layer, this will be of type VEMap
Create a new event pane layer
Set the map property for the layer.
If we can’t load the map lib, then display an error message to the user and tell them where to go for help.
To be implemented by subclasses.
Set the display on the pane
Set the z-index order for the pane.
Handle calls to move the layer.
Get a map location from a pixel location
Get a pixel location from a map location
Get an OL style map location from a 3rd party style map location
Get a 3rd party map location from an OL map location.
Get an OL pixel location from a 3rd party pixel location.
Get a 3rd party pixel location from an OL pixel location
Some Layers will already have established zoom levels (like google or ve).
Create a new fixed zoom levels layer.
Populate the resolutions array
Get the zoom level for a given resolution
Get the OL zoom index from the map object zoom level
Get the map object zoom level from the OL zoom level
{Float} Used to hash URL param strings for multi-WMS server selection.
{Array(String) or String} This is either an array of url strings or a single url string.
{Object} Hashtable of key/value parameters
selectUrl() implements the standard floating-point multiplicative hash function described by Knuth, and hashes the contents of the given param string into a float between 0 and 1.
Combine url with layer’s params and these newParams.
{Boolean} internal state of drawing.
Create a Markers layer.
This method removes all markers from a layer.
Calculate the pixel location for the marker, create it, and add it to the layer’s div
A mixin for layers that wraps up the pieces neccesary to have a coordinate conversion for working with commercial APIs which use a spherical mercator projection.
Get the map’s extent.
Set up the mercator parameters on the layer: resolutions, projection, units.
Given an object with x and y properties in EPSG:4326, modify the x,y properties on the object to be the Spherical Mercator projected coordinates.
Given an object with x and y properties in Spherical Mercator, modify the x,y properties on the object to be the unprojected coordinates.
Transforms from EPSG:4326 to EPSG:900913 and from EPSG:900913 to EPSG:4326 are set by this class.
The DrawFeature control draws point, line or polygon features on a vector layer when active.
{Object} The functions that are sent to the handler for callback
Allows for drawing of features for measurements.
{Array(String)} Supported application event types.
{Object} The functions that are sent to the handler for callback
{String} Display system for output measurements.
{Boolean} Calculate geodesic metrics instead of planar metrics.
{Object} Units for various measurement systems.
{Number} Number of milliseconds between clicks before the event is considered a double-click.
{Number} Timeout id of trigger for measurepartial.
Called when the measurement sketch is done.
Called each time a new point is added to the measurement sketch.
Based on the displaySystem returns the area of a geometry.
Based on the displaySystem returns the length of a geometry.
The ZoomBox control enables zooming directly to a given extent, by drawing a box on the map.
{OpenLayers.Control.TYPE}
{Boolean} Should the control be used for zooming out?
{Boolean} Always zoom in/out, when box drawed
Class for reading and writing Well-Known Text.
Create a new parser for WKT
Deserialize a WKT string and return a vector feature or an array of vector features.
Serialize a feature or array of features into a WKT string.
{Integer} 0
{Integer} 19
{Array(Float)} Hardcode these resolutions so that they are more closely tied with the standard wms projection
{GDraggableObject} Since 2.93, Google has exposed the ability to get the maps GDraggableObject.
{DOMElement} Div for Google’s copyright and terms of use link
{DOMElement} Div for Google’s powered by logo and link
Load the GMap and register appropriate event listeners.
The map has been centered, and a map type was specified, so we set the map type on the gmap object, then unregister the listener so that we dont keep doing this every time the map moves.
Hide or show the layer
Hack-on function because GMAPS does not give it to us
Base class for layers that use a lattice of tiles.
{Array(Array(OpenLayers.Tile))} This is an array of rows, each row is an array of tiles.
Create a new grid layer
Go through and remove all tiles from the grid, calling destroy() on each of them to kill circular references
This function is called whenever the map is moved.
Deprecated.
Generate parameters for the grid layout.
Starts at the top right corner of the grid and proceeds in a spiral towards the center, adding tiles one at a time to the beginning of a queue.
This function takes a tile as input and adds the appropriate hooks to the tile so that the layer can keep track of the loading tiles.
This function takes a tile as input and removes the tile hooks that were added in addTileMonitoringHooks()
Shifty grid work
Shift grid work in the other dimension
When the size of the map or the buffer changes, we may need to remove some excess rows and columns.
For singleTile layers, this will set a new tile size according to the dimensions of the map pane.
{Integer} 1
{Integer} 17
{Array(Float)} Hardcode these resolutions so that they are more closely tied with the standard wms projection
{Integer} 0
{Integer} 17
{Array(Float)} Hardcode these resolutions so that they are more closely tied with the standard wms projection
The map has been centered, so the mysterious yahoo eventpane has been added.
A basic HTTP protocol for vector layers.
{String} Service URL, read-only, set through the options passed to constructor.
{Object} HTTP request headers, read-only, set through the options passed to the constructor, Example: {‘Content-Type’: ‘plain/text’}
{Object} Parameters of GET requests, read-only, set through the options passed to the constructor, Example: {‘bbox’: ‘5,5,5,5’}
{Object} Function to be called when the <read>, <create>, <update>, <delete> or <commit> operation completes, read-only, set through the options passed to the constructor.
{Object} Callback execution scope, read-only, set through the options passed to the constructor.
{Boolean} true if read operations are done with POST requests instead of GET, defaults to false.
A class for giving layers generic HTTP protocol.
Returns a function that applies the given public method with resp and options arguments.
Individual callbacks are created for read, create and update, should a subclass need to override each one separately.
Called the the request issued by <create> is complete.
Called the the request issued by <update> is complete.
Called the the request issued by <delete> is complete.
Called by CRUD specific handlers.
Read HTTP response body and return features.
This method is used from within the commit method each time an an HTTP response is received from the server, it is responsible for calling the user-supplied callbacks.
This class represents a UserStyle obtained from a SLD, containing styling rules.
{String} Title of this style (set if included in SLD)
{String} Description of this style (set if abstract is included in SLD)
{Object} An optional object with properties that symbolizers’ property values should be evaluated against.
{Object} hash of style properties to use as default for merging rule-based style symbolizers onto.
{Boolean} If set to true, the defaultStyle will extend the symbolizer of every rule.
{Hash of Boolean} cache of style properties that need to be parsed for propertyNames.
Creates a UserStyle.
creates a style by applying all feature-dependent rules to the base style.
creates literals for all style properties that have an entry in <this.propertyStyles>.
Looks into all rules for this style and the defaultStyle to collect all the style hash property names containing ${...}
Returns the correct symbolizer prefix according to the geometry type of the passed geometry
converts a style value holding a combination of PropertyName and Literal into a Literal, taking the property values from the passed features.
{Array} prefixes of the sld symbolizers.
The navigation control handles map browsing with mouse events (dragging, double-clicking, and scrolling the wheel).
Create a new navigation control
The destroy method is used to perform any clean up before the control is dereferenced.
User spun scroll wheel up
User spun scroll wheel down
A Geometry is a description of a geographic object.
{String} A unique identifier for this geometry.
{OpenLayers.Geometry}This is set when a Geometry is added as component of another geometry
{OpenLayers.Bounds} The bounds of this geometry
Creates a geometry object.
Destroy this geometry.
Nullify this components bounds and that of its parent as well.
Extend the existing bounds to include the new bounds.
Calculate the length of this geometry.
Calculate the area of this geometry.
Returns the Well-Known Text representation of a geometry
Generate a geometry given a Well-Known Text string.
Determine whether two line segments intersect.
Instances of OpenLayers.Layer.MapGuide are used to display data from a MapGuide OS instance.
{Object} Hashtable of default parameter key/value pairs for tiled layer
{Object} Hashtable of default parameter key/value pairs for untiled layer
{Object} Hashtable of default parameter key/value pairs for untiled layer
{Object} Hashtable of parameter key/value pairs which describe the folder structure for tiles as configured in the mapguide serverconfig.ini section [TileServiceProperties]
{OpenLayers.Size} Tile size as produced by MapGuide server
Create a new Mapguide layer, either tiled or untiled.
factor that are different than the defaults used in OpenLayers, so these must be adjusted accordingly in your application.
Create a clone of this layer
Creates a tile, initializes it, and adds it to the layer div.
Return a query string for this layer
getFullRequestString on MapGuide layers is special, because we do a regular expression replace on ‘,’ in parameters to ‘+’.
special handler to request mapguide tiles from an http exposed tilecache
Generate parameters for the grid layout.
Instances of OpenLayers.Layer.MapServer are used to display data from a MapServer CGI instance.
{Object} Hashtable of default parameter key/value pairs
Create a new MapServer layer object
Create a clone of this layer
Creates a tile, initializes it, and adds it to the layer div.
Return a query string for this layer
combine the layer’s url with its params and these newParams.
Instances of OpenLayers.Layer.WMS are used to display data from OGC Web Mapping Services.
{Object} Hashtable of default parameter key/value pairs
Deprecated.
Create a new WMS layer object
Destroy this layer
Create a clone of this layer
Return a GetMap query string for this layer
addTile creates a tile, initializes it, and adds it to the layer div.
This class represents an SLD Rule, as being used for rule-based SLD styling.
{String} A unique id for this session.
{String} Title of this rule (set if included in SLD)
{String} Description of this rule (set if abstract is included in SLD)
{Object} An optional object with properties that the rule should be evaluated against.
{<OpenLayers.Filter>} Optional filter for the rule.
{Boolean} Determines whether this rule is only to be applied only if no other rules match (ElseFilter according to the SLD specification).
{Object} Symbolizer or hash of symbolizers for this rule.
Creates a Rule.
Gets the context for evaluating this rule
Hash of {OpenLayers.Style}, keyed by names of well known rendering intents (e.g.
{Boolean} if true, every render intent will extend the symbolizers specified for the “default” intent at rendering time.
Creates the symbolizer for a feature for a render intent.
Convenience method to create comparison rules for unique values of a property.
A Collection is exactly what it sounds like: A collection of different Geometries.
{Array(String)} An array of class names representing the types of components that the collection can include.
Creates a Geometry Collection -- a list of geoms.
Get a string representing the components for this collection
Add a new component (geometry) to the collection.
Remove a component from this geometry.
Point geometry class.
Construct a point geometry.
Create a new Bounds based on the lon/lat
{String} Shortened String representation of Point object.
Instances of OpenLayers.Layer.Vector are used to render vector data from a variety of sources.
{Array(String)} Supported application event types.
{Object} hash of features, keyed by feature.id, that the renderer failed to draw
{Array(OpenLayers.Strategy})} Optional list of strategies for the layer.
{OpenLayers.Protocol} Optional protocol for the layer.
{Array(String)} List of supported Renderer classes.
{Boolean} Whether the Vector Layer features have been drawn yet.
Create a new vector layer
Ask the layer to request features again and redraw them.
Iterates through the available renderer implementations and selects and assigns the first one whose “supported()” function returns true.
Let the user know their browser isn’t supported.
The layer has been added to the map.
Called at the end of the map.addLayer sequence.
The layer has been removed from the map.
Notify the renderer of the change in size.
Reset the vector layer’s div so that it once again is lined up with the map.
Erase features from the layer.
Given an event, return a feature if the event occurred over one.
MultiPoint is a collection of Points.
{Array(String)} An array of class names representing the types of components that the collection can include.
Create a new MultiPoint Geometry
Handler to draw a point on the map.
{OpenLayers.Feature.Vector} The currently drawn point
{OpenLayers.Layer.Vector} The temporary drawing layer
{Boolean} Cast features to multi-part geometries before passing to the layer.
{Boolean} A point is being drawn
{Boolean} The mouse is down
{OpenLayers.Pixel} Location of the last mouse down
{Object} Any optional properties to be set on the sketch layer.
Create a new point handler.
Add temporary features
Destroy the temporary geometries
Finish the geometry and call the “done” callback.
Handle clicks.
Handle double-clicks.
Modify the existing geometry given a pixel location.
Render features on the temporary layer.
Return the sketch geometry.
Return a clone of the relevant geometry.
Handle mouse down.
Handle mouse move.
Handle mouse up.
A Curve is a MultiPoint, whose points are assumed to be connected.
{Array(String)} An array of class names representing the types of components that the collection can include.
A LineString is a Curve which, once two points have been added to it, can never be less than two points long.
Create a new LineString geometry
{Array} An array of segment objects.
Split this geometry with the given segment.
Use this geometry (the source) to attempt to split a target geometry.
Split this geometry (the target) with the given geometry (the source).
A Linear Ring is a special LineString which is closed.
{Array(String)} An array of class names representing the types of components that the collection can include.
Linear rings are constructed with an array of points.
Test if a point is inside a linear ring.
A MultiLineString is a geometry with multiple OpenLayers.Geometry.LineString components.
{Array(String)} An array of class names representing the types of components that the collection can include.
Constructor for a MultiLineString Geometry.
Use this geometry (the source) to attempt to split a target geometry.
Split this geometry (the target) with the given geometry (the source).
Handler to draw a path on the map.
{Boolean} In freehand mode, the handler starts the path on mouse down, adds a point for every mouse move, and finishes the path on mouse up.
{String} If set, freehandToggle is checked on mouse events and will set the freehand mode to the opposite of this.freehand.
Create a new path hander
Add temporary geometries
Destroy temporary geometries
Destroy the temporary point.
Add point to geometry.
Determine whether to behave in freehand mode or not.
Modify the existing geometry given the new point
Render geometries on the temporary layer.
Return the sketch feature.
Return the sketch geometry.
Handle mouse down.
Handle mouse move.
Handle mouse up.
Handle double-clicks.
Polygon is a collection of Geometry.LinearRings.
{Array(String)} An array of class names representing the types of components that the collection can include.
Constructor for a Polygon geometry.
Test if a point is inside a polygon.
MultiPolygon is a geometry with multiple OpenLayers.Geometry.Polygon components.
{Array(String)} An array of class names representing the types of components that the collection can include.
Create a new MultiPolygon geometry
Handler to draw a polygon on the map.
Create a Polygon Handler.
Add temporary geometries
Destroy temporary geometries
Render geometries on the temporary layer.
Return the sketch feature.
Return the sketch geometry.
Handle double-clicks.
Read/Wite GML.
Create a new parser for GML.
This function is the core of the GML parsing code in OpenLayers.
Properties of this object are the functions that parse geometries based on their type.
Given a GML node representing a point geometry, create an OpenLayers point geometry.
Given a GML node representing a multipoint geometry, create an OpenLayers multipoint geometry.
Given a GML node representing a linestring geometry, create an OpenLayers linestring geometry.
Given a GML node representing a multilinestring geometry, create an OpenLayers multilinestring geometry.
Given a GML node representing a polygon geometry, create an OpenLayers polygon geometry.
Given a GML node representing a multipolygon geometry, create an OpenLayers multipolygon geometry.
Accept an OpenLayers.Feature.Vector, and build a GML node for it.
Object containing methods to do the actual geometry node building based on geometry type.
Given an OpenLayers point geometry, create a GML point.
Given an OpenLayers multipoint geometry, create a GML multipoint.
Given an OpenLayers linestring geometry, create a GML linestring.
Given an OpenLayers multilinestring geometry, create a GML multilinestring.
Given an OpenLayers linearring geometry, create a GML linearring.
Given an OpenLayers polygon geometry, create a GML polygon.
Given an OpenLayers multipolygon geometry, create a GML multipolygon.
Given an OpenLayers bounds, create a GML box.
builds the coordinates XmlNode
Superclass for GML parsers.
{Object} Mapping of namespace aliases to namespace URIs.
{String} Schema location for a particular minor version.
{Object} Maps OpenLayers geometry class names to GML element names.
{Boolean} True if there is only 1 featureType, and not an array of featuretypes.
Compiled regular expressions for manipulating strings.
Instances of this class are not created directly.
Contains public functions, grouped by namespace prefix, that will be applied when a namespaced node is found matching the function name.
As a compliment to the readers property, this structure contains public writing functions grouped by namespace alias and named like the node names they produce.
Sets the geometryTypes mapping.
Parses GML version 2.
{String} Schema location for a particular minor version.
Create a parser for GML v2.
Contains public functions, grouped by namespace prefix, that will be applied when a namespaced node is found matching the function name.
As a compliment to the readers property, this structure contains public writing functions grouped by namespace alias and named like the node names they produce.
Parses GML version 3.
{String} Schema location for a particular minor version.
{Boolean} Write gml:Curve instead of gml:LineString elements.
{Boolean} Write gml:MultiCurve instead of gml:MultiLineString.
{Boolean} Write gml:Surface instead of gml:Polygon elements.
{Boolean} Write gml:multiSurface instead of gml:MultiPolygon.
Create a parser for GML v3.
Contains public functions, grouped by namespace prefix, that will be applied when a namespaced node is found matching the function name.
As a compliment to the readers property, this structure contains public writing functions grouped by namespace alias and named like the node names they produce.
Sets the <geometryTypes> mapping.
The Browser Core.
Contains Array Prototypes like each, contains, and erase.
Contains Function Prototypes like create, bind, pass, and delay.
Contains Number Prototypes like limit, round, times, and ceil.
Contains String Prototypes like camelCase, capitalize, test, and toInt.
Contains Hash Prototypes.
Contains the Event Native, to make the event object completely crossbrowser.
Contains the Class Function for easily creating, extending, and implementing reusable Classes.
Contains Utility Classes that can be implemented into your own Classes to ease the execution of many common tasks.
One of the most important items in MooTools.
Contains Element methods for dealing with events, and custom Events.
Contains methods for interacting with the styles of Elements in a fashionable way.
Contains methods to work with size, scroll, or positioning of Elements and the window object.
Adds advanced CSS Querying capabilities for targeting elements.
Contains the domready custom event.
JSON encoder and decoder.
Class for creating, loading, and saving browser Cookies.
Wrapper for embedding SWF movies.
Contains the basic animation logic to be extended by all other Fx Classes.
Contains the CSS animation logic.
Formerly Fx.Style, effect to transition any CSS property for an element.
Formerly Fx.Styles, effect to transition any number of CSS properties for an element using an object of rules, or CSS based selector rules.
Contains a set of advanced transitions to be used with any of the Fx Classes.
Powerful all purpose Request Class.
Extends the basic Request Class with additional methods for sending and receiving JSON data.
A css-class based form validation system.
Additional validators for the FormValidator class.
Defines Fx.Reveal, a class that shows and hides elements with a transition.
Effect to slide an element in and out of view.
Class for creating a smooth scrolling effect to all internal links on the page.
A Drag extension that provides support for the constraining of draggables to containers and droppables.
Class for creating horizontal and vertical slider controls.
Defines Request.JSONP, a class for cross domain javascript via script injection.
Requests the same url at a time interval that increases when no data is returned from the requested server
Class for monitoring collections of events
Class for creating, reading, and deleting Cookies in JSON format.
Jx is a global singleton object that contains the entire Jx library within it.
This is the URL that Jx was loaded from, it is automatically calculated from the script tag src property that included Jx.
Static method that applies the PNG Filter Hack for IE browsers when showing 24bit PNG’s.
Request that an image be set to a DOM IMG element src attribute.
An internal method that ensures no more than 2 images are loading at a time.
An internal method actually populate the DOM element with the image source.
Creates a new iframe element that is intended to fill a container to mask out other operating system controls (scrollbars, inputs, buttons, etc) when HTML elements are supposed to be above them.
safely parse a number and return its integer value.
return the dimensions of the browser client area.
Element is a global object provided by the mootools library.
return the size of the content area of an element.
return the size of the border area of an element.
return the size of the margin area of an element.
set either or both of the width and height of an element to the provided size.
set either or both of the width and height of an element to the provided size.
returns the padding for each edge of an element
returns the border size for each edge of an element
determines if the element is a descendent of the reference node.
search the parentage of the element to find an element of the given tag name.
ContentLoader is a mix-in class that provides a consistent mechanism for other Jx controls to load content in one of four different ways:
tracks the load state of the content, specifically useful in the case of remote content.
triggers loading of content based on options set for the current object.
Is fired after a delay to check the request to make sure it’s not failing in AIR.
Mix-in class that provides a method for positioning elements relative to other elements.
positions an element relative to another element based on the provided options.
A mix-in class that provides chrome helper functions.
the DOM element that contains the chrome
create chrome on an element.
show the chrome on an element.
removes the chrome from the DOM.
A mix-in class that provides a helper function that allows an object to be added to an existing element on the page.
adds the object to the DOM relative to another element.
Extends: Object
create a new button.
triggered when the user clicks the button, processes the actionPerformed event
This returns true if the button is enabled, false otherwise
enable or disable the button.
For toggle buttons, this returns true if the toggle button is currently active and false otherwise.
Set the active state of the button
set the image of this button to a new image URL
sets the text of the button.
returns the text of the button.
sets the tooltip displayed by the button
capture the keyboard focus on this button
remove the keyboard focus from this button
Extends: Jx.Button
the HTML element that contains the flyout content
construct a new instance of a flyout button.
Override Jx.Button::clicked to hide/show the content area of the flyout.
Closes the flyout if open
Extends: Object
Create a new instance of Jx.Layout.
when the window is resized, any Jx.Layout controlled elements that are direct children of the BODY element are resized
resize the element controlled by this Jx.Layout object.
Extends: Jx.Button
{HTMLElement} The content area that is displayed when the tab is active.
Create a new instance of Jx.Button.Tab.
triggered when the user clicks the button, processes the actionPerformed event
Extends: Object
the HTML element representing the color panel
initialize a new instance of Jx.ColorPalette
handle the mouse moving over a colour swatch by updating the preview
handle mouse click on a swatch by updating the color and hiding the panel.
handle the user entering a new colour value manually by updating the selected colour if the entered value is valid HEX.
handle the user entering a new alpha value manually by updating the selected alpha if the entered value is valid alpha (0-100).
set the colour represented by this colour panel
set the alpha represented by this colour panel
update the colour panel user interface based on the current colour and alpha values
initialize a new color button.
override Jx.Button.Flyout to use a singleton color palette.
hide the color panel
set the color represented by this color panel
set the alpha represented by this color panel
handle the color changing in the palette by updating the preview swatch in the button and firing the change event.
Update the swatch color for the current color
Extends: Object
{HTMLElement} The HTML element containing the menu.
{Jx.Button} The button that represents this menu in a toolbar and opens the menu.
{HTMLElement} the HTML element that contains the menu items within the menu.
{Array} the items in this menu
Create a new instance of Jx.Menu.
Add menu items to the sub menu.
Deactivate the menu by hiding it.
Handle the user moving the mouse over the button for this menu by showing this menu and hiding the other menu.
determine if an event happened inside this menu or a sub menu of this menu.
Hide the menu.
Show the menu
Set the sub menu that is currently open
Extends: Object
{Array} array of buttons that are managed by this button set
Create a new instance of Jx.ButtonSet
Add one or more Jx.Buttons to the ButtonSet.
Remove a button from this Button.
Set the active button to the one passed to this method
Handle selection changing on the buttons themselves and activate the appropriate button in response.
Extends: Jx.Button
the currently selected button
{Array} the buttons added to this multi button
construct a new instance of Jx.Button.Multi.
adds one or more buttons to the Multi button.
remove a button from a multi button
update the menu item to be the requested button.
update the active button in the menu item, trigger the button’s action and hide the flyout that contains the buttons.
Extends: Jx.Button
{<Jx.SubMenu> or Jx.Menu} the menu that contains the menu item.
Create a new instance of Jx.Menu.Item
Set the owner of this menu item
Hide the menu item.
Show the menu item
Handle the user clicking on the menu item, overriding the Jx.Button::clicked method to facilitate menu tracking
handle the mouse moving over the menu item
{Object} current selection in the list
create a new instance of Jx.Combo
enable or disable the combo button.
invoked when the current value is changed
Handle the user pressing a key by looking for an ENTER key to set the value.
add a new item to the pick list
Remove the item at the given index.
set the value of the Combo
Return the current value
Extends: Object
Initialize a new Jx.Panel instance
the sizeChange event of the Jx.Layout that manages the outer container is intercepted and passed through this method to handle resizing of the panel contents because we need to do some calculations if the panel is collapsed and if there are toolbars to put around the content area.
Set the label in the title bar of this panel
Get the label of the title bar of this panel
Clean up the panel
Maximize this panel
set the content of this panel to some HTML
Set the content of this panel to come from some URL.
When the content of the panel is loaded from a remote URL, this method is called when the ajax request returns.
Set the panel as busy or not busy, which displays a loading image in the title bar.
sets or toggles the collapsed state of the panel.
Closes the panel (completely hiding it).
Extends: Jx.Panel
modal dialogs prevent interaction with the rest of the application while they are open, this element is displayed just under the dialog to prevent the user from clicking anything.
Construct a new instance of Jx.Dialog
resize the dialog.
overload panel’s sizeChanged method
sets or toggles the collapsed state of the panel.
show the dialog, external code should use the Jx.Dialog::open method to make the dialog visible.
hide the dialog, external code should use the Jx.Dialog::close method to hide the dialog.
open the dialog and load content from the provided url.
open the dialog.
close the dialog and trigger the onClose callback function if necessary
Extends: Object
{HTMLElement} the element being split
{Array} an array of elements that are displayed in each of the split areas
{Array} an array of the bars between each of the elements used to resize the split areas.
{Boolean} track the first resize event so that unexposed Jx things can be forced to calculate their size the first time they are exposed.
Create a new instance of Jx.Splitter
Prepare a new, empty element to go into a split area.
Prepare a new, empty bar to go into between split areas.
Setup the initial set of constraints that set the behaviour of the bars between the elements in the split area.
In a horizontally split container, handle a bar being dragged left or right by resizing the elements on either side of the bar.
In a vertically split container, handle a bar being dragged up or down by resizing the elements on either side of the bar.
handle the size of the container being changed.
Resize a horizontally layed-out container
Resize a vertically layed out container.
Extends: Object
{Array} the panels being managed by the set
{Integer} the height of the container, cached for speed
{Boolean} true until the panel set has first been resized
Create a new instance of Jx.PanelSet.
Maximize a panel, taking up all available space (taking into consideration any minimum or maximum values)
Extends: Object
construct a new instance of Jx.Grid within the domObj
handle the grid scrolling by updating the position of the headers
resize the grid to fit inside its container.
set the model for the grid to display.
destroy the contents of the grid safely
create the grid for the current model
set the height of a row.
called through the grid listener interface when data has changed in the underlying model
apply the jxGridRowHeaderPrelight style to the header cell of a row.
apply the jxGridColumnHeaderPrelight style to the header cell of a column.
apply the jxGridRowPrelight style to row.
apply the jxGridColumnPrelight style to a column.
apply the jxGridCellPrelight style to a cell.
Select a cell and apply the jxGridCellSelected style to it.
Apply the jxGridRowHeaderSelected style to the row header cell of a selected row.
Select a row and apply the jxGridRowSelected style to it.
Apply the jxGridColumnHeaderSelected style to the column header cell of a selected column.
Select a column.
handle the mouse moving over the main grid.
handle the mouse moving over the row header cells.
handle the mouse moving over the column header cells.
handle the user clicking on the grid.
handle the user clicking on the row header.
handle the user clicking on the column header.
retrieve the row and column indexes from an event click.
create a new grid model
This function returns the number of columns of data in the model as an integer value.
This function returns an HTML string to be placed in the column header for the given column index.
This function returns an integer which is the height of the column header row in pixels.
This function returns an integer which is the width of the given column in pixels.
This function returns an HTML string to be placed in the row header for the given row index
This function returns an integer which is the width of the row header column in pixels.
This function returns an integer which is the height of the given row in pixels.
This function returns the number of rows of data in the model as an integer value.
This function returns an HTML string which is the text to place in the cell at the given row and column.
This function is called with a column index and width in pixels when a column is resized.
This function returns a boolean value to indicate if a given cell is editable by the user.
This function is called with the row and column of a cell and a new value for the cell.
This function is called by the grid to indicate that the user has selected a row by clicking on the row header.
This function is called by the grid to indicate that the user has selected a column by clicking on the column header.
This function is called by the grid to indicate that the user has selected a cell by clicking on the cell in the grid.
Extends: Jx.Menu
create a new context menu
Show the context menu at the location of the mouse click
Extends: Object
{HTMLElement} the HTML element that the separator is contained within
{Jx.Menu, Jx.Menu.SubMenu} the menu that the separator is in.
Create a new instance of a menu separator
Set the ownder of this menu item
Hide the menu item.
Show the menu item
Extends: Jx.Menu.Item
{HTMLElement} the HTML container for the sub menu.
{Jx.Menu or Jx.SubMenu} the menu or sub menu that this sub menu belongs
{<Jx.MenuItem>} the visible item within the menu
{Array} the menu items that are in this sub menu.
Create a new instance of Jx.SubMenu
Set the owner of this sub menu
Show the sub menu
Hide the sub menu
Add menu items to the sub menu.
Insert a menu item before another menu item.
Remove a single menu item from the menu.
Deactivate the sub menu
Indicate if this sub menu is active
Set the active state of the Jx.Menu that contains this sub menu
Set a sub menu of this menu to be visible and hide the previously visible one.
Extends: Object
{HTMLElement} the DOM element of the snap (the thing that gets clicked).
{HTMLElement} An element of the Jx.Splitter that gets controlled by this snap
{Jx.Splitter} the splitter that this snap is associated with.
{String} track the layout of the splitter for convenience.
Create a new Jx.Splitter.Snap
Snap the element open or closed.
Handle the size of the element changing to see if the toggle state has changed.
Extends: Object
{Array} an array of the things in the toolbar.
{HTMLElement} the HTML element that the toolbar lives in
When a toolbar contains Jx.Menu instances, they want to know if any menu in the toolbar is active and this is how they find out.
Create a new instance of Jx.Toolbar.
add this toolbar to a DOM element automatically creating a toolbar container if necessary
Add an item to the toolbar.
remove an item from a toolbar.
Deactivate the Toolbar (when it is acting as a menu bar).
Indicate if the toolbar is currently active (as a menu bar)
Set the active state of the toolbar (for menus)
For menus, they want to know which menu is currently open.
Extends: Object
{Array} array of tabs that are managed by this tab set
{HTMLElement} The HTML element that represents this tab set in the DOM.
Create a new instance of Jx.TabSet within a specific element of the DOM.
Resize the tab set content area and propogate the changes to each of the tabs managed by the tab set.
Add one or more Jx.Button.Tabs to the TabSet.
Remove a tab from this TabSet.
Set the active tab to the one passed to this method
Extends: Object
{Jx.Toolbar} the toolbar for this tab box.
{Jx.TabSet} the tab set for this tab box.
Create a new instance of a TabBox.
Add one or more <Jx.Tab>s to the TabBox.
Remove a tab from the TabSet.
Extends: Object
{HTMLElement} the HTML element that the container lives in
Create a new instance of Jx.Toolbar.Container
Add a toolbar to the container.
remove an item from a toolbar.
scrolls an item in one of the toolbars into the currently visible area of the container if it is not already fully visible
Extends: Object
{HTMLElement} an element to contain the thing to be placed in the toolbar.
Create a new instance of Jx.Toolbar.Item.
Extends: Object
{HTMLElement} The DOM element that goes in the Jx.Toolbar
Create a new Jx.Toolbar.Separator
Extends: Object
{HTMLElement} a reference to the HTML element that is the TreeItem in the DOM
{Object} the folder or tree that this item belongs to
Create a new instance of Jx.TreeItem with the associated options
Clean up the TreeItem and remove all DOM references
Clean up the TreeItem and remove all DOM references
Create a clone of the TreeItem
Update the CSS of the TreeItem’s DOM element in case it has changed position
Called when the DOM element for the TreeItem is clicked, the node is selected.
Get the label associated with a TreeItem
A property of an object has changed, synchronize the state of the TreeItem with the state of the object
Extends: Jx.TreeItem
{HTMLElement} an HTML container for the things inside the folder
{Array} an array of references to the javascript objects that are children of this folder
Create a new instance of Jx.TreeFolder
Clean up a TreeFolder.
Internal method to clean up folder-related stuff.
Create a clone of the TreeFolder
Indicates if a node is the last thing in the folder.
Update the CSS of the TreeFolder’s DOM element in case it has changed position.
append a node at the end of the sub-tree
insert a node after refNode.
remove the specified node from the tree
Replace a node with another node
handle the user clicking on this folder by expanding or collapsing it.
Expands the folder
Collapses the folder
Get a reference to a child node by recursively searching the tree
Extends: Jx.TreeFolder
Create a new instance of Jx.Tree
Clean up a Jx.Tree instance
Clear the tree of all child nodes
Update the CSS of the Tree’s DOM element in case it has changed position
Append a node at the end of the sub-tree
General purpose Error object
an internal class for managing generic events.
Utility class to parse an application definition
array of map groups, parsed from ApplicationDefinition.
array of widget sets (each one corresponding to a map) parsed from the ApplicationDefinition.
A Broker object that can communicate with a MapGuide instance in the case we are running against a MapGuide server
An array of search definitions
An array of search categories
construct a new instance of the ApplicationDefinition object.
start parsing the ApplicationDefinition file.
parse the ApplicationDefinition file into the appropriate Fusion objects
Create the application definition.
return a map widget with the given name
return a map widget with the given id
return the map widget at the given index
return the specified map group from the application definition
Holds an internal representation of MapGroup objects as defined in the AppDef
Holds an internal representation of Map objects as defined in the AppDef
Holds an internal representation of WidgetSet objects as defined in the AppDef
keep track of live widgets created in this widgetSet
return the map widget for this widget set
create all the things required by this widgetSet, including containers and widgets.
return the map widget from this widget set if the map’s name matches the requested name, or null.
Holds an internal representation of Container objects as defined in the AppDef
Holds an internal representation of Widget objects as defined in the AppDef
creates a new instance of the widget, optionally using a different name during instantiation to accomodate containers
Holds an internal representation of Menu Item objects as defined in the AppDef
Holds an internal representation of Flyout objects as defined in the AppDef
Holds an internal representation of Multi objects as defined in the AppDef
Holds an internal representation of SearchDefinition objects as defined in the AppDef
Holds an internal representation of SearchJoin objects as defined in the AppDef
Holds an internal representation of SearchRule objects as defined in the AppDef
Holds an internal representation of SearchCondition objects as defined in the AppDef
MGBroker is used to broker requests to the MapGuide Open Source mapagent interface.
MGRequest is the base class for all broker-compatible requests.
encapsulate a request to the server to enumerate resources in the library.
encapsulate a request to the server to get resource contents from the library.
encapsulate a request to the server to get resource header from the library.
encapsulate a request to the server to create a new session on the server.
encapsulate a request to the server to copy a resource.
encapsulate a request to the server to delete a resource.
encapsulate a request to the server to move a resource in the repository.
encapsulate a request to the server to set the content XML of a resource.
encapsulate a request to the server to describe the schema of a FeatureSource.
encapsulate a request to the server to retrieve the spatial context of a resource.
encapsulate a request to the server to enumerate the references to a resource id.
encapsulate a request to the server to enumerate the data associated with a FeatureSource N.B.
encapsulate a request to the server to enumerate the data associated with a FeatureSource N.B.
encapsulate a request to the server to query map features on selectable layers
encapsulate a request to the server to query map features on selectable layers
This is the base class for all widgets.
returns the location of this widget relative to the installation of fusion.
The Fusion search mechanism defines a common capability for searches that link individual searches to a common search set maintained for all search-based widgets.
generic class for map widgets.
Callback for when all maps have been loaded
Attaches a context menu as defined in the AppDef to the map
Controls the creation of Layers based on the MapGroup object passed in
Called after each layer is loaded in the OL viewport.
handles mouse wheel events by accummulating the events and setting a timer to do the actual zoom in/out
Carries out the actual map zoom based on the wheel movement
User spun scroll wheel up
User spun scroll wheel down
returns the dom element for this widget
returns the name of the baselayer map
returns the Title of the baselayer map.
returns the server session ID
returns the ID of dom element for this widget
sets options on the OpenLayers map object, a wrapper for the OL function
adds a map/Layer to the map and registers some event handlers on the map
returns the array of map objects
Called to reload all the map objects.
Loads the ScaleRange objects separate from the LoadMap sequence since this also generates sprites and is a relatively expensive operation.
dispatch query requests to the maps
handle selection events from maps and republish for widgets as appropriate
cehck to see if any of the maps have an active selection
clear the selection on all maps
initiates a call to get the current selection asynchronously in case we need to retrieve the details from the server
sets a Selection XML back to the server for each of the maps
accumulate the selection results from each map and when all have reported in, pass the results to the callback function
sets the active layer for selection/manipulation
returns the active layer for selection/manipulation
indicate that a new asynchronous process has started and make sure the visual indicator is visible for the user.
indicate that an asynchronous process has completed and hide the visual indicator if no remaining processes are active.
OpenLayers event handler for whenever the map changes either zoom level of the center has changed.
check to see if there are any outstanding requests to the server
callback for when the browser window size changes, simply calls resize on the map viewport layout object
handles the resizing of the maps and triggers a Fusion event
redraws the map using current extents and zoom level.
sets the background color for the map
handle selection events from maps and republish for widgets as appropriate
1.
gets the intitial extents from all maps with or without including the extent of any Generic/commercial layers
sets the extent of the map to the max as returned by loadMap
returns if the map has finished loading (based on setting the _oCurrentExtent value)
sets the map zoom and extent.
sets the map zoom and extent.
sets the map zoom and extent.
sets the map zoom and extent.
returns the current center of the map view
returns the Extent of the map given a center point and a scale (optional)
Implements Layers for Fusion.
This function should be called after the map has loaded.
Returns true if the Map has been laoded succesfully form the server
Implements the map layer groups
Implements individual map legend layers
Implements a scale range object
Implements the legend style items to get a legend icon from the server
Dictionary for Catalan, UTF8 encoding.
Dictionary for Czech.
Dictionary for Danish.
Dictionary for German.
Dictionary for English-CA.
Dictionary for English.
Dictionary for Spanish, UTF8 encoding.
Dictionary for French.
Dictionary for Hungarian.
Dictionary for Italian.
Dictionary for Japanese.
Dictionary for norwegian bokm�l (Norway).
Dictionary for Dutch.
Dictionary for Brazilian Portuguese.
Dictionary for swedish (Sweden).
Dictionary for Simplified Chinese.
Dictionary for Traditional Chinese.
About widget to display a pop-up window about the application.
opens a pop-up window with the about information when invoked
AcitivityIndicator is a widget that shows or hides its DOM element based on whether the map widget is busy or not.
A widget to allow selection of the basemaps display under the overlay MapGuide layer Currently, Google Street, Google Satellite, Google Hybrid, Yahoo Street, Yahoo Satellite, Yahoo Hybrid, Bing Street, Bing Satellite and Bing Hybrid is supported.
The Buffer widget prompts the user for some inputs and then creates a buffer around the current selection based on those inputs.
Use BufferPanel instead.
The BufferPanel widget prompts the user for some inputs and then creates a buffer around the current selection based on those inputs.
Center the current selection, if any, but maintain the current scale if possible.
Clears the current selection, if any.
The user can pick from a palette of web-safe colours or enter a hex value.
Displays the geographic position of the cursor when it is over the map.
The user can manually type in a new scale
Maintain and navigate through a history of extents
The FeatureInfo widget displays information about selected polygons.
Display a user help page.
Restore the map to it’s full extents determined when it was initially loaded.
Executes an arbitrary piece of JavaScript code
A widget that will open the configured URL in the target element.
Displays a LayerManager of all the layers in the map as a collapsable tree.
A widget to display a legend of all layers.
{String} The default image for DWF layer
{String} The default image for Raster layer
{String} The default image for layers that are currently themed.
{String} The default image for layers that are out of scale.
{String} The default image for the root folder
{String} The default image for layer info
{String} The default image for groupd info
This is a class designed to help users to create their own renderer for customize the legend.
{Fusion.Widget.Legend} The parent widget that uses the renderer.
{Groups} The groups of all layers.
Abstract method that have the main purpose to draw the legend.
Abstract method that handle the event: Fusion.Event.MAP_LOADED.
Abstract method that handle the event: Fusion.Event.MAP_RELOADED.
Helper method to obtains the map.
This class provide a default legend as a collapsable tree.
{Boolean} This controls whether the tree will have a single root node that contains the name of the map as its label.
{Jx.TreeNode} The current selected node.
{Boolean} Determine if the map is drawn.
{Jx.TreeFolder} The current TreeFolder that the mouse will interact with.
{Boolean} Determine if non-visible layer must be draw in the legend.
A widget that displays a link to the currently displayedd map view.
A widget that displays a selection of maps that can be loaded into the application.
Displays tooltips over the map when the mouse is hovered for some time.
The Measure widget allows the user to measure distances or areas on the map in one or more segments.
A widget that immplements an in-map navigation control with zoom and pan.
A widget that displays an overview map showing the current view of the primary map.
A widget that allows for naviagtion by panning
Pans the map a fixed amount in a particular direction
A widget that combines pan and query functionality.
Print the current map.
The Query widget prompts the user for some inputs and then executes a query on the map.
Allows the user to create a temporary OpenLayers Vector layer and draw POINT, LINE and POLYGON features on that layer.
Refreshes the current map view without changing zoom or center.
Save the current map image on the client’s computer
A dynamically generated cartographic scalebar
A dynamically generated cartographic scalebar that looks like the Google scalebar
A widget that displays a pre-configured search form to the user and then runs the search.
perform a selection on map features
perform a selection using a polygon
perform a selection by radius from a point
A widget to allow the user to specify the radius to use for a SelectRadius widget.
A widget to perform a selection within a currently selected set of features.
Displays the number of features and number of layers in the current selection.
A widget to display information about the currently selected set of features.
{String} The default image for Previous page button.
{String} The default image for Previous page button.
This is a class designed to help users to create their own renderer for customize display results.
{Fusion.Widget.SelectionPanel} The parent widget that uses the renderer.
{Array(int)} The index of the current position for pagination.
{int} The number of results per page for pagination.
Constructor for a new Fusion.Widget.SelectionPanel.SelectionRenderer instance.
Helper method to update the aiCurrentIndex array for pagination.
Get the next batches of features.
Get the previous batches of features.
Helper method to obtains the map.
Get a batches of features in a selection.
Abstract method that handle the event: Fusion.Event.MAP_SELECTION_ON.
Abstract method that handle the event: Fusion.Event.MAP_SELECTION_OFF.
This class provide a default behavior for the selection panel.
This class provide a alternate behavior for the selection panel.
A utility widget that holds output from other widgets.
The Theme widget prompts the user for some inputs and then creates a new themed layer based on one of the existing map layers.
A widget to allow selection of the display units for various widgets
Display the size of the current view in user-definable units
A widget that will zoom the map in or out.
Zoom the map by a fixed amount when a button is clicked
Zoom to the current selection, if any
Implements the map layer for Generic mapping services.
Implements the map widget for MapGuide Open Source services.
This function should be called after the map has loaded.
Returns an OpenLayers MapGuide layer object
Returns the MapGuide layer object as identified by the layer name
Returns the MapGuide layer object as identified by the layer unique id
Implementation of the map widget for MapServer CGI interface services
This function should be called after the map has loaded.

Fusion. Tools

A set of utility classes that provide common tools for applications

Fusion. Widget

A set of classes that implement the functionlity required for applications

Fusion. Event

A class to provide for event handling at application runtime

Fusion.Lib

A set of classes to provide core funtionality

Fusion. Layers

A set of classes that implement layer functionality for various server technologies.

Fusion. Constant

Application scope constants

Summary
Initialize the Fusion application.
Initialize the Strings hash with the requested locale.
set the current initialization state of the application.
load any scripts that have been queued for loading.
Insert a new script into the loading queue.
Called when a script fails to load for some reason.
a script has loaded.
check if scripts have loaded.
asynchronously load the application definition.
the server has returned the application configuration file that contains enough information to bootstrap the application.
the server has returned the application configuration file that contains enough information to bootstrap the application.
the application failed to load the application configuration file.
convenience function to issue an XmlHttpRequest to the server relative to the Fusion installation.
trap exceptions produced in handling an ajax response.
Convert XML to JSON using a server-side script for requests that aren’t available in JSON.
Callback method to convert the XNR response into an actual json object and triggers the call to the callback method
return a map widget with the given name
return a map widget that is associated with the given DOM element by id.
return the map widget at the given index if there are more than one map elements specified in the AppDef
return a reference to a widget by the id of the DOM Element that it was created in.
returns the applicaiton’s absolute URL minus the filename.html part
returns the application’s absolute URL minus the filename.html part
returns individual elements out of the Fusion config.json file
Accessor to return the server-side script language
Accessor to return the URL of the redirect script
Accessor to return the broker object (for MapGuide only).
Marks a JavaScript file as required which puts it into the queue for loading during Fusion initialization.
Triggers the Fusion.Event.FUSION_ERROR and passes along the error object to the callback functions registered for this event.
returns index into the units array for the given unit name or abbreviation
imperial, metric, degrees or device units
Given a unit, this method returns the units name
Given a unit, this method returns the units abbreviation
Converts a length value from native units into meters.
Converts a length value from meters into native units.
Converts a length value from one unit system into another.
initializes the meters per unit values when a new map is loaded.
find the OpenLayers units identifier given the Fusion metersPerUnit value
Dynamically load a CSS stylesheet.
An initialization time function to parse the application URL parameters and stores them in an array.
Returns the query parameter value for a given parameter name
{String} Relative path of this script.
Return the path to this script for bootstrapping Fusion.
Pre-create a session to avoid the 401 Unauthorized dialog

Functions and Properties

initialize

initialize: function(options)

Initialize the Fusion application.  This method must be called from the template’s onload method once all script files have been loaded.  Applications can register for the event Fusion.Event.FUSION_INITIALIZED to carry out further application initialization when all the Fusion objects have been created and are available.

@param {Object} options

Optional paramters that can be passed to initialize are

{String} applicationDefinitionURLa URL or resource ID for an ApplicationDefinition file
{String} sessionIda session id to start the application with.  Normally, applications are started without a session id and create one.  However, sometimes it is desirable to use an existing session.

initializeLocale

initializeLocale: function(locale)

Initialize the Strings hash with the requested locale.  This method simply extends the OpenLayers strings hash with strings specific to Fusion.  Add strings to the files in fusion/text/[locale].json.  This method can be called before Fusion.initialize() if localized strings are required in the template initialization.

@param {String} localethe locale value e.g.  ‘en-CA’ or simply ‘en’ for English

setLoadState

setLoadState: function(state)

set the current initialization state of the application.  Depending on the state, this will cause various scripts to be loaded.

Parameter {Integer} state

the new loading state

loadQueuedScripts

loadQueuedScripts: function()

load any scripts that have been queued for loading.  As the scripts load, they are removed.  When all queued scripts have been loaded, the load state is advanced.  If any of the loaded scripts require other scripts (for inheritance), they will be queued and loaded before the load state is advanced.

queueScript

queueScript: function(url)

Insert a new script into the loading queue.  The URL should be relative to the Fusion base url.  The script will not actually be loaded until loadQueuedScripts is called.

Parameter: {String} url

The url of the script.

scriptFailed

scriptFailed: function(url)

Called when a script fails to load for some reason.

Parameter: url

{String} the url that failed to load

TODO: the application probably won’t work if a script fails to load so we need to decide how to inform the user and fail gracefully.

scriptLoaded

scriptLoaded: function(url)

a script has loaded.  It is removed from the various tracking arrays.  When all requested scripts have been loaded, we check to see if any scripts where required by the ones just loaded.  If yes, then we loadQueuedScripts again, otherwise we advance the load state.

Parameter: url

{String} the url of the script that was loaded.

checkLoadingScripts

checkLoadingScripts: function()

check if scripts have loaded.  In IE, scripts don’t seem to fire the onload event.  Safari also seems to have some problems.

loadConfig

loadConfig: function()

asynchronously load the application definition.  For MapGuide, also set up the broker object.  Once the AppDef is loaded/created advance the laod state.

getConfigCB

getConfigCB: function(r)

the server has returned the application configuration file that contains enough information to bootstrap the application.

Parameter {Object} r an XMLHttpRequest object

serverSet

serverSet: function()

the server has returned the application configuration file that contains enough information to bootstrap the application.

Parameter {Object} r an XMLHttpRequest object

serverFailed

serverFailed: function(r)

the application failed to load the application configuration file.  Not much point in continuing, but we can inform the user why this happened.

Parameter: {Object} r

the XMLHttpRequest object

TODO: do something more useful in here?

ajaxRequest

ajaxRequest: function(scriptURL,
options)

convenience function to issue an XmlHttpRequest to the server relative to the Fusion installation.

Parameter: {String} scriptURL

the URL (relative to Fusion) to request

Parameter: {Object} options

optional parameters to send with the request, passed directly to the OpenLayers Ajax.Request function

ajaxException

ajaxException: function(r,
e)

trap exceptions produced in handling an ajax response.

Parameter: {XmlHttpRequest} r

Parameter: {Exception} e

getXmlAsJson

getXmlAsJson: function(url,
callback)

Convert XML to JSON using a server-side script for requests that aren’t available in JSON.

Parameter: {String} urlthe URL of the XML object to be converted; this can be any URL and is not prepended with the Fusion URL
Parameter: {Function} callbacka callback function to be called if the request is successful

boolean indicator if the content is JSON or not.

xml2json

xml2json: function(callback,
r,
json)

Callback method to convert the XNR response into an actual json object and triggers the call to the callback method

Parameter: callback

callback method to be executed on success and will be passed a parsed json object

Parameter: {XmlHttpRequest} r

the XmlHttpRequest object

Parameter: json

boolean indicator if the content is JSON or not (set by OpenLayers)

getMapByName

getMapByName: function(name)

return a map widget with the given name

Parameter: {String} name

The map name to return

Returns: {Object} a map object or null if not found.

getMapById

getMapById: function(id)

return a map widget that is associated with the given DOM element by id.

Parameter: {String} id

The map id to return

Returns: {Object} a map object or null if not found.

getMapByIndice

getMapByIndice: function(indice)

return the map widget at the given index if there are more than one map elements specified in the AppDef

Parameter: {String} indice

The map indice to return

Returns: {Object} a map object or null if not found.

getWidgetById

getWidgetById: function(id)

return a reference to a widget by the id of the DOM Element that it was created in.

Parameter: {String} id

the DOM id to get the widget for

Returns: {Fusion.Widget} the widget or null

getApplicationURL

getApplicationURL: function()

returns the applicaiton’s absolute URL minus the filename.html part

Returns: {String} a URL

getFusionURL

getFusionURL: function()

returns the application’s absolute URL minus the filename.html part

Returns: {String} a URL

getConfigurationItem

getConfigurationItem: function(arch,
key)

returns individual elements out of the Fusion config.json file

Parameter: {String} archthe server architecture (mapguide or mapserver)
Parameter: {String} keythe config item to be returned

Returns: {String} a the value for the key of null if not found

getScriptLanguage

getScriptLanguage: function()

Accessor to return the server-side script language

Returns: {String} the script language e.g.  ‘php’

getRedirectScript

getRedirectScript: function()

Accessor to return the URL of the redirect script

Returns: {String} a URL

getBroker

getBroker: function()

Accessor to return the broker object (for MapGuide only).  The broker is used to prepare various queries to the MapGuide server.

Returns: {Object} the broker object

require

require: function(url)

Marks a JavaScript file as required which puts it into the queue for loading during Fusion initialization.  Widget code is included through this mecahnism

Parameter: {String} urlthe URL of the JS file to be loaded

Returns: none

reportError

reportError: function(o)

Triggers the Fusion.Event.FUSION_ERROR and passes along the error object to the callback functions registered for this event.  Widgets call Fusion.reportError(o) to inform the system of errors.  Applications will typically register an event listener for the error event and do something to report the error to the user.  By default, errors are not reported since there is no listener

Parameter: {Object} othe error object which is typically a string

Returns: none

unitFromName

unitFromName: function(unit)

returns index into the units array for the given unit name or abbreviation

Parameter: {String} unitthe units name to look up

Returns: {Integer} index into the units array

unitFromName

Given a unit, this method returns if the units system is one of

imperial, metric, degrees or device units

Parameter: {Integer} unitthe units array index

Returns: {String} the units system

unitName

unitName: function(unit)

Given a unit, this method returns the units name

Parameter: {Integer} unitthe units array index

Returns: {String} the units name

unitAbbr

unitAbbr: function(unit)

Given a unit, this method returns the units abbreviation

Parameter: {Integer} unitthe units array index

Returns: {String} the units abbreviation

toMeter

toMeter: function(unit,
value)

Converts a length value from native units into meters.  This is the identity transform if the input units are meters

Parameter: {Integer} unitthe units array index
Parameter: {Float} valuethe value to be converted

Returns: {Float} the value in meters

fromMeter

fromMeter: function(unit,
value)

Converts a length value from meters into native units.  This is the identity transform if the native units are meters

Parameter: {Integer} unitthe units array index
Parameter: {Float} valuethe value to be converted

Returns: {Float} the value in native units

convert

convert: function(unitsIn,
unitsOut,
value)

Converts a length value from one unit system into another.

Parameter: {Integer} unitsInthe units array index of the input
Parameter: {Integer} unitsOutthe units array index of the output
Parameter: {Float} valuethe value to be converted

Returns: {Float} the value in output units

initUnits

initUnits: function(metersPerUnit)

initializes the meters per unit values when a new map is loaded.  Some systems make different assumptions for the conversion of degrees to meters so this makes sure both Fusion and OpenLayers are using the same value.

Parameter: {Float} metersPerUnitthe value returned by LoadMap.php for meters per unit

getClosestUnits

getClosestUnits: function(metersPerUnit)

find the OpenLayers units identifier given the Fusion metersPerUnit value

@param metersPerUnit the value returned by LoadMap.php for meters per unit

addWidgetStyleSheet

addWidgetStyleSheet: function(url)

Dynamically load a CSS stylesheet.  The url will be prepended with the Fusion URL.

Parameter: {String} urlthe URL of the CSS file to be loaded

Returns: none

parseQueryString

parseQueryString: function()

An initialization time function to parse the application URL parameters and stores them in an array.  They can be retrieved using Fusion.getQueryParam(key).

Returns: {Array} an array of the query params from when the page was loaded

getQueryParam

getQueryParam: function(p)

Returns the query parameter value for a given parameter name

Parameter: {String} pthe parameter to lookup

Returns: parameter value or the empty string ‘’ if not found

_scriptName

{String} Relative path of this script.

_getScriptLocation

_getScriptLocation: function ()

Return the path to this script for bootstrapping Fusion.

Returns

{String} Path to this script

createSessionId

var createSessionId = function()

Pre-create a session to avoid the 401 Unauthorized dialog

OpenLayers

The OpenLayers object provides a namespace for all things OpenLayers

Summary
{String} Relative path of this script.
Return the path to this script.

Properties

_scriptName

{String} Relative path of this script.

Functions

_getScriptLocation

_getScriptLocation: function ()

Return the path to this script.

Returns

{String} Path to this script

Constants

VERSION_NUMBER

Util

Summary
This is the old $() from prototype
Remove an object from an array.
Deprecated.
Seems to exist already in FF, but not in MOZ.
Modifies many properties of a DOM element all at once.
Creates a new div and optionally set some standard attributes.
Creates an img element with specific attribute values.
Deprecated.
Bound to image load events.
{String} The color tiles with load errors will turn.
{Integer} How many times should we try to reload an image before giving up? 
{Boolean} true if the png alpha hack is necessary and possible, false otherwise.
Checks whether it’s necessary (and possible) to use the png alpha hack which allows alpha transparency for png images under Internet Explorer.
Creates a new hashtable and copies over all the keys from the passed-in object, but storing them under an uppercased version of the key at which they were stored.
Takes an object and copies any properties that don’t exist from another properties, by analogy with OpenLayers.Util.extend() from Prototype.js.
{String} Default is ‘’.
{String} The fully formatted image location string
Execute functions until one of them doesn’t throw an error.
These could/should be made namespace aware?
{Number} The number of significant digits to retain to avoid floating point precision errors.
Convenience method to cast an object to a Number, rounded to the desired floating point precision.
Given two objects representing points with geographic coordinates, this calculates the distance between those points on the surface of an ellipsoid.
Parse the parameters from a URL or from the current page itself into a JavaScript Object.
Deprecated.
{Integer} The ever-incrementing count variable.
Create a unique identifier for this session.
{Object} Constant inches per unit -- borrowed from MapServer mapscale.c derivation of nautical miles from http://en.wikipedia.org/wiki/Nautical_mile Includes the full set of units supported by CS-MAP (http://trac.osgeo.org/csmap/) and PROJ.4 (http://trac.osgeo.org/proj/) The hardcoded table is maintain in a CS-MAP source code module named CSdataU.c The hardcoded table of PROJ.4 units are in pj_units.c.
{Integer} 72 (A sensible default)
Deprecated.
Calculates the position of an element on the page.
Test two URLs for equivalence.
Takes a url and removes everything after the ?
{String} A string which specifies which is the current browser in which we are running.
Renders the contentHTML offscreen to determine actual dimensions for popup sizing.

Functions and Properties

getElement

OpenLayers.Util.getElement = function()

This is the old $() from prototype

removeItem

OpenLayers.Util.removeItem = function(array,
item)

Remove an object from an array.  Iterates through the array to find the item, then removes it.

Parameters

array{Array}
item{Object}

Return {Array} A reference to the array

clearArray

OpenLayers.Util.clearArray = function(array)

Deprecated.  This function will disappear in 3.0.  Please use “array.length = 0” instead.

Parameters

array{Array}

indexOf

OpenLayers.Util.indexOf = function(array,
obj)

Seems to exist already in FF, but not in MOZ.

Parameters

array{Array}
obj{Object}

Returns

{Integer} The index at, which the object was found in the array.  If not found, returns -1.

modifyDOMElement

OpenLayers.Util.modifyDOMElement = function(element,
id,
px,
sz,
position,
border,
overflow,
opacity)

Modifies many properties of a DOM element all at once.  Passing in null to an individual parameter will avoid setting the attribute.

Parameters

id{String} The element id attribute to set.
px{OpenLayers.Pixel} The left and top style position.
sz{OpenLayers.Size} The width and height style attributes.
position{String} The position attribute.  eg: absolute, relative, etc.
border{String} The style.border attribute.  eg: solid black 2px
overflow{String} The style.overview attribute.
opacity{Float} Fractional value (0.0 - 1.0)

createDiv

OpenLayers.Util.createDiv = function(id,
px,
sz,
imgURL,
position,
border,
overflow,
opacity)

Creates a new div and optionally set some standard attributes.  Null may be passed to each parameter if you do not wish to set a particular attribute.  Note - zIndex is NOT set on the resulting div.

Parameters

id{String} An identifier for this element.  If no id is passed an identifier will be created automatically.
px{OpenLayers.Pixel} The element left and top position.
sz{OpenLayers.Size} The element width and height.
imgURL{String} A url pointing to an image to use as a background image.
position{String} The style.position value. eg: absolute, relative etc.
border{String} The the style.border value. eg: 2px solid black
overflow{String} The style.overflow value.  Eg. hidden
opacity{Float} Fractional value (0.0 - 1.0)

Returns

{DOMElement} A DOM Div created with the specified attributes.

createImage

OpenLayers.Util.createImage = function(id,
px,
sz,
imgURL,
position,
border,
opacity,
delayDisplay)

Creates an img element with specific attribute values.

Parameters

id{String} The id field for the img.  If none assigned one will be automatically generated.
px{OpenLayers.Pixel} The left and top positions.
sz{OpenLayers.Size} The style.width and style.height values.
imgURL{String} The url to use as the image source.
position{String} The style.position value.
border{String} The border to place around the image.
opacity{Float} Fractional value (0.0 - 1.0)
delayDisplay{Boolean} If true waits until the image has been loaded.

Returns

{DOMElement} A DOM Image created with the specified attributes.

setOpacity

OpenLayers.Util.setOpacity = function(element,
opacity)

Deprecated.  This function has been deprecated.  Instead, please use <OpenLayers.Util.modifyDOMElement> or <OpenLayers.Util.modifyAlphaImageDiv>

Set the opacity of a DOM Element Note that for this function to work in IE, elements must “have layout” according to: http://msdn.microsoft.com- /workshop- /author- /dhtml- /reference- /properties- /haslayout.asp

Parameters

element{DOMElement} Set the opacity on this DOM element
opacity{Float} Opacity value (0.0 - 1.0)

onImageLoad

OpenLayers.Util.onImageLoad = function()

Bound to image load events.  For all images created with createImage or createAlphaImageDiv, this function will be bound to the load event.

onImageLoadErrorColor

{String} The color tiles with load errors will turn.  Default is “pink”

IMAGE_RELOAD_ATTEMPTS

{Integer} How many times should we try to reload an image before giving up?  Default is 0

onImageLoadError

OpenLayers.Util.onImageLoadError = function()

alphaHackNeeded

{Boolean} true if the png alpha hack is necessary and possible, false otherwise.

alphaHack

OpenLayers.Util.alphaHack = function()

Checks whether it’s necessary (and possible) to use the png alpha hack which allows alpha transparency for png images under Internet Explorer.

Returns

{Boolean} true if the png alpha hack is necessary and possible, false otherwise.

modifyAlphaImageDiv

OpenLayers.Util.modifyAlphaImageDiv = function(div,
id,
px,
sz,
imgURL,
position,
border,
sizing,
opacity)
div{DOMElement} Div containing Alpha-adjusted Image
id{String}
px{OpenLayers.Pixel}
sz{OpenLayers.Size}
imgURL{String}
position{String}
border{String} sizing {String} ‘crop’, ‘scale’, or ‘image’.  Default is “scale”
opacity{Float} Fractional value (0.0 - 1.0)

createAlphaImageDiv

OpenLayers.Util.createAlphaImageDiv = function(id,
px,
sz,
imgURL,
position,
border,
sizing,
opacity,
delayDisplay)
id{String}
px{OpenLayers.Pixel}
sz{OpenLayers.Size}
imgURL{String}
position{String}
border{String}
sizing{String} ‘crop’, ‘scale’, or ‘image’.  Default is “scale”
opacity{Float} Fractional value (0.0 - 1.0)
delayDisplay{Boolean} If true waits until the image has been loaded.

Returns

{DOMElement} A DOM Div created with a DOM Image inside it.  If the hack is needed for transparency in IE, it is added.

upperCaseObject

OpenLayers.Util.upperCaseObject = function (object)

Creates a new hashtable and copies over all the keys from the passed-in object, but storing them under an uppercased version of the key at which they were stored.

Parameters

object{Object}

Returns

{Object} A new Object with all the same keys but uppercased

applyDefaults

OpenLayers.Util.applyDefaults = function (to,
from)

Takes an object and copies any properties that don’t exist from another properties, by analogy with OpenLayers.Util.extend() from Prototype.js.

Parameters

to{Object} The destination object.
from{Object} The source object.  Any properties of this object that are undefined in the to object will be set on the to object.

Returns

{Object} A reference to the to object.  Note that the to argument is modified in place and returned by this function.

getParameterString

OpenLayers.Util.getParameterString = function(params)

Parameters

params{Object}

Returns

{String} A concatenation of the properties of an object in http parameter notation.  (ex.  <i>”key1=value1&key2=value2&key3=value3”</i>) If a parameter is actually a list, that parameter will then be set to a comma-seperated list of values (foo,bar) instead of being URL escaped (foo%3Abar).

ImgPath

{String} Default is ‘’.

getImagesLocation

OpenLayers.Util.getImagesLocation = function()

Returns

{String} The fully formatted image location string

Try

OpenLayers.Util.Try = function()

Execute functions until one of them doesn’t throw an error.  Capitalized because “try” is a reserved word in JavaScript.  Taken directly from OpenLayers.Util.Try()

Parameters

[*]{Function} Any number of parameters may be passed to Try() It will attempt to execute each of them until one of them successfully executes.  If none executes successfully, returns null.

Returns

{*} The value returned by the first successfully executed function.

getNodes

OpenLayers.Util.getNodes=function(p,
tagName)

These could/should be made namespace aware?

Parameters

p{}
tagName{String}

Returns

{Array}

_getNodes

OpenLayers.Util._getNodes=function(nodes,
tagName)

Parameters

nodes{Array}
tagName{String}

Returns

{Array}

getTagText

OpenLayers.Util.getTagText = function (parent,
item,
index)

Parameters

parent{}
item{String}
index{Integer}

Returns

{String}

getXmlNodeValue

OpenLayers.Util.getXmlNodeValue = function(node)

Parameters

node{XMLNode}

Returns

{String} The text value of the given node, without breaking in firefox or IE

mouseLeft

OpenLayers.Util.mouseLeft = function (evt,
div)

Parameters

evt{Event}
div{HTMLDivElement}

Returns

{Boolean}

precision

{Number} The number of significant digits to retain to avoid floating point precision errors.

We use 14 as a “safe” default because, although IEEE 754 double floats (standard on most modern operating systems) support up to about 16 significant digits, 14 significant digits are sufficient to represent sub-millimeter accuracy in any coordinate system that anyone is likely to use with OpenLayers.

If DEFAULT_PRECISION is set to 0, the original non-truncating behavior of OpenLayers <2.8 is preserved.  Be aware that this will cause problems with certain projections, e.g. spherical Mercator.

toFloat

OpenLayers.Util.toFloat = function (number,
precision)

Convenience method to cast an object to a Number, rounded to the desired floating point precision.

Parameters

number{Number} The number to cast and round.
precision{Number} An integer suitable for use with Number.toPrecision().  Defaults to OpenLayers.Util.DEFAULT_PRECISION.  If set to 0, no rounding is performed.

Returns

{Number} The cast, rounded number.

rad

OpenLayers.Util.rad = function(x)

Parameters

x{Float}

Returns

{Float}

distVincenty

OpenLayers.Util.distVincenty=function(p1,
p2)

Given two objects representing points with geographic coordinates, this calculates the distance between those points on the surface of an ellipsoid.

Parameters

p1{OpenLayers.LonLat} (or any object with both .lat, .lon properties)
p2{OpenLayers.LonLat} (or any object with both .lat, .lon properties)

Returns

{Float} The distance (in km) between the two input points as measured on an ellipsoid.  Note that the input point objects must be in geographic coordinates (decimal degrees) and the return distance is in kilometers.

getParameters

OpenLayers.Util.getParameters = function(url)

Parse the parameters from a URL or from the current page itself into a JavaScript Object.  Note that parameter values with commas are separated out into an Array.

Parameters

url{String} Optional url used to extract the query string.  If null, query string is taken from page location.

Returns

{Object} An object of key/value pairs from the query string.

getArgs

OpenLayers.Util.getArgs = function(url)

Deprecated.  Will be removed in 3.0.  Please use instead <OpenLayers.Util.getParameters>

Parameters

url{String} Optional url used to extract the query string.  If null, query string is taken from page location.

Returns

{Object} An object of key/value pairs from the query string.

lastSeqID

{Integer} The ever-incrementing count variable.  Used for generating unique ids.

createUniqueID

OpenLayers.Util.createUniqueID = function(prefix)

Create a unique identifier for this session.  Each time this function is called, a counter is incremented.  The return will be the optional prefix (defaults to “id_”) appended with the counter value.

Parameters

prefix {String} Optionsal string to prefix unique id.  Default is “id_”.

Returns

{String} A unique id string, built on the passed in prefix.

Constants

INCHES_PER_UNIT

{Object} Constant inches per unit -- borrowed from MapServer mapscale.c derivation of nautical miles from http://en.wikipedia.org/wiki/Nautical_mile Includes the full set of units supported by CS-MAP (http://trac.osgeo.org/csmap/) and PROJ.4 (http://trac.osgeo.org/proj/) The hardcoded table is maintain in a CS-MAP source code module named CSdataU.c The hardcoded table of PROJ.4 units are in pj_units.c.

DOTS_PER_INCH

{Integer} 72 (A sensible default)

Functions

normalizeScale

OpenLayers.Util.normalizeScale = function (scale)

Parameters

scale{float}

Returns

{Float} A normalized scale value, in 1 / X format.  This means that if a value less than one ( already 1/x) is passed in, it just returns scale directly.  Otherwise, it returns 1 / scale

getResolutionFromScale

OpenLayers.Util.getResolutionFromScale = function (scale,
units)

Parameters

scale{Float}
units{String} Index into OpenLayers.INCHES_PER_UNIT hashtable.  Default is degrees

Returns

{Float} The corresponding resolution given passed-in scale and unit parameters.

getScaleFromResolution

OpenLayers.Util.getScaleFromResolution = function (resolution,
units)

Parameters

resolution{Float}
units{String} Index into OpenLayers.INCHES_PER_UNIT hashtable.  Default is degrees

Returns

{Float} The corresponding scale given passed-in resolution and unit parameters.

safeStopPropagation

OpenLayers.Util.safeStopPropagation = function(evt)

Deprecated.  This function has been deprecated.  Please use directly OpenLayers.Event.stop passing ‘true’ as the 2nd argument (preventDefault)

Safely stop the propagation of an event without preventing the default browser action from occurring.

Parameter

evt{Event}

pagePositon

Calculates the position of an element on the page.

Parameters

forElement{DOMElement}

Returns

{Array} two item array, L value then T value.

isEquivalentUrl

OpenLayers.Util.isEquivalentUrl = function(url1,
url2,
options)

Test two URLs for equivalence.

Setting ‘ignoreCase’ allows for case-independent comparison.

Comparison is based on

  • Protocol
  • Host (evaluated without the port)
  • Port (set ‘ignorePort80’ to ignore “80” values)
  • Hash ( set ‘ignoreHash’ to disable)
  • Pathname (for relative <-> absolute comparison)
  • Arguments (so they can be out of order)

Parameters

url1{String}
url2{String}
options{Object} Allows for customization of comparison:
’ignoreCase’Default is True
’ignorePort80’Default is True
’ignoreHash’Default is True

Returns

{Boolean} Whether or not the two URLs are equivalent

createUrlObject

OpenLayers.Util.createUrlObject = function(url,
options)

Parameters

url{String}
options{Object} A hash of options.  Can be one of: ignoreCase: lowercase url, ignorePort80: don’t include explicit port if port is 80, ignoreHash: Don’t include part of url after the hash (#).

Returns

{Object} An object with separate url, a, port, host, and args parsed out and ready for comparison

removeTail

OpenLayers.Util.removeTail = function(url)

Takes a url and removes everything after the ? and #

Parameters

url{String} The url to process

Returns

{String} The string with all queryString and Hash removed

getBrowserName

OpenLayers.Util.getBrowserName = function()

Returns

{String} A string which specifies which is the current browser in which we are running.

Currently-supported browser detection and codes

  • ’opera’ -- Opera
  • ’msie’ -- Internet Explorer
  • ’safari’ -- Safari
  • ’firefox’ -- FireFox
  • ’mozilla’ -- Mozilla

If we are unable to property identify the browser, we return an empty string.

getRenderedDimensions

OpenLayers.Util.getRenderedDimensions = function(contentHTML,
size,
options)

Renders the contentHTML offscreen to determine actual dimensions for popup sizing.  As we need layout to determine dimensions the content is rendered -9999px to the left and absolute to ensure the scrollbars do not flicker

Parameters

contentHTML size - {OpenLayers.Size} If either the ‘w’ or ‘h’ properties is specified, we fix that dimension of the div to be measured.  This is useful in the case where we have a limit in one dimension and must therefore meaure the flow in the other dimension. options - {Object} displayClass - {String} Optional parameter.  A CSS class name(s) string to provide the CSS context of the rendered content. containerElement - {DOMElement} Optional parameter.  Insert the HTML to this node instead of the body root when calculating dimensions.

Returns

{OpenLayers.Size}

OpenLayers. Console

The OpenLayers.Console namespace is used for debugging and error logging.  If the Firebug Lite (../Firebug/firebug.js) is included before this script, calls to OpenLayers.Console methods will get redirected to window.console.  This makes use of the Firebug extension where available and allows for cross-browser debugging Firebug style.

Note

Note that behavior will differ with the Firebug extention and Firebug Lite.  Most notably, the Firebug Lite console does not currently allow for hyperlinks to code or for clicking on object to explore their properties.

Summary
OpenLayers custom string, number and function functions are described here.

Files

OpenLayers Base Types

OpenLayers custom string, number and function functions are described here.

OpenLayers. String

Contains convenience functions for string manipulation.

Summary
Used to find tokens in a string.
Used to test strings as numbers.

Properties

OpenLayers. String. tokenRegEx

Used to find tokens in a string.  Examples: ${a}, ${a.b.c}, ${a-b}, ${5}

OpenLayers. String. numberRegEx

Used to test strings as numbers.

OpenLayers. Number

Contains convenience functions for manipulating numbers.

Summary
Decimal separator to use when formatting numbers.
Thousands separator to use when formatting numbers.

Properties

decimalSeparator

Decimal separator to use when formatting numbers.

thousandsSeparator

Thousands separator to use when formatting numbers.

OpenLayers. Function

Contains convenience functions for function manipulation.

OpenLayers. Array

Contains convenience functions for array manipulation.

Summary
Base class used to construct all other classes.
Deprecated.

Functions

OpenLayers. Class

OpenLayers.Class = function()

Base class used to construct all other classes.  Includes support for multiple inheritance.

This constructor is new in OpenLayers 2.5.  At OpenLayers 3.0, the old syntax for creating classes and dealing with inheritance will be removed.

To create a new OpenLayers-style class, use the following syntax

var MyClass = OpenLayers.Class(prototype);

To create a new OpenLayers-style class with multiple inheritance, use the following syntax:

var MyClass = OpenLayers.Class(Class1, Class2, prototype);

Note that instanceof reflection will only reveil Class1 as superclass.  Class2 ff are mixins.

Properties

isPrototype

Deprecated.  This is no longer needed and will be removed at 3.0.

OpenLayers.Size

Instances of this class represent a width/height pair

Summary
Create an instance of OpenLayers.Size
Return the string representation of a size object

Functions

OpenLayers.Size

Create an instance of OpenLayers.Size

Parameters

w{Number} width
h{Number} height

toString

toString:function()

Return the string representation of a size object

Returns

{String} The string representation of OpenLayers.Size object.  (ex.  <i>”w=55,h=66”</i>)

OpenLayers. Bounds

Instances of this class represent bounding boxes.  Data stored as left, bottom, right, top floats.  All values are initialized to null, however, you should make sure you set them before using the bounds for anything.

Possible use case

bounds = new OpenLayers.Bounds();
bounds.extend(new OpenLayers.LonLat(4,5));
bounds.extend(new OpenLayers.LonLat(5,6));
bounds.toBBOX(); // returns 4,5,5,6
Summary
{Number} Minimum horizontal coordinate.
{Number} Minimum vertical coordinate.
{Number} Maximum horizontal coordinate.
{Number} Maximum vertical coordinate.
{OpenLayers.LonLat} A cached center location.
Construct a new bounds object.
Create a cloned instance of this bounds.
Test a two bounds for equivalence.
Scales the bounds around a pixel or lonlat.
Get the opposite quadrant for a given quadrant string.

Properties

left

{Number} Minimum horizontal coordinate.

bottom

{Number} Minimum vertical coordinate.

right

{Number} Maximum horizontal coordinate.

top

{Number} Maximum vertical coordinate.

centerLonLat

{OpenLayers.LonLat} A cached center location.  This should not be accessed directly.  Use <getCenterLonLat> instead.

Functions

OpenLayers. Bounds

Construct a new bounds object.

Parameters

left{Number} The left bounds of the box.  Note that for width calculations, this is assumed to be less than the right value.
bottom{Number} The bottom bounds of the box.  Note that for height calculations, this is assumed to be more than the top value.
right{Number} The right bounds.
top{Number} The top bounds.

clone

clone:function()

Create a cloned instance of this bounds.

Returns

{OpenLayers.Bounds} A fresh copy of the bounds

equals

equals:function(bounds)

Test a two bounds for equivalence.

Parameters

bounds{OpenLayers.Bounds}

Returns

{Boolean} The passed-in bounds object has the same left, right, top, bottom components as this.  Note that if bounds passed in is null, returns false.

scale

scale: function(ratio,
origin)

Scales the bounds around a pixel or lonlat.  Note that the new bounds may return non-integer properties, even if a pixel is passed.

Parameters

ratio{Float}
origin{OpenLayers.Pixel or OpenLayers.LonLat} Default is center.

Returns

{<OpenLayers.Bound>} A new bounds that is scaled by ratio from origin.

oppositeQuadrant

OpenLayers.Bounds.oppositeQuadrant = function(quadrant)

Get the opposite quadrant for a given quadrant string.

Parameters

quadrant{String} two character quadrant shortstring

Returns

{String} The opposing quadrant (“br” “tr” “tl” “bl”).  For Example, if you pass in “bl” it returns “tr”, if you pass in “br” it returns “tl”, etc.

OpenLayers. Element

Summary
Tests if an element has the given CSS class name.
Add a CSS class name to an element.
Remove a CSS class name from an element.
Remove a CSS class name from an element if it exists.

Functions

hasClass

hasClass: function(element,
name)

Tests if an element has the given CSS class name.

Parameters

element{DOMElement} A DOM element node.
name{String} The CSS class name to search for.

Returns

{Boolean} The element has the given class name.

addClass

addClass: function(element,
name)

Add a CSS class name to an element.  Safe where element already has the class name.

Parameters

element{DOMElement} A DOM element node.
name{String} The CSS class name to add.

Returns

{DOMElement} The element.

removeClass

removeClass: function(element,
name)

Remove a CSS class name from an element.  Safe where element does not have the class name.

Parameters

element{DOMElement} A DOM element node.
name{String} The CSS class name to remove.

Returns

{DOMElement} The element.

toggleClass

toggleClass: function(element,
name)

Remove a CSS class name from an element if it exists.  Add the class name if it doesn’t exist.

Parameters

element{DOMElement} A DOM element node.
name{String} The CSS class name to toggle.

Returns

{DOMElement} The element.

OpenLayers. LonLat

This class represents a longitude and latitude pair

Summary
Create a new map location.
Return a readable string version of the lonlat
Alternative constructor that builds a new OpenLayers.LonLat from a parameter string

Functions

OpenLayers. LonLat

Create a new map location.

Parameters

lon{Number} The x-axis coordinate in map units.  If your map is in a geographic projection, this will be the Longitude.  Otherwise, it will be the x coordinate of the map location in your map units.
lat{Number} The y-axis coordinate in map units.  If your map is in a geographic projection, this will be the Latitude.  Otherwise, it will be the y coordinate of the map location in your map units.

toString

toString:function()

Return a readable string version of the lonlat

Returns

{String} String representation of OpenLayers.LonLat object.  (ex.  <i>”lon=5,lat=42”</i>)

fromString

OpenLayers.LonLat.fromString = function(str)

Alternative constructor that builds a new OpenLayers.LonLat from a parameter string

Parameters

str{String} Comma-separated Lon,Lat coordinate string.  (ex.  <i>”5,40”</i>)

Returns

{OpenLayers.LonLat} New OpenLayers.LonLat object built from the passed-in String.

OpenLayers. Pixel

This class represents a screen coordinate, in x and y coordinates

Summary
Create a new OpenLayers.Pixel instance
Cast this object into a string

Functions

OpenLayers. Pixel

Create a new OpenLayers.Pixel instance

Parameters

x{Number} The x coordinate
y{Number} The y coordinate

Returns

An instance of OpenLayers.Pixel

toString

toString:function()

Cast this object into a string

Returns

{String} The string representation of Pixel. ex: “x=200.4,y=242.2”

OpenLayers.Icon

The icon represents a graphical icon on the screen.  Typically used in conjunction with a OpenLayers.Marker to represent markers on a screen.

An icon has a url, size and position.  It also contains an offset which allows the center point to be represented correctly.  This can be provided either as a fixed offset or a function provided to calculate the desired offset.

Summary
{String} image url
{OpenLayers.Pixel} distance in pixels to offset the image when being rendered
{OpenLayers.Pixel} Function to calculate the offset (based on the size)
{DOMElement}
Creates an icon, which is an image tag in a div.
Nullify references and remove event listeners to prevent circular references and memory leaks
{OpenLayers.Icon} A fresh copy of the icon.
Move the div to the given pixel.
Erase the underlying image element.
Change the icon’s opacity
move icon to passed in px.
Hide or show the icon

Properties

url

{String} image url

offset

{OpenLayers.Pixel} distance in pixels to offset the image when being rendered

calculateOffset

{OpenLayers.Pixel} Function to calculate the offset (based on the size)

imageDiv

{DOMElement}

Functions

OpenLayers.Icon

Creates an icon, which is an image tag in a div.

url{String}
size{OpenLayers.Size}
offset{OpenLayers.Pixel}
calculateOffset{Function}

destroy

destroy: function()

Nullify references and remove event listeners to prevent circular references and memory leaks

clone

clone: function()

Returns

{OpenLayers.Icon} A fresh copy of the icon.

setSize

setSize: function(size)

Parameters

size{OpenLayers.Size}

setUrl

setUrl: function(url)

Parameters

url{String}

draw

draw: function(px)

Move the div to the given pixel.

Parameters

px{OpenLayers.Pixel}

Returns

{DOMElement} A new DOM Image of this icon set at the location passed-in

erase

erase: function()

Erase the underlying image element.

setOpacity

setOpacity: function(opacity)

Change the icon’s opacity

Parameters

opacity{float}

moveTo

moveTo: function (px)

move icon to passed in px.

Parameters

px{OpenLayers.Pixel}

display

display: function(display)

Hide or show the icon

Parameters

display{Boolean}

OpenLayers. Popup

A popup is a small div that can opened and closed on the map.  Typically opened in response to clicking on a marker.  See OpenLayers.Marker.  Popup’s don’t require their own layer and are added the the map using the <OpenLayers.Map.addPopup> method.

Example

popup = new OpenLayers.Popup("chicken",
new OpenLayers.LonLat(5,40),
new OpenLayers.Size(200,200),
"example popup",
true);

map.addPopup(popup);
Summary
{OpenLayers.Events} custom event manager
{String} the unique identifier assigned to this popup.
{OpenLayers.LonLat} the position of this popup on the map
{DOMElement} the div that contains this popup.
{OpenLayers.Size} the width and height of the content.
{OpenLayers.Size} the width and height of the popup.
{String} An HTML string for this popup to display.
{String} the background color used by the popup.
{float} the opacity of this popup (between 0.0 and 1.0)
{String} the border size of the popup.
{DOMElement} a reference to the element that holds the content of the div.
{DOMElement} First and only child of ‘div’.
{DOMElement} the optional closer image
{String} The CSS class of the popup.
{String} The CSS class of the popup content div.
{int or OpenLayers.Bounds} An extra opportunity to specify internal padding of the content div inside the popup.
{Boolean} The hack for overflow in Firefox causes all elements to be re-drawn, which causes Flash elements to be re-initialized, which is troublesome.
To be removed in 3.0, this function merely helps us to deal with the case where the user may have set an integer value for padding, instead of an OpenLayers.Bounds object.
{OpenLayers.Map} this gets set in Map.js when the popup is added to the map
Create a popup.
nullify references to prevent circular references and memory leaks
Constructs the elements that make up the popup.
if the popup has a lonlat and its map members set, then have it move itself to its proper position
{Boolean} Boolean indicating whether or not the popup is visible
Toggles visibility of the popup.
Makes the popup visible.
Makes the popup invisible.
Used to adjust the size of the popup.
Sets the background color of the popup.
Sets the opacity of the popup.
Sets the border style of the popup.
Allows the user to set the HTML content of the popup.
Called when an image contained by the popup loaded.
Glorious, oh glorious hack in order to determine the css ‘padding’ of the contentDiv.
Pans the map such that the popup is totaly viewable (if necessary)
Registers events on the popup.
When mouse goes down within the popup, make a note of it locally, and then do not propagate the mousedown (but do so safely so that user can select text inside)
If the drag was started within the popup, then do not propagate the mousemove (but do so safely so that user can select text inside)
When mouse comes up within the popup, after going down in it, reset the flag, and then (once again) do not propagate the event, but do so safely so that user can select text inside
Ignore clicks, but allowing default browser handling
When mouse goes out of the popup set the flag to false so that if they let go and then drag back in, we won’t be confused.
Ignore double-clicks, but allowing default browser handling

Properties and Functions

events

{OpenLayers.Events} custom event manager

id

{String} the unique identifier assigned to this popup.

lonlat

{OpenLayers.LonLat} the position of this popup on the map

div

{DOMElement} the div that contains this popup.

contentSize

{OpenLayers.Size} the width and height of the content.

size

{OpenLayers.Size} the width and height of the popup.

contentHTML

{String} An HTML string for this popup to display.

backgroundColor

{String} the background color used by the popup.

opacity

{float} the opacity of this popup (between 0.0 and 1.0)

border

{String} the border size of the popup.  (eg 2px)

contentDiv

{DOMElement} a reference to the element that holds the content of the div.

groupDiv

{DOMElement} First and only child of ‘div’.  The group Div contains the ‘contentDiv’ and the ‘closeDiv’.

closeDiv

{DOMElement} the optional closer image

displayClass

{String} The CSS class of the popup.

contentDisplayClass

{String} The CSS class of the popup content div.

padding

{int or OpenLayers.Bounds} An extra opportunity to specify internal padding of the content div inside the popup.  This was originally confused with the css padding as specified in style.css’s ‘olPopupContent’ class.  We would like to get rid of this altogether, except that it does come in handy for the framed and anchoredbubble popups, who need to maintain yet another barrier between their content and the outer border of the popup itself.

Note that in order to not break API, we must continue to support this property being set as an integer.  Really, though, we’d like to have this specified as a Bounds object so that user can specify distinct left, top, right, bottom paddings.  With the 3.0 release we can make this only a bounds.

disableFirefoxOverflowHack

{Boolean} The hack for overflow in Firefox causes all elements to be re-drawn, which causes Flash elements to be re-initialized, which is troublesome.  With this property the hack can be disabled.

fixPadding

fixPadding: function()

To be removed in 3.0, this function merely helps us to deal with the case where the user may have set an integer value for padding, instead of an OpenLayers.Bounds object.

map

{OpenLayers.Map} this gets set in Map.js when the popup is added to the map

OpenLayers. Popup

Create a popup.

Parameters

id{String} a unqiue identifier for this popup.  If null is passed an identifier will be automatically generated.
lonlat{OpenLayers.LonLat} The position on the map the popup will be shown.
contentSize{OpenLayers.Size} The size of the content.
contentHTML{String} An HTML string to display inside the popup.
closeBox{Boolean} Whether to display a close box inside the popup.
closeBoxCallback{Function} Function to be called on closeBox click.

destroy

destroy: function()

nullify references to prevent circular references and memory leaks

draw

draw: function(px)

Constructs the elements that make up the popup.

Parameters

px{OpenLayers.Pixel} the position the popup in pixels.

Returns

{DOMElement} Reference to a div that contains the drawn popup

updatePosition

updatePosition: function()

if the popup has a lonlat and its map members set, then have it move itself to its proper position

moveTo

moveTo: function(px)

Parameters

px{OpenLayers.Pixel} the top and left position of the popup div.

visible

visible: function()

Returns

{Boolean} Boolean indicating whether or not the popup is visible

toggle

toggle: function()

Toggles visibility of the popup.

show

show: function()

Makes the popup visible.

hide

hide: function()

Makes the popup invisible.

setSize

setSize:function(contentSize)

Used to adjust the size of the popup.

Parameters

contentSize{OpenLayers.Size} the new size for the popup’s contents div (in pixels).

setBackgroundColor

setBackgroundColor:function(color)

Sets the background color of the popup.

Parameters

color{String} the background color.  eg “#FFBBBB”

setOpacity

setOpacity:function(opacity)

Sets the opacity of the popup.

Parameters

opacity{float} A value between 0.0 (transparent) and 1.0 (solid).

setBorder

setBorder:function(border)

Sets the border style of the popup.

Parameters

border{String} The border style value. eg 2px

setContentHTML

setContentHTML:function(contentHTML)

Allows the user to set the HTML content of the popup.

Parameters

contentHTML{String} HTML for the div.

registerImageListeners

registerImageListeners: function()

Called when an image contained by the popup loaded. this function updates the popup size, then unregisters the image load listener.

getContentDivPadding

getContentDivPadding: function()

Glorious, oh glorious hack in order to determine the css ‘padding’ of the contentDiv.  IE/Opera return null here unless we actually add the popup’s main ‘div’ element (which contains contentDiv) to the DOM.  So we make it invisible and then add it to the document temporarily.

Once we’ve taken the padding readings we need, we then remove it from the DOM (it will actually get added to the DOM in Map.js’s addPopup)

Returns

{OpenLayers.Bounds}

addCloseBox

addCloseBox: function(callback)

Parameters

callback{Function} The callback to be called when the close button is clicked.

panIntoView

panIntoView: function()

Pans the map such that the popup is totaly viewable (if necessary)

registerEvents

registerEvents:function()

Registers events on the popup.

Do this in a separate function so that subclasses can choose to override it if they wish to deal differently with mouse events

Note in the following handler functions that some special care is needed to deal correctly with mousing and popups.

Because the user might select the zoom-rectangle option and then drag it over a popup, we need a safe way to allow the mousemove and mouseup events to pass through the popup when they are initiated from outside.

Otherwise, we want to essentially kill the event propagation for all other events, though we have to do so carefully, without disabling basic html functionality, like clicking on hyperlinks or drag-selecting text.

onmousedown

onmousedown: function (evt)

When mouse goes down within the popup, make a note of it locally, and then do not propagate the mousedown (but do so safely so that user can select text inside)

Parameters

evt{Event}

onmousemove

onmousemove: function (evt)

If the drag was started within the popup, then do not propagate the mousemove (but do so safely so that user can select text inside)

Parameters

evt{Event}

onmouseup

onmouseup: function (evt)

When mouse comes up within the popup, after going down in it, reset the flag, and then (once again) do not propagate the event, but do so safely so that user can select text inside

Parameters

evt{Event}

onclick

onclick: function (evt)

Ignore clicks, but allowing default browser handling

Parameters

evt{Event}

onmouseout

onmouseout: function (evt)

When mouse goes out of the popup set the flag to false so that if they let go and then drag back in, we won’t be confused.

Parameters

evt{Event}

ondblclick

ondblclick: function (evt)

Ignore double-clicks, but allowing default browser handling

Parameters

evt{Event}

OpenLayers. Protocol

Abstract vector layer protocol class.  Not to be instantiated directly.  Use one of the protocol subclasses instead.

Summary
{OpenLayers.Format} The format used by this protocol.
{Object} Any options sent to the constructor.
{Boolean} The creator of the protocol can set autoDestroy to false to fully control when the protocol is destroyed.
Abstract class for vector protocols.
Abort an ongoing request.

Properties

format

{OpenLayers.Format} The format used by this protocol.

options

{Object} Any options sent to the constructor.

autoDestroy

{Boolean} The creator of the protocol can set autoDestroy to false to fully control when the protocol is destroyed.  Defaults to true.

Functions

OpenLayers. Protocol

Abstract class for vector protocols.  Create instances of a subclass.

Parameters

options{Object} Optional object whose properties will be set on the instance.

abort

abort: function(response)

Abort an ongoing request.

Parameters

response{OpenLayers.Protocol.Response}

OpenLayers. Protocol. Response

Protocols return Response objects to their users.

Summary
{String} The type of request this response corresponds to.
{Array({OpenLayers.Feature.Vector})} or {OpenLayers.Feature.Vector} The features returned in the response by the server.
{Array({OpenLayers.Feature.Vector})} or {OpenLayers.Feature.Vector} The features provided by the user and placed in the request by the protocol.

Properties

code

{Number}OpenLayers.Protocol.Response.SUCCESS or OpenLayers.Protocol.Response.FAILURE

requestType

{String} The type of request this response corresponds to.  Either “create”, “read”, “update” or “delete”.

last

{Boolean}true if this is the last response expected in a commit, false otherwise, defaults to true.

features

{Array({OpenLayers.Feature.Vector})} or {OpenLayers.Feature.Vector} The features returned in the response by the server.

reqFeatures

{Array({OpenLayers.Feature.Vector})} or {OpenLayers.Feature.Vector} The features provided by the user and placed in the request by the protocol.

priv

Functions

OpenLayers. Protocol. Response

Parameters

options{Object} Optional object whose properties will be set on the instance.

success

success: function()

Returns

{Boolean}true on success, false otherwise

OpenLayers. Renderer

This is the base class for all renderers.

This is based on a merger code written by Paul Spencer and Bertil Chapuis.  It is largely composed of virtual functions that are to be implemented in technology-specific subclasses, but there is some generic code too.

The functions that are implemented here merely deal with the maintenance of the size and extent variables, as well as the cached ‘resolution’ value.

A note to the user that all subclasses should use getResolution() instead of directly accessing this.resolution in order to correctly use the cacheing system.

Summary
{DOMElement}
{DOMElement}
{Boolean} If the renderer is currently in a state where many things are changing, the ‘locked’ property is set to true.
{Float} cache of current map resolution
{OpenLayers.Map} Reference to the map -- this is set in Vector’s setMap()
Set the visible part of the layer.
Sets the size of the drawing surface.
Uses cached copy of resolution if available to minimize computing
Draw the feature.
Draw a geometry.
Function for drawing text labels.
Function for removing text labels.
Clear all vectors from the renderer.
Returns a feature id from an event on the renderer.
This is called by the layer to erase features
Remove a geometry from the renderer (by id).
moves this renderer’s root to a (different) renderer.
Gets the layer that this renderer’s output appears on.

Properties

container

{DOMElement}

root

{DOMElement}

locked

{Boolean} If the renderer is currently in a state where many things are changing, the ‘locked’ property is set to true.  This means that renderers can expect at least one more drawFeature event to be called with the ‘locked’ property set to ‘true’: In some renderers, this might make sense to use as a ‘only update local information’ flag.

resolution

{Float} cache of current map resolution

map

{OpenLayers.Map} Reference to the map -- this is set in Vector’s setMap()

Functions

OpenLayers. Renderer

Parameters

containerID{String}
options{Object} options for this renderer.  See sublcasses for supported options.

setExtent

setExtent: function(extent,
resolutionChanged)

Set the visible part of the layer.

Resolution has probably changed, so we nullify the resolution cache (this.resolution) -- this way it will be re-computed when next it is needed.  We nullify the resolution cache (this.resolution) if resolutionChanged is set to true - this way it will be re-computed on the next getResolution() request.

Parameters

extent{OpenLayers.Bounds}
resolutionChanged{Boolean}

setSize

setSize: function(size)

Sets the size of the drawing surface.

Resolution has probably changed, so we nullify the resolution cache (this.resolution) -- this way it will be re-computed when next it is needed.

Parameters

size{OpenLayers.Size}

getResolution

getResolution: function()

Uses cached copy of resolution if available to minimize computing

Returns

The current map’s resolution

drawFeature

drawFeature: function(feature,
style)

Draw the feature.  The optional style argument can be used to override the feature’s own style.  This method should only be called from layer.drawFeature().

Parameters

feature{OpenLayers.Feature.Vector}
style{<Object>}

Returns

{Boolean} true if the feature has been drawn completely, false if not, undefined if the feature had no geometry

drawGeometry

drawGeometry: function(geometry,
style,
featureId)

Draw a geometry.  This should only be called from the renderer itself.  Use layer.drawFeature() from outside the renderer. virtual function

Parameters

geometry{OpenLayers.Geometry}
style{Object}
featureId{String}

drawText

drawText: function(featureId,
style,
location)

Function for drawing text labels.  This method is only called by the renderer itself.

Parameters

featureId{String} style -
location{OpenLayers.Geometry.Point}

removeText

removeText: function(featureId)

Function for removing text labels.  This method is only called by the renderer itself.

Parameters

featureId{String}

clear

clear: function()

Clear all vectors from the renderer. virtual function.

getFeatureIdFromEvent

getFeatureIdFromEvent: function(evt)

Returns a feature id from an event on the renderer.  How this happens is specific to the renderer.  This should be called from layer.getFeatureFromEvent().  Virtual function.

Parameters

evt{OpenLayers.Event}

Returns

{String} A feature id or null.

eraseFeatures

eraseFeatures: function(features)

This is called by the layer to erase features

Parameters

features{Array(OpenLayers.Feature.Vector)}

eraseGeometry

eraseGeometry: function(geometry)

Remove a geometry from the renderer (by id). virtual function.

Parameters

geometry{OpenLayers.Geometry}

moveRoot

moveRoot: function(renderer)

moves this renderer’s root to a (different) renderer.  To be implemented by subclasses that require a common renderer root for feature selection.

Parameters

renderer{OpenLayers.Renderer} target renderer for the moved root

getRenderLayerId

getRenderLayerId: function()

Gets the layer that this renderer’s output appears on.  If moveRoot was used, this will be different from the id of the layer containing the features rendered by this renderer.

Returns

{String} the id of the output layer.

OpenLayers. Strategy

Abstract vector layer strategy class.  Not to be instantiated directly.  Use one of the strategy subclasses instead.

Summary
{OpenLayers.Layer.Vector} The layer this strategy belongs to.
{Object} Any options sent to the constructor.
{Boolean} The control is active.
{Boolean} The creator of the strategy can set autoActivate to false to fully control when the protocol is activated and deactivated.
{Boolean} The creator of the strategy can set autoDestroy to false to fully control when the strategy is destroyed.
Abstract class for vector strategies.
Called to set the layer property.
Activate the strategy.
Deactivate the strategy.

Properties

layer

{OpenLayers.Layer.Vector} The layer this strategy belongs to.

options

{Object} Any options sent to the constructor.

active

{Boolean} The control is active.

autoActivate

{Boolean} The creator of the strategy can set autoActivate to false to fully control when the protocol is activated and deactivated.  Defaults to true.

autoDestroy

{Boolean} The creator of the strategy can set autoDestroy to false to fully control when the strategy is destroyed.  Defaults to true.

Functions

OpenLayers. Strategy

Abstract class for vector strategies.  Create instances of a subclass.

Parameters

options{Object} Optional object whose properties will be set on the instance.

setLayer

setLayer: function(layer)

Called to set the layer property.

Parameters

{OpenLayers.Layer.Vector}

activate

activate: function()

Activate the strategy.  Register any listeners, do appropriate setup.

Returns

{Boolean} True if the strategy was successfully activated or false if the strategy was already active.

deactivate

deactivate: function()

Deactivate the strategy.  Unregister any listeners, do appropriate tear-down.

Returns

{Boolean} True if the strategy was successfully deactivated or false if the strategy was already inactive.

OpenLayers. Control

Controls affect the display or behavior of the map.  They allow everything from panning and zooming to displaying a scale indicator.  Controls by default are added to the map they are contained within however it is possible to add a control to an external div by passing the div in the options parameter.

Example

The following example shows how to add many of the common controls to a map.

var map = new OpenLayers.Map('map', { controls: [] });

map.addControl(new OpenLayers.Control.PanZoomBar());
map.addControl(new OpenLayers.Control.MouseToolbar());
map.addControl(new OpenLayers.Control.LayerSwitcher({'ascending':false}));
map.addControl(new OpenLayers.Control.Permalink());
map.addControl(new OpenLayers.Control.Permalink('permalink'));
map.addControl(new OpenLayers.Control.MousePosition());
map.addControl(new OpenLayers.Control.OverviewMap());
map.addControl(new OpenLayers.Control.KeyboardDefaults());

The next code fragment is a quick example of how to intercept shift-mouse click to display the extent of the bounding box dragged out by the user.  Usually controls are not created in exactly this manner.  See the source for a more complete example:

var control = new OpenLayers.Control();
OpenLayers.Util.extend(control, {
draw: function () {
// this Handler.Box will intercept the shift-mousedown
// before Control.MouseDefault gets to see it
this.box = new OpenLayers.Handler.Box( control,
{"done": this.notice},
{keyMask: OpenLayers.Handler.MOD_SHIFT});
this.box.activate();
},

notice: function (bounds) {
OpenLayers.Console.userError(bounds);
}
});
map.addControl(control);
Summary
{String}
{OpenLayers.Map} this gets set in the addControl() function in OpenLayers.Map
{DOMElement}
{OpenLayers.Control.TYPES} Controls can have a ‘type’.
{Boolean} By deafault, controls do not allow selection, because it may interfere with map dragging.
{string} This property is used for CSS related to the drawing of the Control.
{string} This property is used for showing a tooltip over the Control.
{Boolean} The control is active.
{OpenLayers.Events} Events instance for triggering control specific events.
{Array(String)} Supported application event types.
Create an OpenLayers Control.
The destroy method is used to perform any clean up before the control is dereferenced.
Set the map property for the control.
The draw method is called when the control is ready to be displayed on the page.
Sets the left and top style attributes to the passed in pixel coordinates.
Explicitly activates a control and it’s associated handler if one has been set.
Deactivates a control and it’s associated handler if any.

Properties

id

{String}

map

{OpenLayers.Map} this gets set in the addControl() function in OpenLayers.Map

div

{DOMElement}

type

{OpenLayers.Control.TYPES} Controls can have a ‘type’.  The type determines the type of interactions which are possible with them when they are placed into a toolbar.

allowSelection

{Boolean} By deafault, controls do not allow selection, because it may interfere with map dragging.  If this is true, OpenLayers will not prevent selection of the control.  Default is false.

displayClass

{string} This property is used for CSS related to the drawing of the Control.

title

{string} This property is used for showing a tooltip over the Control.

active

{Boolean} The control is active.

handler

events

{OpenLayers.Events} Events instance for triggering control specific events.

Constants

EVENT_TYPES

{Array(String)} Supported application event types.  Register a listener for a particular event with the following syntax:

control.events.register(type, obj, listener);

Listeners will be called with a reference to an event object.  The properties of this event depends on exactly what happened.

All event objects have at least the following properties

object{Object} A reference to control.events.object (a reference to the control).
element{DOMElement} A reference to control.events.element (which will be null unless documented otherwise).

Supported map event types

activateTriggered when activated.
deactivateTriggered when deactivated.

Functions

OpenLayers. Control

Create an OpenLayers Control.  The options passed as a parameter directly extend the control.  For example passing the following:

var control = new OpenLayers.Control({div: myDiv});

Overrides the default div attribute value of null.

Parameters

options{Object}

destroy

destroy: function ()

The destroy method is used to perform any clean up before the control is dereferenced.  Typically this is where event listeners are removed to prevent memory leaks.

setMap

setMap: function(map)

Set the map property for the control.  This is done through an accessor so that subclasses can override this and take special action once they have their map variable set.

Parameters

map{OpenLayers.Map}

draw

draw: function (px)

The draw method is called when the control is ready to be displayed on the page.  If a div has not been created one is created.  Controls with a visual component will almost always want to override this method to customize the look of control.

Parameters

px{OpenLayers.Pixel} The top-left pixel position of the control or null.

Returns

{DOMElement} A reference to the DIV DOMElement containing the control

moveTo

moveTo: function (px)

Sets the left and top style attributes to the passed in pixel coordinates.

Parameters

px{OpenLayers.Pixel}

activate

activate: function ()

Explicitly activates a control and it’s associated handler if one has been set.  Controls can be deactivated by calling the deactivate() method.

Returns

{Boolean} True if the control was successfully activated or false if the control was already active.

deactivate

deactivate: function ()

Deactivates a control and it’s associated handler if any.  The exact effect of this depends on the control itself.

Returns

{Boolean} True if the control was effectively deactivated or false if the control was already inactive.

OpenLayers.Lang

Internationalization namespace.  Contains dictionaries in various languages and methods to set and get the current language.

Summary
{String} Current language code to use in OpenLayers.

Properties

code

{String} Current language code to use in OpenLayers.  Use the <setCode> method to set this value and the <getCode> method to retrieve it.

OpenLayers. Popup. Anchored

Inherits from

Summary
Since the popup is moving to a new px, it might need also to be moved relative to where the marker is.
The popup has been moved to a new relative location, so we may want to make some cosmetic adjustments to it.

Functions

OpenLayers. Popup. Anchored

Parameters

id{String}
lonlat{OpenLayers.LonLat}
contentSize{OpenLayers.Size}
contentHTML{String}
anchor{Object} Object which must expose a ‘size’ OpenLayers.Size and ‘offset’ OpenLayers.Pixel (generally an OpenLayers.Icon).
closeBox{Boolean}
closeBoxCallback{Function} Function to be called on closeBox click.

moveTo

moveTo: function(px)

Since the popup is moving to a new px, it might need also to be moved relative to where the marker is.  We first calculate the new relativePosition, and then we calculate the new px where we will put the popup, based on the new relative position.

If the relativePosition has changed, we must also call updateRelativePosition() to make any visual changes to the popup which are associated with putting it in a new relativePosition.

Parameters

px{OpenLayers.Pixel}

calculateRelativePosition

calculateRelativePosition:function(px)

Parameters

px{OpenLayers.Pixel}

Returns

{String} The relative position (“br” “tr” “tl” “bl”) at which the popup should be placed.

updateRelativePosition

updateRelativePosition: function()

The popup has been moved to a new relative location, so we may want to make some cosmetic adjustments to it.

Note that in the classic Anchored popup, there is nothing to do here, since the popup looks exactly the same in all four positions.  Subclasses such as the AnchoredBubble and Framed, however, will want to do something special here.

calculateNewPx

calculateNewPx:function(px)

Parameters

px{OpenLayers.Pixel}

Returns

{OpenLayers.Pixel} The the new px position of the popup on the screen relative to the passed-in px.

OpenLayers. Renderer. Canvas

A renderer based on the 2D ‘canvas’ drawing element.element

Inherits

Summary
{Canvas} The canvas context object.
{Object} Internal object of feature/style pairs for use in redrawing the layer.
{Object} Geometry -> Feature lookup table.
Erase a geometry from the renderer.
Set the visible part of the layer.
Sets the size of the drawing surface.
Draw the feature.
Used when looping (in redraw) over the features; draws the canvas.
Called to draw External graphics.
Prepare the canvas for drawing by setting various global settings.
This method is only called by the renderer itself.
This method is only called by the renderer itself.
This method is only called by the renderer itself.
This method is only called by the renderer itself.
This method is only called by the renderer itself.
transform geographic xy into pixel xy
Clear all vectors from the renderer.
Returns a feature id from an event on the renderer.
This is called by the layer to erase features; removes the feature from the list, then redraws the layer.
The real ‘meat’ of the function: any time things have changed, redraw() can be called to loop over all the data and (you guessed it) redraw it.
{Object}

Properties

canvas

{Canvas} The canvas context object.

features

{Object} Internal object of feature/style pairs for use in redrawing the layer.

geometryMap

{Object} Geometry -> Feature lookup table.  Used by eraseGeometry to lookup features to remove from our internal table (this.features) when erasing geoms.

Functions

OpenLayers. Renderer. Canvas

Parameters

containerID{String}

eraseGeometry

eraseGeometry: function(geometry)

Erase a geometry from the renderer.  Because the Canvas renderer has ‘memory’ of the features that it has drawn, we have to remove the feature so it doesn’t redraw.

Parameters

geometry{OpenLayers.Geometry}

setExtent

setExtent: function(extent)

Set the visible part of the layer.

Resolution has probably changed, so we nullify the resolution cache (this.resolution), then redraw.

Parameters

extent{OpenLayers.Bounds}

setSize

setSize: function(size)

Sets the size of the drawing surface.

Once the size is updated, redraw the canvas.

Parameters

size{OpenLayers.Size}

drawFeature

drawFeature: function(feature,
style)

Draw the feature.  Stores the feature in the features list, then redraws the layer.

Parameters

feature{OpenLayers.Feature.Vector}
style{<Object>}

drawGeometry

drawGeometry: function(geometry,
style)

Used when looping (in redraw) over the features; draws the canvas.

Parameters

geometry{OpenLayers.Geometry}
style{Object}

drawExternalGraphic

drawExternalGraphic: function(pt,
style)

Called to draw External graphics.

Parameters

geometry{OpenLayers.Geometry}
style{Object}

setCanvasStyle

setCanvasStyle: function(type,
style)

Prepare the canvas for drawing by setting various global settings.

Parameters

type{String} one of ‘stroke’, ‘fill’, or ‘reset’
style{Object} Symbolizer hash

drawPoint

drawPoint: function(geometry,
style)

This method is only called by the renderer itself.

Parameters

geometry{OpenLayers.Geometry}
style{Object}

drawLineString

drawLineString: function(geometry,
style)

This method is only called by the renderer itself.

Parameters

geometry{OpenLayers.Geometry}
style{Object}

drawLinearRing

drawLinearRing: function(geometry,
style)

This method is only called by the renderer itself.

Parameters

geometry{OpenLayers.Geometry}
style{Object}

drawPolygon

drawPolygon: function(geometry,
style)

This method is only called by the renderer itself.

Parameters

geometry{OpenLayers.Geometry}
style{Object}

drawText

drawText: function(location,
style)

This method is only called by the renderer itself.

Parameters

location{<OpenLayers.Point>}
style{Object}

getLocalXY

getLocalXY: function(point)

transform geographic xy into pixel xy

Parameters

point{OpenLayers.Geometry.Point}

clear

clear: function()

Clear all vectors from the renderer. virtual function.

getFeatureIdFromEvent

getFeatureIdFromEvent: function(evt)

Returns a feature id from an event on the renderer.

Parameters

evt{OpenLayers.Event}

Returns

{String} A feature id or null.

eraseFeatures

eraseFeatures: function(features)

This is called by the layer to erase features; removes the feature from the list, then redraws the layer.

Parameters

features{Array(OpenLayers.Feature.Vector)}

redraw

redraw: function()

The real ‘meat’ of the function: any time things have changed, redraw() can be called to loop over all the data and (you guessed it) redraw it.  Unlike Elements-based Renderers, we can’t interact with things once they’re drawn, to remove them, for example, so instead we have to just clear everything and draw from scratch.

Constants

OpenLayers. Renderer. Canvas. LABEL_ALIGN

{Object}

OpenLayers. ElementsIndexer

This class takes care of figuring out which order elements should be placed in the DOM based on given indexing methods.

Summary
{Integer} This is the largest-most z-index value for a node contained within the indexer.
{Array<String>} This is an array of node id’s stored in the order that they should show up on screen.
{Object} This is a hash that maps node ids to their z-index value stored in the indexer.
{Function} This is the function used to determine placement of of a new node within the indexer.
Determine the z-index for the current node if there isn’t one, and set the maximum value if we’ve found a new maximum.

Properties

maxZIndex

{Integer} This is the largest-most z-index value for a node contained within the indexer.

order

{Array<String>} This is an array of node id’s stored in the order that they should show up on screen.  Id’s higher up in the array (higher array index) represent nodes with higher z-indeces.

indices

{Object} This is a hash that maps node ids to their z-index value stored in the indexer.  This is done to make finding a nodes z-index value O(1).

compare

{Function} This is the function used to determine placement of of a new node within the indexer.  If null, this defaults to to the Z_ORDER_DRAWING_ORDER comparison method.

Functions

determineZIndex

determineZIndex: function(node)

Determine the z-index for the current node if there isn’t one, and set the maximum value if we’ve found a new maximum.

Parameters

node{DOMElement}

OpenLayers. ElementsIndexer. IndexingMethods

These are the compare methods for figuring out where a new node should be placed within the indexer.  These methods are very similar to general sorting methods in that they return -1, 0, and 1 to specify the direction in which new nodes fall in the ordering.

Summary
This compare method is used by other comparison methods.

Functions

Z_ORDER

Z_ORDER: function(indexer,
newNode,
nextNode)

This compare method is used by other comparison methods.  It can be used individually for ordering, but is not recommended, because it doesn’t subscribe to drawing order.

Parameters

indexer{OpenLayers.ElementsIndexer}
newNode{DOMElement}
nextNode{DOMElement}

Returns

{Integer}

OpenLayers. Renderer. Elements

This is another virtual class in that it should never be instantiated by itself as a Renderer.  It exists because there is tons of shared functionality between different vector libraries which use nodes/elements as a base for rendering vectors.

The highlevel bits of code that are implemented here are the adding and removing of geometries, which is essentially the same for any element-based renderer.  The details of creating each node and drawing the paths are of course different, but the machinery is the same.

Inherits

Summary
{DOMElement}
{DOMElement}
{DOMElement}
{DOMElement}
{String}
{<OpenLayers.ElementIndexer>} An instance of OpenLayers.ElementsIndexer created upon initialization if the zIndexing or yOrdering options passed to this renderer’s constructor are set to true.
{String}
{String}
{Object}
Remove all the elements from the root
This function is in charge of asking the specific renderer which type of node to create for the given geometry and style.
Draw the geometry, creating new nodes, setting paths, setting style, setting featureId on the node.
Redraws the node using special ‘background’ style properties.
Given a node, draw a geometry on the specified layer.
Things that have do be done after the geometry node is appended to its parent node.
Virtual function for drawing Point Geometry.
Virtual function for drawing LineString Geometry.
Virtual function for drawing LinearRing Geometry.
Virtual function for drawing Polygon Geometry.
Virtual function for drawing Rectangle Geometry.
Virtual function for drawing Circle Geometry.
Virtual function for drawing Surface Geometry.
Removes a label
Erase a geometry from the renderer.
Create new node of the specified type, with the (optional) specified id.
moves this renderer’s root to a different renderer.
Gets the layer that this renderer’s output appears on.
Determines if a symbol cannot be rendered using drawCircle
Coordinate arrays for well known (named) symbols.

Properties

rendererRoot

{DOMElement}

root

{DOMElement}

vectorRoot

{DOMElement}

textRoot

{DOMElement}

xmlns

{String}

Indexer

{<OpenLayers.ElementIndexer>} An instance of OpenLayers.ElementsIndexer created upon initialization if the zIndexing or yOrdering options passed to this renderer’s constructor are set to true.

Constants

BACKGROUND_ID_SUFFIX

{String}

BACKGROUND_ID_SUFFIX

{String}

Properties

minimumSymbolizer

{Object}

Functions

OpenLayers. Renderer. Elements

Parameters

containerID{String}
options{Object} options for this renderer.  Supported options are:
  • yOrdering - {Boolean} Whether to use y-ordering
  • zIndexing - {Boolean} Whether to use z-indexing.  Will be ignored if yOrdering is set to true.

destroy

destroy: function()

clear

clear: function()

Remove all the elements from the root

getNodeType

getNodeType: function(geometry,
style)

This function is in charge of asking the specific renderer which type of node to create for the given geometry and style.  All geometries in an Elements-based renderer consist of one node and some attributes.  We have the nodeFactory() function which creates a node for us, but it takes a ‘type’ as input, and that is precisely what this function tells us.

Parameters

geometry{OpenLayers.Geometry}
style{Object}

Returns

{String} The corresponding node type for the specified geometry

drawGeometry

drawGeometry: function(geometry,
style,
featureId)

Draw the geometry, creating new nodes, setting paths, setting style, setting featureId on the node.  This method should only be called by the renderer itself.

Parameters

geometry{OpenLayers.Geometry}
style{Object}
featureId{String}

Returns

{Boolean} true if the geometry has been drawn completely; null if incomplete; false otherwise

redrawNode

redrawNode: function(id,
geometry,
style,
featureId)

Parameters

id{String}
geometry{OpenLayers.Geometry}
style{Object}
featureId{String}

Returns

{Boolean} true if the complete geometry could be drawn, null if parts of the geometry could not be drawn, false otherwise

redrawBackgroundNode

redrawBackgroundNode: function(id,
geometry,
style,
featureId)

Redraws the node using special ‘background’ style properties.  Basically just calls redrawNode(), but instead of directly using the ‘externalGraphic’, ‘graphicXOffset’, ‘graphicYOffset’, and ‘graphicZIndex’ properties directly from the specified ‘style’ parameter, we create a new style object and set those properties from the corresponding ‘background’-prefixed properties from specified ‘style’ parameter.

Parameters

id{String}
geometry{OpenLayers.Geometry}
style{Object}
featureId{String}

Returns

{Boolean} true if the complete geometry could be drawn, null if parts of the geometry could not be drawn, false otherwise

drawGeometryNode

drawGeometryNode: function(node,
geometry,
style)

Given a node, draw a geometry on the specified layer. node and geometry are required arguments, style is optional.  This method is only called by the render itself.

Parameters

node{DOMElement}
geometry{OpenLayers.Geometry}
style{Object}

Returns

{Object} a hash with properties “node” (the drawn node) and “complete” (null if parts of the geometry could not be drawn, false if nothing could be drawn)

postDraw

postDraw: function(node)

Things that have do be done after the geometry node is appended to its parent node.  To be overridden by subclasses.

Parameters

node{DOMElement}

drawPoint

drawPoint: function(node,
geometry)

Virtual function for drawing Point Geometry.  Should be implemented by subclasses.  This method is only called by the renderer itself.

Parameters

node{DOMElement}
geometry{OpenLayers.Geometry}

Returns

{DOMElement} or false if the renderer could not draw the point

drawLineString

drawLineString: function(node,
geometry)

Virtual function for drawing LineString Geometry.  Should be implemented by subclasses.  This method is only called by the renderer itself.

Parameters

node{DOMElement}
geometry{OpenLayers.Geometry}

Returns

{DOMElement} or null if the renderer could not draw all components of the linestring, or false if nothing could be drawn

drawLinearRing

drawLinearRing: function(node,
geometry)

Virtual function for drawing LinearRing Geometry.  Should be implemented by subclasses.  This method is only called by the renderer itself.

Parameters

node{DOMElement}
geometry{OpenLayers.Geometry}

Returns

{DOMElement} or null if the renderer could not draw all components of the linear ring, or false if nothing could be drawn

drawPolygon

drawPolygon: function(node,
geometry)

Virtual function for drawing Polygon Geometry.  Should be implemented by subclasses.  This method is only called by the renderer itself.

Parameters

node{DOMElement}
geometry{OpenLayers.Geometry}

Returns

{DOMElement} or null if the renderer could not draw all components of the polygon, or false if nothing could be drawn

drawRectangle

drawRectangle: function(node,
geometry)

Virtual function for drawing Rectangle Geometry.  Should be implemented by subclasses.  This method is only called by the renderer itself.

Parameters

node{DOMElement}
geometry{OpenLayers.Geometry}

Returns

{DOMElement} or false if the renderer could not draw the rectangle

drawCircle

drawCircle: function(node,
geometry)

Virtual function for drawing Circle Geometry.  Should be implemented by subclasses.  This method is only called by the renderer itself.

Parameters

node{DOMElement}
geometry{OpenLayers.Geometry}

Returns

{DOMElement} or false if the renderer could not draw the circle

drawSurface

drawSurface: function(node,
geometry)

Virtual function for drawing Surface Geometry.  Should be implemented by subclasses.  This method is only called by the renderer itself.

Parameters

node{DOMElement}
geometry{OpenLayers.Geometry}

Returns

{DOMElement} or false if the renderer could not draw the surface

removeText

removeText: function(featureId)

Removes a label

Parameters

featureId{String}

getFeatureIdFromEvent

getFeatureIdFromEvent: function(evt)

Parameters

evt{Object} An OpenLayers.Event object

Returns

{OpenLayers.Geometry} A geometry from an event that happened on a layer.

eraseGeometry

eraseGeometry: function(geometry)

Erase a geometry from the renderer.  In the case of a multi-geometry, we cycle through and recurse on ourselves.  Otherwise, we look for a node with the geometry.id, destroy its geometry, and remove it from the DOM.

Parameters

geometry{OpenLayers.Geometry}

nodeFactory

nodeFactory: function(id,
type)

Create new node of the specified type, with the (optional) specified id.

If node already exists with same ID and a different type, we remove it and then call ourselves again to recreate it.

Parameters

id{String}
type{String} type Kind of node to draw.

Returns

{DOMElement} A new node of the given type and id.

nodeTypeCompare

nodeTypeCompare: function(node,
type)

Parameters

node{DOMElement}
type{String} Kind of node

Returns

{Boolean} Whether or not the specified node is of the specified type This function must be overridden by subclasses.

createNode

createNode: function(type,
id)

Parameters

type{String} Kind of node to draw.
id{String} Id for node.

Returns

{DOMElement} A new node of the given type and id.  This function must be overridden by subclasses.

moveRoot

moveRoot: function(renderer)

moves this renderer’s root to a different renderer.

Parameters

renderer{OpenLayers.Renderer} target renderer for the moved root

getRenderLayerId

getRenderLayerId: function()

Gets the layer that this renderer’s output appears on.  If moveRoot was used, this will be different from the id of the layer containing the features rendered by this renderer.

Returns

{String} the id of the output layer.

isComplexSymbol

isComplexSymbol: function(graphicName)

Determines if a symbol cannot be rendered using drawCircle

Parameters

graphicName{String}

Returns {Boolean} true if the symbol is complex, false if not

Constants

OpenLayers. Renderer. symbol

Coordinate arrays for well known (named) symbols.

OpenLayers. Strategy. Fixed

A simple strategy that requests features once and never requests new data.

Inherits from

Summary
Create a new Fixed strategy.
Activate the strategy: load data or add listener to load when visible
Deactivate the strategy.
Tells protocol to load data and unhooks the visibilitychanged event
Add all features to the layer.

Functions

OpenLayers. Strategy. Fixed

Create a new Fixed strategy.

Parameters

options{Object} Optional object whose properties will be set on the instance.

activate

activate: function()

Activate the strategy: load data or add listener to load when visible

Returns

{Boolean} True if the strategy was successfully activated or false if the strategy was already active.

deactivate

deactivate: function()

Deactivate the strategy.  Undo what is done in activate.

Returns

{Boolean} The strategy was successfully deactivated.

load

load: function(options)

Tells protocol to load data and unhooks the visibilitychanged event

Parameters

options{Object} options to pass to protocol read.

merge

merge: function(resp)

Add all features to the layer.

OpenLayers. Tween

Summary
{int} Interval in milliseconds between 2 steps
{int} Step counter
{int} Interval id returned by window.setInterval
{Boolean} Tells if the easing is currently playing
Creates a Tween.
Calls the appropriate easing method

Constants

INTERVAL

{int} Interval in milliseconds between 2 steps

Properties

time

{int} Step counter

interval

{int} Interval id returned by window.setInterval

playing

{Boolean} Tells if the easing is currently playing

Functions

OpenLayers. Tween

Creates a Tween.

Parameters

easing{<OpenLayers.Easing>(Function)} easing function method to use

play

play: function()

Calls the appropriate easing method

OpenLayers. Easing

Credits

Easing Equations by Robert Penner, http://www.robertpenner.com/easing/

OpenLayers. Easing. Linear

Functions

easeIn

easeIn: function(t,
b,
c,
d)

Parameters

t{Float} time
b{Float} beginning position
c{Float} total change
d{Float} duration of the transition

easeOut

easeOut: function(t,
b,
c,
d)

Parameters

t{Float} time
b{Float} beginning position
c{Float} total change
d{Float} duration of the transition

easeInOut

easeInOut: function(t,
b,
c,
d)

Parameters

t{Float} time
b{Float} beginning position
c{Float} total change
d{Float} duration of the transition

OpenLayers. Easing.Expo

Functions

easeIn

easeIn: function(t,
b,
c,
d)

Parameters

t{Float} time
b{Float} beginning position
c{Float} total change
d{Float} duration of the transition

easeOut

easeOut: function(t,
b,
c,
d)

Parameters

t{Float} time
b{Float} beginning position
c{Float} total change
d{Float} duration of the transition

easeInOut

easeInOut: function(t,
b,
c,
d)

Parameters

t{Float} time
b{Float} beginning position
c{Float} total change
d{Float} duration of the transition

OpenLayers. Easing.Quad

Functions

easeIn

easeIn: function(t,
b,
c,
d)

Parameters

t{Float} time
b{Float} beginning position
c{Float} total change
d{Float} duration of the transition

easeOut

easeOut: function(t,
b,
c,
d)

Parameters

t{Float} time
b{Float} beginning position
c{Float} total change
d{Float} duration of the transition

easeInOut

easeInOut: function(t,
b,
c,
d)

Parameters

t{Float} time
b{Float} beginning position
c{Float} total change
d{Float} duration of the transition

OpenLayers. Control. ArgParser

The ArgParser control adds location bar querystring parsing functionality to an OpenLayers Map.  When added to a Map control, on a page load/refresh, the Map will automatically take the href string and parse it for lon, lat, zoom, and layers information.

Inherits from

Summary
Set the map property for the control.
As soon as a baseLayer has been loaded, we center and zoom ...and remove the handler.
As soon as all the layers are loaded, cycle through them and hide or show them.

Functions

OpenLayers. Control. ArgParser

Parameters

options{Object}

setMap

setMap: function(map)

Set the map property for the control.

Parameters

map{OpenLayers.Map}

setCenter

setCenter: function()

As soon as a baseLayer has been loaded, we center and zoom ...and remove the handler.

configureLayers

configureLayers: function()

As soon as all the layers are loaded, cycle through them and hide or show them.

OpenLayers. Control. PanZoom

The PanZoom is a visible control, composed of a <OpenLayers.Control.PanPanel> and a <OpenLayers.Control.ZoomPanel>.  By default it is drawn in the upper left corner of the map.

Inherits from

Properties

buttons

{Array(DOMElement)} Array of Button Divs

Functions

OpenLayers. Control. PanZoom

Parameters

options{Object}

draw

draw: function(px)

Parameters

px{OpenLayers.Pixel}

Returns

{DOMElement} A reference to the container div for the PanZoom control.

_addButton

_addButton:function(id,
img,
xy,
sz)

Parameters

id{String}
img{String}
xy{OpenLayers.Pixel}
sz{OpenLayers.Size}

Returns

{DOMElement} A Div (an alphaImageDiv, to be precise) that contains the image of the button, and has all the proper event handlers set.

_removeButton

_removeButton: function(btn)

Parameters

btn{Object}

removeButtons

removeButtons: function()

doubleClick

doubleClick: function (evt)

Parameters

evt{Event}

Returns

{Boolean}

buttonDown

buttonDown: function (evt)

Parameters

evt{Event}

Constants

X

{Integer}

Y

{Integer}

OpenLayers. Control. ScaleLine

The ScaleLine displays a small line indicator representing the current map scale on the map.  By default it is drawn in the lower left corner of the map.

Inherits from

Is a very close copy of

  • <OpenLayers.Control.Scale>
Summary
{Integer} Maximum width of the scale line in pixels.
{String} Units for zoomed out on top bar.
{String} Units for zoomed in on top bar.
{String} Units for zoomed out on bottom bar.
{String} Units for zoomed in on bottom bar.
{DOMElement}
{DOMElement}
Create a new scale line control.
{DOMElement}
Given a number, round it down to the nearest 1,2,5 times a power of 10.
Update the size of the bars, and the labels they contain.

Properties

maxWidth

{Integer} Maximum width of the scale line in pixels.  Default is 100.

topOutUnits

{String} Units for zoomed out on top bar.  Default is km.

topInUnits

{String} Units for zoomed in on top bar.  Default is m.

bottomOutUnits

{String} Units for zoomed out on bottom bar.  Default is mi.

bottomInUnits

{String} Units for zoomed in on bottom bar.  Default is ft.

eTop

{DOMElement}

eBottom

{DOMElement}

Functions

OpenLayers. Control. ScaleLine

Create a new scale line control.

Parameters

options{Object} An optional object whose properties will be used to extend the control.

draw

draw: function()

Returns

{DOMElement}

getBarLen

getBarLen: function(maxLen)

Given a number, round it down to the nearest 1,2,5 times a power of 10.  That seems a fairly useful set of number groups to use.

Parameters

maxLen{float} the number we’re rounding down from

Returns

{Float} the rounded number (less than or equal to maxLen)

update

update: function()

Update the size of the bars, and the labels they contain.

OpenLayers. Event

Utility functions for event handling.

Summary
{Object} A hashtable cache of the event observers.
{int}
{int}
{int}
{int}
{int}
{int}
{int}
{int}
{int}
Cross browser event element detection.
Determine whether event was caused by a left click.
Determine whether event was caused by a right mouse click.
Stops an event from propagating.
Given the id of an element to stop observing, cycle through the element’s cached observers, calling stopObserving on each one, skipping those entries which can no longer be removed.
Cycle through all the element entries in the events cache and call stopObservingElement on each.

Properties

observers

{Object} A hashtable cache of the event observers.  Keyed by element._eventCacheID

Constants

KEY_BACKSPACE

{int}

KEY_TAB

{int}

KEY_RETURN

{int}

KEY_ESC

{int}

KEY_LEFT

{int}

KEY_UP

{int}

KEY_RIGHT

{int}

KEY_DOWN

{int}

KEY_DELETE

{int}

Functions

element

element: function(event)

Cross browser event element detection.

Parameters

event{Event}

Returns

{DOMElement} The element that caused the event

isLeftClick

isLeftClick: function(event)

Determine whether event was caused by a left click.

Parameters

event{Event}

Returns

{Boolean}

isRightClick

isRightClick: function(event)

Determine whether event was caused by a right mouse click.

Parameters

event{Event}

Returns

{Boolean}

stop

stop: function(event,
allowDefault)

Stops an event from propagating.

Parameters

event{Event}
allowDefault{Boolean} If true, we stop the event chain but still allow the default browser behaviour (text selection, radio-button clicking, etc) Default false

findElement

findElement: function(event,
tagName)

Parameters

event{Event}
tagName{String}

Returns

{DOMElement} The first node with the given tagName, starting from the node the event was triggered on and traversing the DOM upwards

observe

observe: function(elementParam,
name,
observer,
useCapture)

Parameters

elementParam{DOMElement || String}
name{String}
observer{function}
useCapture{Boolean}

stopObservingElement

stopObservingElement: function(elementParam)

Given the id of an element to stop observing, cycle through the element’s cached observers, calling stopObserving on each one, skipping those entries which can no longer be removed.

parameters

elementParam{DOMElement || String}

_removeElementObservers

_removeElementObservers: function(elementObservers)

Parameters

elementObservers{Array(Object)} Array of (element, name, observer, usecapture) objects, taken directly from hashtable

stopObserving

stopObserving: function(elementParam,
name,
observer,
useCapture)

Parameters

elementParam{DOMElement || String}
name{String}
observer{function}
useCapture{Boolean}

Returns

{Boolean} Whether or not the event observer was removed

unloadCache

unloadCache: function()

Cycle through all the element entries in the events cache and call stopObservingElement on each.

OpenLayers. Events

Summary
{Array(String)} supported events
{Object} Hashtable of Array(Function): events listener functions
{Object} the code object issuing application events
{DOMElement} the DOM element receiving browser events
{Array(String)} list of support application events
{Function} bound event handler attached to elements
A version of <clearMouseCache> that is bound to this instance so that it can be used with OpenLayers.Event.observe and OpenLayers.Event.stopObserving.
Construct an OpenLayers.Events object.
Convenience method for registering listeners with a common scope.
Convenience method for unregistering listeners with a common scope.
Remove all listeners for a given event type.
Basically just a wrapper to the triggerEvent() function, but takes care to set a property ‘xy’ on the event with the current mouse position.

Constants

BROWSER_EVENTS

{Array(String)} supported events

Properties

listeners

{Object} Hashtable of Array(Function): events listener functions

object

{Object} the code object issuing application events

element

{DOMElement} the DOM element receiving browser events

eventTypes

{Array(String)} list of support application events

eventHandler

{Function} bound event handler attached to elements

Functions

clearMouseListener

A version of <clearMouseCache> that is bound to this instance so that it can be used with OpenLayers.Event.observe and OpenLayers.Event.stopObserving.

OpenLayers. Events

Construct an OpenLayers.Events object.

Parameters

object{Object} The js object to which this Events object is being
added element{DOMElement} A dom element to respond to browser events
eventTypes{Array(String)} Array of custom application events
fallThrough{Boolean} Allow events to fall through after these have been handled?
options{Object} Options for the events object.

attachToElement

attachToElement: function (element)

Parameters

element{HTMLDOMElement} a DOM element to attach browser events to

on

on: function(object)

Convenience method for registering listeners with a common scope.

Example use

events.on({
"loadstart": loadStartListener,
"loadend": loadEndListener,
scope: object
});

un

un: function(object)

Convenience method for unregistering listeners with a common scope.

Example use

events.un({
"loadstart": loadStartListener,
"loadend": loadEndListener,
scope: object
});

remove

remove: function(type)

Remove all listeners for a given event type.  If type is not registered, does nothing.

Parameters

type{String}

handleBrowserEvent

handleBrowserEvent: function (evt)

Basically just a wrapper to the triggerEvent() function, but takes care to set a property ‘xy’ on the event with the current mouse position.

Parameters

evt{Event}

getMousePosition

getMousePosition: function (evt)

Parameters

evt{Event}

Returns

{OpenLayers.Pixel} The current xy coordinate of the mouse, adjusted for offsets

OpenLayers. Format

Base class for format reading/writing a variety of formats.  Subclasses of OpenLayers.Format are expected to have read and write methods.

Summary
{Object} A reference to options passed to the constructor.
Instances of this class are not useful.
Read data from a string, and return an object whose type depends on the subclass.
Accept an object, and return a string.

Properties

options

{Object} A reference to options passed to the constructor.

Functions

OpenLayers. Format

Instances of this class are not useful.  See one of the subclasses.

Parameters

options{Object} An optional object with properties to set on the format

Valid options

keepData{Boolean} If true, upon read, the data property will be set to the parsed object (e.g. the json or xml object).

Returns

An instance of OpenLayers.Format

read

read: function(data)

Read data from a string, and return an object whose type depends on the subclass.

Parameters

data{string} Data to read/parse.

Returns

Depends on the subclass

write

write: function(object)

Accept an object, and return a string.

Parameters

object{Object} Object to be serialized

Returns

{String} A string representation of the object.

OpenLayers. Lang[“en”]

Dictionary for English.  Keys for entries are used in calls to <OpenLayers.Lang.translate>.  Entry bodies are normal strings or strings formatted for use with <OpenLayers.String.format> calls.

OpenLayers. Popup. AnchoredBubble

Inherits from

Summary
{Boolean} Has the popup been rounded yet?
The popup has been moved to a new relative location, in which case we will want to re-do the rico corners.
Always sets border to 0.
Update RICO corners according to the popup’s current relative postion.
{String} The proper corners string (“tr tl bl br”) for rico to round.
{Integer} 5.

Properties

rounded

{Boolean} Has the popup been rounded yet?

Functions

OpenLayers. Popup. AnchoredBubble

Parameters

id{String}
lonlat{OpenLayers.LonLat}
contentSize{OpenLayers.Size}
contentHTML{String}
anchor{Object} Object to which we’ll anchor the popup.  Must expose a ‘size’ (OpenLayers.Size) and ‘offset’ (OpenLayers.Pixel) (Note that this is generally an OpenLayers.Icon).
closeBox{Boolean}
closeBoxCallback{Function} Function to be called on closeBox click.

draw

draw: function(px)

Parameters

px{OpenLayers.Pixel}

Returns

{DOMElement} Reference to a div that contains the drawn popup.

updateRelativePosition

updateRelativePosition: function()

The popup has been moved to a new relative location, in which case we will want to re-do the rico corners.

setBorder

setBorder:function(border)

Always sets border to 0.  Bubble Popups can not have a border.

Parameters

border{Integer}

setRicoCorners

setRicoCorners:function()

Update RICO corners according to the popup’s current relative postion.

getCornersToRound

getCornersToRound:function()

Returns

{String} The proper corners string (“tr tl bl br”) for rico to round.

Constants

CORNER_SIZE

{Integer} 5.  Border space for the RICO corners.

OpenLayers. Projection

Class for coordinate transforms between coordinate systems.  Depends on the proj4js library.  If proj4js is not available, then this is just an empty stub.

Summary
{Object} Proj4js.Proj instance.
{String}
This class offers several methods for interacting with a wrapped pro4js projection object.
Convert projection to string (getCode wrapper).
Test equality of two projection instances.
Destroy projection object.
Transforms is an object, with from properties, each of which may have a to property.

Properties

proj

{Object} Proj4js.Proj instance.

projCode

{String}

Functions

OpenLayers. Projection

This class offers several methods for interacting with a wrapped pro4js projection object.

Parameters

projCode{String} A string identifying the Well Known Identifier for the projection.
options{Object} An optional object to set additional properties on the layer.

Returns

{OpenLayers.Projection} A projection object.

toString

toString: function()

Convert projection to string (getCode wrapper).

Returns

{String} The projection code.

equals

equals: function(projection)

Test equality of two projection instances.  Determines equality based soley on the projection code.

Returns

{Boolean} The two projections are equivalent.

destroy

destroy: function()

Destroy projection object.

Properties

transforms

Transforms is an object, with from properties, each of which may have a to property.  This allows you to define projections without requiring support for proj4js to be included.

This object has keys which correspond to a ‘source’ projection object.  The keys should be strings, corresponding to the projection.getCode() value.  Each source projection object should have a set of destination projection keys included in the object.

Each value in the destination object should be a transformation function, where the function is expected to be passed an object with a .x and a .y property.  The function should return the object, with the .x and .y transformed according to the transformation function.

NoteProperties on this object should not be set directly.  To add a transform method to this object, use the <addTransform> method.  For an example of usage, see the OpenLayers.Layer.SphericalMercator file.

OpenLayers. Renderer.SVG

Inherits

Summary
{String}
{String}
{Integer} Firefox has a limitation where values larger or smaller than about 15000 in an SVG document lock the browser up.
{Object} Hash with “x” and “y” properties
{Object} Cache for symbol sizes according to their svg coordinate space
{Boolean}
See #669 for more information
Transforms the SVG coordinate system
Sets the size of the drawing surface.
Use to set all the style attributes to a SVG node.
{DOMElement} The specific render engine’s root element
{DOMElement} The element to which we’ll add the symbol definitions
This method is only called by the renderer itself.
This method is only called by the renderer itself.
This method is only called by the renderer itself.
This method is only called by the renderer itself.
This method is only called by the renderer itself.
This method is only called by the renderer itself.
This method is only called by the renderer itself.
This method is only called by the renderer itself.
Given two points (one inside the valid range, and one outside), clips the line betweeen the two points so that the new points are both inside the valid range.
Finds the position of an svg node.
add a new symbol definition from the rendererer’s symbol hash
{Object}
{Object}

Properties

xmlns

{String}

xlinkns

{String}

Constants

MAX_PIXEL

{Integer} Firefox has a limitation where values larger or smaller than about 15000 in an SVG document lock the browser up.  This works around it.

Properties

translationParameters

{Object} Hash with “x” and “y” properties

symbolSize

{Object} Cache for symbol sizes according to their svg coordinate space

isGecko

{Boolean}

Functions

OpenLayers. Renderer.SVG

Parameters

containerID{String}

inValidRange

inValidRange: function(x,
y,
xyOnly)

See #669 for more information

Parameters

x{Integer}
y{Integer}
xyOnly{Boolean} whether or not to just check for x and y, which means to not take the current translation parameters into account if true.

Returns

{Boolean} Whether or not the ‘x’ and ‘y’ coordinates are in the valid range.

setExtent

setExtent: function(extent,
resolutionChanged)

Parameters

extent{OpenLayers.Bounds}
resolutionChanged{Boolean}

Returns

{Boolean} true to notify the layer that the new extent does not exceed the coordinate range, and the features will not need to be redrawn.  False otherwise.

translate

translate: function(x,
y)

Transforms the SVG coordinate system

Parameters

x{Float}
y{Float}

Returns

{Boolean} true if the translation parameters are in the valid coordinates range, false otherwise.

setSize

setSize: function(size)

Sets the size of the drawing surface.

Parameters

size{OpenLayers.Size} The size of the drawing surface

getNodeType

getNodeType: function(geometry,
style)

Parameters

geometry{OpenLayers.Geometry}
style{Object}

Returns

{String} The corresponding node type for the specified geometry

setStyle

setStyle: function(node,
style,
options)

Use to set all the style attributes to a SVG node.

Takes care to adjust stroke width and point radius to be resolution-relative

Parameters

node{SVGDomElement} An SVG element to decorate
style{Object}
options{Object} Currently supported options include ‘isFilled’ {Boolean} and ‘isStroked’ {Boolean}

dashStyle

dashStyle: function(style,
widthFactor)

Parameters

style{Object}
widthFactor{Number}

Returns

{String} A SVG compliant ‘stroke-dasharray’ value

createNode

createNode: function(type,
id)

Parameters

type{String} Kind of node to draw
id{String} Id for node

Returns

{DOMElement} A new node of the given type and id

nodeTypeCompare

nodeTypeCompare: function(node,
type)

Parameters

node{SVGDomElement} An SVG element
type{String} Kind of node

Returns

{Boolean} Whether or not the specified node is of the specified type

createRenderRoot

createRenderRoot: function()

Returns

{DOMElement} The specific render engine’s root element

createRoot

createRoot: function(suffix)

Parameter

suffix{String} suffix to append to the id

Returns

{DOMElement}

createDefs

createDefs: function()

Returns

{DOMElement} The element to which we’ll add the symbol definitions

drawPoint

drawPoint: function(node,
geometry)

This method is only called by the renderer itself.

Parameters

node{DOMElement}
geometry{OpenLayers.Geometry}

Returns

{DOMElement} or false if the renderer could not draw the point

drawCircle

drawCircle: function(node,
geometry,
radius)

This method is only called by the renderer itself.

Parameters

node{DOMElement}
geometry{OpenLayers.Geometry}
radius{Float}

Returns

{DOMElement} or false if the renderer could not draw the circle

drawLineString

drawLineString: function(node,
geometry)

This method is only called by the renderer itself.

Parameters

node{DOMElement}
geometry{OpenLayers.Geometry}

Returns

{DOMElement} or null if the renderer could not draw all components of the linestring, or false if nothing could be drawn

drawLinearRing

drawLinearRing: function(node,
geometry)

This method is only called by the renderer itself.

Parameters

node{DOMElement}
geometry{OpenLayers.Geometry}

Returns

{DOMElement} or null if the renderer could not draw all components of the linear ring, or false if nothing could be drawn

drawPolygon

drawPolygon: function(node,
geometry)

This method is only called by the renderer itself.

Parameters

node{DOMElement}
geometry{OpenLayers.Geometry}

Returns

{DOMElement} or null if the renderer could not draw all components of the polygon, or false if nothing could be drawn

drawRectangle

drawRectangle: function(node,
geometry)

This method is only called by the renderer itself.

Parameters

node{DOMElement}
geometry{OpenLayers.Geometry}

Returns

{DOMElement} or false if the renderer could not draw the rectangle

drawSurface

drawSurface: function(node,
geometry)

This method is only called by the renderer itself.

Parameters

node{DOMElement}
geometry{OpenLayers.Geometry}

Returns

{DOMElement} or false if the renderer could not draw the surface

drawText

drawText: function(featureId,
style,
location)

This method is only called by the renderer itself.

Parameters

featureId{String} style -
location{OpenLayers.Geometry.Point}

getComponentString

Parameters

components{Array(OpenLayers.Geometry.Point)} Array of points
separator{String} character between coordinate pairs.  Defaults to “,”

Returns

{Object} hash with properties “path” (the string created from the components and “complete” (false if the renderer was unable to draw all components)

clipLine

clipLine: function(badComponent,
goodComponent)

Given two points (one inside the valid range, and one outside), clips the line betweeen the two points so that the new points are both inside the valid range.

Parameters

badComponent{OpenLayers.Geometry.Point)} original geometry of the invalid point
goodComponent{OpenLayers.Geometry.Point)} original geometry of the valid point Returns {String} the SVG coordinate pair of the clipped point (like getShortString), or an empty string if both passed componets are at the same point.

getShortString

getShortString: function(point)

Parameters

point{OpenLayers.Geometry.Point}

Returns

{String} or false if point is outside the valid range

getPosition

getPosition: function(node)

Finds the position of an svg node.

Parameters

node{DOMElement}

Returns

{Object} hash with x and y properties, representing the coordinates within the svg coordinate system

importSymbol

importSymbol: function (graphicName)

add a new symbol definition from the rendererer’s symbol hash

Parameters

graphicName{String} name of the symbol to import

Returns

{String}id of the imported symbol

Constants

OpenLayers. Renderer. SVG. LABEL_ALIGN

{Object}

OpenLayers. Renderer. SVG. LABEL_VSHIFT

{Object}

OpenLayers. Renderer.VML

Render vector features in browsers with VML capability.  Construct a new VML renderer with the OpenLayers.Renderer.VML constructor.

Note that for all calculations in this class, we use toFixed() to round a float value to an integer.  This is done because it seems that VML doesn’t support float values.

Inherits from

Summary
{String} XML Namespace URN
{DOMElement} node holding symbols.
{Object} Hash with “x” and “y” properties
Create a new VML renderer.
Set the renderer’s extent
Set the size of the drawing surface
Get the node type for a geometry and style
Use to set all the style attributes to a VML node.
If a point is to be styled with externalGraphic and rotation, VML fills cannot be used to display the graphic, because rotation of graphic fills is not supported by the VML implementation of Internet Explorer.
Some versions of Internet Explorer seem to be unable to set fillcolor and strokecolor to “none” correctly before the fill node is appended to a visible vml node.
Get the geometry’s bounds, convert it to our vml coordinate system, then set the node’s position, size, and local coordinate system.
Create a new node
Determine whether a node is of a given type
Create the renderer root
Create the main root element
Render a point
Render a circle.
Render a linestring.
Render a linearring
Render a line.
Render a polygon
Render a rectangle
This method is only called by the renderer itself.
moves this renderer’s root to a different renderer.
add a new symbol definition from the rendererer’s symbol hash
{Object}

Properties

xmlns

{String} XML Namespace URN

symbolCache

{DOMElement} node holding symbols.  This hash is keyed by symbol name, and each value is a hash with a “path” and an “extent” property.

offset

{Object} Hash with “x” and “y” properties

Functions

OpenLayers. Renderer.VML

Create a new VML renderer.

Parameters

containerID{String} The id for the element that contains the renderer

setExtent

setExtent: function(extent,
resolutionChanged)

Set the renderer’s extent

Parameters

extent{OpenLayers.Bounds}
resolutionChanged{Boolean}

Returns

{Boolean} true to notify the layer that the new extent does not exceed the coordinate range, and the features will not need to be redrawn.

setSize

setSize: function(size)

Set the size of the drawing surface

Parameters

size{OpenLayers.Size} the size of the drawing surface

getNodeType

getNodeType: function(geometry,
style)

Get the node type for a geometry and style

Parameters

geometry{OpenLayers.Geometry}
style{Object}

Returns

{String} The corresponding node type for the specified geometry

setStyle

setStyle: function(node,
style,
options,
geometry)

Use to set all the style attributes to a VML node.

Parameters

node{DOMElement} An VML element to decorate
style{Object}
options{Object} Currently supported options include ‘isFilled’ {Boolean} and ‘isStroked’ {Boolean}
geometry{OpenLayers.Geometry}

graphicRotate

graphicRotate: function(node,
xOffset,
yOffset)

If a point is to be styled with externalGraphic and rotation, VML fills cannot be used to display the graphic, because rotation of graphic fills is not supported by the VML implementation of Internet Explorer.  This method creates a olv:imagedata element inside the VML node, DXImageTransform.Matrix and BasicImage filters for rotation and opacity, and a 3-step hack to remove rendering artefacts from the graphic and preserve the ability of graphics to trigger events.  Finally, OpenLayers methods are used to determine the correct insertion point of the rotated image, because DXImageTransform.Matrix does the rotation without the ability to specify a rotation center point.

Parameters

node{DOMElement}
xOffset{Number} rotation center relative to image, x coordinate
yOffset{Number} rotation center relative to image, y coordinate

postDraw

postDraw: function(node)

Some versions of Internet Explorer seem to be unable to set fillcolor and strokecolor to “none” correctly before the fill node is appended to a visible vml node.  This method takes care of that and sets fillcolor and strokecolor again if needed.

Parameters

node{DOMElement}

setNodeDimension

setNodeDimension: function(node,
geometry)

Get the geometry’s bounds, convert it to our vml coordinate system, then set the node’s position, size, and local coordinate system.

Parameters

node{DOMElement}
geometry{OpenLayers.Geometry}

dashStyle

dashStyle: function(style)

Parameters

style{Object}

Returns

{String} A VML compliant ‘stroke-dasharray’ value

createNode

createNode: function(type,
id)

Create a new node

Parameters

type{String} Kind of node to draw
id{String} Id for node

Returns

{DOMElement} A new node of the given type and id

nodeTypeCompare

nodeTypeCompare: function(node,
type)

Determine whether a node is of a given type

Parameters

node{DOMElement} An VML element
type{String} Kind of node

Returns

{Boolean} Whether or not the specified node is of the specified type

createRenderRoot

createRenderRoot: function()

Create the renderer root

Returns

{DOMElement} The specific render engine’s root element

createRoot

createRoot: function(suffix)

Create the main root element

Parameters

suffix{String} suffix to append to the id

Returns

{DOMElement}

drawPoint

drawPoint: function(node,
geometry)

Render a point

Parameters

node{DOMElement}
geometry{OpenLayers.Geometry}

Returns

{DOMElement} or false if the point could not be drawn

drawCircle

drawCircle: function(node,
geometry,
radius)

Render a circle.  Size and Center a circle given geometry (x,y center) and radius

Parameters

node{DOMElement}
geometry{OpenLayers.Geometry}
radius{float}

Returns

{DOMElement} or false if the circle could not ne drawn

drawLineString

drawLineString: function(node,
geometry)

Render a linestring.

Parameters

node{DOMElement}
geometry{OpenLayers.Geometry}

Returns

{DOMElement}

drawLinearRing

drawLinearRing: function(node,
geometry)

Render a linearring

Parameters

node{DOMElement}
geometry{OpenLayers.Geometry}

Returns

{DOMElement}

DrawLine

Render a line.

Parameters

node{DOMElement}
geometry{OpenLayers.Geometry}
closeLine{Boolean} Close the line?  (make it a ring?)

Returns

{DOMElement}

drawPolygon

drawPolygon: function(node,
geometry)

Render a polygon

Parameters

node{DOMElement}
geometry{OpenLayers.Geometry}

Returns

{DOMElement}

drawRectangle

drawRectangle: function(node,
geometry)

Render a rectangle

Parameters

node{DOMElement}
geometry{OpenLayers.Geometry}

Returns

{DOMElement}

drawText

drawText: function(featureId,
style,
location)

This method is only called by the renderer itself.

Parameters

featureId{String} style -
location{OpenLayers.Geometry.Point}

drawSurface

drawSurface: function(node,
geometry)

Parameters

node{DOMElement}
geometry{OpenLayers.Geometry}

Returns

{DOMElement}

moveRoot

moveRoot: function(renderer)

moves this renderer’s root to a different renderer.

Parameters

renderer{OpenLayers.Renderer} target renderer for the moved root
root{DOMElement} optional root node.  To be used when this renderer holds roots from multiple layers to tell this method which one to detach

Returns

{Boolean} true if successful, false otherwise

importSymbol

importSymbol: function (graphicName)

add a new symbol definition from the rendererer’s symbol hash

Parameters

graphicName{String} name of the symbol to import

Returns

{Object}hash of {DOMElement} “symbol” and {Number} “size”

Constants

OpenLayers. Renderer. VML. LABEL_SHIFT

{Object}

OpenLayers.Tile

This is a class designed to designate a single tile, however it is explicitly designed to do relatively little.  Tiles store information about themselves -- such as the URL that they are related to, and their size - but do not add themselves to the layer div automatically, for example.  Create a new tile with the OpenLayers.Tile constructor, or a subclass.

TBD 3.0remove reference to url in above paragraph
Summary
{Array(String)} Supported application event types
{String} null
{OpenLayers.Layer} layer the tile is attached to
{String} url of the request.
{OpenLayers.Pixel} Top Left pixel of the tile
{Boolean} Is the tile loading?
Constructor for a new OpenLayers.Tile instance.
Call immediately before destroying if you are listening to tile events, so that counters are properly handled if tile is still loading at destroy-time.
Clear whatever is currently in the tile, then return whether or not it should actually be re-drawn.
Reposition the tile.
Clear the tile of any bounds/position-related data so that it can be reused in a new location.
Take the pixel locations of the corner of the tile, and pass them to the base layer and ask for the location of those pixels, so that displaying tiles over Google works fine.
Show the tile only if it should be drawn.
Show the tile.
Hide the tile.

Constants

EVENT_TYPES

{Array(String)} Supported application event types

Properties

id

{String} null

layer

{OpenLayers.Layer} layer the tile is attached to

url

{String} url of the request.

TBD 3.0 Deprecated.  The base tile class does not need an url.  This should be handled in subclasses.  Does not belong here.

size

position

{OpenLayers.Pixel} Top Left pixel of the tile

isLoading

{Boolean} Is the tile loading?

Functions

OpenLayers.Tile

Constructor for a new OpenLayers.Tile instance.

Parameters

layer{OpenLayers.Layer} layer that the tile will go in.
position{OpenLayers.Pixel}
bounds{OpenLayers.Bounds}
url{String}
size{OpenLayers.Size}

unload

unload: function()

Call immediately before destroying if you are listening to tile events, so that counters are properly handled if tile is still loading at destroy-time.  Will only fire an event if the tile is still loading.

clone

clone: function (obj)

Parameters

obj{OpenLayers.Tile} The tile to be cloned

Returns

{OpenLayers.Tile} An exact clone of this OpenLayers.Tile

draw

draw: function()

Clear whatever is currently in the tile, then return whether or not it should actually be re-drawn.

Returns

{Boolean} Whether or not the tile should actually be drawn.  Note that this is not really the best way of doing things, but such is the way the code has been developed.  Subclasses call this and depend on the return to know if they should draw or not.

moveTo

moveTo: function (bounds,
position,
redraw)

Reposition the tile.

Parameters

bounds{OpenLayers.Bounds}
position{OpenLayers.Pixel}
redraw{Boolean} Call draw method on tile after moving.  Default is true

clear

clear: function()

Clear the tile of any bounds/position-related data so that it can be reused in a new location.  To be implemented by subclasses.

getBoundsFromBaseLayer

getBoundsFromBaseLayer: function(position)

Take the pixel locations of the corner of the tile, and pass them to the base layer and ask for the location of those pixels, so that displaying tiles over Google works fine.

Parameters

position{OpenLayers.Pixel}

Returns

bounds{OpenLayers.Bounds}

showTile

showTile: function()

Show the tile only if it should be drawn.

show

show: function()

Show the tile.  To be implemented by subclasses.

hide

hide: function()

Hide the tile.  To be implemented by subclasses.

OpenLayers. Format.XML

Read and write XML.  For cross-browser XML generation, use methods on an instance of the XML format class instead of on <code>document<end>.  The DOM creation and traversing methods exposed here all mimic the W3C XML DOM methods.  Create a new parser with the OpenLayers.Format.XML constructor.

Inherits from

Summary
{Object} Mapping of namespace aliases to namespace URIs.
{Object} Mapping of namespace URI to namespace alias.
{String} The default namespace alias for creating element nodes.
Contains public functions, grouped by namespace prefix, that will be applied when a namespaced node is found matching the function name.
As a compliment to the readers property, this structure contains public writing functions grouped by namespace alias and named like the node names they produce.
{XMLDom} If this browser uses ActiveX, this will be set to a XMLDOM object.
Construct an XML parser.
Set a namespace alias and URI for the format.
Shorthand for creating namespaced elements with optional attributes and child text nodes.
Set multiple attributes given key value pairs from an object.
Shorthand for applying one of the named readers given the node namespace and local name.
Shorthand for applying the named readers to all children of a node.
Shorthand for applying one of the named writers and appending the results to a node.
Return this node or the next element node.

Properties

namespaces

{Object} Mapping of namespace aliases to namespace URIs.  Properties of this object should not be set individually.  Read-only.  All XML subclasses should have their own namespaces object.  Use setNamespace to add or set a namespace alias after construction.

namespaceAlias

{Object} Mapping of namespace URI to namespace alias.  This object is read-only.  Use setNamespace to add or set a namespace alias.

defaultPrefix

{String} The default namespace alias for creating element nodes.

readers

Contains public functions, grouped by namespace prefix, that will be applied when a namespaced node is found matching the function name.  The function will be applied in the scope of this parser with two arguments: the node being read and a context object passed from the parent.

writers

As a compliment to the readers property, this structure contains public writing functions grouped by namespace alias and named like the node names they produce.

xmldom

{XMLDom} If this browser uses ActiveX, this will be set to a XMLDOM object.  It is not intended to be a browser sniffing property.  Instead, the xmldom property is used instead of <code>document<end> where namespaced node creation methods are not supported.  In all other browsers, this remains null.

Functions

OpenLayers. Format.XML

Construct an XML parser.  The parser is used to read and write XML.  Reading XML from a string returns a DOM element.  Writing XML from a DOM element returns a string.

Parameters

options{Object} Optional object whose properties will be set on the object.

setNamespace

setNamespace: function(alias,
uri)

Set a namespace alias and URI for the format.

Parameters

alias{String} The namespace alias (prefix).
uri{String} The namespace URI.

createElementNSPlus

createElementNSPlus: function(name,
options)

Shorthand for creating namespaced elements with optional attributes and child text nodes.

Parameters

name{String} The qualified node name.
options{Object} Optional object for node configuration.

Valid options

uri{String} Optional namespace uri for the element - supply a prefix instead if the namespace uri is a property of the format’s namespace object.
attributes{Object} Optional attributes to be set using the setAttributes method.
value{String} Optional text to be appended as a text node.

Returns

{Element} An element node.

setAttributes

setAttributes: function(node,
obj)

Set multiple attributes given key value pairs from an object.

Parameters

node{Element} An element node.
obj{Object || Array} An object whose properties represent attribute names and values represent attribute values.  If an attribute name is a qualified name (“prefix:local”), the prefix will be looked up in the parsers {namespaces} object.  If the prefix is found, setAttributeNS will be used instead of setAttribute.

readNode

readNode: function(node,
obj)

Shorthand for applying one of the named readers given the node namespace and local name.  Readers take two args (node, obj) and generally extend or modify the second.

Parameters

node{DOMElement} The node to be read (required).
obj{Object} The object to be modified (optional).

Returns

{Object} The input object, modified (or a new one if none was provided).

readChildNodes

readChildNodes: function(node,
obj)

Shorthand for applying the named readers to all children of a node.  For each child of type 1 (element), <readSelf> is called.

Parameters

node{DOMElement} The node to be read (required).
obj{Object} The object to be modified (optional).

Returns

{Object} The input object, modified.

writeNode

writeNode: function(name,
obj,
parent)

Shorthand for applying one of the named writers and appending the results to a node.  If a qualified name is not provided for the second argument (and a local name is used instead), the namespace of the parent node will be assumed.

Parameters

name{String} The name of a node to generate.  If a qualified name (e.g.  “pre:Name”) is used, the namespace prefix is assumed to be in the writers group.  If a local name is used (e.g.  “Name”) then the namespace of the parent is assumed.  If a local name is used and no parent is supplied, then the default namespace is assumed.
obj{Object} Structure containing data for the writer.
parent{DOMElement} Result will be appended to this node.  If no parent is supplied, the node will not be appended to anything.

Returns

{DOMElement} The child node.

getThisOrNextEl

getThisOrNextEl: function(node,
name,
uri)

Return this node or the next element node.  Optionally get the first sibling with the given local name or namespace URI.

Parameters

node{DOMElement} The node.
name{String} Optional local name of the sibling to search for.
uri{String} Optional namespace URI of the sibling to search for.

Returns

{DOMElement} The next sibling element.  Returns null if no element is found, something significant besides an element is found, or the found element does not match the query.

OpenLayers. Handler

Base class to construct a higher-level handler for event sequences.  All handlers have activate and deactivate methods.  In addition, they have methods named like browser events.  When a handler is activated, any additional methods named like a browser event is registered as a listener for the corresponding event.  When a handler is deactivated, those same methods are unregistered as event listeners.

Handlers also typically have a callbacks object with keys named like the abstracted events or event sequences that they are in charge of handling.  The controls that wrap handlers define the methods that correspond to these abstract events - so instead of listening for individual browser events, they only listen for the abstract events defined by the handler.

Handlers are created by controls, which ultimately have the responsibility of making changes to the the state of the application.  Handlers themselves may make temporary changes, but in general are expected to return the application in the same state that they found it.

Summary
{String}
{Boolean}
{Event} This property references the last event handled by the handler.
Construct a handler.
Check the keyMask on the handler.
Trigger the control’s named callback with the given arguments
register an event on the map
unregister an event from the map
With each registered browser event, the handler sets its own evt property.
Deconstruct the handler.
If set as the <keyMask>, checkModifiers returns false if any key is down.
If set as the <keyMask>, checkModifiers returns false if Shift is down.
If set as the <keyMask>, checkModifiers returns false if Ctrl is down.
If set as the <keyMask>, checkModifiers returns false if Alt is down.

Properties

id

{String}

active

{Boolean}

evt

{Event} This property references the last event handled by the handler.  Note that this property is not part of the stable API.  Use of the evt property should be restricted to controls in the library or other applications that are willing to update with changes to the OpenLayers code.

Functions

OpenLayers. Handler

Construct a handler.

Parameters

control{OpenLayers.Control} The control that initialized this handler.  The control is assumed to have a valid map property; that map is used in the handler’s own setMap method.
callbacks{Object} An object whose properties correspond to abstracted events or sequences of browser events.  The values for these properties are functions defined by the control that get called by the handler.
options{Object} An optional object whose properties will be set on the handler.

setMap

setMap: function (map)

checkModifiers

checkModifiers: function (evt)

Check the keyMask on the handler.  If no <keyMask> is set, this always returns true.  If a <keyMask> is set and it matches the combination of keys down on an event, this returns true.

Returns

{Boolean} The keyMask matches the keys down on an event.

callback

callback: function (name,
args)

Trigger the control’s named callback with the given arguments

Parameters

name{String} The key for the callback that is one of the properties of the handler’s callbacks object.
args{Array(*)} An array of arguments (any type) with which to call the callback (defined by the control).

register

register: function (name,
method)

register an event on the map

unregister

unregister: function (name,
method)

unregister an event from the map

setEvent

setEvent: function(evt)

With each registered browser event, the handler sets its own evt property.  This property can be accessed by controls if needed to get more information about the event that the handler is processing.

This allows modifier keys on the event to be checked (alt, shift, and ctrl cannot be checked with the keyboard handler).  For a control to determine which modifier keys are associated with the event that a handler is currently processing, it should access (code)handler.evt.altKey || handler.evt.shiftKey || handler.evt.ctrlKey(end).

Parameters

evt{Event} The browser event.

destroy

destroy: function ()

Deconstruct the handler.

Constants

OpenLayers. Handler. MOD_NONE

If set as the <keyMask>, checkModifiers returns false if any key is down.

OpenLayers. Handler. MOD_SHIFT

If set as the <keyMask>, checkModifiers returns false if Shift is down.

OpenLayers. Handler. MOD_CTRL

If set as the <keyMask>, checkModifiers returns false if Ctrl is down.

OpenLayers. Handler. MOD_ALT

If set as the <keyMask>, checkModifiers returns false if Alt is down.

OpenLayers.Map

Instances of OpenLayers.Map are interactive maps embedded in a web page.  Create a new map with the OpenLayers.Map constructor.

On their own maps do not provide much functionality.  To extend a map it’s necessary to add controls (OpenLayers.Control) and layers (OpenLayers.Layer) to the map.

Summary
{Object} Base z-indexes for different classes of thing
{Array(String)} Supported application event types.
{String} Unique identifier for the map
{Boolean} For a base layer that supports it, allow the map resolution to be set to a value between one of the values in the resolutions array.
<maxResolution> auto.
{Boolean} The map is currently being dragged.
{OpenLayers.Size} Size of the main div (this.div)
{HTMLDivElement} The element that represents the map viewport
{OpenLayers.LonLat} The lonlat at which the later container was re-initialized (on-zoom)
{HTMLDivElement} The element that contains the layers.
{Array(OpenLayers.Control)} List of controls associated with the map.
{Array(OpenLayers.Popup)} List of popups associated with the map
{OpenLayers.LonLat} The current center of the map
{Float} The resolution of the map.
{Integer} The current zoom level of the map
{Float} The ratio of the current extent within which panning will tween.
{String} Used to store a unique identifier that changes when the map view changes.
{OpenLayers.Tween} Animated panning tween object, see panTo()
{Integer} The number of steps to be passed to the OpenLayers.Tween.start() method when the map is panned.
{OpenLayers.Bounds} Outside margin of the popup.
Constructor for a new OpenLayers.Map instance.
Function that is called to destroy the map on page unload.
When the map is destroyed, we need to stop listening to updateSize events: this method stores the function we need to unregister in non-IE browsers.
Reset each layer’s z-index based on layer’s array index
{OpenLayers.Size} A new OpenLayers.Size object with the dimensions of the map div
This function takes care to recenter the layerContainerDiv.
{Integer} 256 Default tile width (unless otherwise specified)
{Integer} 256 Default tile height (unless otherwise specified)

Constants

Z_INDEX_BASE

{Object} Base z-indexes for different classes of thing

EVENT_TYPES

{Array(String)} Supported application event types.  Register a listener for a particular event with the following syntax:

map.events.register(type, obj, listener);

Listeners will be called with a reference to an event object.  The properties of this event depends on exactly what happened.

All event objects have at least the following properties

  • object {Object} A reference to map.events.object.
  • element {DOMElement} A reference to map.events.element.

Browser events have the following additional properties

  • xy {OpenLayers.Pixel} The pixel location of the event (relative to the the map viewport).
  • other properties that come with browser events

Supported map event types

  • preaddlayer triggered before a layer has been added.  The event object will include a layer property that references the layer to be added.
  • addlayer triggered after a layer has been added.  The event object will include a layer property that references the added layer.
  • removelayer triggered after a layer has been removed.  The event object will include a layer property that references the removed layer.
  • changelayer triggered after a layer name change, order change, or visibility change (due to resolution thresholds).  Listeners will receive an event object with layer and property properties.  The layer property will be a reference to the changed layer.  The property property will be a key to the changed property (name, visibility, or order).
  • movestart triggered after the start of a drag, pan, or zoom
  • move triggered after each drag, pan, or zoom
  • moveend triggered after a drag, pan, or zoom completes
  • zoomend triggered after a zoom completes
  • addmarker triggered after a marker has been added
  • removemarker triggered after a marker has been removed
  • clearmarkers triggered after markers have been cleared
  • mouseover triggered after mouseover the map
  • mouseout triggered after mouseout the map
  • mousemove triggered after mousemove the map
  • dragstart Does not work.  Register for movestart instead.
  • drag Does not work.  Register for move instead.
  • dragend Does not work.  Register for moveend instead.
  • changebaselayer triggered after the base layer changes

Properties

id

{String} Unique identifier for the map

fractionalZoom

{Boolean} For a base layer that supports it, allow the map resolution to be set to a value between one of the values in the resolutions array.  Default is false.

When fractionalZoom is set to true, it is possible to zoom to an arbitrary extent.  This requires a base layer from a source that supports requests for arbitrary extents (i.e. not cached tiles on a regular lattice).  This means that fractionalZoom will not work with commercial layers (Google, Yahoo, VE), layers using TileCache, or any other pre-cached data sources.

If you are using fractionalZoom, then you should also use <getResolutionForZoom> instead of layer.resolutions[zoom] as the former works for non-integer zoom levels.

If you calling <render> after map construction, do not use

<maxResolution> auto.  Instead, divide your <maxExtent> by your maximum expected dimension.

dragging

{Boolean} The map is currently being dragged.

size

{OpenLayers.Size} Size of the main div (this.div)

viewPortDiv

{HTMLDivElement} The element that represents the map viewport

layerContainerOrigin

{OpenLayers.LonLat} The lonlat at which the later container was re-initialized (on-zoom)

layerContainerDiv

{HTMLDivElement} The element that contains the layers.

controls

{Array(OpenLayers.Control)} List of controls associated with the map.

If not provided in the map options at construction, the map will be given the following controls by default:

popups

{Array(OpenLayers.Popup)} List of popups associated with the map

center

{OpenLayers.LonLat} The current center of the map

resolution

{Float} The resolution of the map.

zoom

{Integer} The current zoom level of the map

panRatio

{Float} The ratio of the current extent within which panning will tween.

viewRequestID

{String} Used to store a unique identifier that changes when the map view changes. viewRequestID should be used when adding data asynchronously to the map: viewRequestID is incremented when you initiate your request (right now during changing of baselayers and changing of zooms).  It is stored here in the map and also in the data that will be coming back asynchronously.  Before displaying this data on request completion, we check that the viewRequestID of the data is still the same as that of the map.  Fix for #480

panTween

{OpenLayers.Tween} Animated panning tween object, see panTo()

panDuration

{Integer} The number of steps to be passed to the OpenLayers.Tween.start() method when the map is panned.  Default is 50.

paddingForPopups

{OpenLayers.Bounds} Outside margin of the popup.  Used to prevent the popup from getting too close to the map border.

Functions

OpenLayers.Map

Constructor for a new OpenLayers.Map instance.  There are two possible ways to call the map constructor.  See the examples below.

Parameters

div{String} Id of an element in your page that will contain the map.  May be omitted if the <div> option is provided or if you intend to use <render> later.
options{Object} Optional object with properties to tag onto the map.

Examples (method one)

// create a map with default options in an element with the id "map1"
var map = new OpenLayers.Map("map1");

// create a map with non-default options in an element with id "map2"
var options = {
maxExtent: new OpenLayers.Bounds(-200000, -200000, 200000, 200000),
maxResolution: 156543,
units: 'm',
projection: "EPSG:41001"
};
var map = new OpenLayers.Map("map2", options);
Examples (method twosingle argument):
// create a map with non-default options
var map = new OpenLayers.Map({
div: "map_id",
maxExtent: new OpenLayers.Bounds(-200000, -200000, 200000, 200000),
maxResolution: 156543,
units: 'm',
projection: "EPSG:41001"
});

// create a map without a reference to a container - call render later
var map = new OpenLayers.Map({
maxExtent: new OpenLayers.Bounds(-200000, -200000, 200000, 200000),
maxResolution: 156543,
units: 'm',
projection: "EPSG:41001"
});

unloadDestroy

Function that is called to destroy the map on page unload. stored here so that if map is manually destroyed, we can unregister this.

updateSizeDestroy

When the map is destroyed, we need to stop listening to updateSize events: this method stores the function we need to unregister in non-IE browsers.

setLayerZIndex

setLayerZIndex: function (layer,
zIdx)

Parameters

layer{OpenLayers.Layer}
zIdx{int}

resetLayersZIndex

resetLayersZIndex: function()

Reset each layer’s z-index based on layer’s array index

addControlToMap

addControlToMap: function (control,
px)

Parameters

control{OpenLayers.Control}
px{OpenLayers.Pixel}

getCurrentSize

getCurrentSize: function()

Returns

{OpenLayers.Size} A new OpenLayers.Size object with the dimensions of the map div

calculateBounds

calculateBounds: function(center,
resolution)

Parameters

center{OpenLayers.LonLat} Default is this.getCenter()
resolution{float} Default is this.getResolution()

Returns

{OpenLayers.Bounds} A bounds based on resolution, center, and current mapsize.

moveTo

moveTo: function(lonlat,
zoom,
options)

Parameters

lonlat{OpenLayers.LonLat}
zoom{Integer}
options{Object}

centerLayerContainer

centerLayerContainer: function (lonlat)

This function takes care to recenter the layerContainerDiv.

Parameters

lonlat{OpenLayers.LonLat}

isValidZoomLevel

isValidZoomLevel: function(zoomLevel)

Parameters

zoomLevel{Integer}

Returns

{Boolean} Whether or not the zoom level passed in is non-null and within the min/max range of zoom levels.

isValidLonLat

isValidLonLat: function(lonlat)

Parameters

lonlat{OpenLayers.LonLat}

Returns

{Boolean} Whether or not the lonlat passed in is non-null and within the maxExtent bounds

getLonLatFromViewPortPx

getLonLatFromViewPortPx: function (viewPortPx)

Parameters

viewPortPx{OpenLayers.Pixel}

Returns

{OpenLayers.LonLat} An OpenLayers.LonLat which is the passed-in view port OpenLayers.Pixel, translated into lon/lat by the current base layer.

getLonLatFromLayerPx

getLonLatFromLayerPx: function (px)

Parameters

px{OpenLayers.Pixel}

Returns

{OpenLayers.LonLat}

Constants

TILE_WIDTH

{Integer} 256 Default tile width (unless otherwise specified)

TILE_HEIGHT

{Integer} 256 Default tile height (unless otherwise specified)

OpenLayers. Marker

Instances of OpenLayers.Marker are a combination of a OpenLayers.LonLat and an OpenLayers.Icon.

Markers are generally added to a special layer called OpenLayers.Layer.Markers.

Example

var markers = new OpenLayers.Layer.Markers( "Markers" );
map.addLayer(markers);

var size = new OpenLayers.Size(10,17);
var offset = new OpenLayers.Pixel(-(size.w/2), -size.h);
var icon = new OpenLayers.Icon('http://boston.openguides.org/markers/AQUA.png',size,offset);
markers.addMarker(new OpenLayers.Marker(new OpenLayers.LonLat(0,0),icon));
markers.addMarker(new OpenLayers.Marker(new OpenLayers.LonLat(0,0),icon.clone()));

Note that if you pass an icon into the Marker constructor, it will take that icon and use it.  This means that you should not share icons between markers -- you use them once, but you should clone() for any additional markers using that same icon.

Summary
{OpenLayers.Icon} The icon used by this marker.
{OpenLayers.LonLat} location of object
{OpenLayers.Events} the event handler.
{OpenLayers.Map} the map this marker is attached to
Calls draw on the icon, and returns that output.
Erases any drawn elements for this marker.
Move the marker to the new location.
{Boolean} Whether or not the marker is currently visible on screen.
Englarges the markers icon by the specified ratio.
Change the opacity of the marker by changin the opacity of its icon
Change URL of the Icon Image.
Hide or show the icon
Creates a default OpenLayers.Icon.

Properties

icon

{OpenLayers.Icon} The icon used by this marker.

lonlat

{OpenLayers.LonLat} location of object

events

{OpenLayers.Events} the event handler.

map

{OpenLayers.Map} the map this marker is attached to

Functions

OpenLayers. Marker

Parameters

lonlat{OpenLayers.LonLat} the position of this marker
icon{OpenLayers.Icon} the icon for this marker

draw

draw: function(px)

Calls draw on the icon, and returns that output.

Parameters

px{OpenLayers.Pixel}

Returns

{DOMElement} A new DOM Image with this marker’s icon set at the location passed-in

erase

erase: function()

Erases any drawn elements for this marker.

moveTo

moveTo: function (px)

Move the marker to the new location.

Parameters

px{OpenLayers.Pixel} the pixel position to move to

onScreen

onScreen:function()

Returns

{Boolean} Whether or not the marker is currently visible on screen.

inflate

inflate: function(inflate)

Englarges the markers icon by the specified ratio.

Parameters

inflate{float} the ratio to enlarge the marker by (passing 2 will double the size).

setOpacity

setOpacity: function(opacity)

Change the opacity of the marker by changin the opacity of its icon

Parameters

opacity{float} Specified as fraction (0.4, etc)

setUrl

setUrl: function(url)

Change URL of the Icon Image.

url{String}

display

display: function(display)

Hide or show the icon

display{Boolean}

defaultIcon

OpenLayers.Marker.defaultIcon = function()

Creates a default OpenLayers.Icon.

Returns

{OpenLayers.Icon} A default OpenLayers.Icon to use for a marker

OpenLayers. Request

The OpenLayers.Request namespace contains convenience methods for working with XMLHttpRequests.  These methods work with a cross-browser W3C compliant OpenLayers.Request.XMLHttpRequest class.

Summary
{Object} Default configuration for all requests.

Constants

DEFAULT_CONFIG

{Object} Default configuration for all requests.

OpenLayers. Tile. Image

Instances of OpenLayers.Tile.Image are used to manage the image tiles used by various layers.  Create a new image tile with the OpenLayers.Tile.Image constructor.

Inherits from

Summary
{String} The URL of the image being requested.
{DOMElement} The div element which wraps the image.
{DOMElement} The image element is appended to the frame.
{Boolean} True if the png alpha hack needs to be applied on the layer’s div.
{Boolean} Is this tile a back buffer tile?
{Float} Used in transition code only.
{Boolean} Is this the first time the tile is being drawn? 
{OpenLayers.Tile} A clone of the tile used to create transition effects when the tile is moved or changes resolution.
Constructor for a new OpenLayers.Tile.Image instance.
Check that a tile should be drawn, and draw it.
Triggered by two different events, layer loadend, and tile loadend.
Internal function to actually initialize the image tile, position it correctly, and set its url.
Using the properties currenty set on the layer, position the tile correctly.
Clear the tile of any bounds/position-related data so that it can be reused in a new location.
Creates the imgDiv property on the tile.
Make sure that the image that just loaded is the one this tile is meant to display, since panning/zooming might have changed the tile’s URL in the meantime.
This method is invoked on tiles that are backBuffers for tiles in the grid.
Show the tile by showing its frame.
Hide the tile by hiding its frame.

Properties

url

{String} The URL of the image being requested.  No default.  Filled in by layer.getURL() function.

imgDiv

{DOMElement} The div element which wraps the image.

frame

{DOMElement} The image element is appended to the frame.  Any gutter on the image will be hidden behind the frame.

layerAlphaHack

{Boolean} True if the png alpha hack needs to be applied on the layer’s div.

isBackBuffer

{Boolean} Is this tile a back buffer tile?

lastRatio

{Float} Used in transition code only.  This is the previous ratio of the back buffer tile resolution to the map resolution.  Compared with the current ratio to determine if zooming occurred.

isFirstDraw

{Boolean} Is this the first time the tile is being drawn?  This is used to force resetBackBuffer to synchronize the backBufferTile with the foreground tile the first time the foreground tile loads so that if the user zooms before the layer has fully loaded, the backBufferTile for tiles that have been loaded can be used.

backBufferTile

{OpenLayers.Tile} A clone of the tile used to create transition effects when the tile is moved or changes resolution.

Functions

OpenLayers. Tile. Image

Constructor for a new OpenLayers.Tile.Image instance.

Parameters

layer{OpenLayers.Layer} layer that the tile will go in.
position{OpenLayers.Pixel}
bounds{OpenLayers.Bounds}
url{String} Deprecated.  Remove me in 3.0.
size{OpenLayers.Size}

clone

clone: function (obj)

Parameters

obj{OpenLayers.Tile.Image} The tile to be cloned

Returns

{OpenLayers.Tile.Image} An exact clone of this OpenLayers.Tile.Image

draw

draw: function()

Check that a tile should be drawn, and draw it.

Returns

{Boolean} Always returns true.

resetBackBuffer

resetBackBuffer: function()

Triggered by two different events, layer loadend, and tile loadend.  In any of these cases, we check to see if we can hide the backBufferTile yet and update its parameters to match the foreground tile.

Basic logic

  • If the backBufferTile hasn’t been drawn yet, reset it
  • If layer is still loading, show foreground tile but don’t hide the backBufferTile yet
  • If layer is done loading, reset backBuffer tile and show foreground tile

renderTile

renderTile: function()

Internal function to actually initialize the image tile, position it correctly, and set its url.

positionImage

positionImage: function()

Using the properties currenty set on the layer, position the tile correctly.  This method is used both by the async and non-async versions of the Tile.Image code.

clear

clear: function()

Clear the tile of any bounds/position-related data so that it can be reused in a new location.

initImgDiv

initImgDiv: function()

Creates the imgDiv property on the tile.

checkImgURL

checkImgURL: function ()

Make sure that the image that just loaded is the one this tile is meant to display, since panning/zooming might have changed the tile’s URL in the meantime.  If the tile URL did change before the image loaded, set the imgDiv display to ‘none’, as either (a) it will be reset to visible when the new URL loads in the image, or (b) we don’t want to display this tile after all because its new bounds are outside our maxExtent.

This function should no longer be neccesary with the improvements to Grid.js in OpenLayers 2.3.  The lack of a good isEquivilantURL function caused problems in 2.2, but it’s possible that with the improved isEquivilant URL function, this might be neccesary at some point.

See discussion in the thread at http://openlayers.org- /pipermail- /dev- /2007-January- /000205.html

startTransition

startTransition: function()

This method is invoked on tiles that are backBuffers for tiles in the grid.  The grid tile is about to be cleared and a new tile source loaded.  This is where the transition effect needs to be started to provide visual continuity.

show

show: function()

Show the tile by showing its frame.

hide

hide: function()

Hide the tile by hiding its frame.

OpenLayers. Control. OverviewMap

The OverMap control creates a small overview map, useful to display the extent of a zoomed map and your main map and provide additional navigation options to the User.  By default the overview map is drawn in the lower right corner of the main map.  Create a new overview map with the OpenLayers.Control.OverviewMap constructor.

Inerits from

Summary
{DOMElement} The DOM element that contains the overview map
{Object}
{Object}
Create a new overview map
Render the control in the browser.
Handle extent rectangle drag
Handle browser events
Unhide the control.
Hide all the contents of the control, shrink the size, add the maximize icon
Hide/Show the toggle depending on whether the control is minimized
Update the overview map after layers move.
Determines if the overview map is suitable given the extent and resolution of the main map.
Construct the map that this control contains
Updates the extent rectangle position and size to match the map extent
Updates the map extent to match the extent rectangle position and size
Set extent rectangle pixel bounds.
Get the rect bounds from the map bounds.
Get the map bounds from the rect bounds.
Get a map location from a pixel location
Get a pixel location from a map location

Properties

element

{DOMElement} The DOM element that contains the overview map

handlers

{Object}

resolutionFactor

{Object}

Functions

OpenLayers. Control. OverviewMap

Create a new overview map

Parameters

object{Object} Properties of this object will be set on the overview map object.  Note, to set options on the map object contained in this control, set <mapOptions> as one of the options properties.

draw

draw: function()

Render the control in the browser.

baseLayerDraw

baseLayerDraw: function()
Draw the base layercalled if unable to complete in the initial draw

rectDrag

rectDrag: function(px)

Handle extent rectangle drag

Parameters

px{OpenLayers.Pixel} The pixel location of the drag.

mapDivClick

mapDivClick: function(evt)

Handle browser events

Parameters

evt{OpenLayers.Event} evt

maximizeControl

maximizeControl: function(e)

Unhide the control.  Called when the control is in the map viewport.

Parameters

e{OpenLayers.Event}

minimizeControl

minimizeControl: function(e)

Hide all the contents of the control, shrink the size, add the maximize icon

Parameters

e{OpenLayers.Event}

showToggle

showToggle: function(minimize)

Hide/Show the toggle depending on whether the control is minimized

Parameters

minimize{Boolean}

update

update: function()

Update the overview map after layers move.

isSuitableOverview

isSuitableOverview: function()

Determines if the overview map is suitable given the extent and resolution of the main map.

createMap

createMap: function()

Construct the map that this control contains

updateRectToMap

updateRectToMap: function()

Updates the extent rectangle position and size to match the map extent

updateMapToRect

updateMapToRect: function()

Updates the map extent to match the extent rectangle position and size

setRectPxBounds

setRectPxBounds: function(pxBounds)

Set extent rectangle pixel bounds.

Parameters

pxBounds{OpenLayers.Bounds}

getRectBoundsFromMapBounds

getRectBoundsFromMapBounds: function(lonLatBounds)

Get the rect bounds from the map bounds.

Parameters

lonLatBounds{OpenLayers.Bounds}

Returns

{OpenLayers.Bounds}A bounds which is the passed-in map lon/lat extent translated into pixel bounds for the overview map

getMapBoundsFromRectBounds

getMapBoundsFromRectBounds: function(pxBounds)

Get the map bounds from the rect bounds.

Parameters

pxBounds{OpenLayers.Bounds}

Returns

{OpenLayers.Bounds} Bounds which is the passed-in overview rect bounds translated into lon/lat bounds for the overview map

getLonLatFromOverviewPx

getLonLatFromOverviewPx: function(overviewMapPx)

Get a map location from a pixel location

Parameters

overviewMapPx{OpenLayers.Pixel}

Returns

{OpenLayers.LonLat} Location which is the passed-in overview map OpenLayers.Pixel, translated into lon/lat by the overview map

getOverviewPxFromLonLat

getOverviewPxFromLonLat: function(lonlat)

Get a pixel location from a map location

Parameters

lonlat{OpenLayers.LonLat}

Returns

{OpenLayers.Pixel} Location which is the passed-in OpenLayers.LonLat, translated into overview map pixels

OpenLayers. Feature

Features are combinations of geography and attributes.  The OpenLayers.Feature class specifically combines a marker and a lonlat.

Summary
{String}
{Object}
Constructor for features.
nullify references to prevent circular references and memory leaks
{Boolean} Whether or not the feature is currently visible on screen (based on its ‘lonlat’ property)
Based on the data associated with the Feature, create and return a marker object.
Destroys marker.
Creates a popup object created from the ‘lonlat’, ‘popupSize’, and ‘popupContentHTML’ properties set in this.data.
Destroys the popup created via createPopup.

Properties

id

{String}

data

{Object}

Functions

OpenLayers. Feature

Constructor for features.

Parameters

layer{OpenLayers.Layer}
lonlat{OpenLayers.LonLat}
data{Object}

Returns

{OpenLayers.Feature}

destroy

destroy: function()

nullify references to prevent circular references and memory leaks

onScreen

onScreen:function()

Returns

{Boolean} Whether or not the feature is currently visible on screen (based on its ‘lonlat’ property)

createMarker

createMarker: function()

Based on the data associated with the Feature, create and return a marker object.

Returns

{OpenLayers.Marker} A Marker Object created from the ‘lonlat’ and ‘icon’ properties set in this.data.  If no ‘lonlat’ is set, returns null.  If no ‘icon’ is set, OpenLayers.Marker() will load the default image.

Notethis.marker is set to return value

destroyMarker

destroyMarker: function()

Destroys marker.  If user overrides the createMarker() function, s/he should be able to also specify an alternative function for destroying it

createPopup

createPopup: function(closeBox)

Creates a popup object created from the ‘lonlat’, ‘popupSize’, and ‘popupContentHTML’ properties set in this.data.  It uses this.marker.icon as default anchor.

If no ‘lonlat’ is set, returns null.  If no this.marker has been created, no anchor is sent.

Notethe returned popup object is ‘owned’ by the feature, so you cannot use the popup’s destroy method to discard the popup.  Instead, you must use the feature’s destroyPopup
Notethis.popup is set to return value

Parameters

closeBox{Boolean} create popup with closebox or not

Returns

{OpenLayers.Popup} Returns the created popup, which is also set as ‘popup’ property of this feature.  Will be of whatever type specified by this feature’s ‘popupClass’ property, but must be of type OpenLayers.Popup.

destroyPopup

destroyPopup: function()

Destroys the popup created via createPopup.

As with the marker, if user overrides the createPopup() function, s/he should also be able to override the destruction

OpenLayers. Handler. Click

A handler for mouse clicks.  The intention of this handler is to give controls more flexibility with handling clicks.  Browsers trigger click events twice for a double-click.  In addition, the mousedown, mousemove, mouseup sequence fires a click event.  With this handler, controls can decide whether to ignore clicks associated with a double click.  By setting a <pixelTolerance>, controls can also ignore clicks that include a drag.  Create a new instance with the OpenLayers.Handler.Click constructor.

Inherits from

Summary
{Number} The id of the timeout waiting to clear the delayedCall.
{OpenLayers.Pixel} The pixel location of the last mousedown.
{Number} The id of the right mouse timeout waiting to clear the <delayedEvent>.
Create a new click handler.
Handle mousedown.
Handle mouseup.
Handle rightclick.
Sets rightclickTimerId to null.
Handle dblclick.
Handle click.
Determine whether the event is within the optional pixel tolerance.
Clear the timer and set timerId to null.
Sets timerId to null.

Properties

timerId

{Number} The id of the timeout waiting to clear the delayedCall.

down

{OpenLayers.Pixel} The pixel location of the last mousedown.

rightclickTimerId

{Number} The id of the right mouse timeout waiting to clear the <delayedEvent>.

Functions

OpenLayers. Handler. Click

Create a new click handler.

Parameters

control{OpenLayers.Control} The control that is making use of this handler.  If a handler is being used without a control, the handler’s setMap method must be overridden to deal properly with the map.
callbacks{Object} An object with keys corresponding to callbacks that will be called by the handler.  The callbacks should expect to recieve a single argument, the click event.  Callbacks for ‘click’ and ‘dblclick’ are supported.
options{Object} Optional object whose properties will be set on the handler.

mousedown

Handle mousedown.  Only registered as a listener if pixelTolerance is a non-zero value at construction.

Returns

{Boolean} Continue propagating this event.

mouseup

mouseup: function (evt)

Handle mouseup.  Installed to support collection of right mouse events.

Returns

{Boolean} Continue propagating this event.

rightclick

rightclick: function(evt)

Handle rightclick.  For a dblrightclick, we get two clicks so we need to always register for dblrightclick to properly handle single clicks.

Returns

{Boolean} Continue propagating this event.

delayedRightCall

delayedRightCall: function(evt)

Sets rightclickTimerId to null.  And optionally triggers the rightclick callback if evt is set.

dblclick

dblclick: function(evt)

Handle dblclick.  For a dblclick, we get two clicks in some browsers (FF) and one in others (IE).  So we need to always register for dblclick to properly handle single clicks.

Returns

{Boolean} Continue propagating this event.

click

click: function(evt)

Handle click.

Returns

{Boolean} Continue propagating this event.

passesTolerance

passesTolerance: function(evt)

Determine whether the event is within the optional pixel tolerance.  Note that the pixel tolerance check only works if mousedown events get to the listeners registered here.  If they are stopped by other elements, the <pixelTolerance> will have no effect here (this method will always return true).

Returns

{Boolean} The click is within the pixel tolerance (if specified).

clearTimer

clearTimer: function()

Clear the timer and set timerId to null.

delayedCall

delayedCall: function(evt)

Sets timerId to null.  And optionally triggers the click callback if evt is set.

OpenLayers. Handler.Drag

The drag handler is used to deal with sequences of browser events related to dragging.  The handler is used by controls that want to know when a drag sequence begins, when a drag is happening, and when it has finished.

Controls that use the drag handler typically construct it with callbacks for ‘down’, ‘move’, and ‘done’.  Callbacks for these keys are called when the drag begins, with each move, and when the drag is done.  In addition, controls can have callbacks keyed to ‘up’ and ‘out’ if they care to differentiate between the types of events that correspond with the end of a drag sequence.  If no drag actually occurs (no mouse move) the ‘down’ and ‘up’ callbacks will be called, but not the ‘done’ callback.

Create a new drag handler with the OpenLayers.Handler.Drag constructor.

Inherits from

Summary
{Boolean} When a mousedown event is received, we want to record it, but not set ‘dragging’ until the mouse moves after starting.
{Boolean} Stop propagation of mousedown events from getting to listeners on the same element.
{Boolean}
{OpenLayers.Pixel} The last pixel location of the drag.
{OpenLayers.Pixel} The first pixel location of the drag.
{Function}
{Integer} In order to increase performance, an interval (in milliseconds) can be set to reduce the number of drag events called.
{String} The id of the timeout used for the mousedown interval.
Returns OpenLayers.Handler.Drag
This method is called during the handling of the mouse down event.
This method is called during the handling of the mouse move event.
This method is called during the handling of the mouse up event.
This method is called during the handling of the mouse out event.
Handle mousedown events
Handle mousemove events
Private.
Handle mouseup events
Handle mouseout events
The drag handler captures the click event.
Activate the handler.
Deactivate the handler.

Properties

started

{Boolean} When a mousedown event is received, we want to record it, but not set ‘dragging’ until the mouse moves after starting.

stopDown

{Boolean} Stop propagation of mousedown events from getting to listeners on the same element.  Default is true.

dragging

{Boolean}

last

{OpenLayers.Pixel} The last pixel location of the drag.

start

{OpenLayers.Pixel} The first pixel location of the drag.

oldOnselectstart

{Function}

interval

{Integer} In order to increase performance, an interval (in milliseconds) can be set to reduce the number of drag events called.  If set, a new drag event will not be set until the interval has passed.  Defaults to 0, meaning no interval.

timeoutId

{String} The id of the timeout used for the mousedown interval.  This is “private”, and should be left alone.

Functions

OpenLayers. Handler.Drag

Returns OpenLayers.Handler.Drag

Parameters

control{OpenLayers.Control} The control that is making use of this handler.  If a handler is being used without a control, the handlers setMap method must be overridden to deal properly with the map.
callbacks{Object} An object containing a single function to be called when the drag operation is finished.  The callback should expect to recieve a single argument, the pixel location of the event.  Callbacks for ‘move’ and ‘done’ are supported.  You can also speficy callbacks for ‘down’, ‘up’, and ‘out’ to respond to those events.
options{Object}

down

down: function(evt)

This method is called during the handling of the mouse down event.  Subclasses can do their own processing here.

Parameters

evt{Event} The mouse down event

move

move: function(evt)

This method is called during the handling of the mouse move event.  Subclasses can do their own processing here.

Parameters

evt{Event} The mouse move event

up

up: function(evt)

This method is called during the handling of the mouse up event.  Subclasses can do their own processing here.

Parameters

evt{Event} The mouse up event

out

out: function(evt)

This method is called during the handling of the mouse out event.  Subclasses can do their own processing here.

Parameters

evt{Event} The mouse out event

mousedown

mousedown: function (evt)

Handle mousedown events

Parameters

evt{Event}

Returns

{Boolean} Let the event propagate.

mousemove

mousemove: function (evt)

Handle mousemove events

Parameters

evt{Event}

Returns

{Boolean} Let the event propagate.

removeTimeout

removeTimeout: function()

Private.  Called by mousemove() to remove the drag timeout.

mouseup

mouseup: function (evt)

Handle mouseup events

Parameters

evt{Event}

Returns

{Boolean} Let the event propagate.

mouseout

mouseout: function (evt)

Handle mouseout events

Parameters

evt{Event}

Returns

{Boolean} Let the event propagate.

click

click: function (evt)

The drag handler captures the click event.  If something else registers for clicks on the same element, its listener will not be called after a drag.

Parameters

evt{Event}

Returns

{Boolean} Let the event propagate.

activate

activate: function()

Activate the handler.

Returns

{Boolean} The handler was successfully activated.

deactivate

deactivate: function()

Deactivate the handler.

Returns

{Boolean} The handler was successfully deactivated.

OpenLayers. Handler. Feature

Handler to respond to mouse events related to a drawn feature.  Callbacks with the following keys will be notified of the following events associated with features: click, clickout, over, out, and dblclick.

This handler stops event propagation for mousedown and mouseup if those browser events target features that can be selected.

Summary
{Object} A object mapping the browser events to objects with callback keys for in and out.
{OpenLayers.Feature.Vector} The last feature that was hovered.
{OpenLayers.Feature.Vector} The last feature that was handled.
{OpenLayers.Pixel} The location of the last mousedown.
{OpenLayers.Pixel} The location of the last mouseup.
{Number} The number of pixels the mouse can move between mousedown and mouseup for the event to still be considered a click.
To restrict dragging to a limited set of geometry types, send a list of strings corresponding to the geometry class names.
{Boolean} If stopClick is set to true, handled clicks do not propagate to other click listeners.
{Boolean} If stopDown is set to true, handled mousedowns do not propagate to other mousedown listeners.
{Boolean} If stopUp is set to true, handled mouseups do not propagate to other mouseup listeners.
Handle mouse down.
Handle mouse up.
Handle click.
Handle mouse moves.
Handle dblclick.
Return true if the geometry type of the passed feature matches one of the geometry types in the geometryTypes array.
Call the callback keyed in the event map with the supplied arguments.
Turn on the handler.
Turn off the handler.
Moves the layer for this handler to the top, so mouse events can reach it.
Moves the layer back to the position determined by the map’s layers array.

Properties

EVENTMAP

{Object} A object mapping the browser events to objects with callback keys for in and out.

feature

{OpenLayers.Feature.Vector} The last feature that was hovered.

lastFeature

{OpenLayers.Feature.Vector} The last feature that was handled.

down

{OpenLayers.Pixel} The location of the last mousedown.

up

{OpenLayers.Pixel} The location of the last mouseup.

clickTolerance

{Number} The number of pixels the mouse can move between mousedown and mouseup for the event to still be considered a click.  Dragging the map should not trigger the click and clickout callbacks unless the map is moved by less than this tolerance.  Defaults to 4.

geometryTypes

To restrict dragging to a limited set of geometry types, send a list of strings corresponding to the geometry class names.

@type Array(String)

stopClick

{Boolean} If stopClick is set to true, handled clicks do not propagate to other click listeners.  Otherwise, handled clicks do propagate.  Unhandled clicks always propagate, whatever the value of stopClick.  Defaults to true.

stopDown

{Boolean} If stopDown is set to true, handled mousedowns do not propagate to other mousedown listeners.  Otherwise, handled mousedowns do propagate.  Unhandled mousedowns always propagate, whatever the value of stopDown.  Defaults to true.

stopUp

{Boolean} If stopUp is set to true, handled mouseups do not propagate to other mouseup listeners.  Otherwise, handled mouseups do propagate.  Unhandled mouseups always propagate, whatever the value of stopUp.  Defaults to false.

Functions

OpenLayers. Handler. Feature

Parameters

control{OpenLayers.Control}
layer{OpenLayers.Layer.Vector}
callbacks{Object} An object with a ‘over’ property whos value is a function to be called when the mouse is over a feature.  The callback should expect to recieve a single argument, the feature.
options{Object}

mousedown

mousedown: function(evt)

Handle mouse down.  Stop propagation if a feature is targeted by this event (stops map dragging during feature selection).

Parameters

evt{Event}

mouseup

mouseup: function(evt)

Handle mouse up.  Stop propagation if a feature is targeted by this event.

Parameters

evt{Event}

click

click: function(evt)

Handle click.  Call the “click” callback if click on a feature, or the “clickout” callback if click outside any feature.

Parameters

evt{Event}

Returns

{Boolean}

mousemove

mousemove: function(evt)

Handle mouse moves.  Call the “over” callback if moving in to a feature, or the “out” callback if moving out of a feature.

Parameters

evt{Event}

Returns

{Boolean}

dblclick

dblclick: function(evt)

Handle dblclick.  Call the “dblclick” callback if dblclick on a feature.

Parameters

evt{Event}

Returns

{Boolean}

geometryTypeMatches

geometryTypeMatches: function(feature)

Return true if the geometry type of the passed feature matches one of the geometry types in the geometryTypes array.

Parameters

feature{<OpenLayers.Vector.Feature>}

Returns

{Boolean}

handle

handle: function(evt)

Parameters

evt{Event}

Returns

{Boolean} The event occurred over a relevant feature.

triggerCallback

triggerCallback: function(type,
mode,
args)

Call the callback keyed in the event map with the supplied arguments.  For click and clickout, the clickTolerance is checked first.

Parameters

type{String}

activate

activate: function()

Turn on the handler.  Returns false if the handler was already active.

Returns

{Boolean}

deactivate

deactivate: function()

Turn off the handler.  Returns false if the handler was already active.

Returns

{Boolean}

moveLayerToTop

moveLayerToTop: function()

Moves the layer for this handler to the top, so mouse events can reach it.

moveLayerBack

moveLayerBack: function()

Moves the layer back to the position determined by the map’s layers array.

OpenLayers. Handler. Hover

The hover handler is to be used to emulate mouseovers on objects on the map that aren’t DOM elements.  For example one can use this handler to send WMS/GetFeatureInfo requests as the user moves the mouve over the map.

Inherits from

Summary
Construct a hover handler.
Called when the mouse moves on the map.
Called when the mouse goes out of the map.
Determine whether the mouse move is within the optional pixel tolerance.
Clear the timer and set timerId to null.
Triggers pause callback.

Properties

px

{<OpenLayers.Pixel>}The location of the last mousemove, expressed in pixels.

timerId

{Number}The id of the timer.

Functions

OpenLayers. Handler. Hover

Construct a hover handler.

Parameters

control{OpenLayers.Control} The control that initialized this handler.  The control is assumed to have a valid map property; that map is used in the handler’s own setMap method.
callbacks{Object} An object with keys corresponding to callbacks that will be called by the handler.  The callbacks should expect to receive a single argument, the event.  Callbacks for ‘move’, the mouse is moving, and ‘pause’, the mouse is pausing, are supported.
options{Object} An optional object whose properties will be set on the handler.

mousemove

mousemove: function(evt)

Called when the mouse moves on the map.

Parameters

evt{OpenLayers.Event}

Returns

{Boolean} Continue propagating this event.

mouseout

mouseout: function(evt)

Called when the mouse goes out of the map.

Parameters

evt{OpenLayers.Event}

Returns

{Boolean} Continue propagating this event.

passesTolerance

passesTolerance: function(px)

Determine whether the mouse move is within the optional pixel tolerance.

Parameters

px{OpenLayers.Pixel}

Returns

{Boolean} The mouse move is within the pixel tolerance.

clearTimer

clearTimer: function()

Clear the timer and set timerId to null.

delayedCall

delayedCall: function(evt)

Triggers pause callback.

Parameters

evt{OpenLayers.Event}

OpenLayers. Handler. MouseWheel

Handler for wheel up/down events.

Inherits from

Summary
{function}
{OpenLayers.Pixel} mousePosition is necessary because evt.clientX/Y is buggy in Moz on wheel events, so we cache and use the value from the last mousemove.
Catch the wheel event and handle it xbrowserly
Given the wheel event, we carry out the appropriate zooming in or out, based on the ‘wheelDelta’ or ‘detail’ property of the event.
Update the stored mousePosition on every move.

Properties

wheelListener

{function}

mousePosition

{OpenLayers.Pixel} mousePosition is necessary because evt.clientX/Y is buggy in Moz on wheel events, so we cache and use the value from the last mousemove.

Functions

OpenLayers. Handler. MouseWheel

Parameters

control{OpenLayers.Control}
callbacks{Object} An object containing a single function to be called when the drag operation is finished.  The callback should expect to recieve a single argument, the point geometry.
options{Object}

destroy

destroy: function()

onWheelEvent

onWheelEvent: function(e)

Catch the wheel event and handle it xbrowserly

Parameters

e{Event}

wheelZoom

wheelZoom: function(e)

Given the wheel event, we carry out the appropriate zooming in or out, based on the ‘wheelDelta’ or ‘detail’ property of the event.

Parameters

e{Event}

mousemove

mousemove: function (evt)

Update the stored mousePosition on every move.

Parameters

evt{Event} The browser event

Returns

{Boolean} Allow event propagation

activate

activate: function (evt)

deactivate

deactivate: function (evt)

OpenLayers. Layer

Summary
{Float} The layer’s opacity.
{Array(String)} Supported application event types.
{Boolean} The layer’s images have an alpha channel.
{Boolean} The current map resolution is within the layer’s min/max range.
{OpenLayers.Pixel} For layers with a gutter, the image offset represents displacement due to the gutter.
{Object} An optional object whose properties will be set on the layer.
{Array} An immutable (that means don’t change it!)
Destroy is a destructor: this is to alleviate cyclic references which the Javascript garbage cleaner can not take care of on its own.
Set the map property for the layer.
Called at the end of the map.addLayer sequence.
This method’s responsibility is to set up the ‘resolutions’ array for the layer -- this array is what the layer will use to interface between the zoom levels of the map and the resolution display of the layer.
Calculates the max extent which includes all of the data for the layer.
{Integer} the z-index of this layer
This function will take a bounds, and if wrapDateLine option is set on the layer, it will return a bounds which is wrapped around the world.

Properties

opacity

{Float} The layer’s opacity.  Float number between 0.0 and 1.0.

Constants

EVENT_TYPES

{Array(String)} Supported application event types.  Register a listener for a particular event with the following syntax:

layer.events.register(type, obj, listener);

Listeners will be called with a reference to an event object.  The properties of this event depends on exactly what happened.

All event objects have at least the following properties

object{Object} A reference to layer.events.object.
element{DOMElement} A reference to layer.events.element.

Supported map event types

loadstartTriggered when layer loading starts.
loadendTriggered when layer loading ends.
loadcancelTriggered when layer loading is canceled.
visibilitychangedTriggered when layer visibility is changed.
moveTriggered when layer moves (triggered with every mousemove during a drag).
moveendTriggered when layer is done moving, object passed as argument has a zoomChanged boolean property which tells that the zoom has changed.

Properties

alpha

{Boolean} The layer’s images have an alpha channel.  Default is false.

inRange

{Boolean} The current map resolution is within the layer’s min/max range.  This is set in <OpenLayers.Map.setCenter> whenever the zoom changes.

imageOffset

{OpenLayers.Pixel} For layers with a gutter, the image offset represents displacement due to the gutter.

options

{Object} An optional object whose properties will be set on the layer.  Any of the layer properties can be set as a property of the options object and sent to the constructor when the layer is created.

SUPPORTED_TRANSITIONS

{Array} An immutable (that means don’t change it!) list of supported transitionEffect values.

Functions

OpenLayers. Layer

Parameters

name{String} The layer name
options{Object} Hashtable of extra options to tag onto the layer

destroy

destroy: function(setNewBaseLayer)

Destroy is a destructor: this is to alleviate cyclic references which the Javascript garbage cleaner can not take care of on its own.

Parameters

setNewBaseLayer{Boolean} Set a new base layer when this layer has been destroyed.  Default is true.

clone

clone: function (obj)

Parameters

obj{OpenLayers.Layer} The layer to be cloned

Returns

{OpenLayers.Layer} An exact clone of this OpenLayers.Layer

moveTo

moveTo:function(bounds,
zoomChanged,
dragging)

Parameters

bound{OpenLayers.Bounds}
zoomChanged{Boolean} Tells when zoom has changed, as layers have to do some init work in that case.
dragging{Boolean}

setMap

setMap: function(map)

Set the map property for the layer.  This is done through an accessor so that subclasses can override this and take special action once they have their map variable set.

Here we take care to bring over any of the necessary default properties from the map.

Parameters

map{OpenLayers.Map}

afterAdd

afterAdd: function()

Called at the end of the map.addLayer sequence.  At this point, the map will have a base layer.  To be overridden by subclasses.

initResolutions

initResolutions: function()

This method’s responsibility is to set up the ‘resolutions’ array for the layer -- this array is what the layer will use to interface between the zoom levels of the map and the resolution display of the layer.

The user has several options that determine how the array is set up.

For a detailed explanation, see the following wiki from the openlayers.org homepage: http://trac.openlayers.org/wiki/SettingZoomLevels

getDataExtent

getDataExtent: function ()

Calculates the max extent which includes all of the data for the layer.  This function is to be implemented by subclasses.

Returns

{OpenLayers.Bounds}

getZIndex

getZIndex: function ()

Returns

{Integer} the z-index of this layer

setZIndex

setZIndex: function (zIndex)

Parameters

zIndex{Integer}

adjustBounds

adjustBounds: function (bounds)

This function will take a bounds, and if wrapDateLine option is set on the layer, it will return a bounds which is wrapped around the world.  We do not wrap for bounds which cross the maxExtent.left/right, only bounds which are entirely to the left or entirely to the right.

Parameters

bounds{OpenLayers.Bounds}

OpenLayers. Marker.Box

Inherits from

Summary
{DOMElement}
Allow the user to change the box’s color and border width
{Boolean} Whether or not the marker is currently visible on screen.
Hide or show the icon

Properties

div

{DOMElement}

Functions

OpenLayers. Marker.Box

Parameters

bounds{OpenLayers.Bounds}
borderColor{String}
borderWidth{int}

destroy

destroy: function()

setBorder

setBorder: function (color,
width)

Allow the user to change the box’s color and border width

Parameters

color{String} Default is “red”
width{int} Default is 2

draw

draw: function(px,
sz)

Parameters

px{OpenLayers.Pixel}
sz{OpenLayers.Size}

Returns

{DOMElement} A new DOM Image with this marker�s icon set at the location passed-in

onScreen

onScreen:function()

Rreturn

{Boolean} Whether or not the marker is currently visible on screen.

display

display: function(display)

Hide or show the icon

Parameters

display{Boolean}

OpenLayers. Request. XMLHttpRequest

Standard-compliant (W3C) cross-browser implementation of the XMLHttpRequest object.  From http://code.google.com/p/xmlhttprequest/.

Summary
@param {} request
Parse XML into a doc structure

Functions

OpenLayers. nullHandler

OpenLayers.nullHandler = function(request)

@param {} request

parseXMLString

OpenLayers.parseXMLString = function(text)

Parse XML into a doc structure

Parameters

text{String}

Returns

{?}  Parsed AJAX Responsev

OpenLayers.Ajax

Summary
{Object} Transport mechanism for whichever browser we’re in, or false if none available.
{Integer}

Functions

emptyFunction

emptyFunction: function ()

getTransport

getTransport: function()

Returns

{Object} Transport mechanism for whichever browser we’re in, or false if none available.

Properties

activeRequestCount

{Integer}

OpenLayers. Ajax. Responders

Properties

responders

{Array}

Functions

register

register: function(responderToAdd)

Parameters

responderToAdd{?}

unregister

unregister: function(responderToRemove)

Parameters

responderToRemove{?}

dispatch

dispatch: function(callback,
request,
transport)

Parameters

callback{?}
request{?}
transport{?}

onCreate

onCreate: function()

onComplete

onComplete: function()

OpenLayers. Ajax.Base

Functions

OpenLayers. Ajax.Base

Parameters

options{Object}

OpenLayers. Ajax. Request

Deprecated.  Use OpenLayers.Request method instead.

Inherit

Summary
{Boolean}
{Boolean} -
If the optional onException function is set, execute it and then dispatch the call to any other listener registered for onException.
{Array(String)}

Properties

_complete

{Boolean}

Functions

OpenLayers. Ajax. Request

Parameters

url{String}
options{Object}

request

request: function(url)

Parameters

url{String}

onStateChange

onStateChange: function()

setRequestHeaders

setRequestHeaders: function()

success

success: function()

Returns

{Boolean} -

getStatus

getStatus: function()

Returns

{Integer}Status

respondToReadyState

respondToReadyState: function(readyState)

Parameters

readyState{?}

getHeader

getHeader: function(name)

Parameters

name{String} Header name

Returns

{?}response header for the given name

dispatchException

dispatchException: function(exception)

If the optional onException function is set, execute it and then dispatch the call to any other listener registered for onException.

If no optional onException function is set, we suspect that the user may have also not used OpenLayers.Ajax.Responders.register to register a listener for the onException call.  To make sure that something gets done with this exception, only dispatch the call if there are listeners.

If you explicitly want to swallow exceptions, set request.options.onException to an empty function (function(){}) or register an empty function with OpenLayers.Ajax.Responders for onException.

Parameters

exception{?}

Properties

Events

{Array(String)}

OpenLayers. Ajax. Response

Summary

Properties

status

{Integer}

statusText

{String}

Functions

OpenLayers. Ajax. Response

Parameters

request{Object}

getStatus

getStatustext

Returns

{String}statusText

getHeader

getResponseHeader

getResponseHeader: function(name)

Returns

{?}response header for given name

getElementsByTagNameNS

OpenLayers.Ajax.getElementsByTagNameNS = function(parentnode,
nsuri,
nsprefix,
tagname)

Parameters

parentnode{?}
nsuri{?}
nsprefix{?}
tagname{?}

Returns

{?}

serializeXMLToString

OpenLayers.Ajax.serializeXMLToString = function(xmldom)

Wrapper function around XMLSerializer, which doesn’t exist/work in IE/Safari.  We need to come up with a way to serialize in those browser: for now, these browsers will just fail.  #535, #536

Parameters

xmldom {XMLNode} xml dom to serialize

Returns

{?}

OpenLayers. Control. DragPan

The DragPan control pans the map with a drag of the mouse.

Inherits from

Summary
{OpenLayers.Control.TYPES}
{Boolean} The map moved.
{Integer} The number of milliseconds that should ellapse before panning the map again.
Creates a Drag handler, using panMap and panMapDone as callbacks.
Finish the panning operation.

Properties

type

{OpenLayers.Control.TYPES}

panned

{Boolean} The map moved.

interval

{Integer} The number of milliseconds that should ellapse before panning the map again.  Set this to increase dragging performance.  Defaults to 25 milliseconds.

Functions

draw

draw: function()

Creates a Drag handler, using panMap and panMapDone as callbacks.

panMap

panMap: function(xy)

Parameters

xy{OpenLayers.Pixel} Pixel of the mouse position

panMapDone

panMapDone: function(xy)

Finish the panning operation.  Only call setCenter (through panMap) if the map has actually been moved.

Parameters

xy{OpenLayers.Pixel} Pixel of the mouse position

OpenLayers. Feature. Vector

Vector features use the OpenLayers.Geometry classes as geometry description.  They have an ‘attributes’ property, which is the data object, and a ‘style’ property, the default values of which are defined in the OpenLayers.Feature.Vector.style objects.

Inherits from

Summary
{String}
{OpenLayers.Bounds} The box bounding that feature’s geometry, that property can be set by an OpenLayers.Format object when deserializing the feature, so in most cases it represents an information set by the server.
{String}
{String} rendering intent currently being used
Create a vector feature.
nullify references to prevent circular references and memory leaks
Create a clone of this vector feature.
Determine whether the feature is within the map viewport.
Determins whether the feature intersects with the specified location.
Moves the feature and redraws it at its new location
Sets the new state
OpenLayers features can have a number of style attributes.

Properties

fid

{String}

bounds

{OpenLayers.Bounds} The box bounding that feature’s geometry, that property can be set by an OpenLayers.Format object when deserializing the feature, so in most cases it represents an information set by the server.

state

{String}

renderIntent

{String} rendering intent currently being used

Functions

OpenLayers. Feature. Vector

Create a vector feature.

Parameters

geometry{OpenLayers.Geometry} The geometry that this feature represents.
attributes{Object} An optional object that will be mapped to the <attributes> property.
style{Object} An optional style object.

destroy

destroy: function()

nullify references to prevent circular references and memory leaks

clone

clone: function ()

Create a clone of this vector feature.  Does not set any non-standard properties.

Returns

{OpenLayers.Feature.Vector} An exact clone of this vector feature.

onScreen

onScreen:function(boundsOnly)

Determine whether the feature is within the map viewport.  This method tests for an intersection between the geometry and the viewport bounds.  If a more effecient but less precise geometry bounds intersection is desired, call the method with the boundsOnly parameter true.

Parameters

boundsOnly{Boolean} Only test whether a feature’s bounds intersects the viewport bounds.  Default is false.  If false, the feature’s geometry must intersect the viewport for onScreen to return true.

Returns

{Boolean} The feature is currently visible on screen (optionally based on its bounds if boundsOnly is true).

createMarker

createMarker: function()
HACKwe need to decide if all vector features should be able to create markers

Returns

{OpenLayers.Marker} For now just returns null

destroyMarker

destroyMarker: function()
HACKwe need to decide if all vector features should be able to delete markers

If user overrides the createMarker() function, s/he should be able to also specify an alternative function for destroying it

createPopup

createPopup: function()
HACKwe need to decide if all vector features should be able to create popups

Returns

{OpenLayers.Popup} For now just returns null

atPoint

atPoint: function(lonlat,
toleranceLon,
toleranceLat)

Determins whether the feature intersects with the specified location.

Parameters

lonlat{OpenLayers.LonLat}
toleranceLon{float} Optional tolerance in Geometric Coords
toleranceLat{float} Optional tolerance in Geographic Coords

Returns

{Boolean} Whether or not the feature is at the specified location

destroyPopup

destroyPopup: function()
HACKwe need to decide if all vector features should be able to delete popups

move

move: function(location)

Moves the feature and redraws it at its new location

Parameters

state{OpenLayers.LonLat or OpenLayers.Pixel} the location to which to move the feature.

toState

toState: function(state)

Sets the new state

Parameters

state{String}

Constants

OpenLayers. Feature. Vector. style

OpenLayers features can have a number of style attributes.  The ‘default’ style will typically be used if no other style is specified.  These styles correspond for the most part, to the styling properties defined by the SVG standard.  Information on fill properties: http://www.w3.org- /TR- /SVG- /painting.html#FillProperties Information on stroke properties: http://www.w3.org- /TR- /SVG- /painting.html#StrokeProperties

Symbolizer properties

fill{Boolean} Set to false if no fill is desired.
fillColor{String} Hex fill color.  Default is “#ee9900”.
fillOpacity{Number} Fill opacity (0-1).  Default is 0.4
stroke{Boolean} Set to false if no stroke is desired.
strokeColor{String} Hex stroke color.  Default is “#ee9900”.
strokeOpacity{Number} Stroke opacity (0-1).  Default is 1.
strokeWidth{Number} Pixel stroke width.  Default is 1.
strokeLinecap{String} Stroke cap type.  Default is “round”.  [butt | round | square]
strokeDashstyle{String} Stroke dash style.  Default is “solid”.  [dot | dash | dashdot | longdash | longdashdot | solid]
graphic{Boolean} Set to false if no graphic is desired.
pointRadius{Number} Pixel point radius.  Default is 6.
pointerEvents{String} Default is “visiblePainted”.
cursor{String} Default is “”.
externalGraphic{String} Url to an external graphic that will be used for rendering points.
graphicWidth{Number} Pixel width for sizing an external graphic.
graphicHeight{Number} Pixel height for sizing an external graphic.
graphicOpacity{Number} Opacity (0-1) for an external graphic.
graphicXOffset{Number} Pixel offset along the positive x axis for displacing an external graphic.
graphicYOffset{Number} Pixel offset along the positive y axis for displacing an external graphic.
graphicZIndex{Number} The integer z-index value to use in rendering.
graphicName{String} Named graphic to use when rendering points.  Supported values include “circle” (default), “square”, “star”, “x”, “cross”, “triangle”.
graphicTitle{String} Tooltip for an external graphic.  Only supported in Firefox and Internet Explorer.
backgroundGraphic{String} Url to a graphic to be used as the background under an externalGraphic.
backgroundGraphicZIndex{Number} The integer z-index value to use in rendering the background graphic.
backgroundXOffset{Number} The x offset (in pixels) for the background graphic.
backgroundYOffset{Number} The y offset (in pixels) for the background graphic.
backgroundHeight{Number} The height of the background graphic.  If not provided, the graphicHeight will be used.
backgroundWidth{Number} The width of the background width.  If not provided, the graphicWidth will be used.
label{String} The text for an optional label.  For browsers that use the canvas renderer, this requires either fillText or mozDrawText to be available.
labelAlign{String} Label alignment.  This specifies the insertion point relative to the text.  It is a string composed of two characters.  The first character is for the horizontal alignment, the second for the vertical alignment.  Valid values for horizontal alignment: “l”=left, “c”=center, “r”=right.  Valid values for vertical alignment: “t”=top, “m”=middle, “b”=bottom.  Example values: “lt”, “cm”, “rb”.  The canvas renderer does not support vertical alignment, it will always use “b”.
fontColor{String} The font color for the label, to be provided like CSS.
fontFamily{String} The font family for the label, to be provided like in CSS.
fontSize{String} The font size for the label, to be provided like in CSS.
fontWeight{String} The font weight for the label, to be provided like in CSS.
display{String} Symbolizers will have no effect if display is set to “none”.  All other values have no effect.

OpenLayers. Handler.Box

Handler for dragging a rectangle across the map.  Box is displayed on mouse down, moves on mouse move, and is finished on mouse up.

Inherits from

Summary
{Object} Caches some box characteristics from css.
Remove the zoombox from the screen and nullify our reference to it.
Determines offset and box model for a box.

Properties

boxCharacteristics

{Object} Caches some box characteristics from css.  This is used by the getBoxCharacteristics method.

Functions

OpenLayers. Handler.Box

Parameters

control{OpenLayers.Control}
callbacks{Object} An object containing a single function to be called when the drag operation is finished.  The callback should expect to recieve a single argument, the point geometry.
options{Object}

setMap

setMap: function (map)

startBox

startBox: function (xy)

Parameters

evt{Event}

moveBox

moveBox: function (xy)

endBox

endBox: function(end)

removeBox

removeBox: function()

Remove the zoombox from the screen and nullify our reference to it.

activate

activate: function ()

deactivate

deactivate: function ()

getCharacteristics

Determines offset and box model for a box.

Returns

{Object} a hash with the following properties:

  • xOffset - Corner offset in x-direction
  • yOffset - Corner offset in y-direction
  • newBoxModel - true for all browsers except IE in quirks mode

OpenLayers. Handler. RegularPolygon

Handler to draw a regular polygon on the map.  Polygon is displayed on mouse down, moves or is modified on mouse move, and is finished on mouse up.  The handler triggers callbacks for ‘done’ and ‘cancel’.  Create a new instance with the OpenLayers.Handler.RegularPolygon constructor.

Inherits from

Summary
{Float} The angle from the origin (mouse down) to the current mouse position, in radians.
{Boolean} The polygon has a fixed radius.
{OpenLayers.Feature.Vector} The currently drawn polygon feature
{OpenLayers.Layer.Vector} The temporary drawing layer
{OpenLayers.Geometry.Point} Location of the first mouse down
Create a new regular polygon handler.
Start drawing a new feature
Respond to drag move events
Finish drawing the feature
Finish drawing the feature.
Create the new polygon geometry.
Modify the polygon geometry in place.
Calculate the angle based on settings.
Finish the geometry and call the “done” callback.
Trigger the control’s named callback with the given arguments

Properties

angle

{Float} The angle from the origin (mouse down) to the current mouse position, in radians.  This is measured counterclockwise from the positive x-axis.

fixedRadius

{Boolean} The polygon has a fixed radius.  True if a radius is set before drawing begins.  False otherwise.

feature

{OpenLayers.Feature.Vector} The currently drawn polygon feature

layer

{OpenLayers.Layer.Vector} The temporary drawing layer

origin

{OpenLayers.Geometry.Point} Location of the first mouse down

Functions

OpenLayers. Handler. RegularPolygon

Create a new regular polygon handler.

Parameters

control{OpenLayers.Control} The control that owns this handler
callbacks{Object} An object with a properties whose values are functions.  Various callbacks described below.
options{Object} An object with properties to be set on the handler.  If the options.sides property is not specified, the number of sides will default to 4.

Named callbacks

createCalled when a sketch is first created.  Callback called with the creation point geometry and sketch feature.
doneCalled when the sketch drawing is finished.  The callback will recieve a single argument, the sketch geometry.
cancelCalled when the handler is deactivated while drawing.  The cancel callback will receive a geometry.

down

down: function(evt)

Start drawing a new feature

Parameters

evt{Event} The drag start event

move

move: function(evt)

Respond to drag move events

Parameters

evt{Evt} The move event

up

up: function(evt)

Finish drawing the feature

Parameters

evt{Event} The mouse up event

out

out: function(evt)

Finish drawing the feature.

Parameters

evt{Event} The mouse out event

createGeometry

createGeometry: function()

Create the new polygon geometry.  This is called at the start of the drag and at any point during the drag if the number of sides changes.

modifyGeometry

modifyGeometry: function()

Modify the polygon geometry in place.

calculateAngle

calculateAngle: function(point,
evt)

Calculate the angle based on settings.

Parameters

point{OpenLayers.Geometry.Point}
evt{Event}

finalize

finalize: function()

Finish the geometry and call the “done” callback.

callback

callback: function (name,
args)

Trigger the control’s named callback with the given arguments

Parameters

name{String} The key for the callback that is one of the properties of the handler’s callbacks object.
args{Array} An array of arguments with which to call the callback (defined by the control).

OpenLayers. Layer. EventPane

Base class for 3rd party layers.  Create a new event pane layer with the OpenLayers.Layer.EventPane constructor.

Inherits from

Summary
{Boolean} EventPaned layers are always base layers, by necessity.
{DOMElement} A reference to the element that controls the events.
{Object} This is the object which will be used to load the 3rd party library in the case of the google layer, this will be of type GMap, in the case of the ve layer, this will be of type VEMap
Create a new event pane layer
Set the map property for the layer.
If we can’t load the map lib, then display an error message to the user and tell them where to go for help.
To be implemented by subclasses.
Set the display on the pane
Set the z-index order for the pane.
Handle calls to move the layer.
Get a map location from a pixel location
Get a pixel location from a map location
Get an OL style map location from a 3rd party style map location
Get a 3rd party map location from an OL map location.
Get an OL pixel location from a 3rd party pixel location.
Get a 3rd party pixel location from an OL pixel location

Properties

isBaseLayer

{Boolean} EventPaned layers are always base layers, by necessity.

pane

{DOMElement} A reference to the element that controls the events.

mapObject

{Object} This is the object which will be used to load the 3rd party library in the case of the google layer, this will be of type GMap, in the case of the ve layer, this will be of type VEMap

Functions

OpenLayers. Layer. EventPane

Create a new event pane layer

Parameters

name{String}
options{Object} Hashtable of extra options to tag onto the layer

setMap

setMap: function(map)

Set the map property for the layer.  This is done through an accessor so that subclasses can override this and take special action once they have their map variable set.

Parameters

map{OpenLayers.Map}

loadWarningMessage

loadWarningMessage:function()

If we can’t load the map lib, then display an error message to the user and tell them where to go for help.

This function sets up the layout for the warning message.  Each 3rd party layer must implement its own getWarningHTML() function to provide the actual warning message.

getWarningHTML

getWarningHTML:function()

To be implemented by subclasses.

Returns

{String} String with information on why layer is broken, how to get it working.

display

display: function(display)

Set the display on the pane

Parameters

display{Boolean}

setZIndex

setZIndex: function (zIndex)

Set the z-index order for the pane.

Parameters

zIndex{int}

moveTo

moveTo:function(bounds,
zoomChanged,
dragging)

Handle calls to move the layer.

Parameters

bounds{OpenLayers.Bounds}
zoomChanged{Boolean}
dragging{Boolean}

getLonLatFromViewPortPx

getLonLatFromViewPortPx: function (viewPortPx)

Get a map location from a pixel location

Parameters

viewPortPx{OpenLayers.Pixel}

Returns

{OpenLayers.LonLat} An OpenLayers.LonLat which is the passed-in view port OpenLayers.Pixel, translated into lon/lat by map lib If the map lib is not loaded or not centered, returns null

getViewPortPxFromLonLat

getViewPortPxFromLonLat: function (lonlat)

Get a pixel location from a map location

Parameters

lonlat{OpenLayers.LonLat}

Returns

{OpenLayers.Pixel} An OpenLayers.Pixel which is the passed-in OpenLayers.LonLat, translated into view port pixels by map lib If map lib is not loaded or not centered, returns null

getOLLonLatFromMapObjectLonLat

getOLLonLatFromMapObjectLonLat: function(moLonLat)

Get an OL style map location from a 3rd party style map location

Parameters moLonLat - {Object}

Returns

{OpenLayers.LonLat} An OpenLayers.LonLat, translated from the passed in MapObject LonLat Returns null if null value is passed in

getMapObjectLonLatFromOLLonLat

getMapObjectLonLatFromOLLonLat: function(olLonLat)

Get a 3rd party map location from an OL map location.

Parameters

olLonLat{OpenLayers.LonLat}

Returns

{Object} A MapObject LonLat, translated from the passed in OpenLayers.LonLat Returns null if null value is passed in

getOLPixelFromMapObjectPixel

getOLPixelFromMapObjectPixel: function(moPixel)

Get an OL pixel location from a 3rd party pixel location.

Parameters

moPixel{Object}

Returns

{OpenLayers.Pixel} An OpenLayers.Pixel, translated from the passed in MapObject Pixel Returns null if null value is passed in

getMapObjectPixelFromOLPixel

getMapObjectPixelFromOLPixel: function(olPixel)

Get a 3rd party pixel location from an OL pixel location

Parameters

olPixel{OpenLayers.Pixel}

Returns

{Object} A MapObject Pixel, translated from the passed in OpenLayers.Pixel Returns null if null value is passed in

OpenLayers. Layer. FixedZoomLevels

Some Layers will already have established zoom levels (like google or ve).  Instead of trying to determine them and populate a resolutions[] Array with those values, we will hijack the resolution functionality here.

When you subclass FixedZoomLevels

The initResolutions() call gets nullified, meaning no resolutions[] array is set up.  Which would be a big problem getResolution() in Layer, since it merely takes map.zoom and indexes into resolutions[]... but....

The getResolution() call is also overridden.  Instead of using the resolutions[] array, we simply calculate the current resolution based on the current extent and the current map size.  But how will we be able to calculate the current extent without knowing the resolution...?

The getExtent() function is also overridden.  Instead of calculating extent based on the center point and the current resolution, we instead calculate the extent by getting the lonlats at the top-left and bottom-right by using the getLonLatFromViewPortPx() translation function, taken from the pixel locations (0,0) and the size of the map.  But how will we be able to do lonlat-px translation without resolution....?

The getZoomForResolution() method is overridden.  Instead of indexing into the resolutions[] array, we call OpenLayers.Layer.getExent(), passing in the desired resolution.  With this extent, we then call getZoomForExtent()

Whenever you implement a layer using OpenLayers.Layer.FixedZoomLevels, it is your responsibility to provide the following three functions:

  • getLonLatFromViewPortPx
  • getViewPortPxFromLonLat
  • getZoomForExtent

...those three functions should generally be provided by any reasonable API that you might be working from.

Summary
Create a new fixed zoom levels layer.
Populate the resolutions array
Get the zoom level for a given resolution
Get the OL zoom index from the map object zoom level
Get the map object zoom level from the OL zoom level

Functions

OpenLayers. Layer. FixedZoomLevels

Create a new fixed zoom levels layer.

initResolutions

initResolutions: function()

Populate the resolutions array

getZoomForResolution

getZoomForResolution: function(resolution)

Get the zoom level for a given resolution

Parameters

resolution{Float}

Returns

{Integer} A suitable zoom level for the specified resolution.  If no baselayer is set, returns null.

getOLZoomFromMapObjectZoom

getOLZoomFromMapObjectZoom: function(moZoom)

Get the OL zoom index from the map object zoom level

Parameters

moZoom{Integer}

Returns

{Integer} An OpenLayers Zoom level, translated from the passed in zoom Returns null if null value is passed in

getMapObjectZoomFromOLZoom

getMapObjectZoomFromOLZoom: function(olZoom)

Get the map object zoom level from the OL zoom level

Parameters

olZoom{Integer}

Returns

{Integer} A MapObject level, translated from the passed in olZoom Returns null if null value is passed in

OpenLayers. Layer. HTTPRequest

Inherits from

Summary
{Float} Used to hash URL param strings for multi-WMS server selection.
{Array(String) or String} This is either an array of url strings or a single url string.
{Object} Hashtable of key/value parameters
selectUrl() implements the standard floating-point multiplicative hash function described by Knuth, and hashes the contents of the given param string into a float between 0 and 1.
Combine url with layer’s params and these newParams.

Constants

URL_HASH_FACTOR

{Float} Used to hash URL param strings for multi-WMS server selection.  Set to the Golden Ratio per Knuth’s recommendation.

Properties

url

{Array(String) or String} This is either an array of url strings or a single url string.

params

{Object} Hashtable of key/value parameters

Functions

OpenLayers. Layer. HTTPRequest

Parameters

name{String}
url{Array(String) or String}
params{Object}
options{Object} Hashtable of extra options to tag onto the layer

selectUrl

selectUrl: function(paramString,
urls)

selectUrl() implements the standard floating-point multiplicative hash function described by Knuth, and hashes the contents of the given param string into a float between 0 and 1.  This float is then scaled to the size of the provided urls array, and used to select a URL.

Parameters

paramString{String}
urls{Array(String)}

Returns

{String} An entry from the urls array, deterministically selected based on the paramString.

getFullRequestString

getFullRequestString:function(newParams,
altUrl)

Combine url with layer’s params and these newParams.

does checking on the serverPath variable, allowing for cases when it is supplied with trailing ? or &, as well as cases where not.

return in formatted string like this

”server?key1=value1&key2=value2&key3=value3”

WARNING: The altUrl parameter is deprecated and will be removed in 3.0.

Parameters

newParams{Object}
altUrl{String} Use this as the url instead of the layer’s url

Returns

{String}

OpenLayers. Layer. Markers

Inherits from

Summary
{Boolean} internal state of drawing.
Create a Markers layer.
This method removes all markers from a layer.
Calculate the pixel location for the marker, create it, and add it to the layer’s div

Properties

drawn

{Boolean} internal state of drawing.  This is a workaround for the fact that the map does not call moveTo with a zoomChanged when the map is first starting up.  This lets us catch the case where we have never drawn the layer, and draw it even if the zoom hasn’t changed.

Functions

OpenLayers. Layer. Markers

Create a Markers layer.

Parameters

name{String}
options{Object} Hashtable of extra options to tag onto the layer

moveTo

moveTo:function(bounds,
zoomChanged,
dragging)

Parameters

bounds{OpenLayers.Bounds}
zoomChanged{Boolean}
dragging{Boolean}

clearMarkers

clearMarkers: function()

This method removes all markers from a layer.  The markers are not destroyed by this function, but are removed from the list of markers.

drawMarker

drawMarker: function(marker)

Calculate the pixel location for the marker, create it, and add it to the layer’s div

Parameters

marker{OpenLayers.Marker}

OpenLayers. Layer. SphericalMercator

A mixin for layers that wraps up the pieces neccesary to have a coordinate conversion for working with commercial APIs which use a spherical mercator projection.  Using this layer as a base layer, additional layers can be used as overlays if they are in the same projection.

A layer is given properties of this object by setting the sphericalMercator property to true.

More projection information

Proj4 Text

+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs

WKT

900913=PROJCS[“WGS84 / Simple Mercator”, GEOGCS[“WGS 84”, DATUM[“WGS_1984”, SPHEROID[“WGS_1984”, 6378137.0, 298.257223563]], PRIMEM[“Greenwich”, 0.0], UNIT[“degree”, 0.017453292519943295], AXIS[“Longitude”, EAST], AXIS[“Latitude”, NORTH]], PROJECTION[“Mercator_1SP_Google”], PARAMETER[“latitude_of_origin”, 0.0], PARAMETER[“central_meridian”, 0.0], PARAMETER[“scale_factor”, 1.0], PARAMETER[“false_easting”, 0.0], PARAMETER[“false_northing”, 0.0], UNIT[“m”, 1.0], AXIS[“x”, EAST], AXIS[“y”, NORTH], AUTHORITY[“EPSG”,”900913”]]

Summary
Get the map’s extent.
Set up the mercator parameters on the layer: resolutions, projection, units.
Given an object with x and y properties in EPSG:4326, modify the x,y properties on the object to be the Spherical Mercator projected coordinates.
Given an object with x and y properties in Spherical Mercator, modify the x,y properties on the object to be the unprojected coordinates.
Transforms from EPSG:4326 to EPSG:900913 and from EPSG:900913 to EPSG:4326 are set by this class.

Functions

getExtent

getExtent: function()

Get the map’s extent.

Returns

{OpenLayers.Bounds} The map extent.

initMercatorParameters

initMercatorParameters: function()

Set up the mercator parameters on the layer: resolutions, projection, units.

projectForward

projectForward: function(point)

Given an object with x and y properties in EPSG:4326, modify the x,y properties on the object to be the Spherical Mercator projected coordinates.

Parameters

point{Object} An object with x and y properties.

Returns

{Object} The point, with the x and y properties transformed to spherical mercator.

projectInverse

projectInverse: function(point)

Given an object with x and y properties in Spherical Mercator, modify the x,y properties on the object to be the unprojected coordinates.

Parameters

point{Object} An object with x and y properties.

Returns

{Object} The point, with the x and y properties transformed from spherical mercator to unprojected coordinates..

Two transforms declared

Transforms from EPSG:4326 to EPSG:900913 and from EPSG:900913 to EPSG:4326 are set by this class.

OpenLayers. Control. DrawFeature

The DrawFeature control draws point, line or polygon features on a vector layer when active.

Inherits from

Properties

callbacks

{Object} The functions that are sent to the handler for callback

Constants

EVENT_TYPES

Supported event types

featureaddedTriggered when a feature is added

Functions

OpenLayers. Control. DrawFeature

Parameters

layer{OpenLayers.Layer.Vector}
handler{OpenLayers.Handler}
options{Object}

drawFeature

drawFeature: function(geometry)

OpenLayers. Control. Measure

Allows for drawing of features for measurements.

Inherits from

Summary
{Array(String)} Supported application event types.
{Object} The functions that are sent to the handler for callback
{String} Display system for output measurements.
{Boolean} Calculate geodesic metrics instead of planar metrics.
{Object} Units for various measurement systems.
{Number} Number of milliseconds between clicks before the event is considered a double-click.
{Number} Timeout id of trigger for measurepartial.
Called when the measurement sketch is done.
Called each time a new point is added to the measurement sketch.
Based on the displaySystem returns the area of a geometry.
Based on the displaySystem returns the length of a geometry.

Constants

EVENT_TYPES

{Array(String)} Supported application event types.  Register a listener for a particular event with the following syntax:

control.events.register(type, obj, listener);

Listeners will be called with a reference to an event object.  The properties of this event depends on exactly what happened.

Supported control event types (in addition to those from OpenLayers.Control)

measureTriggered when a measurement sketch is complete.  Listeners will receive an event with measure, units, order, and geometry properties.
measurepartialTriggered when a new point is added to the measurement sketch.  Listeners receive an event with measure, units, order, and geometry.

Properties

callbacks

{Object} The functions that are sent to the handler for callback

displaySystem

{String} Display system for output measurements.  Supported values are ‘english’, ‘metric’, and ‘geographic’.  Default is ‘metric’.

geodesic

{Boolean} Calculate geodesic metrics instead of planar metrics.  This requires that geometries can be transformed into Geographic/WGS84 (if that is not already the map projection).  Default is false.

displaySystemUnits

{Object} Units for various measurement systems.  Values are arrays of unit abbreviations (from OpenLayers.INCHES_PER_UNIT) in decreasing order of length.

delay

{Number} Number of milliseconds between clicks before the event is considered a double-click.  The “measurepartial” event will not be triggered if the sketch is completed within this time.  This is required for IE where creating a browser reflow (if a listener is modifying the DOM by displaying the measurement values) messes with the dblclick listener in the sketch handler.

delayedTrigger

{Number} Timeout id of trigger for measurepartial.

Functions

OpenLayers. Control. Measure

Parameters

handler{OpenLayers.Handler}
options{Object}

updateHandler

updateHandler: function(handler,
options)

Parameters

handler{Function} One of the sketch handler constructors.
options{Object} Options for the handler.

measureComplete

measureComplete: function(geometry)

Called when the measurement sketch is done.

Parameters

geometry{OpenLayers.Geometry}

measurePartial

measurePartial: function(point,
geometry)

Called each time a new point is added to the measurement sketch.

Parameters

point{OpenLayers.Geometry.Point} The last point added.
geometry{OpenLayers.Geometry} The sketch geometry.

measure

measure: function(geometry,
eventType)

Parameters

geometry{OpenLayers.Geometry}
eventType{String}

getBestArea

getBestArea: function(geometry)

Based on the displaySystem returns the area of a geometry.

Parameters

geometry{OpenLayers.Geometry}

Returns

{Array([Float, String])} Returns a two item array containing the area and the units abbreviation.

getArea

getArea: function(geometry,
units)

Parameters

geometry{OpenLayers.Geometry}
units{String} Unit abbreviation

Returns

{Float} The geometry area in the given units.

getBestLength

getBestLength: function(geometry)

Based on the displaySystem returns the length of a geometry.

Parameters

geometry{OpenLayers.Geometry}

Returns

{Array([Float, String])} Returns a two item array containing the length and the units abbreviation.

getLength

getLength: function(geometry,
units)

Parameters

geometry{OpenLayers.Geometry}
units{String} Unit abbreviation

Returns

{Float} The geometry length in the given units.

OpenLayers. Control. ZoomBox

The ZoomBox control enables zooming directly to a given extent, by drawing a box on the map.  The box is drawn by holding down shift, whilst dragging the mouse.

Inherits from

Summary
{OpenLayers.Control.TYPE}
{Boolean} Should the control be used for zooming out?
{Boolean} Always zoom in/out, when box drawed

Properties

type

{OpenLayers.Control.TYPE}

out

{Boolean} Should the control be used for zooming out?

alwaysZoom

{Boolean} Always zoom in/out, when box drawed

Functions

draw

draw: function()

zoomBox

zoomBox: function (position)

Parameters

position{OpenLayers.Bounds} or {OpenLayers.Pixel}

OpenLayers. Format.WKT

Class for reading and writing Well-Known Text.  Create a new instance with the OpenLayers.Format.WKT constructor.

Inherits from

Summary
Create a new parser for WKT
Deserialize a WKT string and return a vector feature or an array of vector features.
Serialize a feature or array of features into a WKT string.

Functions

OpenLayers. Format.WKT

Create a new parser for WKT

Parameters

options{Object} An optional object whose properties will be set on this instance

Returns

{OpenLayers.Format.WKT} A new WKT parser.

read

read: function(wkt)

Deserialize a WKT string and return a vector feature or an array of vector features.  Supports WKT for POINT, MULTIPOINT, LINESTRING, MULTILINESTRING, POLYGON, MULTIPOLYGON, and GEOMETRYCOLLECTION.

Parameters

wkt{String} A WKT string

Returns

{<OpenLayers.Feature.Vector>|Array} A feature or array of features for GEOMETRYCOLLECTION WKT.

write

write: function(features)

Serialize a feature or array of features into a WKT string.

Parameters

features{<OpenLayers.Feature.Vector>|Array} A feature or array of features

Returns

{String} The WKT string representation of the input geometries

OpenLayers. Layer. Google

Inherits from

Summary
{Integer} 0
{Integer} 19
{Array(Float)} Hardcode these resolutions so that they are more closely tied with the standard wms projection
{GDraggableObject} Since 2.93, Google has exposed the ability to get the maps GDraggableObject.
{DOMElement} Div for Google’s copyright and terms of use link
{DOMElement} Div for Google’s powered by logo and link
Load the GMap and register appropriate event listeners.
The map has been centered, and a map type was specified, so we set the map type on the gmap object, then unregister the listener so that we dont keep doing this every time the map moves.
Hide or show the layer
Hack-on function because GMAPS does not give it to us

Constants

MIN_ZOOM_LEVEL

{Integer} 0

MAX_ZOOM_LEVEL

{Integer} 19

RESOLUTIONS

{Array(Float)} Hardcode these resolutions so that they are more closely tied with the standard wms projection

Properties

dragObject

{GDraggableObject} Since 2.93, Google has exposed the ability to get the maps GDraggableObject.  We can now use this for smooth panning

termsOfUse

{DOMElement} Div for Google’s copyright and terms of use link

poweredBy

{DOMElement} Div for Google’s powered by logo and link

Functions

OpenLayers. Layer. Google

Parameters

name{String} A name for the layer.
options{Object} An optional object whose properties will be set on the layer.

loadMapObject

loadMapObject:function()

Load the GMap and register appropriate event listeners.  If we can’t load GMap2, then display a warning message.

setMapType

setMapType: function()

The map has been centered, and a map type was specified, so we set the map type on the gmap object, then unregister the listener so that we dont keep doing this every time the map moves.

display

display: function(display)

Hide or show the layer

Parameters

display{Boolean}

addContainerPxFunction

addContainerPxFunction: function()

Hack-on function because GMAPS does not give it to us

Parameters

gLatLng{GLatLng}

Returns

{GPoint} A GPoint specifying gLatLng translated into “Container” coords

OpenLayers. Layer.Grid

Base class for layers that use a lattice of tiles.  Create a new grid layer with the OpenLayers.Layer.Grid constructor.

Inherits from

Summary
{Array(Array(OpenLayers.Tile))} This is an array of rows, each row is an array of tiles.
Create a new grid layer
Go through and remove all tiles from the grid, calling destroy() on each of them to kill circular references
This function is called whenever the map is moved.
Deprecated.
Generate parameters for the grid layout.
Starts at the top right corner of the grid and proceeds in a spiral towards the center, adding tiles one at a time to the beginning of a queue.
This function takes a tile as input and adds the appropriate hooks to the tile so that the layer can keep track of the loading tiles.
This function takes a tile as input and removes the tile hooks that were added in addTileMonitoringHooks()
Shifty grid work
Shift grid work in the other dimension
When the size of the map or the buffer changes, we may need to remove some excess rows and columns.
For singleTile layers, this will set a new tile size according to the dimensions of the map pane.

Properties

grid

{Array(Array(OpenLayers.Tile))} This is an array of rows, each row is an array of tiles.

Functions

OpenLayers. Layer.Grid

Create a new grid layer

Parameters

name{String}
url{String}
params{Object}
options{Object} Hashtable of extra options to tag onto the layer

clearGrid

clearGrid:function()

Go through and remove all tiles from the grid, calling destroy() on each of them to kill circular references

moveTo

moveTo:function(bounds,
zoomChanged,
dragging)

This function is called whenever the map is moved.  All the moving of actual ‘tiles’ is done by the map, but moveTo’s role is to accept a bounds and make sure the data that that bounds requires is pre-loaded.

Parameters

bounds{OpenLayers.Bounds}
zoomChanged{Boolean}
dragging{Boolean}

getGridBounds

getGridBounds: function()

Deprecated.  This function will be removed in 3.0.  Please use getTilesBounds() instead.

Returns

{OpenLayers.Bounds} A Bounds object representing the bounds of all the currently loaded tiles (including those partially or not at all seen onscreen)

initSingleTile

initSingleTile: function(bounds)

Parameters

bounds{OpenLayers.Bounds}

calculateGridLayout

calculateGridLayout: function(bounds,
extent,
resolution)

Generate parameters for the grid layout.  This

Parameters

bounds{<OpenLayers.Bound>}
extent{OpenLayers.Bounds}
resolution{Number}

Returns

Object containing properties tilelon, tilelat, tileoffsetlat, tileoffsetlat, tileoffsetx, tileoffsety

initGriddedTiles

initGriddedTiles:function(bounds)

Parameters

bounds{OpenLayers.Bounds}

spiralTileLoad

spiralTileLoad: function()

Starts at the top right corner of the grid and proceeds in a spiral towards the center, adding tiles one at a time to the beginning of a queue.

Once all the grid’s tiles have been added to the queue, we go back and iterate through the queue (thus reversing the spiral order from outside-in to inside-out), calling draw() on each tile.

addTileMonitoringHooks

addTileMonitoringHooks: function(tile)

This function takes a tile as input and adds the appropriate hooks to the tile so that the layer can keep track of the loading tiles.

Parameters

tile{OpenLayers.Tile}

removeTileMonitoringHooks

removeTileMonitoringHooks: function(tile)

This function takes a tile as input and removes the tile hooks that were added in addTileMonitoringHooks()

Parameters

tile{OpenLayers.Tile}

moveGriddedTiles

moveGriddedTiles: function(bounds)

Parameters

bounds{OpenLayers.Bounds}

shiftRow

shiftRow:function(prepend)

Shifty grid work

Parameters

prepend{Boolean} if true, prepend to beginning. if false, then append to end

shiftColumn

shiftColumn: function(prepend)

Shift grid work in the other dimension

Parameters

prepend{Boolean} if true, prepend to beginning. if false, then append to end

removeExcessTiles

removeExcessTiles: function(rows,
columns)

When the size of the map or the buffer changes, we may need to remove some excess rows and columns.

Parameters

rows{Integer} Maximum number of rows we want our grid to have.
colums{Integer} Maximum number of columns we want our grid to have.

onMapResize

onMapResize: function()

For singleTile layers, this will set a new tile size according to the dimensions of the map pane.

OpenLayers. Layer. VirtualEarth

Inherits from

Summary
{Integer} 1
{Integer} 17
{Array(Float)} Hardcode these resolutions so that they are more closely tied with the standard wms projection

Constants

MIN_ZOOM_LEVEL

{Integer} 1

MAX_ZOOM_LEVEL

{Integer} 17

RESOLUTIONS

{Array(Float)} Hardcode these resolutions so that they are more closely tied with the standard wms projection

Functions

OpenLayers. Layer. VirtualEarth

Parameters

name{String}
options{Object}

loadMapObject

loadMapObject:function()

onMapResize

onMapResize: function()

OpenLayers. Layer. Yahoo

Inherits from

Summary
{Integer} 0
{Integer} 17
{Array(Float)} Hardcode these resolutions so that they are more closely tied with the standard wms projection
The map has been centered, so the mysterious yahoo eventpane has been added.

Constants

MIN_ZOOM_LEVEL

{Integer} 0

MAX_ZOOM_LEVEL

{Integer} 17

RESOLUTIONS

{Array(Float)} Hardcode these resolutions so that they are more closely tied with the standard wms projection

Functions

OpenLayers. Layer. Yahoo

Parameters

name{String}
options{Object}

loadMapObject

loadMapObject:function()

onMapResize

onMapResize: function()

fixYahooEventPane

fixYahooEventPane: function()

The map has been centered, so the mysterious yahoo eventpane has been added. we remove it so that it doesnt mess with our event pane.

OpenLayers. Protocol.HTTP

A basic HTTP protocol for vector layers.  Create a new instance with the OpenLayers.Protocol.HTTP constructor.

Inherits from

Summary
{String} Service URL, read-only, set through the options passed to constructor.
{Object} HTTP request headers, read-only, set through the options passed to the constructor, Example: {‘Content-Type’: ‘plain/text’}
{Object} Parameters of GET requests, read-only, set through the options passed to the constructor, Example: {‘bbox’: ‘5,5,5,5’}
{Object} Function to be called when the <read>, <create>, <update>, <delete> or <commit> operation completes, read-only, set through the options passed to the constructor.
{Object} Callback execution scope, read-only, set through the options passed to the constructor.
{Boolean} true if read operations are done with POST requests instead of GET, defaults to false.
A class for giving layers generic HTTP protocol.
Returns a function that applies the given public method with resp and options arguments.
Individual callbacks are created for read, create and update, should a subclass need to override each one separately.
Called the the request issued by <create> is complete.
Called the the request issued by <update> is complete.
Called the the request issued by <delete> is complete.
Called by CRUD specific handlers.
Read HTTP response body and return features.
This method is used from within the commit method each time an an HTTP response is received from the server, it is responsible for calling the user-supplied callbacks.

Properties

url

{String} Service URL, read-only, set through the options passed to constructor.

headers

{Object} HTTP request headers, read-only, set through the options passed to the constructor, Example: {‘Content-Type’: ‘plain/text’}

params

{Object} Parameters of GET requests, read-only, set through the options passed to the constructor, Example: {‘bbox’: ‘5,5,5,5’}

callback

{Object} Function to be called when the <read>, <create>, <update>, <delete> or <commit> operation completes, read-only, set through the options passed to the constructor.

scope

{Object} Callback execution scope, read-only, set through the options passed to the constructor.

readWithPOST

{Boolean} true if read operations are done with POST requests instead of GET, defaults to false.

Functions

OpenLayers. Protocol.HTTP

A class for giving layers generic HTTP protocol.

Parameters

options{Object} Optional object whose properties will be set on the instance.

Valid options include

url{String}
headers{Object}
params{Object}
format{OpenLayers.Format}
callback{Function}
scope{Object}

createCallback

createCallback: function(method,
response,
options)

Returns a function that applies the given public method with resp and options arguments.

Parameters

method{Function} The method to be applied by the callback.
response{OpenLayers.Protocol.Response} The protocol response object.
options{Object} Options sent to the protocol method (read, create, update, or delete).

handleRead

handleRead: function(resp,
options)

Individual callbacks are created for read, create and update, should a subclass need to override each one separately.

Parameters

resp{OpenLayers.Protocol.Response} The response object to pass to the user callback.
options{Object} The user options passed to the read call.

handleCreate

handleCreate: function(resp,
options)

Called the the request issued by <create> is complete.  May be overridden by subclasses.

Parameters

resp{OpenLayers.Protocol.Response} The response object to pass to any user callback.
options{Object} The user options passed to the create call.

handleUpdate

handleUpdate: function(resp,
options)

Called the the request issued by <update> is complete.  May be overridden by subclasses.

Parameters

resp{OpenLayers.Protocol.Response} The response object to pass to any user callback.
options{Object} The user options passed to the update call.

handleDelete

handleDelete: function(resp,
options)

Called the the request issued by <delete> is complete.  May be overridden by subclasses.

Parameters

resp{OpenLayers.Protocol.Response} The response object to pass to any user callback.
options{Object} The user options passed to the delete call.

handleResponse

handleResponse: function(resp,
options)

Called by CRUD specific handlers.

Parameters

resp{OpenLayers.Protocol.Response} The response object to pass to any user callback.
options{Object} The user options passed to the create, read, update, or delete call.

parseFeatures

parseFeatures: function(request)

Read HTTP response body and return features.

Parameters

request{XMLHttpRequest} The request object

Returns

{Array({OpenLayers.Feature.Vector})} or {OpenLayers.Feature.Vector} Array of features or a single feature.

callUserCallback

callUserCallback: function(resp,
options)

This method is used from within the commit method each time an an HTTP response is received from the server, it is responsible for calling the user-supplied callbacks.

Parameters

resp{OpenLayers.Protocol.Response}
options{Object} The map of options passed to the commit call.

OpenLayers. Style

This class represents a UserStyle obtained from a SLD, containing styling rules.

Summary
{String} Title of this style (set if included in SLD)
{String} Description of this style (set if abstract is included in SLD)
{Object} An optional object with properties that symbolizers’ property values should be evaluated against.
{Object} hash of style properties to use as default for merging rule-based style symbolizers onto.
{Boolean} If set to true, the defaultStyle will extend the symbolizer of every rule.
{Hash of Boolean} cache of style properties that need to be parsed for propertyNames.
Creates a UserStyle.
creates a style by applying all feature-dependent rules to the base style.
creates literals for all style properties that have an entry in <this.propertyStyles>.
Looks into all rules for this style and the defaultStyle to collect all the style hash property names containing ${...}
Returns the correct symbolizer prefix according to the geometry type of the passed geometry
converts a style value holding a combination of PropertyName and Literal into a Literal, taking the property values from the passed features.
{Array} prefixes of the sld symbolizers.

Properties

title

{String} Title of this style (set if included in SLD)

description

{String} Description of this style (set if abstract is included in SLD)

rules

context

{Object} An optional object with properties that symbolizers’ property values should be evaluated against.  If no context is specified, feature.attributes will be used

defaultStyle

{Object} hash of style properties to use as default for merging rule-based style symbolizers onto.  If no rules are defined, createSymbolizer will return this style.  If defaultsPerSymbolizer is set to true, the defaultStyle will only be taken into account if there are rules defined.

defaultsPerSymbolizer

{Boolean} If set to true, the defaultStyle will extend the symbolizer of every rule.  Properties of the defaultStyle will also be used to set missing symbolizer properties if the symbolizer has stroke, fill or graphic set to true.  Default is false.

propertyStyles

{Hash of Boolean} cache of style properties that need to be parsed for propertyNames.  Property names are keys, values won’t be used.

Functions

OpenLayers. Style

Creates a UserStyle.

Parameters

style{Object} Optional hash of style properties that will be used as default style for this style object.  This style applies if no rules are specified.  Symbolizers defined in rules will extend this default style.
options{Object} An optional object with properties to set on the style.

Valid options

rules{Array(OpenLayers.Rule)} List of rules to be added to the style.

Return

{OpenLayers.Style}

createSymbolizer

createSymbolizer: function(feature)

creates a style by applying all feature-dependent rules to the base style.

Parameters

feature{OpenLayers.Feature} feature to evaluate rules for

Returns

{Object} symbolizer hash

applySymbolizer

applySymbolizer: function(rule,
style,
feature)

Parameters

rule{OpenLayers.Rule}
style{Object}
feature{<OpenLayer.Feature.Vector>}

Returns

{Object} A style with new symbolizer applied.

createLiterals

createLiterals: function(style,
feature)

creates literals for all style properties that have an entry in <this.propertyStyles>.

Parameters

style{Object} style to create literals for.  Will be modified inline.
feature{Object}

Returns

{Object} the modified style

findPropertyStyles

findPropertyStyles: function()

Looks into all rules for this style and the defaultStyle to collect all the style hash property names containing ${...} strings that have to be replaced using the createLiteral method before returning them.

Returns

{Object} hash of property names that need createLiteral parsing.  The name of the property is the key, and the value is true;

addPropertyStyles

addPropertyStyles: function(propertyStyles,
symbolizer)

Parameters

propertyStyles{Object} hash to add new property styles to.  Will be modified inline
symbolizer{Object} search this symbolizer for property styles

Returns

{Object} propertyStyles hash

getSymbolizerPrefix

getSymbolizerPrefix: function(geometry)

Returns the correct symbolizer prefix according to the geometry type of the passed geometry

Parameters

geometry {OpenLayers.Geometry}

Returns

{String} key of the according symbolizer

createLiteral

OpenLayers.Style.createLiteral = function(value,
context,
feature)

converts a style value holding a combination of PropertyName and Literal into a Literal, taking the property values from the passed features.

Parameters

value{String} value to parse.  If this string contains a construct like “foo ${bar}”, then “foo “ will be taken as literal, and “${bar}” will be replaced by the value of the “bar” attribute of the passed feature.
context{Object} context to take attribute values from
feature{OpenLayers.Feature.Vector} The feature that will be passed to <OpenLayers.String.format> for evaluating functions in the context.

Returns

{String} the parsed value.  In the example of the value parameter above, the result would be “foo valueOfBar”, assuming that the passed feature has an attribute named “bar” with the value “valueOfBar”.

Constants

OpenLayers. Style. SYMBOLIZER_PREFIXES

{Array} prefixes of the sld symbolizers.  These are the same as the main geometry types

OpenLayers. Control. Navigation

The navigation control handles map browsing with mouse events (dragging, double-clicking, and scrolling the wheel).  Create a new navigation control with the OpenLayers.Control.Navigation control.

Note that this control is added to the map by default (if no controls array is sent in the options object to the OpenLayers.Map constructor).

Inherits

Summary
Create a new navigation control
The destroy method is used to perform any clean up before the control is dereferenced.
User spun scroll wheel up
User spun scroll wheel down

Properties

Functions

OpenLayers. Control. Navigation

Create a new navigation control

Parameters

options{Object} An optional object whose properties will be set on the control

destroy

destroy: function()

The destroy method is used to perform any clean up before the control is dereferenced.  Typically this is where event listeners are removed to prevent memory leaks.

activate

activate: function()

deactivate

deactivate: function()

draw

draw: function()

defaultDblClick

defaultDblClick: function (evt)

Parameters

evt{Event}

defaultDblRightClick

defaultDblRightClick: function (evt)

Parameters

evt{Event}

wheelChange

wheelChange: function(evt,
deltaZ)

Parameters

evt{Event}
deltaZ{Integer}

wheelUp

wheelUp: function(evt)

User spun scroll wheel up

Parameters

evt{Event}

wheelDown

wheelDown: function(evt)

User spun scroll wheel down

Parameters

evt{Event}

disableZoomWheel

disableZoomWheel : function()

enableZoomWheel

enableZoomWheel : function()

OpenLayers. Geometry

A Geometry is a description of a geographic object.  Create an instance of this class with the OpenLayers.Geometry constructor.  This is a base class, typical geometry types are described by subclasses of this class.

Summary
{String} A unique identifier for this geometry.
{OpenLayers.Geometry}This is set when a Geometry is added as component of another geometry
{OpenLayers.Bounds} The bounds of this geometry
Creates a geometry object.
Destroy this geometry.
Nullify this components bounds and that of its parent as well.
Extend the existing bounds to include the new bounds.
Calculate the length of this geometry.
Calculate the area of this geometry.
Returns the Well-Known Text representation of a geometry
Generate a geometry given a Well-Known Text string.
Determine whether two line segments intersect.

Properties

id

{String} A unique identifier for this geometry.

parent

{OpenLayers.Geometry}This is set when a Geometry is added as component of another geometry

bounds

{OpenLayers.Bounds} The bounds of this geometry

Functions

OpenLayers. Geometry

Creates a geometry object.

destroy

destroy: function()

Destroy this geometry.

clearBounds

clearBounds: function()

Nullify this components bounds and that of its parent as well.

extendBounds

extendBounds: function(newBounds)

Extend the existing bounds to include the new bounds.  If geometry’s bounds is not yet set, then set a new Bounds.

Parameters

newBounds{OpenLayers.Bounds}

atPoint

atPoint: function(lonlat,
toleranceLon,
toleranceLat)
NoteThis is only an approximation based on the bounds of the geometry.

Parameters

lonlat{OpenLayers.LonLat}
toleranceLon{float} Optional tolerance in Geometric Coords
toleranceLat{float} Optional tolerance in Geographic Coords

Returns

{Boolean} Whether or not the geometry is at the specified location

getLength

getLength: function()

Calculate the length of this geometry.  This method is defined in subclasses.

Returns

{Float} The length of the collection by summing its parts

getArea

getArea: function()

Calculate the area of this geometry.  This method is defined in subclasses.

Returns

{Float} The area of the collection by summing its parts

toString

toString: function()

Returns the Well-Known Text representation of a geometry

Returns

{String} Well-Known Text

OpenLayers. Geometry. fromWKT

OpenLayers.Geometry.fromWKT = function(wkt)

Generate a geometry given a Well-Known Text string.

Parameters

wkt{String} A string representing the geometry in Well-Known Text.

Returns

{OpenLayers.Geometry} A geometry of the appropriate class.

OpenLayers. Geometry. segmentsIntersect

OpenLayers.Geometry.segmentsIntersect = function(seg1,
seg2,
options)

Determine whether two line segments intersect.  Optionally calculates and returns the intersection point.  This function is optimized for cases where seg1.x2 >= seg2.x1 || seg2.x2 >= seg1.x1.  In those obvious cases where there is no intersection, the function should not be called.

Parameters

seg1{Object} Object representing a segment with properties x1, y1, x2, and y2.  The start point is represented by x1 and y1.  The end point is represented by x2 and y2.  Start and end are ordered so that x1 < x2.
seg2{Object} Object representing a segment with properties x1, y1, x2, and y2.  The start point is represented by x1 and y1.  The end point is represented by x2 and y2.  Start and end are ordered so that x1 < x2.
options{Object} Optional properties for calculating the intersection.

Valid options

point{Boolean} Return the intersection point.  If false, the actual intersection point will not be calculated.  If true and the segments intersect, the intersection point will be returned.  If true and the segments do not intersect, false will be returned.  If true and the segments are coincident, true will be returned.
tolerance{Number} If a non-null value is provided, if the segments are within the tolerance distance, this will be considered an intersection.  In addition, if the point option is true and the calculated intersection is within the tolerance distance of an end point, the endpoint will be returned instead of the calculated intersection.  Further, if the intersection is within the tolerance of endpoints on both segments, or if two segment endpoints are within the tolerance distance of eachother (but no intersection is otherwise calculated), an endpoint on the first segment provided will be returned.

Returns

{Boolean | OpenLayers.Geometry.Point} The two segments intersect.  If the point argument is true, the return will be the intersection point or false if none exists.  If point is true and the segments are coincident, return will be true (and the instersection is equal to the shorter segment).

OpenLayers. Geometry. distanceToSegment

OpenLayers.Geometry.distanceToSegment = function(point,
segment)

Parameters

point{Object} An object with x and y properties representing the point coordinates.
segment{Object} An object with x1, y1, x2, and y2 properties representing endpoint coordinates.

Returns

{Object} An object with distance, x, and y properties.  The distance will be the shortest distance between the input point and segment.  The x and y properties represent the coordinates along the segment where the shortest distance meets the segment.

OpenLayers. Layer. MapGuide

Instances of OpenLayers.Layer.MapGuide are used to display data from a MapGuide OS instance.

Inherits from

Summary
{Object} Hashtable of default parameter key/value pairs for tiled layer
{Object} Hashtable of default parameter key/value pairs for untiled layer
{Object} Hashtable of default parameter key/value pairs for untiled layer
{Object} Hashtable of parameter key/value pairs which describe the folder structure for tiles as configured in the mapguide serverconfig.ini section [TileServiceProperties]
{OpenLayers.Size} Tile size as produced by MapGuide server
Create a new Mapguide layer, either tiled or untiled.
factor that are different than the defaults used in OpenLayers, so these must be adjusted accordingly in your application.
Create a clone of this layer
Creates a tile, initializes it, and adds it to the layer div.
Return a query string for this layer
getFullRequestString on MapGuide layers is special, because we do a regular expression replace on ‘,’ in parameters to ‘+’.
special handler to request mapguide tiles from an http exposed tilecache
Generate parameters for the grid layout.

Constants

TILE_PARAMS

{Object} Hashtable of default parameter key/value pairs for tiled layer

SINGLE_TILE_PARAMS

{Object} Hashtable of default parameter key/value pairs for untiled layer

OVERLAY_PARAMS

{Object} Hashtable of default parameter key/value pairs for untiled layer

FOLDER_PARAMS

{Object} Hashtable of parameter key/value pairs which describe the folder structure for tiles as configured in the mapguide serverconfig.ini section [TileServiceProperties]

Properties

defaultSize

{OpenLayers.Size} Tile size as produced by MapGuide server

Functions

OpenLayers. Layer. MapGuide

Create a new Mapguide layer, either tiled or untiled.

For tiled layers, the ‘groupName’ and ‘mapDefinition’ values must be specified as parameters in the constructor.

For untiled base layers, specify either combination of ‘mapName’ and ‘session’, or ‘mapDefinition’ and ‘locale’.

For older versions of MapGuide and overlay layers, set useAsyncOverlay to false and in this case mapName and session are required parameters for the constructor.

MapGuide OS uses a DPI value and degrees to meters conversion

factor that are different than the defaults used in OpenLayers, so these must be adjusted accordingly in your application.  See the MapGuide example for how to set these values for MGOS.

Parameters

name{String} Name of the layer displayed in the interface
url{String} Location of the MapGuide mapagent executable (e.g.  http://localhost:8008- /mapguide- /mapagent- /mapagent.fcgi)
params{Object} hashtable of additional parameters to use.  Some parameters may require additional code on the server.  The ones that you may want to use are:
  • mapDefinition - {String} The MapGuide resource definition (e.g.  Library://Samples/Gmap/Maps/gmapTiled.MapDefinition)
  • locale - Locale setting (for untiled overlays layers only)
  • mapName - {String} Name of the map as stored in the MapGuide session.  (for untiled layers with a session parameter only)
  • session - { String} MapGuide session ID (for untiled overlays layers only)
  • basemaplayergroupname - {String} GroupName for tiled MapGuide layers only
  • format - Image format to be returned (for untiled overlay layers only)
  • showLayers - {String} A comma separated list of GUID’s for the layers to display eg: ‘cvc-xcv34,453-345-345sdf’.
  • hideLayers - {String} A comma separated list of GUID’s for the layers to hide eg: ‘cvc-xcv34,453-345-345sdf’.
  • showGroups - {String} A comma separated list of GUID’s for the groups to display eg: ‘cvc-xcv34,453-345-345sdf’.
  • hideGroups - {String} A comma separated list of GUID’s for the groups to hide eg: ‘cvc-xcv34,453-345-345sdf’
  • selectionXml - {String} A selection xml string Some server plumbing is required to read such a value.
options{Ojbect} Hashtable of extra options to tag onto the layer; will vary depending if tiled or untiled maps are being requested

clone

clone: function (obj)

Create a clone of this layer

Returns

{OpenLayers.Layer.MapGuide} An exact clone of this layer

addTile

addTile:function(bounds,
position)

Creates a tile, initializes it, and adds it to the layer div.

Parameters

bounds{OpenLayers.Bounds}
position{OpenLayers.Pixel}

Returns

{OpenLayers.Tile.Image} The added OpenLayers.Tile.Image

getURL

getURL: function (bounds)

Return a query string for this layer

Parameters

bounds{OpenLayers.Bounds} A bounds representing the bbox for the request

Returns

{String} A string with the layer’s url and parameters and also the passed-in bounds and appropriate tile size specified as parameters.

getFullRequestString

getFullRequestString:function(newParams,
altUrl)

getFullRequestString on MapGuide layers is special, because we do a regular expression replace on ‘,’ in parameters to ‘+’.  This is why it is subclassed here.

Parameters

altUrl{String} Alternative base URL to use.

Returns

{String} A string with the layer’s url appropriately encoded for MapGuide

getImageFilePath

getImageFilePath:function(newParams,
altUrl)

special handler to request mapguide tiles from an http exposed tilecache

Parameters

altUrl{String} Alternative base URL to use.

Returns

{String} A string with the url for the tile image

calculateGridLayout

calculateGridLayout: function(bounds,
extent,
resolution)

Generate parameters for the grid layout.  This

Parameters

bounds{<OpenLayers.Bound>}
extent{OpenLayers.Bounds}
resolution{Number}

Returns

Object containing properties tilelon, tilelat, tileoffsetlat, tileoffsetlat, tileoffsetx, tileoffsety

OpenLayers. Layer. MapServer

Instances of OpenLayers.Layer.MapServer are used to display data from a MapServer CGI instance.

Inherits from

Summary
{Object} Hashtable of default parameter key/value pairs
Create a new MapServer layer object
Create a clone of this layer
Creates a tile, initializes it, and adds it to the layer div.
Return a query string for this layer
combine the layer’s url with its params and these newParams.

Constants

DEFAULT_PARAMS

{Object} Hashtable of default parameter key/value pairs

Functions

OpenLayers. Layer. MapServer

Create a new MapServer layer object

Parameters

name{String} A name for the layer
url{String} Base url for the MapServer CGI (e.g.  http://www2.dmsolutions.ca/cgi-bin/mapserv)
params{Object} An object with key/value pairs representing the GetMap query string parameters and parameter values.
options{Ojbect} Hashtable of extra options to tag onto the layer

clone

clone: function (obj)

Create a clone of this layer

Returns

{OpenLayers.Layer.MapServer} An exact clone of this layer

addTile

addTile:function(bounds,
position)

Creates a tile, initializes it, and adds it to the layer div.

Parameters

bounds{OpenLayers.Bounds}
position{OpenLayers.Pixel}

Returns

{OpenLayers.Tile.Image} The added OpenLayers.Tile.Image

getURL

getURL: function (bounds)

Return a query string for this layer

Parameters

bounds{OpenLayers.Bounds} A bounds representing the bbox for the request

Returns

{String} A string with the layer’s url and parameters and also the passed-in bounds and appropriate tile size specified as parameters.

getFullRequestString

getFullRequestString:function(newParams,
altUrl)

combine the layer’s url with its params and these newParams.

Parameter

newParams{Object} New parameters that should be added to the request string.
altUrl{String} (optional) Replace the URL in the full request string with the provided URL.

Returns

{String} A string with the layer’s url and parameters embedded in it.

OpenLayers. Layer.WMS

Instances of OpenLayers.Layer.WMS are used to display data from OGC Web Mapping Services.  Create a new WMS layer with the OpenLayers.Layer.WMS constructor.

Inherits from

Summary
{Object} Hashtable of default parameter key/value pairs
Deprecated.
Create a new WMS layer object
Destroy this layer
Create a clone of this layer
Return a GetMap query string for this layer
addTile creates a tile, initializes it, and adds it to the layer div.

Constants

DEFAULT_PARAMS

{Object} Hashtable of default parameter key/value pairs

Properties

reproject

Deprecated.  See http://trac.openlayers.org/wiki/SphericalMercator for information on the replacement for this functionality.  {Boolean} Try to reproject this layer if its coordinate reference system is different than that of the base layer.  Default is true.  Set this in the layer options.  Should be set to false in most cases.

Functions

OpenLayers. Layer.WMS

Create a new WMS layer object

Example

var wms = new OpenLayers.Layer.WMS("NASA Global Mosaic",
"http://wms.jpl.nasa.gov/wms.cgi",
{layers: "modis,global_mosaic"});

Parameters

name{String} A name for the layer
url{String} Base url for the WMS (e.g.  http://wms.jpl.nasa.gov/wms.cgi)
params{Object} An object with key/value pairs representing the GetMap query string parameters and parameter values.
options{Ojbect} Hashtable of extra options to tag onto the layer

destroy

destroy: function()

Destroy this layer

clone

clone: function (obj)

Create a clone of this layer

Returns

{OpenLayers.Layer.WMS} An exact clone of this layer

getURL

getURL: function (bounds)

Return a GetMap query string for this layer

Parameters

bounds{OpenLayers.Bounds} A bounds representing the bbox for the request.

Returns

{String} A string with the layer’s url and parameters and also the passed-in bounds and appropriate tile size specified as parameters.

addTile

addTile:function(bounds,
position)

addTile creates a tile, initializes it, and adds it to the layer div.

Parameters

bounds{OpenLayers.Bounds}
position{OpenLayers.Pixel}

Returns

{OpenLayers.Tile.Image} The added OpenLayers.Tile.Image

OpenLayers.Rule

This class represents an SLD Rule, as being used for rule-based SLD styling.

Summary
{String} A unique id for this session.
{String} Title of this rule (set if included in SLD)
{String} Description of this rule (set if abstract is included in SLD)
{Object} An optional object with properties that the rule should be evaluated against.
{<OpenLayers.Filter>} Optional filter for the rule.
{Boolean} Determines whether this rule is only to be applied only if no other rules match (ElseFilter according to the SLD specification).
{Object} Symbolizer or hash of symbolizers for this rule.
Creates a Rule.
Gets the context for evaluating this rule

Properties

id

{String} A unique id for this session.

title

{String} Title of this rule (set if included in SLD)

description

{String} Description of this rule (set if abstract is included in SLD)

context

{Object} An optional object with properties that the rule should be evaluated against.  If no context is specified, feature.attributes will be used.

filter

{<OpenLayers.Filter>} Optional filter for the rule.

elseFilter

{Boolean} Determines whether this rule is only to be applied only if no other rules match (ElseFilter according to the SLD specification).  Default is false.  For instances of OpenLayers.Rule, if elseFilter is false, the rule will always apply.  For subclasses, the else property is ignored.

symbolizer

{Object} Symbolizer or hash of symbolizers for this rule.  If hash of symbolizers, keys are one or more of [“Point”, “Line”, “Polygon”].  The latter if useful if it is required to style e.g. vertices of a line with a point symbolizer.  Note, however, that this is not implemented yet in OpenLayers, but it is the way how symbolizers are defined in SLD.

Functions

OpenLayers.Rule

Creates a Rule.

Parameters

options{Object} An optional object with properties to set on the rule

Returns

{OpenLayers.Rule}

getContext

getContext: function(feature)

Gets the context for evaluating this rule

Paramters

feature{OpenLayers.Feature} feature to take the context from if none is specified.

OpenLayers. StyleMap

Summary
Hash of {OpenLayers.Style}, keyed by names of well known rendering intents (e.g.
{Boolean} if true, every render intent will extend the symbolizers specified for the “default” intent at rendering time.
Creates the symbolizer for a feature for a render intent.
Convenience method to create comparison rules for unique values of a property.

Properties

styles

Hash of {OpenLayers.Style}, keyed by names of well known rendering intents (e.g.  “default”, “temporary”, “select”, “delete”).

extendDefault

{Boolean} if true, every render intent will extend the symbolizers specified for the “default” intent at rendering time.  Otherwise, every rendering intent will be treated as a completely independent style.

Functions

OpenLayers. StyleMap

Parameters

style{Object} Optional.  Either a style hash, or a style object, or a hash of style objects (style hashes) keyed by rendering intent.  If just one style hash or style object is passed, this will be used for all known render intents (default, select, temporary)
options{Object} optional hash of additional options for this instance

destroy

destroy: function()

createSymbolizer

createSymbolizer: function(feature,
intent)

Creates the symbolizer for a feature for a render intent.

Parameters

feature{OpenLayers.Feature} The feature to evaluate the rules of the intended style against.
intent{String} The intent determines the symbolizer that will be used to draw the feature.  Well known intents are “default” (for just drawing the features), “select” (for selected features) and “temporary” (for drawing features).

Returns

{Object} symbolizer hash

addUniqueValueRules

addUniqueValueRules: function(renderIntent,
property,
symbolizers,
context)

Convenience method to create comparison rules for unique values of a property.  The rules will be added to the style object for a specified rendering intent.  This method is a shortcut for creating something like the “unique value legends” familiar from well known desktop GIS systems

Parameters

renderIntent{String} rendering intent to add the rules to
property{String} values of feature attributes to create the rules for
symbolizers{Object} Hash of symbolizers, keyed by the desired property values
context{Object} An optional object with properties that symbolizers’ property values should be evaluated against.  If no context is specified, feature.attributes will be used

OpenLayers. Geometry. Collection

A Collection is exactly what it sounds like: A collection of different Geometries.  These are stored in the local parameter <components> (which can be passed as a parameter to the constructor).

As new geometries are added to the collection, they are NOT cloned.  When removing geometries, they need to be specified by reference (ie you have to pass in the exact geometry to be removed).

The getArea and getLength functions here merely iterate through the components, summing their respective areas and lengths.

Create a new instance with the OpenLayers.Geometry.Collection constructor.

Inerhits from

Summary
{Array(String)} An array of class names representing the types of components that the collection can include.
Creates a Geometry Collection -- a list of geoms.
Get a string representing the components for this collection
Add a new component (geometry) to the collection.
Remove a component from this geometry.

Properties

componentTypes

{Array(String)} An array of class names representing the types of components that the collection can include.  A null value means the component types are not restricted.

Functions

OpenLayers. Geometry. Collection

Creates a Geometry Collection -- a list of geoms.

Parameters

components{Array(OpenLayers.Geometry)} Optional array of geometries

getComponentsString

getComponentsString: function()

Get a string representing the components for this collection

Returns

{String} A string representation of the components of this geometry

addComponent

addComponent: function(component,
index)

Add a new component (geometry) to the collection.  If this.componentTypes is set, then the component class name must be in the componentTypes array.

The bounds cache is reset.

Parameters

component{OpenLayers.Geometry} A geometry to add
index{int} Optional index into the array to insert the component

Returns

{Boolean} The component geometry was successfully added

removeComponent

removeComponent: function(component)

Remove a component from this geometry.

Parameters

component{OpenLayers.Geometry}

OpenLayers. Geometry. Point

Point geometry class.

Inherits from

Summary
Construct a point geometry.
Create a new Bounds based on the lon/lat
{String} Shortened String representation of Point object.

Functions

OpenLayers. Geometry. Point

Construct a point geometry.

Parameters

x{float}
y{float}

calculateBounds

calculateBounds: function ()

Create a new Bounds based on the lon/lat

toShortString

toShortString: function()

Returns

{String} Shortened String representation of Point object.  (ex.  <i>”5, 42”</i>)

OpenLayers. Layer. Vector

Instances of OpenLayers.Layer.Vector are used to render vector data from a variety of sources.  Create a new vector layer with the OpenLayers.Layer.Vector constructor.

Inherits from

Summary
{Array(String)} Supported application event types.
{Object} hash of features, keyed by feature.id, that the renderer failed to draw
{Array(OpenLayers.Strategy})} Optional list of strategies for the layer.
{OpenLayers.Protocol} Optional protocol for the layer.
{Array(String)} List of supported Renderer classes.
{Boolean} Whether the Vector Layer features have been drawn yet.
Create a new vector layer
Ask the layer to request features again and redraw them.
Iterates through the available renderer implementations and selects and assigns the first one whose “supported()” function returns true.
Let the user know their browser isn’t supported.
The layer has been added to the map.
Called at the end of the map.addLayer sequence.
The layer has been removed from the map.
Notify the renderer of the change in size.
Reset the vector layer’s div so that it once again is lined up with the map.
Erase features from the layer.
Given an event, return a feature if the event occurred over one.

Constants

EVENT_TYPES

{Array(String)} Supported application event types.  Register a listener for a particular event with the following syntax:

layer.events.register(type, obj, listener);

Listeners will be called with a reference to an event object.  The properties of this event depends on exactly what happened.

All event objects have at least the following properties

object{Object} A reference to layer.events.object.
element{DOMElement} A reference to layer.events.element.

Supported map event types (in addition to those from OpenLayers.Layer)

beforefeatureaddedTriggered before a feature is added.  Listeners will receive an object with a feature property referencing the feature to be added.  To stop the feature from being added, a listener should return false.
beforefeaturesaddedTriggered before an array of features is added.  Listeners will receive an object with a features property referencing the feature to be added.  To stop the features from being added, a listener should return false.
featureaddedTriggered after a feature is added.  The event object passed to listeners will have a feature property with a reference to the added feature.
featuresaddedTriggered after features are added.  The event object passed to listeners will have a features property with a reference to an array of added features.
beforefeatureremovedTriggered before a feature is removed.  Listeners will receive an object with a feature property referencing the feature to be removed.
featureremovedTriggerd after a feature is removed.  The event object passed to listeners will have a feature property with a reference to the removed feature.
featuresremovedTriggered after features are removed.  The event object passed to listeners will have a features property with a reference to an array of removed features.
featureselectedTriggered after a feature is selected.  Listeners will receive an object with a feature property referencing the selected feature.
featureunselectedTriggered after a feature is unselected.  Listeners will receive an object with a feature property referencing the unselected feature.
beforefeaturemodifiedTriggered when a feature is selected to be modified.  Listeners will receive an object with a feature property referencing the selected feature.
featuremodifiedTriggered when a feature has been modified.  Listeners will receive an object with a feature property referencing the modified feature.
afterfeaturemodifiedTriggered when a feature is finished being modified.  Listeners will receive an object with a feature property referencing the modified feature.
vertexmodifiedTriggered when a vertex within any feature geometry has been modified.  Listeners will receive an object with a feature property referencing the modified feature, a vertex property referencing the vertex modified (always a point geometry), and a pixel property referencing the pixel location of the modification.
sketchstartedTriggered when a feature sketch bound for this layer is started.  Listeners will receive an object with a feature property referencing the new sketch feature and a vertex property referencing the creation point.
sketchmodifiedTriggered when a feature sketch bound for this layer is modified.  Listeners will receive an object with a vertex property referencing the modified vertex and a feature property referencing the sketch feature.
sketchcompleteTriggered when a feature sketch bound for this layer is complete.  Listeners will receive an object with a feature property referencing the sketch feature.  By returning false, a listener can stop the sketch feature from being added to the layer.
refreshTriggered when something wants a strategy to ask the protocol for a new set of features.

Properties

selectedFeatures

unrenderedFeatures

{Object} hash of features, keyed by feature.id, that the renderer failed to draw

strategies

{Array(OpenLayers.Strategy})} Optional list of strategies for the layer.

protocol

{OpenLayers.Protocol} Optional protocol for the layer.

renderers

{Array(String)} List of supported Renderer classes.  Add to this list to add support for additional renderers.  This list is ordered: the first renderer which returns true for the ‘supported()’ method will be used, if not defined in the ‘renderer’ option.

drawn

{Boolean} Whether the Vector Layer features have been drawn yet.

Functions

OpenLayers. Layer. Vector

Create a new vector layer

Parameters

name{String} A name for the layer
options{Object} Optional object with non-default properties to set on the layer.

Returns

{OpenLayers.Layer.Vector} A new vector layer

refresh

refresh: function(obj)

Ask the layer to request features again and redraw them.  Triggers the refresh event if the layer is in range and visible.

Parameters

obj{Object} Optional object with properties for any listener of the refresh event.

assignRenderer

assignRenderer: function()

Iterates through the available renderer implementations and selects and assigns the first one whose “supported()” function returns true.

displayError

displayError: function()

Let the user know their browser isn’t supported.

setMap

setMap: function(map)

The layer has been added to the map.

If there is no renderer set, the layer can’t be used.  Remove it.  Otherwise, give the renderer a reference to the map and set its size.

Parameters

map{OpenLayers.Map}

afterAdd

afterAdd: function()

Called at the end of the map.addLayer sequence.  At this point, the map will have a base layer.  Any autoActivate strategies will be activated here.

removeMap

removeMap: function(map)

The layer has been removed from the map.

Parameters

map{OpenLayers.Map}

onMapResize

onMapResize: function()

Notify the renderer of the change in size.

moveTo

moveTo: function(bounds,
zoomChanged,
dragging)

Reset the vector layer’s div so that it once again is lined up with the map.  Notify the renderer of the change of extent, and in the case of a change of zoom level (resolution), have the renderer redraw features.

If the layer has not yet been drawn, cycle through the layer’s features and draw each one.

Parameters

bounds{OpenLayers.Bounds}
zoomChanged{Boolean}
dragging{Boolean}

eraseFeatures

eraseFeatures: function(features)

Erase features from the layer.

Parameters

features{Array(OpenLayers.Feature.Vector)}

getFeatureFromEvent

getFeatureFromEvent: function(evt)

Given an event, return a feature if the event occurred over one.  Otherwise, return null.

Parameters

evt{Event}

Returns

{OpenLayers.Feature.Vector} A feature if one was under the event.

OpenLayers. Geometry. MultiPoint

MultiPoint is a collection of Points.  Create a new instance with the OpenLayers.Geometry.MultiPoint constructor.

Inherits from

Summary
{Array(String)} An array of class names representing the types of components that the collection can include.
Create a new MultiPoint Geometry

Properties

componentTypes

{Array(String)} An array of class names representing the types of components that the collection can include.  A null value means the component types are not restricted.

Functions

OpenLayers. Geometry. MultiPoint

Create a new MultiPoint Geometry

Parameters

components{Array(OpenLayers.Geometry.Point)}

Returns

{OpenLayers.Geometry.MultiPoint}

OpenLayers. Handler. Point

Handler to draw a point on the map.  Point is displayed on mouse down, moves on mouse move, and is finished on mouse up.  The handler triggers callbacks for ‘done’, ‘cancel’, and ‘modify’.  The modify callback is called with each change in the sketch and will receive the latest point drawn.  Create a new instance with the OpenLayers.Handler.Point constructor.

Inherits from

Summary
{OpenLayers.Feature.Vector} The currently drawn point
{OpenLayers.Layer.Vector} The temporary drawing layer
{Boolean} Cast features to multi-part geometries before passing to the layer.
{Boolean} A point is being drawn
{Boolean} The mouse is down
{OpenLayers.Pixel} Location of the last mouse down
{Object} Any optional properties to be set on the sketch layer.
Create a new point handler.
Add temporary features
Destroy the temporary geometries
Finish the geometry and call the “done” callback.
Handle clicks.
Handle double-clicks.
Modify the existing geometry given a pixel location.
Render features on the temporary layer.
Return the sketch geometry.
Return a clone of the relevant geometry.
Handle mouse down.
Handle mouse move.
Handle mouse up.

Properties

point

{OpenLayers.Feature.Vector} The currently drawn point

layer

{OpenLayers.Layer.Vector} The temporary drawing layer

multi

{Boolean} Cast features to multi-part geometries before passing to the layer.  Default is false.

drawing

{Boolean} A point is being drawn

mouseDown

{Boolean} The mouse is down

lastDown

{OpenLayers.Pixel} Location of the last mouse down

layerOptions

{Object} Any optional properties to be set on the sketch layer.

Functions

OpenLayers. Handler. Point

Create a new point handler.

Parameters

control{OpenLayers.Control} The control that owns this handler
callbacks{Object} An object with a properties whose values are functions.  Various callbacks described below.
options{Object} An optional object with properties to be set on the handler

Named callbacks

createCalled when a sketch is first created.  Callback called with the creation point geometry and sketch feature.
modifyCalled with each move of a vertex with the vertex (point) geometry and the sketch feature.
doneCalled when the point drawing is finished.  The callback will recieve a single argument, the point geometry.
cancelCalled when the handler is deactivated while drawing.  The cancel callback will receive a geometry.

createFeature

createFeature: function(pixel)

Add temporary features

Parameters

pixel{OpenLayers.Pixel} A pixel location on the map.

destroyFeature

destroyFeature: function()

Destroy the temporary geometries

finalize

finalize: function(cancel)

Finish the geometry and call the “done” callback.

Parameters

cancel{Boolean} Call cancel instead of done callback.  Default is false.

click

click: function(evt)

Handle clicks.  Clicks are stopped from propagating to other listeners on map.events or other dom elements.

Parameters

evt{Event} The browser event

Returns

{Boolean} Allow event propagation

dblclick

dblclick: function(evt)

Handle double-clicks.  Double-clicks are stopped from propagating to other listeners on map.events or other dom elements.

Parameters

evt{Event} The browser event

Returns

{Boolean} Allow event propagation

modifyFeature

modifyFeature: function(pixel)

Modify the existing geometry given a pixel location.

Parameters

pixel{OpenLayers.Pixel} A pixel location on the map.

drawFeature

drawFeature: function()

Render features on the temporary layer.

getGeometry

getGeometry: function()

Return the sketch geometry.  If multi is true, this will return a multi-part geometry.

Returns

{OpenLayers.Geometry.Point}

geometryClone

geometryClone: function()

Return a clone of the relevant geometry.

Returns

{OpenLayers.Geometry}

mousedown

mousedown: function(evt)

Handle mouse down.  Adjust the geometry and redraw.  Return determines whether to propagate the event on the map.

Parameters

evt{Event} The browser event

Returns

{Boolean} Allow event propagation

mousemove

mousemove: function (evt)

Handle mouse move.  Adjust the geometry and redraw.  Return determines whether to propagate the event on the map.

Parameters

evt{Event} The browser event

Returns

{Boolean} Allow event propagation

mouseup

mouseup: function (evt)

Handle mouse up.  Send the latest point in the geometry to the control.  Return determines whether to propagate the event on the map.

Parameters

evt{Event} The browser event

Returns

{Boolean} Allow event propagation

OpenLayers. Geometry. Curve

A Curve is a MultiPoint, whose points are assumed to be connected.  To this end, we provide a “getLength()” function, which iterates through the points, summing the distances between them.

Inherits

Summary
{Array(String)} An array of class names representing the types of components that the collection can include.

Properties

componentTypes

{Array(String)} An array of class names representing the types of components that the collection can include.  A null value means the component types are not restricted.

Functions

OpenLayers. Geometry. Curve

Parameters

point{Array(OpenLayers.Geometry.Point)}

OpenLayers. Geometry. LineString

A LineString is a Curve which, once two points have been added to it, can never be less than two points long.

Inherits from

Summary
Create a new LineString geometry
{Array} An array of segment objects.
Split this geometry with the given segment.
Use this geometry (the source) to attempt to split a target geometry.
Split this geometry (the target) with the given geometry (the source).

Functions

OpenLayers. Geometry. LineString

Create a new LineString geometry

Parameters

points{Array(OpenLayers.Geometry.Point)} An array of points used to generate the linestring

getSortedSegments

getSortedSegments: function()

Returns

{Array} An array of segment objects.  Segment objects have properties x1, y1, x2, and y2.  The start point is represented by x1 and y1.  The end point is represented by x2 and y2.  Start and end are ordered so that x1 < x2.

splitWithSegment

splitWithSegment: function(seg,
options)

Split this geometry with the given segment.

Parameters

seg{Object} An object with x1, y1, x2, and y2 properties referencing segment endpoint coordinates.
options{Object} Properties of this object will be used to determine how the split is conducted.

Valid options

edge{Boolean} Allow splitting when only edges intersect.  Default is true.  If false, a vertex on the source segment must be within the tolerance distance of the intersection to be considered a split.
tolerance{Number} If a non-null value is provided, intersections within the tolerance distance of one of the source segment’s endpoints will be assumed to occur at the endpoint.

Returns

{Object} An object with lines and points properties.  If the given segment intersects this linestring, the lines array will reference geometries that result from the split.  The points array will contain all intersection points.  Intersection points are sorted along the segment (in order from x1,y1 to x2,y2).

split

split: function(target,
options)

Use this geometry (the source) to attempt to split a target geometry.

Parameters

target{OpenLayers.Geometry} The target geometry.
options{Object} Properties of this object will be used to determine how the split is conducted.

Valid options

mutual{Boolean} Split the source geometry in addition to the target geometry.  Default is false.
edge{Boolean} Allow splitting when only edges intersect.  Default is true.  If false, a vertex on the source must be within the tolerance distance of the intersection to be considered a split.
tolerance{Number} If a non-null value is provided, intersections within the tolerance distance of an existing vertex on the source will be assumed to occur at the vertex.

Returns

{Array} A list of geometries (of this same type as the target) that result from splitting the target with the source geometry.  The source and target geometry will remain unmodified.  If no split results, null will be returned.  If mutual is true and a split results, return will be an array of two arrays - the first will be all geometries that result from splitting the source geometry and the second will be all geometries that result from splitting the target geometry.

splitWith

splitWith: function(geometry,
options)

Split this geometry (the target) with the given geometry (the source).

Parameters

geometry{OpenLayers.Geometry} A geometry used to split this geometry (the source).
options{Object} Properties of this object will be used to determine how the split is conducted.

Valid options

mutual{Boolean} Split the source geometry in addition to the target geometry.  Default is false.
edge{Boolean} Allow splitting when only edges intersect.  Default is true.  If false, a vertex on the source must be within the tolerance distance of the intersection to be considered a split.
tolerance{Number} If a non-null value is provided, intersections within the tolerance distance of an existing vertex on the source will be assumed to occur at the vertex.

Returns

{Array} A list of geometries (of this same type as the target) that result from splitting the target with the source geometry.  The source and target geometry will remain unmodified.  If no split results, null will be returned.  If mutual is true and a split results, return will be an array of two arrays - the first will be all geometries that result from splitting the source geometry and the second will be all geometries that result from splitting the target geometry.

OpenLayers. Geometry. LinearRing

A Linear Ring is a special LineString which is closed.  It closes itself automatically on every addPoint/removePoint by adding a copy of the first point as the last point.

Also, as it is the first in the line family to close itself, a getArea() function is defined to calculate the enclosed area of the linearRing

Inherits

Summary
{Array(String)} An array of class names representing the types of components that the collection can include.
Linear rings are constructed with an array of points.
Test if a point is inside a linear ring.

Properties

componentTypes

{Array(String)} An array of class names representing the types of components that the collection can include.  A null value means the component types are not restricted.

Functions

OpenLayers. Geometry. LinearRing

Linear rings are constructed with an array of points.  This array can represent a closed or open ring.  If the ring is open (the last point does not equal the first point), the constructor will close the ring.  If the ring is already closed (the last point does equal the first point), it will be left closed.

Parameters

points{Array(OpenLayers.Geometry.Point)} points

containsPoint

containsPoint: function(point)

Test if a point is inside a linear ring.  For the case where a point is coincident with a linear ring edge, returns 1.  Otherwise, returns boolean.

Parameters

point{OpenLayers.Geometry.Point}

Returns

{Boolean | Number} The point is inside the linear ring.  Returns 1 if the point is coincident with an edge.  Returns boolean otherwise.

OpenLayers. Geometry. MultiLineString

A MultiLineString is a geometry with multiple OpenLayers.Geometry.LineString components.

Inherits from

Summary
{Array(String)} An array of class names representing the types of components that the collection can include.
Constructor for a MultiLineString Geometry.
Use this geometry (the source) to attempt to split a target geometry.
Split this geometry (the target) with the given geometry (the source).

Properties

componentTypes

{Array(String)} An array of class names representing the types of components that the collection can include.  A null value means the component types are not restricted.

Functions

OpenLayers. Geometry. MultiLineString

Constructor for a MultiLineString Geometry.

Parameters

components{Array(OpenLayers.Geometry.LineString)}

split

split: function(geometry,
options)

Use this geometry (the source) to attempt to split a target geometry.

Parameters

target{OpenLayers.Geometry} The target geometry.
options{Object} Properties of this object will be used to determine how the split is conducted.

Valid options

mutual{Boolean} Split the source geometry in addition to the target geometry.  Default is false.
edge{Boolean} Allow splitting when only edges intersect.  Default is true.  If false, a vertex on the source must be within the tolerance distance of the intersection to be considered a split.
tolerance{Number} If a non-null value is provided, intersections within the tolerance distance of an existing vertex on the source will be assumed to occur at the vertex.

Returns

{Array} A list of geometries (of this same type as the target) that result from splitting the target with the source geometry.  The source and target geometry will remain unmodified.  If no split results, null will be returned.  If mutual is true and a split results, return will be an array of two arrays - the first will be all geometries that result from splitting the source geometry and the second will be all geometries that result from splitting the target geometry.

splitWith

splitWith: function(geometry,
options)

Split this geometry (the target) with the given geometry (the source).

Parameters

geometry{OpenLayers.Geometry} A geometry used to split this geometry (the source).
options{Object} Properties of this object will be used to determine how the split is conducted.

Valid options

mutual{Boolean} Split the source geometry in addition to the target geometry.  Default is false.
edge{Boolean} Allow splitting when only edges intersect.  Default is true.  If false, a vertex on the source must be within the tolerance distance of the intersection to be considered a split.
tolerance{Number} If a non-null value is provided, intersections within the tolerance distance of an existing vertex on the source will be assumed to occur at the vertex.

Returns

{Array} A list of geometries (of this same type as the target) that result from splitting the target with the source geometry.  The source and target geometry will remain unmodified.  If no split results, null will be returned.  If mutual is true and a split results, return will be an array of two arrays - the first will be all geometries that result from splitting the source geometry and the second will be all geometries that result from splitting the target geometry.

OpenLayers. Handler.Path

Handler to draw a path on the map.  Path is displayed on mouse down, moves on mouse move, and is finished on mouse up.

Inherits from

Summary
{Boolean} In freehand mode, the handler starts the path on mouse down, adds a point for every mouse move, and finishes the path on mouse up.
{String} If set, freehandToggle is checked on mouse events and will set the freehand mode to the opposite of this.freehand.
Create a new path hander
Add temporary geometries
Destroy temporary geometries
Destroy the temporary point.
Add point to geometry.
Determine whether to behave in freehand mode or not.
Modify the existing geometry given the new point
Render geometries on the temporary layer.
Return the sketch feature.
Return the sketch geometry.
Handle mouse down.
Handle mouse move.
Handle mouse up.
Handle double-clicks.

Properties

freehand

{Boolean} In freehand mode, the handler starts the path on mouse down, adds a point for every mouse move, and finishes the path on mouse up.  Outside of freehand mode, a point is added to the path on every mouse click and double-click finishes the path.

freehandToggle

{String} If set, freehandToggle is checked on mouse events and will set the freehand mode to the opposite of this.freehand.  To disallow toggling between freehand and non-freehand mode, set freehandToggle to null.  Acceptable toggle values are ‘shiftKey’, ‘ctrlKey’, and ‘altKey’.

Functions

OpenLayers. Handler.Path

Create a new path hander

Parameters

control{OpenLayers.Control} The control that owns this handler
callbacks{Object} An object with a properties whose values are functions.  Various callbacks described below.
options{Object} An optional object with properties to be set on the handler

Named callbacks

createCalled when a sketch is first created.  Callback called with the creation point geometry and sketch feature.
modifyCalled with each move of a vertex with the vertex (point) geometry and the sketch feature.
pointCalled as each point is added.  Receives the new point geometry.
doneCalled when the point drawing is finished.  The callback will recieve a single argument, the linestring geometry.
cancelCalled when the handler is deactivated while drawing.  The cancel callback will receive a geometry.

createFeature

createFeature: function(pixel)

Add temporary geometries

Parameters

pixel{OpenLayers.Pixel} The initial pixel location for the new feature.

destroyFeature

destroyFeature: function()

Destroy temporary geometries

removePoint

removePoint: function()

Destroy the temporary point.

addPoint

addPoint: function(pixel)

Add point to geometry.  Send the point index to override the behavior of LinearRing that disregards adding duplicate points.

Parameters

pixel{OpenLayers.Pixel} The pixel location for the new point.

freehandMode

freehandMode: function(evt)

Determine whether to behave in freehand mode or not.

Returns

{Boolean}

modifyFeature

modifyFeature: function(pixel)

Modify the existing geometry given the new point

Parameters

pixel{OpenLayers.Pixel} The updated pixel location for the latest point.

drawFeature

drawFeature: function()

Render geometries on the temporary layer.

getSketch

getSketch: function()

Return the sketch feature.

Returns

{OpenLayers.Feature.Vector}

getGeometry

getGeometry: function()

Return the sketch geometry.  If <multi> is true, this will return a multi-part geometry.

Returns

{OpenLayers.Geometry.LineString}

mousedown

mousedown: function(evt)

Handle mouse down.  Add a new point to the geometry and render it.  Return determines whether to propagate the event on the map.

Parameters

evt{Event} The browser event

Returns

{Boolean} Allow event propagation

mousemove

mousemove: function (evt)

Handle mouse move.  Adjust the geometry and redraw.  Return determines whether to propagate the event on the map.

Parameters

evt{Event} The browser event

Returns

{Boolean} Allow event propagation

mouseup

mouseup: function (evt)

Handle mouse up.  Send the latest point in the geometry to the control.  Return determines whether to propagate the event on the map.

Parameters

evt{Event} The browser event

Returns

{Boolean} Allow event propagation

dblclick

dblclick: function(evt)

Handle double-clicks.  Finish the geometry and send it back to the control.

Parameters

evt{Event} The browser event

Returns

{Boolean} Allow event propagation

OpenLayers. Geometry. Polygon

Polygon is a collection of Geometry.LinearRings.

Inherits from

Summary
{Array(String)} An array of class names representing the types of components that the collection can include.
Constructor for a Polygon geometry.
Test if a point is inside a polygon.

Properties

componentTypes

{Array(String)} An array of class names representing the types of components that the collection can include.  A null value means the component types are not restricted.

Functions

OpenLayers. Geometry. Polygon

Constructor for a Polygon geometry.  The first ring (this.component[0])is the outer bounds of the polygon and all subsequent rings (this.component[1-n]) are internal holes.

Parameters

components{Array(OpenLayers.Geometry.LinearRing)}

containsPoint

containsPoint: function(point)

Test if a point is inside a polygon.  Points on a polygon edge are considered inside.

Parameters

point{OpenLayers.Geometry.Point}

Returns

{Boolean | Number} The point is inside the polygon.  Returns 1 if the point is on an edge.  Returns boolean otherwise.

OpenLayers. Geometry. MultiPolygon

MultiPolygon is a geometry with multiple OpenLayers.Geometry.Polygon components.  Create a new instance with the OpenLayers.Geometry.MultiPolygon constructor.

Inherits from

Summary
{Array(String)} An array of class names representing the types of components that the collection can include.
Create a new MultiPolygon geometry

Properties

componentTypes

{Array(String)} An array of class names representing the types of components that the collection can include.  A null value means the component types are not restricted.

Functions

OpenLayers. Geometry. MultiPolygon

Create a new MultiPolygon geometry

Parameters

components{Array(OpenLayers.Geometry.Polygon)} An array of polygons used to generate the MultiPolygon

OpenLayers. Handler. Polygon

Handler to draw a polygon on the map.  Polygon is displayed on mouse down, moves on mouse move, and is finished on mouse up.

Inherits from

Summary
Create a Polygon Handler.
Add temporary geometries
Destroy temporary geometries
Render geometries on the temporary layer.
Return the sketch feature.
Return the sketch geometry.
Handle double-clicks.

Functions

OpenLayers. Handler. Polygon

Create a Polygon Handler.

Parameters

control{OpenLayers.Control} The control that owns this handler
callbacks{Object} An object with a properties whose values are functions.  Various callbacks described below.
options{Object} An optional object with properties to be set on the handler

Named callbacks

createCalled when a sketch is first created.  Callback called with the creation point geometry and sketch feature.
modifyCalled with each move of a vertex with the vertex (point) geometry and the sketch feature.
pointCalled as each point is added.  Receives the new point geometry.
doneCalled when the point drawing is finished.  The callback will recieve a single argument, the polygon geometry.
cancelCalled when the handler is deactivated while drawing.  The cancel callback will receive a geometry.

createFeature

createFeature: function(pixel)

Add temporary geometries

Parameters

pixel{OpenLayers.Pixel} The initial pixel location for the new feature.

destroyFeature

destroyFeature: function()

Destroy temporary geometries

drawFeature

drawFeature: function()

Render geometries on the temporary layer.

getSketch

getSketch: function()

Return the sketch feature.

Returns

{OpenLayers.Feature.Vector}

getGeometry

getGeometry: function()

Return the sketch geometry.  If <multi> is true, this will return a multi-part geometry.

Returns

{OpenLayers.Geometry.Polygon}

dblclick

dblclick: function(evt)

Handle double-clicks.  Finish the geometry and send it back to the control.

Parameters

evt{Event}

OpenLayers. Format.GML

Read/Wite GML.  Create a new instance with the OpenLayers.Format.GML constructor.  Supports the GML simple features profile.

Inherits from

Summary
Create a new parser for GML.
This function is the core of the GML parsing code in OpenLayers.
Properties of this object are the functions that parse geometries based on their type.
Given a GML node representing a point geometry, create an OpenLayers point geometry.
Given a GML node representing a multipoint geometry, create an OpenLayers multipoint geometry.
Given a GML node representing a linestring geometry, create an OpenLayers linestring geometry.
Given a GML node representing a multilinestring geometry, create an OpenLayers multilinestring geometry.
Given a GML node representing a polygon geometry, create an OpenLayers polygon geometry.
Given a GML node representing a multipolygon geometry, create an OpenLayers multipolygon geometry.
Accept an OpenLayers.Feature.Vector, and build a GML node for it.
Object containing methods to do the actual geometry node building based on geometry type.
Given an OpenLayers point geometry, create a GML point.
Given an OpenLayers multipoint geometry, create a GML multipoint.
Given an OpenLayers linestring geometry, create a GML linestring.
Given an OpenLayers multilinestring geometry, create a GML multilinestring.
Given an OpenLayers linearring geometry, create a GML linearring.
Given an OpenLayers polygon geometry, create a GML polygon.
Given an OpenLayers multipolygon geometry, create a GML multipolygon.
Given an OpenLayers bounds, create a GML box.
builds the coordinates XmlNode

Functions and Properties

OpenLayers. Format.GML

Create a new parser for GML.

Parameters

options{Object} An optional object whose properties will be set on this instance.

parseFeature

parseFeature: function(node)

This function is the core of the GML parsing code in OpenLayers.  It creates the geometries that are then attached to the returned feature, and calls parseAttributes() to get attribute data out.

Parameters

node{DOMElement} A GML feature node.

parseGeometry

Properties of this object are the functions that parse geometries based on their type.

parseGeometry. point

Given a GML node representing a point geometry, create an OpenLayers point geometry.

Parameters

node{DOMElement} A GML node.

Returns

{OpenLayers.Geometry.Point} A point geometry.

parseGeometry. multipoint

Given a GML node representing a multipoint geometry, create an OpenLayers multipoint geometry.

Parameters

node{DOMElement} A GML node.

Returns

{OpenLayers.Geometry.MultiPoint} A multipoint geometry.

parseGeometry. linestring

Given a GML node representing a linestring geometry, create an OpenLayers linestring geometry.

Parameters

node{DOMElement} A GML node.

Returns

{OpenLayers.Geometry.LineString} A linestring geometry.

parseGeometry. multilinestring

Given a GML node representing a multilinestring geometry, create an OpenLayers multilinestring geometry.

Parameters

node{DOMElement} A GML node.

Returns

{OpenLayers.Geometry.MultiLineString} A multilinestring geometry.

parseGeometry. polygon

Given a GML node representing a polygon geometry, create an OpenLayers polygon geometry.

Parameters

node{DOMElement} A GML node.

Returns

{OpenLayers.Geometry.Polygon} A polygon geometry.

parseGeometry. multipolygon

Given a GML node representing a multipolygon geometry, create an OpenLayers multipolygon geometry.

Parameters

node{DOMElement} A GML node.

Returns

{OpenLayers.Geometry.MultiPolygon} A multipolygon geometry.

parseAttributes

parseAttributes: function(node)

Parameters

node{<DOMElement>}

Returns

{Object} An attributes object.

createFeatureXML

createFeatureXML: function(feature)

Accept an OpenLayers.Feature.Vector, and build a GML node for it.

Parameters

feature{OpenLayers.Feature.Vector} The feature to be built as GML.

Returns

{DOMElement} A node reprensting the feature in GML.

buildGeometry

Object containing methods to do the actual geometry node building based on geometry type.

buildGeometry. point

Given an OpenLayers point geometry, create a GML point.

Parameters

geometry{OpenLayers.Geometry.Point} A point geometry.

Returns

{DOMElement} A GML point node.

buildGeometry. multipoint

Given an OpenLayers multipoint geometry, create a GML multipoint.

Parameters

geometry{OpenLayers.Geometry.MultiPoint} A multipoint geometry.

Returns

{DOMElement} A GML multipoint node.

buildGeometry. linestring

Given an OpenLayers linestring geometry, create a GML linestring.

Parameters

geometry{OpenLayers.Geometry.LineString} A linestring geometry.

Returns

{DOMElement} A GML linestring node.

buildGeometry. multilinestring

Given an OpenLayers multilinestring geometry, create a GML multilinestring.

Parameters

geometry{OpenLayers.Geometry.MultiLineString} A multilinestring geometry.

Returns

{DOMElement} A GML multilinestring node.

buildGeometry. linearring

Given an OpenLayers linearring geometry, create a GML linearring.

Parameters

geometry{OpenLayers.Geometry.LinearRing} A linearring geometry.

Returns

{DOMElement} A GML linearring node.

buildGeometry. polygon

Given an OpenLayers polygon geometry, create a GML polygon.

Parameters

geometry{OpenLayers.Geometry.Polygon} A polygon geometry.

Returns

{DOMElement} A GML polygon node.

buildGeometry. multipolygon

Given an OpenLayers multipolygon geometry, create a GML multipolygon.

Parameters

geometry{OpenLayers.Geometry.MultiPolygon} A multipolygon geometry.

Returns

{DOMElement} A GML multipolygon node.

buildGeometry. bounds

Given an OpenLayers bounds, create a GML box.

Parameters

bounds{<OpenLayers.Geometry.Bounds>} A bounds object.

Returns

{DOMElement} A GML box node.

buildCoordinates

buildCoordinatesNode: function(geometry)

builds the coordinates XmlNode

<gml:coordinates decimal="." cs="," ts=" ">...</gml:coordinates>

Parameters: geometry - {OpenLayers.Geometry}

Returns

{XmlNode} created xmlNode

OpenLayers. Format. GML.Base

Superclass for GML parsers.

Inherits from

Summary
{Object} Mapping of namespace aliases to namespace URIs.
{String} Schema location for a particular minor version.
{Object} Maps OpenLayers geometry class names to GML element names.
{Boolean} True if there is only 1 featureType, and not an array of featuretypes.
Compiled regular expressions for manipulating strings.
Instances of this class are not created directly.
Contains public functions, grouped by namespace prefix, that will be applied when a namespaced node is found matching the function name.
As a compliment to the readers property, this structure contains public writing functions grouped by namespace alias and named like the node names they produce.
Sets the geometryTypes mapping.

Properties and Functions

namespaces

{Object} Mapping of namespace aliases to namespace URIs.

defaultPrefix

schemaLocation

{String} Schema location for a particular minor version.

geometryTypes

{Object} Maps OpenLayers geometry class names to GML element names.  Use setGeometryTypes before accessing this property.

singleFeatureType

{Boolean} True if there is only 1 featureType, and not an array of featuretypes.

regExes

Compiled regular expressions for manipulating strings.

OpenLayers. Format. GML.Base

Instances of this class are not created directly.  Use the OpenLayers.Format.GML.v2 or OpenLayers.Format.GML.v3 constructor instead.

Parameters

options{Object} An optional object whose properties will be set on this instance.

Valid options properties

featureType{Array(String) or String} Local (without prefix) feature typeName(s) (required).
featureNS{String} Feature namespace (required).
geometryName{String} Geometry element name.

read

read: function(data)

Parameters

data{DOMElement} A gml:featureMember element, a gml:featureMembers element, or an element containing either of the above at any level.

Returns

{Array(OpenLayers.Feature.Vector)} An array of features.

readers

Contains public functions, grouped by namespace prefix, that will be applied when a namespaced node is found matching the function name.  The function will be applied in the scope of this parser with two arguments: the node being read and a context object passed from the parent.

write

write: function(features)

Parameters

features{Array(OpenLayers.Feature.Vector) | OpenLayers.Feature.Vector} An array of features or a single feature.

Returns

{String} Given an array of features, a doc with a gml:featureMembers element will be returned.  Given a single feature, a doc with a gml:featureMember element will be returned.

writers

As a compliment to the readers property, this structure contains public writing functions grouped by namespace alias and named like the node names they produce.

setGeometryTypes

setGeometryTypes: function()

Sets the geometryTypes mapping.

OpenLayers. Format. GML.v2

Parses GML version 2.

Inherits from

Summary
{String} Schema location for a particular minor version.
Create a parser for GML v2.
Contains public functions, grouped by namespace prefix, that will be applied when a namespaced node is found matching the function name.
As a compliment to the readers property, this structure contains public writing functions grouped by namespace alias and named like the node names they produce.

Properties and Functions

schemaLocation

{String} Schema location for a particular minor version.

OpenLayers. Format. GML.v2

Create a parser for GML v2.

Parameters

options{Object} An optional object whose properties will be set on this instance.

Valid options properties

featureType{String} Local (without prefix) feature typeName (required).
featureNS{String} Feature namespace (required).
geometryName{String} Geometry element name.

readers

Contains public functions, grouped by namespace prefix, that will be applied when a namespaced node is found matching the function name.  The function will be applied in the scope of this parser with two arguments: the node being read and a context object passed from the parent.

write

write: function(features)

Parameters

features{Array(OpenLayers.Feature.Vector) | OpenLayers.Feature.Vector} An array of features or a single feature.

Returns

{String} Given an array of features, a doc with a gml:featureMembers element will be returned.  Given a single feature, a doc with a gml:featureMember element will be returned.

writers

As a compliment to the readers property, this structure contains public writing functions grouped by namespace alias and named like the node names they produce.

OpenLayers. Format. GML.v3

Parses GML version 3.

Inherits from

Summary
{String} Schema location for a particular minor version.
{Boolean} Write gml:Curve instead of gml:LineString elements.
{Boolean} Write gml:MultiCurve instead of gml:MultiLineString.
{Boolean} Write gml:Surface instead of gml:Polygon elements.
{Boolean} Write gml:multiSurface instead of gml:MultiPolygon.
Create a parser for GML v3.
Contains public functions, grouped by namespace prefix, that will be applied when a namespaced node is found matching the function name.
As a compliment to the readers property, this structure contains public writing functions grouped by namespace alias and named like the node names they produce.
Sets the <geometryTypes> mapping.
The Browser Core.
Contains Array Prototypes like each, contains, and erase.
Contains Function Prototypes like create, bind, pass, and delay.
Contains Number Prototypes like limit, round, times, and ceil.
Contains String Prototypes like camelCase, capitalize, test, and toInt.
Contains Hash Prototypes.
Contains the Event Native, to make the event object completely crossbrowser.
Contains the Class Function for easily creating, extending, and implementing reusable Classes.
Contains Utility Classes that can be implemented into your own Classes to ease the execution of many common tasks.
One of the most important items in MooTools.
Contains Element methods for dealing with events, and custom Events.
Contains methods for interacting with the styles of Elements in a fashionable way.
Contains methods to work with size, scroll, or positioning of Elements and the window object.
Adds advanced CSS Querying capabilities for targeting elements.
Contains the domready custom event.
JSON encoder and decoder.
Class for creating, loading, and saving browser Cookies.
Wrapper for embedding SWF movies.
Contains the basic animation logic to be extended by all other Fx Classes.
Contains the CSS animation logic.
Formerly Fx.Style, effect to transition any CSS property for an element.
Formerly Fx.Styles, effect to transition any number of CSS properties for an element using an object of rules, or CSS based selector rules.
Contains a set of advanced transitions to be used with any of the Fx Classes.
Powerful all purpose Request Class.
Extends the basic Request Class with additional methods for sending and receiving JSON data.
A css-class based form validation system.
Additional validators for the FormValidator class.
Defines Fx.Reveal, a class that shows and hides elements with a transition.
Effect to slide an element in and out of view.
Class for creating a smooth scrolling effect to all internal links on the page.
A Drag extension that provides support for the constraining of draggables to containers and droppables.
Class for creating horizontal and vertical slider controls.
Defines Request.JSONP, a class for cross domain javascript via script injection.
Requests the same url at a time interval that increases when no data is returned from the requested server
Class for monitoring collections of events
Class for creating, reading, and deleting Cookies in JSON format.

Properties and Functions

schemaLocation

{String} Schema location for a particular minor version.  The writers conform with the Simple Features Profile for GML.

curve

{Boolean} Write gml:Curve instead of gml:LineString elements.  This also affects the elements in multi-part geometries.  Default is false.  To write gml:Curve elements instead of gml:LineString, set curve to true in the options to the contstructor (cannot be changed after instantiation).

multiCurve

{Boolean} Write gml:MultiCurve instead of gml:MultiLineString.  Since the latter is deprecated in GML 3, the default is true.  To write gml:MultiLineString instead of gml:MultiCurve, set multiCurve to false in the options to the constructor (cannot be changed after instantiation).

surface

{Boolean} Write gml:Surface instead of gml:Polygon elements.  This also affects the elements in multi-part geometries.  Default is false.  To write gml:Surface elements instead of gml:Polygon, set surface to true in the options to the contstructor (cannot be changed after instantiation).

multiSurface

{Boolean} Write gml:multiSurface instead of gml:MultiPolygon.  Since the latter is deprecated in GML 3, the default is true.  To write gml:MultiPolygon instead of gml:multiSurface, set multiSurface to false in the options to the constructor (cannot be changed after instantiation).

OpenLayers. Format. GML.v3

Create a parser for GML v3.

Parameters

options{Object} An optional object whose properties will be set on this instance.

Valid options properties

featureType{String} Local (without prefix) feature typeName (required).
featureNS{String} Feature namespace (required).
geometryName{String} Geometry element name.

readers

Contains public functions, grouped by namespace prefix, that will be applied when a namespaced node is found matching the function name.  The function will be applied in the scope of this parser with two arguments: the node being read and a context object passed from the parent.

write

write: function(features)

Parameters

features{Array(OpenLayers.Feature.Vector) | OpenLayers.Feature.Vector} An array of features or a single feature.

Returns

{String} Given an array of features, a doc with a gml:featureMembers element will be returned.  Given a single feature, a doc with a gml:featureMember element will be returned.

writers

As a compliment to the readers property, this structure contains public writing functions grouped by namespace alias and named like the node names they produce.

setGeometryTypes

setGeometryTypes: function()

Sets the <geometryTypes> mapping.

Files

Core.js

MooToolsMy Object Oriented JavaScript Tools.

License

MIT-style license.

Copyright

Copyright © 2006-2008 [Valerio Proietti](http://mad4milk.net/).

Code & Documentation

[The MooTools production team](http://mootools.net/developers/).

Inspiration

Browser.js

The Browser Core.  Contains Browser initialization, Window and Document, and the Browser Hash.

License

MIT-style license.

Array.js

Contains Array Prototypes like each, contains, and erase.

License

MIT-style license.

Function.js

Contains Function Prototypes like create, bind, pass, and delay.

License

MIT-style license.

Number.js

Contains Number Prototypes like limit, round, times, and ceil.

License

MIT-style license.

String.js

Contains String Prototypes like camelCase, capitalize, test, and toInt.

License

MIT-style license.

Hash.js

Contains Hash Prototypes.  Provides a means for overcoming the JavaScript practical impossibility of extending native Objects.

License

MIT-style license.

Event.js

Contains the Event Native, to make the event object completely crossbrowser.

License

MIT-style license.

Class.js

Contains the Class Function for easily creating, extending, and implementing reusable Classes.

License

MIT-style license.

Class. Extras.js

Contains Utility Classes that can be implemented into your own Classes to ease the execution of many common tasks.

License

MIT-style license.

Element.js

One of the most important items in MooTools.  Contains the dollar function, the dollars function, and an handful of cross-browser, time-saver methods to let you easily work with HTML Elements.

License

MIT-style license.

Element. Event.js

Contains Element methods for dealing with events, and custom Events.

License

MIT-style license.

Element. Style.js

Contains methods for interacting with the styles of Elements in a fashionable way.

License

MIT-style license.

Element. Dimensions.js

Contains methods to work with size, scroll, or positioning of Elements and the window object.

License

MIT-style license.

Credits

Selectors.js

Adds advanced CSS Querying capabilities for targeting elements.  Also includes pseudoselectors support.

License

MIT-style license.

Domready.js

Contains the domready custom event.

License

MIT-style license.

JSON.js

JSON encoder and decoder.

License

MIT-style license.

See Also

http://www.json.org/

Cookie.js

Class for creating, loading, and saving browser Cookies.

License

MIT-style license.

Credits

Based on the functions by Peter-Paul Koch (http://quirksmode.org).

Swiff.js

Wrapper for embedding SWF movies.  Supports (and fixes) External Interface Communication.

License

MIT-style license.

Credits

Flash detection & Internet Explorer + Flash Player 9 fix inspired by SWFObject.

Fx.js

Contains the basic animation logic to be extended by all other Fx Classes.

License

MIT-style license.

Fx. CSS.js

Contains the CSS animation logic.  Used by Fx.Tween, Fx.Morph, Fx.Elements.

License

MIT-style license.

Fx. Tween.js

Formerly Fx.Style, effect to transition any CSS property for an element.

License

MIT-style license.

Fx. Morph.js

Formerly Fx.Styles, effect to transition any number of CSS properties for an element using an object of rules, or CSS based selector rules.

License

MIT-style license.

Fx. Transitions.js

Contains a set of advanced transitions to be used with any of the Fx Classes.

License

MIT-style license.

Credits

Easing Equations by Robert Penner, http://www.robertpenner.com/easing/, modified and optimized to be used with MooTools.

Request.js

Powerful all purpose Request Class.  Uses XMLHTTPRequest.

License

MIT-style license.

Request. JSON.js

Extends the basic Request Class with additional methods for sending and receiving JSON data.

License

MIT-style license.

FormValidator.js

A css-class based form validation system.

License

MIT-style license.

Authors

Aaron Newton

FormValidator. Extras.js

Additional validators for the FormValidator class.

License

MIT-style license.

Authors

Aaron Newton

Fx. Reveal.js

Defines Fx.Reveal, a class that shows and hides elements with a transition.

License

MIT-style license.

Authors

Aaron Newton

Fx. Slide.js

Effect to slide an element in and out of view.

License

MIT-style license.

Authors

Valerio Proietti

Fx. SmoothScroll.js

Class for creating a smooth scrolling effect to all internal links on the page.

License

MIT-style license.

Authors

Valerio Proietti

Drag. Move.js

A Drag extension that provides support for the constraining of draggables to containers and droppables.

License

MIT-style license.

Authors

Valerio Proietti Tom Occhinno Jan Kassens

Slider.js

Class for creating horizontal and vertical slider controls.

License

MIT-style license.

Authors

Valerio Proietti

Request. JSONP.js

Defines Request.JSONP, a class for cross domain javascript via script injection.

License

MIT-style license.

Authors

Aaron Newton Guillermo Rauch

Request. Periodical.js

Requests the same url at a time interval that increases when no data is returned from the requested server

License

MIT-style license.

Authors

Christoph Pojer

Group.js

Class for monitoring collections of events

License

MIT-style license.

Authors

Valerio Proietti

Hash. Cookie.js

Class for creating, reading, and deleting Cookies in JSON format.

License

MIT-style license.

Authors

Valerio Proietti Aaron Newton

Jx

Jx is a global singleton object that contains the entire Jx library within it.  All Jx functions, attributes and classes are accessed through the global Jx object.  Jx should not create any other global variables, if you discover that it does then please report it as a bug

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
This is the URL that Jx was loaded from, it is automatically calculated from the script tag src property that included Jx.
Static method that applies the PNG Filter Hack for IE browsers when showing 24bit PNG’s.
Request that an image be set to a DOM IMG element src attribute.
An internal method that ensures no more than 2 images are loading at a time.
An internal method actually populate the DOM element with the image source.
Creates a new iframe element that is intended to fill a container to mask out other operating system controls (scrollbars, inputs, buttons, etc) when HTML elements are supposed to be above them.
safely parse a number and return its integer value.
return the dimensions of the browser client area.

Properties

{String} baseURL

This is the URL that Jx was loaded from, it is automatically calculated from the script tag src property that included Jx.

Note that this assumes that you are loading Jx from a js/ or lib/ folder in parallel to the images/ folder that contains the various images needed by Jx components.  If you have a different folder structure, you can define Jx’s base by including the following before including the jxlib javascript file:

Jx = {
baseURL: 'some/path'
}

Functions

applyPNGFilter

Jx.applyPNGFilter = function(o)

Static method that applies the PNG Filter Hack for IE browsers when showing 24bit PNG’s.  Used automatically for img tags with a class of png24.

The filter is applied using a nifty feature of IE that allows javascript to be executed as part of a CSS style rule - this ensures that the hack only gets applied on IE browsers.

The CSS that triggers this hack is only in the ie6.css files of the various themes.

Parameters

object {Object} the object (img) to which the filter needs to be applied.

addToImgQueue

Jx.addToImgQueue = function(obj)

Request that an image be set to a DOM IMG element src attribute.  This puts the image into a queue and there are private methods to manage that queue and limit image loading to 2 at a time.

Parameters

obj{Object} an object containing an element and src property, where element is the element to update and src is the url to the image.

checkImgQueue

Jx.checkImgQueue = function()

An internal method that ensures no more than 2 images are loading at a time.

loadNextImg

Jx.loadNextImg = function()

An internal method actually populate the DOM element with the image source.

createIframeShim

Jx.createIframeShim = function()

Creates a new iframe element that is intended to fill a container to mask out other operating system controls (scrollbars, inputs, buttons, etc) when HTML elements are supposed to be above them.

Returns

an HTML iframe element that can be inserted into the DOM.

getNumber

Jx.getNumber = function(n,
def)

safely parse a number and return its integer value.  A NaN value returns 0.  CSS size values are also parsed correctly.

Parameters

n{Mixed} the string or object to parse.

Returns

{Integer} the integer value that the parameter represents

getPageDimensions

Jx.getPageDimensions = function()

return the dimensions of the browser client area.

Returns

{Object} an object containing a width and height property that represent the width and height of the browser client area.

Element

Element is a global object provided by the mootools library.  The functions documented here are extensions to the Element object provided by Jx to make cross-browser compatibility easier to achieve.  Most of the methods are measurement related.

While the code in these methods has been converted to use MooTools methods, there may be better MooTools methods to use to accomplish these things.  Ultimately, it would be nice to eliminate most or all of these and find the MooTools equivalent or convince MooTools to add them.

Summary
return the size of the content area of an element.
return the size of the border area of an element.
return the size of the margin area of an element.
set either or both of the width and height of an element to the provided size.
set either or both of the width and height of an element to the provided size.
returns the padding for each edge of an element
returns the border size for each edge of an element
determines if the element is a descendent of the reference node.
search the parentage of the element to find an element of the given tag name.

Functions

getContentBoxSize

getContentBoxSize : function()

return the size of the content area of an element.  This is the size of the element less margins, padding, and borders.

Parameters

elem{Object} the element to get the content size of.

Returns

{Object} an object with two properties, width and height, that are the size of the content area of the measured element.

getBorderBoxSize

getBorderBoxSize: function()

return the size of the border area of an element.  This is the size of the element less margins.

Parameters

elem{Object} the element to get the border sizing of.

Returns

{Object} an object with two properties, width and height, that are the size of the border area of the measured element.

getMarginBoxSize

getMarginBoxSize: function()

return the size of the margin area of an element.  This is the size of the element plus margins.

Parameters

elem{Object} the element to get the margin sizing of.

Returns

{Object} an object with two properties, width and height, that are the size of the margin area of the measured element.

setContentBoxSize

setContentBoxSize : function(size)

set either or both of the width and height of an element to the provided size.  This function ensures that the content area of the element is the requested size and the resulting size of the element may be larger depending on padding and borders.

Parameters

elem{Object} the element to set the content area of.
size{Object} an object with a width and/or height property that is the size to set the content area of the element to.

setBorderBoxSize

setBorderBoxSize : function(size)

set either or both of the width and height of an element to the provided size.  This function ensures that the border size of the element is the requested size and the resulting content areaof the element may be larger depending on padding and borders.

Parameters

elem{Object} the element to set the border size of.
size{Object} an object with a width and/or height property that is the size to set the content area of the element to.

getPaddingSize

getPaddingSize : function ()

returns the padding for each edge of an element

Parameters

elem{Object} The element to get the padding for.

Returns

{Object} an object with properties left, top, right and bottom that contain the associated padding values.

getBorderSize

getBorderSize : function()

returns the border size for each edge of an element

Parameters

elem{Object} The element to get the borders for.

Returns

{Object} an object with properties left, top, right and bottom that contain the associated border values.

descendantOf

descendantOf: function(node)

determines if the element is a descendent of the reference node.

Parameters

node{HTMLElement} the reference node

Returns

{Boolean} true if the element is a descendent, false otherwise.

findElement

findElement: function(type)

search the parentage of the element to find an element of the given tag name.

Parameters

type{String} the tag name of the element type to search for

Returns

{HTMLElement} the first node (this one or first parent) with the requested tag name or false if none are found.

Jx. ContentLoader

ContentLoader is a mix-in class that provides a consistent mechanism for other Jx controls to load content in one of four different ways:

  • using an existing element, by id
  • using an existing element, by object reference
  • using an HTML string
  • using a URL to get the content remotely

Use the Implements syntax in your Class to add Jx.ContentLoader to your class.

Option: content content may be an HTML element reference, the id of an HTML element already in the DOM, or an HTML string that becomes the inner HTML of the element.

Option: contentURL the URL to load content from

Summary
tracks the load state of the content, specifically useful in the case of remote content.
triggers loading of content based on options set for the current object.
Is fired after a delay to check the request to make sure it’s not failing in AIR.

Properties

contentIsLoaded

tracks the load state of the content, specifically useful in the case of remote content.

Functions

loadContent

loadContent: function(element)

triggers loading of content based on options set for the current object.

Parameters

element{Object} the element to insert the content into

Events

ContentLoader adds the following events to an object.  You can register for these events using the addEvent method or by providing callback functions via the on{EventName} properties in the options object

contentLoadedcalled when the content has been loaded.  If the content is not asynchronous then this is called before loadContent returns.
contentLoadFailedcalled if the content fails to load, primarily useful when using the contentURL method of loading content.

checkRequest()

checkRequest: function()

Is fired after a delay to check the request to make sure it’s not failing in AIR.

Jx. AutoPosition

Mix-in class that provides a method for positioning elements relative to other elements.

Summary
positions an element relative to another element based on the provided options.

Functions

position

position: function(element,
relative,
options)

positions an element relative to another element based on the provided options.  Positioning rules are a string with two space-separated values.  The first value references the parent element and the second value references the thing being positioned.  In general, multiple rules can be considered by passing an array of rules to the horizontal and vertical options.  The position method will attempt to position the element in relation to the relative element using the rules specified in the options.  If the element does not fit in the viewport using the rule, then the next rule is attempted.  If all rules fail, the last rule is used and element may extend outside the viewport.  Horizontal and vertical rules are processed independently.

Horizontal Positioning

Horizontal values are ‘left’, ‘center’, ‘right’, and numeric values.  Some common rules are:

  • ’left left’ is interpreted as aligning the left edge of the element to be positioned with the left edge of the reference element.
  • ’right right’ aligns the two right edges.
  • ’right left’ aligns the left edge of the element to the right of the reference element.
  • ’left right’ aligns the right edge of the element to the left edge of the reference element.

Vertical Positioning

Vertical values are ‘top’, ‘center’, ‘bottom’, and numeric values.  Some common rules are:

  • ’top top’ is interpreted as aligning the top edge of the element to be positioned with the top edge of the reference element.
  • ’bottom bottom’ aligns the two bottom edges.
  • ’bottom top’ aligns the top edge of the element to the bottom of the reference element.
  • ’top bottom’ aligns the bottom edge of the element to the top edge of the reference element.

Parameters

elementthe element to position
relativethe element to position relative to
optionsthe positioning options, see list below.

Options

horizontalthe horizontal positioning rule to use to position the element.  Valid values are ‘left’, ‘center’, ‘right’, and a numeric value.  The default value is ‘center center’.
verticalthe vertical positioning rule to use to position the element.  Valid values are ‘top’, ‘center’, ‘bottom’, and a numeric value.  The default value is ‘center center’.
offsetsan object containing numeric pixel offset values for the object being positioned as top, right, bottom and left properties.

Jx. Chrome

A mix-in class that provides chrome helper functions.  Chrome is the extraneous visual element that provides the look and feel to some elements i.e. dialogs.  Chrome is added inside the element specified but may bleed outside the element to provide drop shadows etc.  This is done by absolutely positioning the chrome objects in the container based on calculations using the margins, borders, and padding of the jxChrome class and the element it is added to.

Chrome can consist of either pure CSS border and background colors, or a background-image on the jxChrome class.  Using a background-image on the jxChrome class creates four images inside the chrome container that are positioned in the top-left, top-right, bottom-left and bottom-right corners of the chrome container and are sized to fill 50% of the width and height.  The images are positioned and clipped such that the appropriate corners of the chrome image are displayed in those locations.

Summary
the DOM element that contains the chrome
create chrome on an element.
show the chrome on an element.
removes the chrome from the DOM.

Properties

chrome

the DOM element that contains the chrome

Functions

makeChrome

makeChrome: function(element)

create chrome on an element.

Parameters

element{HTMLElement} the element to put the chrome on.

showChrome

showChrome: function(element)

show the chrome on an element.  This creates the chrome if necessary.  If the chrome has been previously created and not removed, you can call this without an element and it will just resize the chrome within its existing element.  You can also pass in a different element from which the chrome was previously attached to and it will move the chrome to the new element.

Parameters

element{HTMLElement} the element to show the chrome on.

hideChrome

hideChrome: function()

removes the chrome from the DOM.  If you do this, you can’t call showChrome with no arguments.

Jx. Addable

A mix-in class that provides a helper function that allows an object to be added to an existing element on the page.

Summary
adds the object to the DOM relative to another element.

Functions

addTo

addTo: function(reference,
where)

adds the object to the DOM relative to another element.  If you use ‘top’ or ‘bottom’ then the element is added to the relative element (becomes a child node).  If you use ‘before’ or ‘after’ then the element is inserted adjacent to the reference node.

Parameters

reference{Object} the DOM element or id of a DOM element to append the object relative to
where{String} where to append the element in relation to the reference node.  Can be ‘top’, ‘bottom’, ‘before’ or ‘after’.  The default is ‘bottom’.

Returns

the object itself, which is useful for chaining calls together

Jx. Button

Extends: Object

Implements: Options, Events, Jx.Addable

Jx.Button creates a clickable element that can be added to a web page.  When the button is clicked, it fires a ‘click’ event.

The CSS styling for a button is controlled by several classes related to the various objects in the button’s HTML structure:

<div class="jxButtonContainer">
<a class="jxButton">
<span class="jxButtonContent">
<img class="jxButtonIcon" src="image_url">
<span class="jxButtonLabel">button label</span>
</span>
</a>
</div>

The CSS classes will change depending on the type option passed to the constructor of the button.  The default type is Button.  Passing another value such as Tab will cause all the CSS classes to change from jxButton to jxTab.  For example:

<div class="jxTabContainer">
<a class="jxTab">
<span class="jxTabContent">
<img class="jxTabIcon" src="image_url">
<span class="jxTabLabel">tab label</span>
</span>
</a>
</div>

When you construct a new instance of Jx.Button, the button does not automatically get inserted into the web page.  Typically a button is used as part of building another capability such as a Jx.Toolbar.  However, if you want to manually insert the button into your application, you may use the addTo method to append or insert the button into the page.

There are two modes for a button, normal and toggle.  A toggle button has an active state analogous to a checkbox.  A toggle button generates different events (down and up) from a normal button (click).  To create a toggle button, pass toggle: true to the Jx.Button constructor.

To use a Jx.Button in an application, you should to register for the ‘click’ event.  You can pass a function in the ‘onClick’ option when constructing a button or you can call the addEvent(‘click’, myFunction) method.  The addEvent method can be called several times, allowing more than one function to be called when a button is clicked.  You can use the removeEvent(‘click’, myFunction) method to stop receiving click events.

Example

var button = new Jx.Button(options);
button.addTo('myListItem'); // the id of an LI in the page.
Example:
var options = {
imgPath: 'images/mybutton.png',
tooltip: 'click me!',
label: 'click me',
onClick: function() {
alert('you clicked me');
}
};
var button = new Jx.Button(options);
button.addEvent('click', anotherFunction);

function anotherFunction() {
alert('a second alert for a single click');
}

Events

clickthe button was pressed and released (only if type is not ‘toggle’).
downthe button is down (only if type is ‘toggle’)
upthe button is up (only if the type is ‘toggle’).

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
create a new button.
triggered when the user clicks the button, processes the actionPerformed event
This returns true if the button is enabled, false otherwise
enable or disable the button.
For toggle buttons, this returns true if the toggle button is currently active and false otherwise.
Set the active state of the button
set the image of this button to a new image URL
sets the text of the button.
returns the text of the button.
sets the tooltip displayed by the button
capture the keyboard focus on this button
remove the keyboard focus from this button

Functions

Jx. Button

create a new button.

Parameters

options{Object} an object containing optional properties for this button as below.

clicked

clicked : function(evt)

triggered when the user clicks the button, processes the actionPerformed event

Parameters

evt{Event} the user click event

isEnabled

isEnabled: function()

This returns true if the button is enabled, false otherwise

Returns

{Boolean} whether the button is enabled or not

setEnabled

setEnabled: function(enabled)

enable or disable the button.

Parameters

enabled{Boolean} the new enabled state of the button

isActive

isActive: function()

For toggle buttons, this returns true if the toggle button is currently active and false otherwise.

Returns

{Boolean} the active state of a toggle button

setActive

setActive: function(active)

Set the active state of the button

Parameters

active{Boolean} the new active state of the button

setImage

setImage: function(path)

set the image of this button to a new image URL

Parameters

path{String} the new url to use as the image for this button

setLabel

setLabel: function(label)

sets the text of the button.  Only works if a label was supplied when the button was constructed

Parameters

label{String} the new label for the button

getLabel

getLabel: function()

returns the text of the button.

setTooltip

setTooltip: function(tooltip)

sets the tooltip displayed by the button

Parameters

tooltip{String} the new tooltip

focus

focus: function()

capture the keyboard focus on this button

blur

blur: function()

remove the keyboard focus from this button

Jx. Button. Flyout

Extends: Jx.Button

Implements: Jx.ContentLoader, Jx.AutoPosition, Jx.Chrome

Flyout buttons expose a panel when the user clicks the button.  The panel can have arbitrary content.  You must provide any necessary code to hook up elements in the panel to your application.

When the panel is opened, the ‘open’ event is fired.  When the panel is closed, the ‘close’ event is fired.  You can register functions to handle these events in the options passed to the constructor (onOpen, onClose).

The user can close the flyout panel by clicking the button again, by clicking anywhere outside the panel and other buttons, or by pressing the ‘esc’ key.

Flyout buttons implement Jx.ContentLoader which provides the hooks to insert content into the Flyout element.  Note that the Flyout element is not appended to the DOM until the first time it is opened, and it is removed from the DOM when closed.

It is generally best to specify a width and height for your flyout content area through CSS to ensure that it works correctly across all browsers.  You can do this for all flyouts using the .jxFlyout CSS selector, or you can apply specific styles to your content elements.

A flyout closes other flyouts when it is opened.  It is possible to embed flyout buttons inside the content area of another flyout button.  In this case, opening the inner flyout will not close the outer flyout but it will close any other flyouts that are siblings.

Example

var flyout = new Jx.Button.Flyout({
label: 'flyout',
content: 'flyoutContent',
onOpen: function(flyout) {
console.log('flyout opened');
},
onClose: function(flyout) {
console.log('flyout closed');
}
});

Events

openthis event is triggered when the flyout is opened.
closethis event is triggered when the flyout is closed.

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
the HTML element that contains the flyout content
construct a new instance of a flyout button.
Override Jx.Button::clicked to hide/show the content area of the flyout.
Closes the flyout if open

Properties

content

the HTML element that contains the flyout content

Functions

initialize

initialize: function(options)

construct a new instance of a flyout button.  The single options argument takes a combination of options that apply to Jx.Button, Jx.ContentLoader, and Jx.AutoPosition.

Parameters

optionsan options object used to initialize the button, see <Jx.Button.Options>, <Jx.ContentLoader.Options>, and <Jx.AutoPosition.Options> for details.

clicked

clicked: function(e)

Override Jx.Button::clicked to hide/show the content area of the flyout.

Parameters

e{Event} the user event

hide

hide: function()

Closes the flyout if open

Jx. Layout

Extends: Object

Implements: Options, Events

Jx.Layout is used to provide more flexible layout options for applications

Jx.Layout wraps an existing DOM element (typically a div) and provides extra functionality for sizing that element within its parent and sizing elements contained within it that have a ‘resize’ function attached to them.

To create a Jx.Layout, pass the element or id plus an options object to the constructor.

Example

var myContainer = new Jx.Layout('myDiv', options);

Events

sizeChangefired when the size of the container changes

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
Create a new instance of Jx.Layout.
when the window is resized, any Jx.Layout controlled elements that are direct children of the BODY element are resized
resize the element controlled by this Jx.Layout object.

Functions

Jx. Layout

Create a new instance of Jx.Layout.

Parameters

domObj{HTMLElement} element or id to apply the layout to
options<Jx.Layout.Options>

windowResize

windowResize: function()

when the window is resized, any Jx.Layout controlled elements that are direct children of the BODY element are resized

resize

resize: function(options)

resize the element controlled by this Jx.Layout object.

Parameters

optionsnew options to apply, see <Jx.Layout.Options>

Jx. Button.Tab

Extends: Jx.Button

Implements: Jx.ContentLoader

A single tab in a tab set.  A tab has a label (displayed in the tab) and a content area that is displayed when the tab is active.  A tab has to be added to both a Jx.TabSet (for the content) and Jx.Toolbar (for the actual tab itself) in order to be useful.  Alternately, you can use a Jx.TabBox which combines both into a single control at the cost of some flexibility in layout options.

A tab is a Jx.ContentLoader and you can specify the initial content of the tab using any of the methods supported by Jx.ContentLoader::loadContent.  You can acccess the actual DOM element that contains the content (if you want to dynamically insert content for instance) via the <Jx.Tab::content> property.

A tab is a button of type toggle which means that it emits the up and down events.

Example

var tab1 = new Jx.Button.Tab({
label: 'tab 1',
content: 'content1',
onDown: function(tab) {
console.log('tab became active');
},
onUp: function(tab) {
console.log('tab became inactive');
}
});

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
{HTMLElement} The content area that is displayed when the tab is active.
Create a new instance of Jx.Button.Tab.
triggered when the user clicks the button, processes the actionPerformed event

Properties

content

{HTMLElement} The content area that is displayed when the tab is active.

Functions

Jx. Button.Tab

Create a new instance of Jx.Button.Tab.  Any layout options passed are used to create a Jx.Layout for the tab content area.

Parameters

options{Object} an object containing options that are used to control the appearance of the tab.  See Jx.Button, Jx.ContentLoader::loadContent and Jx.Layout::Jx.Layout for valid options.

clicked

clicked : function(evt)

triggered when the user clicks the button, processes the actionPerformed event

Jx. ColorPalette

Extends: Object

Implements: Options, Events, Jx.Addable

A Jx.ColorPalette presents a user interface for selecting colors.  Currently, the user can either enter a HEX colour value or select from a palette of web-safe colours.  The user can also enter an opacity value.

A Jx.ColorPalette can be embedded anywhere in a web page using its addTo method.  However, a Jx.Button subclass is provided (Jx.Button.Color) that embeds a colour panel inside a button for easy use in toolbars.

Colour changes are propogated via a change event.  To be notified of changes in a Jx.ColorPalette, use the addEvent method.

Example

Events

changetriggered when the color changes.
clickthe user clicked on a color swatch (emitted after a change event)

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
the HTML element representing the color panel
initialize a new instance of Jx.ColorPalette
handle the mouse moving over a colour swatch by updating the preview
handle mouse click on a swatch by updating the color and hiding the panel.
handle the user entering a new colour value manually by updating the selected colour if the entered value is valid HEX.
handle the user entering a new alpha value manually by updating the selected alpha if the entered value is valid alpha (0-100).
set the colour represented by this colour panel
set the alpha represented by this colour panel
update the colour panel user interface based on the current colour and alpha values

Properties

{HTMLElement} domObj

the HTML element representing the color panel

Functions

Jx. ColorPalette

initialize a new instance of Jx.ColorPalette

Parameters

options<Jx.ColorPalette.Options>

swatchOver

swatchOver: function(e)

handle the mouse moving over a colour swatch by updating the preview

Parameters

e{Event} the mousemove event object

swatchClick

swatchClick: function(e)

handle mouse click on a swatch by updating the color and hiding the panel.

Parameters

e{Event} the mouseclick event object

changed

changed: function()

handle the user entering a new colour value manually by updating the selected colour if the entered value is valid HEX.

alphaChanged

alphaChanged: function()

handle the user entering a new alpha value manually by updating the selected alpha if the entered value is valid alpha (0-100).

setColor

setColor: function(color)

set the colour represented by this colour panel

Parameters

color{String} the new hex color value

setAlpha

setAlpha: function(alpha)

set the alpha represented by this colour panel

Parameters

alpha{Integer} the new alpha value (between 0 and 100)

updateSelected

updateSelected: function()

update the colour panel user interface based on the current colour and alpha values

Jx. Button. Color

Extends: Jx.Button.Flyout

A Jx.ColorPalette wrapped up in a Jx.Button.  The button includes a preview of the currently selected color.  Clicking the button opens the color panel.

A color button is essentially a Jx.Button.Flyout where the content of the flyout is a Jx.ColorPalette.  For performance, all color buttons share an instance of Jx.ColorPalette which means only one button can be open at a time.  This isn’t a huge restriction as flyouts already close each other when opened.

Example

var colorButton = new Jx.Button.Color({
onChange: function(button) {
console.log('color:' + button.options.color + ' alpha: ' +
button.options.alpha);
}
});

Events

changefired when the color is changed.

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
initialize a new color button.
override Jx.Button.Flyout to use a singleton color palette.
hide the color panel
set the color represented by this color panel
set the alpha represented by this color panel
handle the color changing in the palette by updating the preview swatch in the button and firing the change event.
Update the swatch color for the current color

Functions

Jx. Button. Color

initialize a new color button.

Parameters

options<Jx.Button.Color.Options> initialize instance options.

clicked

clicked: function()

override Jx.Button.Flyout to use a singleton color palette.

hide

hide: function()

hide the color panel

setColor

setColor: function(color)

set the color represented by this color panel

Parameters

color{String} the new hex color value

setAlpha

setAlpha: function(alpha)

set the alpha represented by this color panel

Parameters

alpha{Integer} the new alpha value (between 0 and 100)

changed

changed: function(panel)

handle the color changing in the palette by updating the preview swatch in the button and firing the change event.

Parameters

panelJx.ColorPalette the palette that changed.

updateSwatch

updateSwatch: function()

Update the swatch color for the current color

Jx.Menu

Extends: Object

Implements: Options, Events, Jx.AutoPosition, Jx.Chrome, Jx.Addable

A main menu as opposed to a sub menu that lives inside the menu.

TODO: Jx.Menu revisit this to see if Jx.Menu and Jx.SubMenu can be merged into a single implementation.

Example

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
{HTMLElement} The HTML element containing the menu.
{Jx.Button} The button that represents this menu in a toolbar and opens the menu.
{HTMLElement} the HTML element that contains the menu items within the menu.
{Array} the items in this menu
Create a new instance of Jx.Menu.
Add menu items to the sub menu.
Deactivate the menu by hiding it.
Handle the user moving the mouse over the button for this menu by showing this menu and hiding the other menu.
determine if an event happened inside this menu or a sub menu of this menu.
Hide the menu.
Show the menu
Set the sub menu that is currently open

Properties

domObj

{HTMLElement} The HTML element containing the menu.

button

{Jx.Button} The button that represents this menu in a toolbar and opens the menu.

subDomObj

{HTMLElement} the HTML element that contains the menu items within the menu.

items

{Array} the items in this menu

Functions

Jx.Menu

Create a new instance of Jx.Menu.

Parameters

optionssee <Jx.Button.Options>.  If no options are provided then no button is created.

add

add : function()

Add menu items to the sub menu.

Parameters

item{<Jx.MenuItem>} the menu item to add.  Multiple menu items can be added by passing multiple arguments to this function.

deactivate

deactivate: function()

Deactivate the menu by hiding it.

onMouseOver

onMouseOver: function(e)

Handle the user moving the mouse over the button for this menu by showing this menu and hiding the other menu.

Parameters

e{Event} the mouse event

eventInMenu

eventInMenu: function(e)

determine if an event happened inside this menu or a sub menu of this menu.

Parameters

e{Event} the mouse event

Returns

{Boolean} true if the event happened in the menu or a sub menu of this menu, false otherwise

hide

hide: function(e)

Hide the menu.

Parameters

e{Event} the mouse event

show

show : function(o)

Show the menu

Parameters

e{Event} the mouse event

setVisibleItem

setVisibleItem: function(obj)

Set the sub menu that is currently open

Parameters

obj- {<Jx.SubMenu>} the sub menu that just became visible

Jx. ButtonSet

Extends: Object

Implements: Options, Events

A ButtonSet manages a set of Jx.Button instances by ensuring that only one of the buttons is active.  All the buttons need to have been created with the toggle option set to true for this to work.

Example

var toolbar = new Jx.Toolbar('bar');
var buttonSet = new Jx.ButtonSet();

var tab1 = new Jx.Button({label: 'b1', toggle:true, contentID: 'content1'});
var tab2 = new Jx.Button({label: 'b2', toggle:true, contentID: 'content2'});
var tab3 = new Jx.Button({label: 'b3', toggle:true, contentID: 'content3'});
var tab4 = new Jx.Button({label: 'b4', toggle:true, contentURL: 'test_content.html'});

buttonSet.add(b1,b2,b3,b4);

Events

changethe current button has changed

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
{Array} array of buttons that are managed by this button set
Create a new instance of Jx.ButtonSet
Add one or more Jx.Buttons to the ButtonSet.
Remove a button from this Button.
Set the active button to the one passed to this method
Handle selection changing on the buttons themselves and activate the appropriate button in response.

Properties

buttons

{Array} array of buttons that are managed by this button set

Functions

Jx. ButtonSet

Create a new instance of Jx.ButtonSet

Parameters

optionsan options object, only event handlers are supported as options at this time.

add

add : function()

Add one or more Jx.Buttons to the ButtonSet.

Parameters

button{Jx.Button} an instance of Jx.Button to add to the button set.  More than one button can be added by passing extra parameters to this method.

remove

remove : function(button)

Remove a button from this Button.

Parameters

button{Jx.Button} the button to remove.

setActiveButton

setActiveButton: function(button)

Set the active button to the one passed to this method

Parameters

button{Jx.Button} the button to make active.

selectionChanged

Handle selection changing on the buttons themselves and activate the appropriate button in response.

Parameters

button{Jx.Button} the button to make active.

Jx. Button. Multi

Extends: Jx.Button

Implements

Multi buttons are used to contain multiple buttons in a drop down list where only one button is actually visible and clickable in the interface.

When the user clicks the active button, it performs its normal action.  The user may also click a drop-down arrow to the right of the button and access the full list of buttons.  Clicking a button in the list causes that button to replace the active button in the toolbar and performs the button’s regular action.

Other buttons can be added to the Multi button using the add method.

This is not really a button, but rather a container for buttons.  The button structure is a div containing two buttons, a normal button and a flyout button.  The flyout contains a toolbar into which all the added buttons are placed.  The main button content is cloned from the last button clicked (or first button added).

The Multi button does not trigger any events itself, only the contained buttons trigger events.

Example

var b1 = new Jx.Button({
label: 'b1',
onClick: function(button) {
console.log('b1 clicked');
}
});
var b2 = new Jx.Button({
label: 'b2',
onClick: function(button) {
console.log('b2 clicked');
}
});
var b3 = new Jx.Button({
label: 'b3',
onClick: function(button) {
console.log('b3 clicked');
}
});
var multiButton = new Jx.Button.Multi();
multiButton.add(b1, b2, b3);

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
the currently selected button
{Array} the buttons added to this multi button
construct a new instance of Jx.Button.Multi.
adds one or more buttons to the Multi button.
remove a button from a multi button
update the menu item to be the requested button.
update the active button in the menu item, trigger the button’s action and hide the flyout that contains the buttons.

Properties

{<Jx. Button>} activeButton

the currently selected button

buttons

{Array} the buttons added to this multi button

Functions

Jx. Button. Multi

construct a new instance of Jx.Button.Multi.

add

add: function()

adds one or more buttons to the Multi button.  The first button added becomes the active button initialize.  This function takes a variable number of arguments, each of which is expected to be an instance of Jx.Button.

Parameters

button{Jx.Button} a Jx.Button instance, may be repeated in the parameter list

remove

remove: function(button)

remove a button from a multi button

Parameters

button{Jx.Button} the button to remove

setActiveButton

setActiveButton: function(button)

update the menu item to be the requested button.

Parameters

button{Jx.Button} a Jx.Button instance that was added to this multi button.

setButton

setButton: function(button)

update the active button in the menu item, trigger the button’s action and hide the flyout that contains the buttons.

Parameters

button{Jx.Button} The button to set as the active button

Jx. Menu.Item

Extends: Jx.Button

A menu item is a single entry in a menu.  It is typically composed of a label and an optional icon.  Selecting the menu item emits an event.

Jx.Menu.Item is represented by a Jx.Button with type MenuItem and the associated CSS changes noted in Jx.Button.  The container of a MenuItem is an ‘li’ element.

Example

Events

clickfired when the menu item is clicked.

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
{<Jx.SubMenu> or Jx.Menu} the menu that contains the menu item.
Create a new instance of Jx.Menu.Item
Set the owner of this menu item
Hide the menu item.
Show the menu item
Handle the user clicking on the menu item, overriding the Jx.Button::clicked method to facilitate menu tracking
handle the mouse moving over the menu item

Properties

owner

{<Jx.SubMenu> or Jx.Menu} the menu that contains the menu item.

Functions

Jx. Menu.Item

Create a new instance of Jx.Menu.Item

Parameters

optionsSee <Jx.Button.Options>

setOwner

setOwner: function(obj)

Set the owner of this menu item

Parameters

obj{Object} the new owner

hide

hide: function()

Hide the menu item.

show

Show the menu item

clicked

clicked: function(obj)

Handle the user clicking on the menu item, overriding the Jx.Button::clicked method to facilitate menu tracking

Parameters

obj{Object} an object containing an event property that was the user event.

onmouseover

handle the mouse moving over the menu item

Parameters

e{Event} the mousemove event

Jx. Button. Combo

Extends: Jx.Button.Multi

A drop down list of selectable items.  Items can be either a string, an image or both.

Example

new Jx.Button.Combo({
label: 'Choose a symbol',
items: [
{label: 'Star', image: 'images/swatches.png', imageClass: 'comboStar'},
{label: 'Square', image: 'images/swatches.png', imageClass: 'comboSquare'},
{label: 'Triangle', image: 'images/swatches.png', imageClass: 'comboTriangle'},
{label: 'Circle', image: 'images/swatches.png', imageClass: 'comboCircle'},
{label: 'Plus', image: 'images/swatches.png', imageClass: 'comboPlus'},
{label: 'Cross', image: 'images/swatches.png', imageClass: 'comboCross'}
],
onChange: function(combo) { alert('you selected ' + combo.getValue()) }
})

Events

changetriggered when the user selects a new item from the list

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
{Object} current selection in the list
create a new instance of Jx.Combo
enable or disable the combo button.
invoked when the current value is changed
Handle the user pressing a key by looking for an ENTER key to set the value.
add a new item to the pick list
Remove the item at the given index.
set the value of the Combo
Return the current value

Properties

currentSelection

{Object} current selection in the list

Functions

Jx. Combo

create a new instance of Jx.Combo

Parameters

options<Jx.button.Combo.Options>

setEnabled

setEnabled: function(enabled)

enable or disable the combo button.

Parameters

enabled{Boolean} the new enabled state of the button

valueChanged

valueChanged: function()

invoked when the current value is changed

onKeyPress

onKeyPress: function(e)

Handle the user pressing a key by looking for an ENTER key to set the value.

Parameters

e{Event} the keypress event

add

add: function()

add a new item to the pick list

Parameters

options{Object} object with properties suitable to be passed to a <Jx.Menu.Item.Options> object.  More than one options object can be passed, comma separated or in an array.

remove

remove: function(idx)

Remove the item at the given index.  Not implemented.

Parameters

idx{Integer} the item to remove.

setValue

setValue: function(value)

set the value of the Combo

Parameters

value{Object} the new value.  May be a string, a text node, or another DOM element.

getValue

getValue: function()

Return the current value

Returns

{Object} returns the currently selected item

Jx. Panel

Extends: Object

Implements: Options, Events, Jx.ContentLoader

A panel is a fundamental container object that has a content area and optional toolbars around the content area.  It also has a title bar area that contains an optional label and some user controls as determined by the options passed to the constructor.

Example

Events

closefired when the panel is closed
collapsefired when the panel is collapsed
expandfired when the panel is opened

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
Initialize a new Jx.Panel instance
the sizeChange event of the Jx.Layout that manages the outer container is intercepted and passed through this method to handle resizing of the panel contents because we need to do some calculations if the panel is collapsed and if there are toolbars to put around the content area.
Set the label in the title bar of this panel
Get the label of the title bar of this panel
Clean up the panel
Maximize this panel
set the content of this panel to some HTML
Set the content of this panel to come from some URL.
When the content of the panel is loaded from a remote URL, this method is called when the ajax request returns.
Set the panel as busy or not busy, which displays a loading image in the title bar.
sets or toggles the collapsed state of the panel.
Closes the panel (completely hiding it).

Functions

Jx. Panel

Initialize a new Jx.Panel instance

Options: <Jx.Panel.Options>, <Jx.ContentLoader.Options>

layoutContent

layoutContent: function()

the sizeChange event of the Jx.Layout that manages the outer container is intercepted and passed through this method to handle resizing of the panel contents because we need to do some calculations if the panel is collapsed and if there are toolbars to put around the content area.

setLabel

setLabel: function(s)

Set the label in the title bar of this panel

Parameters

s{String} the new label

getLabel

getLabel: function()

Get the label of the title bar of this panel

Returns

{String} the label

finalize

finalize: function()

Clean up the panel

maximize

maximize: function()

Maximize this panel

setContent

setContent : function (html)

set the content of this panel to some HTML

Parameters

html{String} the new HTML to go in the panel

setContentURL

setContentURL : function (url)

Set the content of this panel to come from some URL.

Parameters

url{String} URL to some HTML content for this panel

panelContentLoaded

panelContentLoaded: function(html)

When the content of the panel is loaded from a remote URL, this method is called when the ajax request returns.

Parameters

html{String} the html return from xhr.onSuccess

setBusy

setBusy : function(isBusy)

Set the panel as busy or not busy, which displays a loading image in the title bar.

Parameters

isBusy{Boolean} the busy state

toggleCollapse

toggleCollapse: function(state)

sets or toggles the collapsed state of the panel.  If a new state is passed, it is used, otherwise the current state is toggled.

Parameters

stateoptional, if passed then the state is used, otherwise the state is toggled.

close

close: function()

Closes the panel (completely hiding it).

Jx. Dialog

Extends: Jx.Panel

Implements: Jx.AutoPosition, Jx.Chrome

A Jx.Dialog implements a floating dialog.  Dialogs represent a useful way to present users with certain information or application controls.  Jx.Dialog is designed to provide the same types of features as traditional operating system dialog boxes, including:

  • dialogs may be modal (user must dismiss the dialog to continue) or non-modal
  • dialogs are movable (user can drag the title bar to move the dialog around)
  • dialogs may be a fixed size or allow user resizing.

Jx.Dialog uses Jx.ContentLoader to load content into the content area of the dialog.  Refer to the Jx.ContentLoader documentation for details on content options.

Example

var dialog = new Jx.Dialog();

Events

opentriggered when the dialog is opened
closetriggered when the dialog is closed
changetriggered when the value of an input in the dialog is changed
resizetriggered when the dialog is resized

Extends

Jx.Dialog extends Jx.Panel, please go there for more details.

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
modal dialogs prevent interaction with the rest of the application while they are open, this element is displayed just under the dialog to prevent the user from clicking anything.
Construct a new instance of Jx.Dialog
resize the dialog.
overload panel’s sizeChanged method
sets or toggles the collapsed state of the panel.
show the dialog, external code should use the Jx.Dialog::open method to make the dialog visible.
hide the dialog, external code should use the Jx.Dialog::close method to hide the dialog.
open the dialog and load content from the provided url.
open the dialog.
close the dialog and trigger the onClose callback function if necessary

Properties

{HTMLElement} blanket

modal dialogs prevent interaction with the rest of the application while they are open, this element is displayed just under the dialog to prevent the user from clicking anything.

Functions

Jx. Dialog

Construct a new instance of Jx.Dialog

Parameters

options{Object} an object containing options for the dialog.

Options: <Jx.Dialog.Options>, <Jx.Panel.Options>, <Jx.ContentLoader.Options>

resize

resize: function(width,
height,
autoPosition)

resize the dialog.  This can be called when the dialog is closed or open.

Parameters

widththe new width
heightthe new height
autoPositionboolean, false by default, if resizing an open dialog setting this to true will reposition it according to its position rules.

sizeChanged

sizeChanged: function()

overload panel’s sizeChanged method

toggleCollapse

toggleCollapse: function(state)

sets or toggles the collapsed state of the panel.  If a new state is passed, it is used, otherwise the current state is toggled.

Parameters

stateoptional, if passed then the state is used, otherwise the state is toggled.

show

show : function( )

show the dialog, external code should use the Jx.Dialog::open method to make the dialog visible.

hide

hide : function()

hide the dialog, external code should use the Jx.Dialog::close method to hide the dialog.

openURL

openURL: function(url)

open the dialog and load content from the provided url.  If you don’t provide a URL then the dialog opens normally.

Parameters

url<String> the url to load when opening.

open

open: function()

open the dialog.  This may be delayed depending on the asynchronous loading of dialog content.  The onOpen callback function is called when the dialog actually opens

close

close: function()

close the dialog and trigger the onClose callback function if necessary

Jx. Splitter

Extends: Object

Implements: Options

a Jx.Splitter creates two or more containers within a parent container and provides user control over the size of the containers.  The split can be made horizontally or vertically.

A horizontal split creates containers that divide the space horizontally with vertical bars between the containers.  A vertical split divides the space vertically and creates horizontal bars between the containers.

Example

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
{HTMLElement} the element being split
{Array} an array of elements that are displayed in each of the split areas
{Array} an array of the bars between each of the elements used to resize the split areas.
{Boolean} track the first resize event so that unexposed Jx things can be forced to calculate their size the first time they are exposed.
Create a new instance of Jx.Splitter
Prepare a new, empty element to go into a split area.
Prepare a new, empty bar to go into between split areas.
Setup the initial set of constraints that set the behaviour of the bars between the elements in the split area.
In a horizontally split container, handle a bar being dragged left or right by resizing the elements on either side of the bar.
In a vertically split container, handle a bar being dragged up or down by resizing the elements on either side of the bar.
handle the size of the container being changed.
Resize a horizontally layed-out container
Resize a vertically layed out container.

Properties

domObj

{HTMLElement} the element being split

elements

{Array} an array of elements that are displayed in each of the split areas

bars

{Array} an array of the bars between each of the elements used to resize the split areas.

firstUpdate

{Boolean} track the first resize event so that unexposed Jx things can be forced to calculate their size the first time they are exposed.

Functions

Jx. Splitter

Create a new instance of Jx.Splitter

Parameters

domObj{HTMLElement} the element or id of the element to split
options<Jx.Splitter.Options>

prepareElement

prepareElement: function()

Prepare a new, empty element to go into a split area.

Returns

{HTMLElement} an HTMLElement that goes into a split area.

prepareBar

prepareBar: function()

Prepare a new, empty bar to go into between split areas.

Returns

{HTMLElement} an HTMLElement that becomes a bar.

establishConstraints

establishConstraints: function()

Setup the initial set of constraints that set the behaviour of the bars between the elements in the split area.

dragHorizontal

dragHorizontal: function(obj)

In a horizontally split container, handle a bar being dragged left or right by resizing the elements on either side of the bar.

Parameters

obj{HTMLElement} the bar that was dragged

dragVertical

dragVertical: function(obj)

In a vertically split container, handle a bar being dragged up or down by resizing the elements on either side of the bar.

Parameters

obj{HTMLElement} the bar that was dragged

sizeChanged

sizeChanged: function()

handle the size of the container being changed.

horizontalResize

horizontalResize: function()

Resize a horizontally layed-out container

verticalResize

verticalResize: function()

Resize a vertically layed out container.

Jx. PanelSet

Extends: Object

Implements: Options, Events, Jx.Addable

A panel set manages a set of panels within a DOM element.  The PanelSet fills its container by resizing the panels in the set to fill the width and then distributing the height of the container across all the panels.  Panels can be resized by dragging their respective title bars to make them taller or shorter.  The maximize button on the panel title will cause all other panels to be closed and the target panel to be expanded to fill the remaining space.  In this respect, PanelSet works like a traditional Accordion control.

When creating panels for use within a panel set, it is important to use the proper options.  You must override the collapse option and set it to false and add a maximize option set to true.  You must also not include options for menu and close.

Example

var p1 = new Jx.Panel({collapse: false, maximize: true, content: 'content1'});
var p2 = new Jx.Panel({collapse: false, maximize: true, content: 'content2'});
var p3 = new Jx.Panel({collapse: false, maximize: true, content: 'content3'});
var panelSet = new Jx.PanelSet('panels', [p1,p2,p3]);

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
{Array} the panels being managed by the set
{Integer} the height of the container, cached for speed
{Boolean} true until the panel set has first been resized
Create a new instance of Jx.PanelSet.
Maximize a panel, taking up all available space (taking into consideration any minimum or maximum values)

Properties

panels

{Array} the panels being managed by the set

height

{Integer} the height of the container, cached for speed

firstLayout

{Boolean} true until the panel set has first been resized

Functions

Jx. PanelSet

Create a new instance of Jx.PanelSet.

Parameters

options<Jx.PanelSet.Options>

TODO: Jx.PanelSet.initialize Remove the panels parameter in favour of an add method.

maximizePanel

maximizePanel: function(panel)

Maximize a panel, taking up all available space (taking into consideration any minimum or maximum values)

Jx.Grid

Extends: Object

Implements: Options, Events, Jx.Addable

A tabular control that has fixed scrolling headers on the rows and columns like a spreadsheet.

Jx.Grid is a tabular control with convenient controls for resizing columns, sorting, and inline editing.  It is created inside another element, typically a div.  If the div is resizable (for instance it fills the page or there is a user control allowing it to be resized), you must call the resize() method of the grid to let it know that its container has been resized.

When creating a new Jx.Grid, you can specify a number of options for the grid that control its appearance and functionality.

Jx.Grid renders data that comes from an external source.  This external source, called the model, must implement the following interface.

Example

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
construct a new instance of Jx.Grid within the domObj
handle the grid scrolling by updating the position of the headers
resize the grid to fit inside its container.
set the model for the grid to display.
destroy the contents of the grid safely
create the grid for the current model
set the height of a row.
called through the grid listener interface when data has changed in the underlying model
apply the jxGridRowHeaderPrelight style to the header cell of a row.
apply the jxGridColumnHeaderPrelight style to the header cell of a column.
apply the jxGridRowPrelight style to row.
apply the jxGridColumnPrelight style to a column.
apply the jxGridCellPrelight style to a cell.
Select a cell and apply the jxGridCellSelected style to it.
Apply the jxGridRowHeaderSelected style to the row header cell of a selected row.
Select a row and apply the jxGridRowSelected style to it.
Apply the jxGridColumnHeaderSelected style to the column header cell of a selected column.
Select a column.
handle the mouse moving over the main grid.
handle the mouse moving over the row header cells.
handle the mouse moving over the column header cells.
handle the user clicking on the grid.
handle the user clicking on the row header.
handle the user clicking on the column header.
retrieve the row and column indexes from an event click.
create a new grid model
This function returns the number of columns of data in the model as an integer value.
This function returns an HTML string to be placed in the column header for the given column index.
This function returns an integer which is the height of the column header row in pixels.
This function returns an integer which is the width of the given column in pixels.
This function returns an HTML string to be placed in the row header for the given row index
This function returns an integer which is the width of the row header column in pixels.
This function returns an integer which is the height of the given row in pixels.
This function returns the number of rows of data in the model as an integer value.
This function returns an HTML string which is the text to place in the cell at the given row and column.
This function is called with a column index and width in pixels when a column is resized.
This function returns a boolean value to indicate if a given cell is editable by the user.
This function is called with the row and column of a cell and a new value for the cell.
This function is called by the grid to indicate that the user has selected a row by clicking on the row header.
This function is called by the grid to indicate that the user has selected a column by clicking on the column header.
This function is called by the grid to indicate that the user has selected a cell by clicking on the cell in the grid.

Functions

Jx.Grid

construct a new instance of Jx.Grid within the domObj

Parameters

options<Jx.Grid.Options>

onScroll

onScroll: function()

handle the grid scrolling by updating the position of the headers

resize

resize: function()

resize the grid to fit inside its container.  This involves knowing something about the model it is displaying (the height of the column header and the width of the row header) so nothing happens if no model is set

setModel

setModel: function(model)

set the model for the grid to display.  If a model is attached to the grid it is removed and the new model is displayed.

Parameters

model{Object} the model to use for this grid

destroyGrid

destroyGrid: function()

destroy the contents of the grid safely

createGrid

createGrid: function()

create the grid for the current model

setRowHeaderHeight

setRowHeaderHeight: function(row,
height)

set the height of a row.  This is used internally to adjust the height of the row header when cell contents wrap.  A limitation of the table structure is that overflow: hidden on a td will work horizontally but not vertically

Parameters

row{Integer} the row to set the height for
height{Integer} the height to set the row (in pixels)

gridChanged

gridChanged: function(model,
row,
col,
value)

called through the grid listener interface when data has changed in the underlying model

Parameters

model{Object} the model that changed
row{Integer} the row that changed
col{Integer} the column that changed
value{Mixed} the new value

prelightRowHeader

prelightRowHeader: function(row)

apply the jxGridRowHeaderPrelight style to the header cell of a row.  This removes the style from the previously pre-lit row header.

Parameters

row{Integer} the row to pre-light the header cell of

prelightColumnHeader

prelightColumnHeader: function(col)

apply the jxGridColumnHeaderPrelight style to the header cell of a column.  This removes the style from the previously pre-lit column header.

Parameters

col{Integer} the column to pre-light the header cell of

prelightRow

prelightRow: function(row)

apply the jxGridRowPrelight style to row.  This removes the style from the previously pre-lit row.

Parameters

row{Integer} the row to pre-light

prelightColumn

prelightColumn: function(col)

apply the jxGridColumnPrelight style to a column.  This removes the style from the previously pre-lit column.

Parameters

col{Integer} the column to pre-light

TODO: Jx.Grid.prelightColumn Not Yet Implemented.

prelightCell

prelightCell: function(row,
col)

apply the jxGridCellPrelight style to a cell.  This removes the style from the previously pre-lit cell.

Parameters

row{Integer} the row of the cell to pre-light
col{Integer} the column of the cell to pre-light

selectCell

selectCell: function(row,
col)

Select a cell and apply the jxGridCellSelected style to it.  This deselects a previously selected cell.

If the model supports cell selection, it should implement a cellSelected function to receive notification of the selection.

Parameters

row{Integer} the row of the cell to select
col{Integer} the column of the cell to select

selectRowHeader

selectRowHeader: function(row,
selected)

Apply the jxGridRowHeaderSelected style to the row header cell of a selected row.

Parameters

row{Integer} the row header to select
selected{Boolean} the new state of the row header

selectRow

selectRow: function(row,
selected)

Select a row and apply the jxGridRowSelected style to it.

If the model supports row selection, it should implement a rowSelected function to receive notification of the selection.

Parameters

row{Integer} the row to select
selected{Boolean} the new state of the row

selectColumnHeader

selectColumnHeader: function(col,
selected)

Apply the jxGridColumnHeaderSelected style to the column header cell of a selected column.

Parameters

col{Integer} the column header to select
selected{Boolean} the new state of the column header

selectColumn

selectColumn: function(col,
selected)

Select a column.  This deselects a previously selected column.

Parameters

col{Integer} the column to select
selected{Boolean} the new state of the column

onMouseMoveGrid

onMouseMoveGrid: function(e)

handle the mouse moving over the main grid.  This pre-lights the cell, and subsquently the row and column (and headers).

Parameters

e{Event} the browser event object

onMouseMoveRowHeader

onMouseMoveRowHeader: function(e)

handle the mouse moving over the row header cells.  This pre-lights the row and subsequently the row header.

Parameters

e{Event} the browser event object

onMouseMoveColumnHeader

onMouseMoveColumnHeader: function(e)

handle the mouse moving over the column header cells.  This pre-lights the column and subsequently the column header.

Parameters

e{Event} the browser event object

onClickGrid

onClickGrid: function(e)

handle the user clicking on the grid.  This triggers an event to the model (if a cellSelected function is provided).

The following is an example of a function in the model that selects a row when the cellSelected function is called and deselects any rows that are currently selected.

cellSelected: function(grid, row,col) {
if (this.selectedRow != null) {
grid.selectRow(this.selectedRow, false);
}
this.selectedRow = row;
grid.selectRow(row, true);
}

Parameters:
e - {Event} the browser event object

onClickRowHeader

onClickRowHeader: function(e)

handle the user clicking on the row header.  This triggers an event to the model (if a rowSelected function is provided) which can then select the row if desired.

The following is an example of a function in the model that selects a row when the rowSelected function is called and deselects any rows that are currently selected.  More complex code could be written to allow the user to select multiple rows.

rowSelected: function(grid, row) {
if (this.selectedRow != null) {
grid.selectRow(this.selectedRow, false);
}
this.selectedRow = row;
grid.selectRow(row, true);
}

Parameters

e{Event} the browser event object

onClickColumnHeader

onClickColumnHeader: function(e)

handle the user clicking on the column header.  This triggers column selection and column (and header) styling changes and an event to the model (if a columnSelected function is provided)

The following is an example of a function in the model that selects a column when the columnSelected function is called and deselects any columns that are currently selected.  More complex code could be written to allow the user to select multiple columns.

colSelected: function(grid, col) {
if (this.selectedColumn != null) {
grid.selectColumn(this.selectedColumn, false);
}
this.selectedColumn = col;
grid.selectColumn(col, true);
}

Parameters

e{Event} the browser event object

getRowColumnFromEvent

getRowColumnFromEvent: function(e)

retrieve the row and column indexes from an event click.  This function is used by the grid, row header and column header to safely get these numbers.

If the event isn’t valid (i.e. it wasn’t on a TD or TH) then the returned values will be -1, -1

Parameters

e{Event} the browser event object

@return Object an object with two properties, row and column, that contain the row and column that was clicked

Jx. Grid. Model

create a new grid model

Parameters

dataarray of data to display in the grid
options<Jx.Grid.Model.Options>

getColumnCount

getColumnCount: function()

This function returns the number of columns of data in the model as an integer value.

getColumnHeaderHTML

getColumnHeaderHTML: function(col)

This function returns an HTML string to be placed in the column header for the given column index.

getColumnHeaderHeight

getColumnHeaderHeight: function()

This function returns an integer which is the height of the column header row in pixels.

getColumnWidth

getColumnWidth: function(col)

This function returns an integer which is the width of the given column in pixels.

getRowHeaderHTML

getRowHeaderHTML: function(row)

This function returns an HTML string to be placed in the row header for the given row index

getRowHeaderWidth

getRowHeaderWidth: function()

This function returns an integer which is the width of the row header column in pixels.

getRowHeight

getRowHeight: function(row)

This function returns an integer which is the height of the given row in pixels.

getRowCount

getRowCount: function()

This function returns the number of rows of data in the model as an integer value.

getValueAt

getValueAt: function(row,
col)

This function returns an HTML string which is the text to place in the cell at the given row and column.

setColumnWidth

setColumnWidth: function()

This function is called with a column index and width in pixels when a column is resized.  This function is only required if the grid allows resizeable columns.

isCellEditable

isCellEditable: function()

This function returns a boolean value to indicate if a given cell is editable by the user.

setValueAt

setValueAt: function(row,
col,
value)

This function is called with the row and column of a cell and a new value for the cell.  It is mandatory to provide this function if any of the cells in the model are editable.

rowSelected

rowSelected: function(grid,
row)

This function is called by the grid to indicate that the user has selected a row by clicking on the row header.

columnSelected

columnSelected: function(grid,
col)

This function is called by the grid to indicate that the user has selected a column by clicking on the column header.

cellSelected

cellSelected: function(grid,
row,
col)

This function is called by the grid to indicate that the user has selected a cell by clicking on the cell in the grid.

Jx. Menu. Context

Extends: Jx.Menu

A Jx.Menu that has no button but can be opened at a specific browser location to implement context menus (for instance).

Example

Events

TODOadd open/close events?

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
create a new context menu
Show the context menu at the location of the mouse click

Functions

Jx. ContextMenu

create a new context menu

Parameters

id{HTMLElement} element or id to make this the context menu for.  The menu hooks the oncontextmenu event of the element and shows itself at the mouse position where the right-click happened.

show

show : function(e)

Show the context menu at the location of the mouse click

Parameters

e{Event} the mouse event

Jx. Menu. Separator

Extends: Object

A convenience class to create a visual separator in a menu.

Example

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
{HTMLElement} the HTML element that the separator is contained within
{Jx.Menu, Jx.Menu.SubMenu} the menu that the separator is in.
Create a new instance of a menu separator
Set the ownder of this menu item
Hide the menu item.
Show the menu item

Properties

domObj

{HTMLElement} the HTML element that the separator is contained within

owner

{Jx.Menu, Jx.Menu.SubMenu} the menu that the separator is in.

Functions

Jx. Menu. Separator

Create a new instance of a menu separator

setOwner

setOwner: function(obj)

Set the ownder of this menu item

Parameters

obj{Object} the new owner

hide

Hide the menu item.

show

Show the menu item

Jx. Menu. SubMenu

Extends: Jx.Menu.Item

Implements: Jx.AutoPosition, Jx.Chrome

A sub menu contains menu items within a main menu or another sub menu.

The structure of a SubMenu is the same as a Jx.Menu.Item with an additional unordered list element appended to the container.

Example

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
{HTMLElement} the HTML container for the sub menu.
{Jx.Menu or Jx.SubMenu} the menu or sub menu that this sub menu belongs
{<Jx.MenuItem>} the visible item within the menu
{Array} the menu items that are in this sub menu.
Create a new instance of Jx.SubMenu
Set the owner of this sub menu
Show the sub menu
Hide the sub menu
Add menu items to the sub menu.
Insert a menu item before another menu item.
Remove a single menu item from the menu.
Deactivate the sub menu
Indicate if this sub menu is active
Set the active state of the Jx.Menu that contains this sub menu
Set a sub menu of this menu to be visible and hide the previously visible one.

Properties

subDomObj

{HTMLElement} the HTML container for the sub menu.

owner

{Jx.Menu or Jx.SubMenu} the menu or sub menu that this sub menu belongs

visibleItem

{<Jx.MenuItem>} the visible item within the menu

items

{Array} the menu items that are in this sub menu.

Functions

Jx. SubMenu

Create a new instance of Jx.SubMenu

Parameters

optionssee <Jx.Button.Options>

setOwner

setOwner: function(obj)

Set the owner of this sub menu

Parameters

obj{Object} the owner

show

show: function()

Show the sub menu

hide

hide: function()

Hide the sub menu

add

add : function()

Add menu items to the sub menu.

Parameters

item{<Jx.MenuItem>} the menu item to add.  Multiple menu items can be added by passing multiple arguments to this function.

insertBefore

insertBefore: function(newItem,
targetItem)

Insert a menu item before another menu item.

Parameters

newItem{<Jx.MenuItem>} the menu item to insert
targetItem{<Jx.MenuItem>} the menu item to insert before

remove

remove: function(item)

Remove a single menu item from the menu.

Parameters

item{<Jx.MenuItem} the menu item to remove.

deactivate

deactivate: function(e)

Deactivate the sub menu

Parameters

e{Event} the event that triggered the menu being deactivated.

isActive

isActive: function()

Indicate if this sub menu is active

Returns

{Boolean} true if the Jx.Menu that ultimately contains this sub menu is active, false otherwise.

setActive

setActive: function(isActive)

Set the active state of the Jx.Menu that contains this sub menu

Parameters

isActive{Boolean} the new active state

setVisibleItem

setVisibleItem: function(obj)

Set a sub menu of this menu to be visible and hide the previously visible one.

Parameters

obj{Jx.SubMenu} the sub menu that should be visible

Jx. Splitter.Snap

Extends: Object

A helper class to create an element that can snap a split panel open or closed.

Example

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
{HTMLElement} the DOM element of the snap (the thing that gets clicked).
{HTMLElement} An element of the Jx.Splitter that gets controlled by this snap
{Jx.Splitter} the splitter that this snap is associated with.
{String} track the layout of the splitter for convenience.
Create a new Jx.Splitter.Snap
Snap the element open or closed.
Handle the size of the element changing to see if the toggle state has changed.

Properties

snap

{HTMLElement} the DOM element of the snap (the thing that gets clicked).

element

{HTMLElement} An element of the Jx.Splitter that gets controlled by this snap

splitter

{Jx.Splitter} the splitter that this snap is associated with.

layout

{String} track the layout of the splitter for convenience.

Functions

Jx. Splitter.Snap

Create a new Jx.Splitter.Snap

Parameters

snap{HTMLElement} the clickable thing that snaps the element open and closed
element{HTMLElement} the element that gets controlled by the snap
splitter{Jx.Splitter} the splitter that this all happens inside of.

toggleElement

toggleElement: function()

Snap the element open or closed.

sizeChanged

Handle the size of the element changing to see if the toggle state has changed.

Jx. Toolbar

Extends: Object

Implements: Options, Events

A toolbar is a container object that contains other objects such as buttons.  The toolbar organizes the objects it contains automatically, wrapping them as necessary.  Multiple toolbars may be placed within the same containing object.

Jx.Toolbar includes CSS classes for styling the appearance of a toolbar to be similar to traditional desktop application toolbars.

There is one special object, Jx.ToolbarSeparator, that provides a visual separation between objects in a toolbar.

While a toolbar is generally a dumb container, it serves a special purpose for menus by providing some infrastructure so that menus can behave properly.

In general, almost anything can be placed in a Toolbar, and mixed with anything else.

Example

The following example shows how to create a Jx.Toolbar instance and place two objects in it.

//myToolbarContainer is the id of a <div> in the HTML page.
function myFunction() {}
var myToolbar = new Jx.Toolbar('myToolbarContainer');

var myButton = new Jx.Button(buttonOptions);

var myElement = document.createElement('select');

myToolbar.add(myButton, new Jx.ToolbarSeparator(), myElement);

Events

addfired when one or more buttons are added to a toolbar
removefired when on eor more buttons are removed from a toolbar

Implements

Options

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
{Array} an array of the things in the toolbar.
{HTMLElement} the HTML element that the toolbar lives in
When a toolbar contains Jx.Menu instances, they want to know if any menu in the toolbar is active and this is how they find out.
Create a new instance of Jx.Toolbar.
add this toolbar to a DOM element automatically creating a toolbar container if necessary
Add an item to the toolbar.
remove an item from a toolbar.
Deactivate the Toolbar (when it is acting as a menu bar).
Indicate if the toolbar is currently active (as a menu bar)
Set the active state of the toolbar (for menus)
For menus, they want to know which menu is currently open.

Properties

items

{Array} an array of the things in the toolbar.

domObj

{HTMLElement} the HTML element that the toolbar lives in

isActive

When a toolbar contains Jx.Menu instances, they want to know if any menu in the toolbar is active and this is how they find out.

Functions

Jx. Toolbar

Create a new instance of Jx.Toolbar.

Parameters

options<Jx.Toolbar.Options>

addTo

addTo: function(parent)

add this toolbar to a DOM element automatically creating a toolbar container if necessary

Parameters

parentthe DOM element or toolbar container to add this toolbar to.

add

add: function( )

Add an item to the toolbar.  If the item being added is a Jx component with a domObj property, the domObj is added.  If the item being added is an LI element, then it is given a CSS class of jxToolItem.  Otherwise, the thing is wrapped in a <Jx.ToolbarItem>.

Parameters

thing{Object} the thing to add.  More than one thing can be added by passing multiple arguments.

remove

remove: function(item)

remove an item from a toolbar.  If the item is not in this toolbar nothing happens

Parameters

item{Object} the object to remove

Returns

{Object} the item that was removed, or null if the item was not removed.

deactivate

deactivate: function()

Deactivate the Toolbar (when it is acting as a menu bar).

isActive

isActive: function()

Indicate if the toolbar is currently active (as a menu bar)

Returns

{Boolean}

setActive

setActive: function(b)

Set the active state of the toolbar (for menus)

Parameters

b{Boolean} the new state

setVisibleItem

setVisibleItem: function(obj)

For menus, they want to know which menu is currently open.

Parameters

obj{Jx.Menu} the menu that just opened.

Jx. TabSet

Extends: Object

Implements: Options, Events

A TabSet manages a set of Jx.Button.Tab content areas by ensuring that only one of the content areas is visible (i.e. the active tab).  TabSet does not manage the actual tabs.  The instances of Jx.Button.Tab that are to be managed as a set have to be added to both a TabSet and a Jx.Toolbar.  The content areas of the Jx.Button.Tabs are sized to fit the content area that the TabSet is managing.

Example

var tabBar = new Jx.Toolbar('tabBar');
var tabSet = new Jx.TabSet('tabArea');

var tab1 = new Jx.Button.Tab('tab 1', {contentID: 'content1'});
var tab2 = new Jx.Button.Tab('tab 2', {contentID: 'content2'});
var tab3 = new Jx.Button.Tab('tab 3', {contentID: 'content3'});
var tab4 = new Jx.Button.Tab('tab 4', {contentURL: 'test_content.html'});

tabSet.add(t1, t2, t3, t4);
tabBar.add(t1, t2, t3, t4);

Events

tabChangethe current tab has changed

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
{Array} array of tabs that are managed by this tab set
{HTMLElement} The HTML element that represents this tab set in the DOM.
Create a new instance of Jx.TabSet within a specific element of the DOM.
Resize the tab set content area and propogate the changes to each of the tabs managed by the tab set.
Add one or more Jx.Button.Tabs to the TabSet.
Remove a tab from this TabSet.
Set the active tab to the one passed to this method

Properties

tabs

{Array} array of tabs that are managed by this tab set

domObj

{HTMLElement} The HTML element that represents this tab set in the DOM.  The content areas of each tab are sized to fill the domObj.

Functions

Jx. TabSet

Create a new instance of Jx.TabSet within a specific element of the DOM.

Parameters

domObj{HTMLElement} an element or id of an element to put the content of the tabs into.
optionsan options object, only event handlers are supported as options at this time.

resizeTabBox

resizeTabBox: function()

Resize the tab set content area and propogate the changes to each of the tabs managed by the tab set.

add

add: function()

Add one or more Jx.Button.Tabs to the TabSet.

Parameters

tab{<Jx.Tab>} an instance of <Jx.Tab> to add to the tab set.  More than one tab can be added by passing extra parameters to this method.

remove

remove: function(tab)

Remove a tab from this TabSet.  Note that it is the caller’s responsibility to remove the tab from the Jx.Toolbar.

Parameters

tab{<Jx.Tab>} the tab to remove.

setActiveTab

setActiveTab: function(tab)

Set the active tab to the one passed to this method

Parameters

tab{Jx.Button.Tab} the tab to make active.

Jx. TabBox

Extends: Object

Implements: Options, Events, Jx.Addable

A convenience class to handle the common case of a single toolbar directly attached to the content area of the tabs.  It manages both a Jx.Toolbar and a Jx.TabSet so that you don’t have to.  If you are using a TabBox, then tabs only have to be added to the TabBox rather than to both a Jx.TabSet and a Jx.Toolbar.

Example

var tabBox = new Jx.TabBox('subTabArea', 'top');

var tab1 = new Jx.Button.Tab('Tab 1', {contentID: 'content4'});
var tab2 = new Jx.Button.Tab('Tab 2', {contentID: 'content5'});

tabBox.add(tab1, tab2);

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
{Jx.Toolbar} the toolbar for this tab box.
{Jx.TabSet} the tab set for this tab box.
Create a new instance of a TabBox.
Add one or more <Jx.Tab>s to the TabBox.
Remove a tab from the TabSet.

Properties

tabBar

{Jx.Toolbar} the toolbar for this tab box.

tabSet

{Jx.TabSet} the tab set for this tab box.

Functions

Jx. TabBox

Create a new instance of a TabBox.

Parameters

options<Jx.TabBox.Options>

add

add : function()

Add one or more <Jx.Tab>s to the TabBox.

Parameters

tab{<Jx.Tab>} an instance of <Jx.Tab> to add to the tab box.  More than one tab can be added by passing extra parameters to this method.  Unlike Jx.TabSet, tabs do not have to be added to a separate Jx.Toolbar.

remove

remove : function(tab)

Remove a tab from the TabSet.

Parameters

tab{<Jx.Tab>} the tab to remove.

Jx. Toolbar. Container

Extends: Object

Implements: Options, Events, Jx.Addable

A toolbar container contains toolbars.  A single toolbar container fills the available space horizontally.  Toolbars placed in a toolbar container do not wrap when they exceed the available space.

Events

addfired when one or more toolbars are added to a container
removefired when one or more toolbars are removed from a container

Implements

Options Events {Jx.Addable}

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
{HTMLElement} the HTML element that the container lives in
Create a new instance of Jx.Toolbar.Container
Add a toolbar to the container.
remove an item from a toolbar.
scrolls an item in one of the toolbars into the currently visible area of the container if it is not already fully visible

Properties

domObj

{HTMLElement} the HTML element that the container lives in

Functions

Jx. Toolbar. Container

Create a new instance of Jx.Toolbar.Container

Parameters

options<Jx.Toolbar.Options>

add

add: function( )

Add a toolbar to the container.

Parameters

toolbar{Object} the toolbar to add.  More than one toolbar can be added by passing multiple arguments.

remove

remove: function(item)

remove an item from a toolbar.  If the item is not in this toolbar nothing happens

Parameters

item{Object} the object to remove

Returns

{Object} the item that was removed, or null if the item was not removed.

scrollIntoView

scrollIntoView: function(item)

scrolls an item in one of the toolbars into the currently visible area of the container if it is not already fully visible

Parameters

itemthe item to scroll.

Jx. Toolbar.Item

Extends: Object

Implements: Options

A helper class to provide a container for something to go into a Jx.Toolbar.

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
{HTMLElement} an element to contain the thing to be placed in the toolbar.
Create a new instance of Jx.Toolbar.Item.

Properties

domObj

{HTMLElement} an element to contain the thing to be placed in the toolbar.

Functions

Jx. Toolbar.Item

Create a new instance of Jx.Toolbar.Item.

Parameters

jxThing{Object} the thing to be contained.

Jx. Toolbar. Separator

Extends: Object

A helper class that represents a visual separator in a Jx.Toolbar

Example

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
{HTMLElement} The DOM element that goes in the Jx.Toolbar
Create a new Jx.Toolbar.Separator

Properties

domObj

{HTMLElement} The DOM element that goes in the Jx.Toolbar

Functions

Jx. Toolbar. Separator

Create a new Jx.Toolbar.Separator

Jx. TreeItem

Extends: Object

Implements: Options, Events

An item in a tree.  An item is a leaf node that has no children.

Jx.TreeItem supports selection via the click event.  The application is responsible for changing the style of the selected item in the tree and for tracking selection if that is important.

Example

Events

clicktriggered when the tree item is clicked

Implements

EventsMooTools Class.Extras
OptionsMooTools Class.Extras

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
{HTMLElement} a reference to the HTML element that is the TreeItem in the DOM
{Object} the folder or tree that this item belongs to
Create a new instance of Jx.TreeItem with the associated options
Clean up the TreeItem and remove all DOM references
Clean up the TreeItem and remove all DOM references
Create a clone of the TreeItem
Update the CSS of the TreeItem’s DOM element in case it has changed position
Called when the DOM element for the TreeItem is clicked, the node is selected.
Get the label associated with a TreeItem
A property of an object has changed, synchronize the state of the TreeItem with the state of the object

Properties

domObj

{HTMLElement} a reference to the HTML element that is the TreeItem in the DOM

owner

{Object} the folder or tree that this item belongs to

Functions

Jx. TreeItem

Create a new instance of Jx.TreeItem with the associated options

Parameters

options<Jx.TreeItem.Options>

finalize

finalize: function()

Clean up the TreeItem and remove all DOM references

finalizeItem

finalizeItem: function()

Clean up the TreeItem and remove all DOM references

clone

clone : function()

Create a clone of the TreeItem

Returns

{Jx.TreeItem} a copy of the TreeItem

update

update : function(shouldDescend)

Update the CSS of the TreeItem’s DOM element in case it has changed position

Parameters

shouldDescend{Boolean} propagate changes to child nodes?

selected

selected : function(e)

Called when the DOM element for the TreeItem is clicked, the node is selected.

Parameters

e{Event} the DOM event

getName

getName : function()

Get the label associated with a TreeItem

Returns

{String} the name

propertyChanged

propertyChanged : function(obj)

A property of an object has changed, synchronize the state of the TreeItem with the state of the object

Parameters

obj{Object} the object whose state has changed

Jx. TreeFolder

Extends: Jx.TreeItem

A Jx.TreeFolder is an item in a tree that can contain other items.  It is expandable and collapsible.

Example

Extends

Jx.TreeItem

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
{HTMLElement} an HTML container for the things inside the folder
{Array} an array of references to the javascript objects that are children of this folder
Create a new instance of Jx.TreeFolder
Clean up a TreeFolder.
Internal method to clean up folder-related stuff.
Create a clone of the TreeFolder
Indicates if a node is the last thing in the folder.
Update the CSS of the TreeFolder’s DOM element in case it has changed position.
append a node at the end of the sub-tree
insert a node after refNode.
remove the specified node from the tree
Replace a node with another node
handle the user clicking on this folder by expanding or collapsing it.
Expands the folder
Collapses the folder
Get a reference to a child node by recursively searching the tree

Properties

subDomObj

{HTMLElement} an HTML container for the things inside the folder

nodes

{Array} an array of references to the javascript objects that are children of this folder

Functions

Jx. TreeFolder

Create a new instance of Jx.TreeFolder

Parameters

options<Jx.TreeFolder.Options> and <Jx.TreeItem.Options>

finalize

finalize: function()

Clean up a TreeFolder.

finalizeFolder

finalizeFolder: function()

Internal method to clean up folder-related stuff.

clone

clone : function()

Create a clone of the TreeFolder

Returns

{Jx.TreeFolder} a copy of the TreeFolder

isLastNode

isLastNode : function(node)

Indicates if a node is the last thing in the folder.

Parameters

node{Jx.TreeItem} the node to check

Returns

{Boolean}

update

update : function(shouldDescend)

Update the CSS of the TreeFolder’s DOM element in case it has changed position.

Parameters

shouldDescend{Boolean} propagate changes to child nodes?

append

append : function(node)

append a node at the end of the sub-tree

Parameters

node{Object} the node to append.

insert

insert : function(node,
refNode)

insert a node after refNode.  If refNode is null, insert at beginning

Parameters

node{Object} the node to insert
refNode{Object} the node to insert before

remove

remove : function(node)

remove the specified node from the tree

Parameters

node{Object} the node to remove

replace

replace: function(newNode,
refNode)

Replace a node with another node

Parameters

newNode{Object} the node to put into the tree
refNode{Object} the node to replace

Returns

{Boolean} true if the replacement was successful.

clicked

clicked : function(e)

handle the user clicking on this folder by expanding or collapsing it.

Parameters

e{Event} the event object

expand

expand : function()

Expands the folder

collapse

collapse : function()

Collapses the folder

findChild

findChild : function(path)

Get a reference to a child node by recursively searching the tree

Parameters

path{Array} an array of labels of nodes to search for

Returns

{Object} the node or null if the path was not found

Jx.Tree

Extends: Jx.TreeFolder

Implements: Jx.Addable

Jx.Tree displays hierarchical data in a tree structure of folders and nodes.

Example

Extends: Jx.TreeFolder

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
Create a new instance of Jx.Tree
Clean up a Jx.Tree instance
Clear the tree of all child nodes
Update the CSS of the Tree’s DOM element in case it has changed position
Append a node at the end of the sub-tree

Functions

Jx.Tree

Create a new instance of Jx.Tree

Parameters

options: options for Jx.Addable

finalize

finalize: function()

Clean up a Jx.Tree instance

clear

clear: function()

Clear the tree of all child nodes

update

update: function(shouldDescend)

Update the CSS of the Tree’s DOM element in case it has changed position

Parameters

shouldDescend{Boolean} propagate changes to child nodes?

append

append: function(node)

Append a node at the end of the sub-tree

Parameters

node{Object} the node to append.

Fusion. Error

General purpose Error object

Fusion. Lib. EventMgr

an internal class for managing generic events.  Classes that wish to publish and trigger events that other objects can listen for need to inherit from Fusion.Lib.EventMgr.

To publish an event, call registerEventID with some unique numeric or string value.  Other objects can then call registerForEvent with the eventID and a function to call when the event is triggered.

To trigger an event, call triggerEvent with the eventID and any additional arguments that should be passed to listeners.

Functions

destroy

destroy: function()

Fusion. Lib. ApplicationDefinition

Utility class to parse an application definition

Summary
array of map groups, parsed from ApplicationDefinition.
array of widget sets (each one corresponding to a map) parsed from the ApplicationDefinition.
A Broker object that can communicate with a MapGuide instance in the case we are running against a MapGuide server
An array of search definitions
An array of search categories
construct a new instance of the ApplicationDefinition object.
start parsing the ApplicationDefinition file.
parse the ApplicationDefinition file into the appropriate Fusion objects
Create the application definition.
return a map widget with the given name
return a map widget with the given id
return the map widget at the given index
return the specified map group from the application definition

Properties

mapGroups

array of map groups, parsed from ApplicationDefinition.  A MapGroup consists of one or more Maps that can be combined into the same OpenLayers Map object

widgetSets

array of widget sets (each one corresponding to a map) parsed from the ApplicationDefinition.

{Object} oBroker

A Broker object that can communicate with a MapGuide instance in the case we are running against a MapGuide server

{Array} searchDefinitions

An array of search definitions

{Array} searchCategories

An array of search categories

Functions

ApplicationDefinition

construct a new instance of the ApplicationDefinition object.  While not enforced, this is intended to be a singleton.

Parameter: sessionId

an optional session id to initialize the application with, passed to the map widgets when they are created.

parse

parse : function()

start parsing the ApplicationDefinition file.  This happens asynchronously since the ApplicationDefinition has to be retrieved from the server or the MapGuide repository.  When parsing is complete, an APPLICATIONDEFINITION_PARSED event will be emitted.  This function returns true if parsing will start, false if it will not (due to a missing application definition for instance).

parseAppDef

parseAppDef: function(json)

parse the ApplicationDefinition file into the appropriate Fusion objects

Parameter: {XmlHttpRequest} xhr

the XmlHttpRequest object

create

create: function()

Create the application definition.  This actually triggers initializing every widget and container.

getMapByName

getMapByName : function(name)

return a map widget with the given name

Parameter: {String} name

The map name to return

Returns: {Object} a map object or null if not found.

getMapById

getMapById : function(id)

return a map widget with the given id

Parameter: {String} id

The map id to return.  ID is distinct from map.name in that id is the id of the HTML tag where the map widget is inserted.

Returns: {Object} a map object or null if not found.

getMapByIndice

getMapByIndice : function(indice)

return the map widget at the given index

Parameter: {String} indice

The map indice to return

Returns: {Object} a map object or null if not found.

getMapGroup

getMapGroup : function(mapGroupId)

return the specified map group from the application definition

Parameter: {String} mapgroup

The id of the MapGroup to return

Returns: {Object} a MapGroup appdef or null if not found.

Fusion. Lib. ApplicationDefinition. MapGroup

Holds an internal representation of MapGroup objects as defined in the AppDef

Fusion. Lib. ApplicationDefinition.Map

Holds an internal representation of Map objects as defined in the AppDef

Fusion. Lib. ApplicationDefinition. WidgetSet

Holds an internal representation of WidgetSet objects as defined in the AppDef

Summary
keep track of live widgets created in this widgetSet
return the map widget for this widget set
create all the things required by this widgetSet, including containers and widgets.
return the map widget from this widget set if the map’s name matches the requested name, or null.

Functions

addWidgetInstance

addWidgetInstance: function(widget)

keep track of live widgets created in this widgetSet

Parameter: {Fusion.Widget} widget

the widget to add

getMapWidget

getMapWidget: function()

return the map widget for this widget set

Returns: {<Fusion.Lib.Map>} a map widget or null

create

create: function(appDef)

create all the things required by this widgetSet, including containers and widgets.

Parameter: {Fusion.Lib.ApplicationDefinition}

the application definition that this widgetSet is part of

getMapByName

getMapByName : function(name)

return the map widget from this widget set if the map’s name matches the requested name, or null.

Parameter: {String} name

The map name to check

Returns: {Object} a map object or null.

Fusion. Lib. ApplicationDefinition. Container

Holds an internal representation of Container objects as defined in the AppDef

Fusion. Lib. ApplicationDefinition. Widget

Holds an internal representation of Widget objects as defined in the AppDef

Summary
creates a new instance of the widget, optionally using a different name during instantiation to accomodate containers

Functions

create

create: function(widgetSet,
widgetName)

creates a new instance of the widget, optionally using a different name during instantiation to accomodate containers

Parameter: name

An optional name to use for the widget, overrides the original name temporarily if passed.

Returns: an instance of the widget represented by this object.

Fusion. Lib. ApplicationDefinition.Item

Holds an internal representation of Menu Item objects as defined in the AppDef

Fusion. Lib. ApplicationDefinition. Flyout

Holds an internal representation of Flyout objects as defined in the AppDef

Fusion. Lib. ApplicationDefinition. Multi

Holds an internal representation of Multi objects as defined in the AppDef

Fusion. Lib. ApplicationDefinition. SearchDefinition

Holds an internal representation of SearchDefinition objects as defined in the AppDef

Fusion. Lib. ApplicationDefinition. SearchJoin

Holds an internal representation of SearchJoin objects as defined in the AppDef

Fusion. Lib. ApplicationDefinition. SearchRule

Holds an internal representation of SearchRule objects as defined in the AppDef

Fusion. Lib. ApplicationDefinition. SearchCondition

Holds an internal representation of SearchCondition objects as defined in the AppDef

Fusion. Lib. MGBroker

MGBroker is used to broker requests to the MapGuide Open Source mapagent interface.  It is a very simple class that is configured with a URL and credentials via the setSiteURL method and can send requests to the server via the dispatchRequest method.

Fusion. Lib. MGRequest

MGRequest is the base class for all broker-compatible requests.  A request is a wrapper around an operation that is supported by the mapagent.

Fusion. Lib. MGRequest. MGEnumerateResources

encapsulate a request to the server to enumerate resources in the library.

Fusion. Lib. MGRequest. MGGetResourceContent

encapsulate a request to the server to get resource contents from the library.

Fusion. Lib. MGRequest. MGGetResourceHeader

encapsulate a request to the server to get resource header from the library.

Fusion. Lib. MGRequest. MGCreateSession

encapsulate a request to the server to create a new session on the server.

Fusion. Lib. MGRequest. MGCopyResource

encapsulate a request to the server to copy a resource.

Fusion. Lib. MGRequest. MGDeleteResource

encapsulate a request to the server to delete a resource.

Fusion. Lib. MGRequest. MGMoveResource

encapsulate a request to the server to move a resource in the repository.

Fusion. Lib. MGRequest. MGMoveResource

encapsulate a request to the server to set the content XML of a resource.

Fusion. Lib. MGRequest. MGDescribeSchema

encapsulate a request to the server to describe the schema of a FeatureSource.

Fusion. Lib. MGRequest. MGGetSpatialContexts

encapsulate a request to the server to retrieve the spatial context of a resource.

Fusion. Lib. MGRequest. MGEnumerateResourceReferences

encapsulate a request to the server to enumerate the references to a resource id.

Fusion. Lib. MGRequest. MGEnumerateResourceData

encapsulate a request to the server to enumerate the data associated with a FeatureSource N.B.  This does not enumerate resource data for ‘unmanaged’ FeatureSources (those referencing files or directories outside the respository) Fusion.Lib.MGRequest.MGDescribeSchema should be used for those sources.

Fusion. Lib. MGRequest. MGGetVisibleMapExtent

encapsulate a request to the server to enumerate the data associated with a FeatureSource N.B.  This does not enumerate resource data for ‘unmanaged’ FeatureSources (those referencing files or directories outside the respository) Fusion.Lib.MGRequest.MGDescribeSchema should be used for those sources.

Fusion. Lib. MGRequest. MGQueryMapFeatures

encapsulate a request to the server to query map features on selectable layers

Fusion. Lib. MGRequest. MGGetFeatureSetEnvelope

encapsulate a request to the server to query map features on selectable layers

Fusion. Widget

This is the base class for all widgets.  It provides some basic functionality that all widgets should need.

Summary
returns the location of this widget relative to the installation of fusion.

Functions

getLocation

getLocation: function()

returns the location of this widget relative to the installation of fusion.  Can be used to construct URLs to resources that the widget needs.

Returns: {String} the location of this widget

Fusion. Tool. Search

The Fusion search mechanism defines a common capability for searches that link individual searches to a common search set maintained for all search-based widgets.  The common search set can be statically and/or dynamically created.  Static definition is done in the WebLayout.  Dynamic creation is done by individual widgets and creating instances of Fusion.Tool.SearchDefinition(s) - or rather a MGSearchDefinition.

Widgets that want to take advantage of this behaviour can sub-class this widget.  Just make sure to initialize properly!

Fusion. Widget.Map

generic class for map widgets.  Provides common utility classes.  This class provides a wrapper around the OpenLayers Map object.

Summary
Callback for when all maps have been loaded
Attaches a context menu as defined in the AppDef to the map
Controls the creation of Layers based on the MapGroup object passed in
Called after each layer is loaded in the OL viewport.
handles mouse wheel events by accummulating the events and setting a timer to do the actual zoom in/out
Carries out the actual map zoom based on the wheel movement
User spun scroll wheel up
User spun scroll wheel down
returns the dom element for this widget
returns the name of the baselayer map
returns the Title of the baselayer map.
returns the server session ID
returns the ID of dom element for this widget
sets options on the OpenLayers map object, a wrapper for the OL function
adds a map/Layer to the map and registers some event handlers on the map
returns the array of map objects
Called to reload all the map objects.
Loads the ScaleRange objects separate from the LoadMap sequence since this also generates sprites and is a relatively expensive operation.
dispatch query requests to the maps
handle selection events from maps and republish for widgets as appropriate
cehck to see if any of the maps have an active selection
clear the selection on all maps
initiates a call to get the current selection asynchronously in case we need to retrieve the details from the server
sets a Selection XML back to the server for each of the maps
accumulate the selection results from each map and when all have reported in, pass the results to the callback function
sets the active layer for selection/manipulation
returns the active layer for selection/manipulation
indicate that a new asynchronous process has started and make sure the visual indicator is visible for the user.
indicate that an asynchronous process has completed and hide the visual indicator if no remaining processes are active.
OpenLayers event handler for whenever the map changes either zoom level of the center has changed.
check to see if there are any outstanding requests to the server
callback for when the browser window size changes, simply calls resize on the map viewport layout object
handles the resizing of the maps and triggers a Fusion event
redraws the map using current extents and zoom level.
sets the background color for the map
handle selection events from maps and republish for widgets as appropriate
1.
gets the intitial extents from all maps with or without including the extent of any Generic/commercial layers
sets the extent of the map to the max as returned by loadMap
returns if the map has finished loading (based on setting the _oCurrentExtent value)
sets the map zoom and extent.
sets the map zoom and extent.
sets the map zoom and extent.
sets the map zoom and extent.
returns the current center of the map view
returns the Extent of the map given a center point and a scale (optional)

Functions

mapLoaded

mapLoaded: function()

Callback for when all maps have been loaded

Parameter: none.

Return: none

setMenu

setMenu: function()

Attaches a context menu as defined in the AppDef to the map

Parameter: none.

Return: none

loadMapGroup

loadMapGroup: function(mapGroup)

Controls the creation of Layers based on the MapGroup object passed in

Parameter: {Object} mapGroupa representation of the MapGroup object

Return: none

layerLoaded

layerLoaded: function()

Called after each layer is loaded in the OL viewport.  Nothing happens here until the last layer is laoded, then it sets the OL baselayer and zooms to the initial extent.

Parameter: none

Return: none

wheelChange

wheelChange: function(evt,
deltaZ)

handles mouse wheel events by accummulating the events and setting a timer to do the actual zoom in/out

Parameters

evt{Event} the mouse wheel event object
deltaZ{Integer} the number of ticks wheeled

doWheelChange

doWheelChange: function(evt,
deltaZ)

Carries out the actual map zoom based on the wheel movement

Parameters

evt{Event} the mouse wheel event object
deltaZ{Integer} the number of ticks wheeled

Return: none

wheelUp

wheelUp: function(evt)

User spun scroll wheel up

Parameters

evt{Event}

wheelDown

wheelDown: function(evt)

User spun scroll wheel down

Parameters

evt{Event}

getDomObj

getDomObj: function()

returns the dom element for this widget

Parameters: none

Return: none

getMapName

getMapName: function()

returns the name of the baselayer map

Parameters: none

Return: {String} the name of the baselayer map

getMapTitle

getMapTitle: function()

returns the Title of the baselayer map.  This is a human-readable title

Parameters: none

Return: {String} the Title of the baselayer map

getSessionID

getSessionID: function()

returns the server session ID

Parameters: none

Return: {String} the session ID

getDomId

getDomId: function()

returns the ID of dom element for this widget

Parameters: none

Return: {String} the id of the DOM element

setMapOptions

setMapOptions: function(options)

sets options on the OpenLayers map object, a wrapper for the OL function

Parameters: {Object} optionshas of option key/value pairs

Return: none

addMap

addMap: function(map)

adds a map/Layer to the map and registers some event handlers on the map

Parameters: {Object} mapthe map object to tbe added (really a layer object)

Return: none

getAllMaps

getAllMaps: function()

returns the array of map objects

Parameters: none

Return: {Array} the array of map Objects

reloadMap

reloadMap: function()

Called to reload all the map objects. this uses setTimeout so this method can be called from an IFRAME

Parameters: none

Return: none

loadScaleRanges

loadScaleRanges: function(userFunc)

Loads the ScaleRange objects separate from the LoadMap sequence since this also generates sprites and is a relatively expensive operation.

Parameters: {Function} userFunca user defined function to be called as a callback

Return: none

query

query: function(options)

dispatch query requests to the maps

Parameters: {object} optionsquery options to be passed to each map

selectionHandler

selectionHandler: function()

handle selection events from maps and republish for widgets as appropriate

Parameters: none

Return: none

hasSelection

hasSelection: function()

cehck to see if any of the maps have an active selection

Returns: {Boolean}true if any map has a selection

clearSelection

clearSelection: function()

clear the selection on all maps

getSelection

getSelection: function(callback,
layers,
startcount)

initiates a call to get the current selection asynchronously in case we need to retrieve the details from the server

setSelection

setSelection: function(selText,
zoomTo)

sets a Selection XML back to the server for each of the maps

Parameters

{String} selTextthe selection string
{Boolean} zoomToif set, will zoom to the selection on completion

accumulateSelection

accumulateSelection: function(map,
oSelection)

accumulate the selection results from each map and when all have reported in, pass the results to the callback function

Parameters

{Object} mapthe map object that has the selection
{Object} oSelectionthe Fusion selection object

setActiveLayer

setActiveLayer: function(oLayer)

sets the active layer for selection/manipulation

Parameters

{Object} oLayerthe layer to be set as active

getActiveLayer

getActiveLayer: function()

returns the active layer for selection/manipulation

Returns

{Object} the active layer

_addWorker

_addWorker: function()

indicate that a new asynchronous process has started and make sure the visual indicator is visible for the user.  This is intended to be used internally by gMap but could be used by external tools if appropriate.

_removeWorker

_removeWorker: function()

indicate that an asynchronous process has completed and hide the visual indicator if no remaining processes are active.  This is intended to be used internally by gMap but could be used by external tools if appropriate.  Only call this function if addWorker was previously called

mapExtentsChanged

mapExtentsChanged: function()

OpenLayers event handler for whenever the map changes either zoom level of the center has changed.  This in turn triggers the Fusion event.

Parameters: none

Return: none

isBusy

isBusy: function()

check to see if there are any outstanding requests to the server

Parameters: none

Return: {Boolean} true if there are active requests

sizeChanged

sizeChanged: function()

callback for when the browser window size changes, simply calls resize on the map viewport layout object

Parameters: none

Return: none

resize

resize: function()

handles the resizing of the maps and triggers a Fusion event

Parameters: none

Return: none

redraw

redraw: function()

redraws the map using current extents and zoom level.  A dummy parameter is added to the map request to ensure the map request is not cached.

Parameters: none

Return: none

setBackgroundColor

setBackgroundColor: function(color)

sets the background color for the map

Parameters: {String} colorthe CSS color value to set as background

Return: none

setExtents

setExtents: function(oExtents)

handle selection events from maps and republish for widgets as appropriate

Parameters: {Object} oExtentsan OpenLayers.Bounds object or an array of 4 values that will be converted to Bounds

Return: none

setInitialExtents

setInitialExtents: function()

determine the initialExtents of the map from (in order of precedence)

1. a URL query parameter called ‘extent’ 2. an <InitialView> specified in the MapGroup in AppDef 3. the maxExtent as specified by the LoadMap call (default)

Returns: {Object} an OpenLayers.Bounds object which is the initial extent

getMapGroupExtent

getMapGroupExtent: function(includeGenericLayers)

gets the intitial extents from all maps with or without including the extent of any Generic/commercial layers

Return: {Object} an OpenLayers.Bounds object which is the initial extent

fullExtents

fullExtents: function()

sets the extent of the map to the max as returned by loadMap

isMapLoaded

isMapLoaded: function()

returns if the map has finished loading (based on setting the _oCurrentExtent value)

Returns {Boolean} true if the map is loaded and extent has been set

zoom

zoom: function(fX,
fY,
nFactor)

sets the map zoom and extent.

Parameters

fX {Float}new x coordinate value in map units
fY {Float}new y coordinate value in map units
nFactor {Float}zoom factor; positive values zoom in, negative out
  • if set to 0 or 1, the map is just recentered
  • if the map has fractional zoom enabled, the map resolution will be modified by this factor
  • with fixed scales, zoom up or down one level, depending on the sign

Returns: none

zoom

zoomToScale: function(fScale)

sets the map zoom and extent.

Parameters

fX {Float}new x coordinate value in map units
fY {Float}new y coordinate value in map units
nFactor {Float}zoom factor; positive values zoom in, negative out
  • if set to 0 or 1, the map is just recentered
  • if the map has fractional zoom enabled, the map resolution will be modified by this factor
  • with fixed scales, zoom up or down one level, depending on the sign

Returns: none

zoom

sets the map zoom and extent.

Parameters

fX {Float}new x coordinate value in map units
fY {Float}new y coordinate value in map units
nFactor {Float}zoom factor; positive values zoom in, negative out
  • if set to 0 or 1, the map is just recentered
  • if the map has fractional zoom enabled, the map resolution will be modified by this factor
  • with fixed scales, zoom up or down one level, depending on the sign

Returns: none

zoom

sets the map zoom and extent.

Parameters

fX {Float}new x coordinate value in map units
fY {Float}new y coordinate value in map units
nFactor {Float}zoom factor; positive values zoom in, negative out
  • if set to 0 or 1, the map is just recentered
  • if the map has fractional zoom enabled, the map resolution will be modified by this factor
  • with fixed scales, zoom up or down one level, depending on the sign

Returns: none

getCurrentCenter

getCurrentCenter: function()

returns the current center of the map view

Return: {Object} an object with the following attributes x - the x coordinate of the center y - the y coordinate of the center

getExtentFromPoint

getExtentFromPoint: function(fX,
fY,
fScale)

returns the Extent of the map given a center point and a scale (optional)

Return: {OpenLayers.Bounds} the bounds for the map centered on a point

Fusion. Layers

Implements Layers for Fusion.

Summary
This function should be called after the map has loaded.
Returns true if the Map has been laoded succesfully form the server

Functions

loadScaleRanges

loadScaleRanges: function(userFunc)

This function should be called after the map has loaded.  It loads the scsle ranges for each layer.  I tis for now only used by the legend widget.

isMapLoaded

isMapLoaded: function()

Returns true if the Map has been laoded succesfully form the server

Fusion. Layers. Group

Implements the map layer groups

Fusion. Layers. Layer

Implements individual map legend layers

Fusion. Layers. ScaleRange

Implements a scale range object

Fusion. Layers. StyleItem

Implements the legend style items to get a legend icon from the server

OpenLayers. Lang[“ca”]

Dictionary for Catalan, UTF8 encoding.  Keys for entries are used in calls to <OpenLayers.Lang.translate>.  Entry bodies are normal strings or strings formatted for use with <OpenLayers.String.format> calls.

OpenLayers. Lang[“cs-CZ”]

Dictionary for Czech.  Keys for entries are used in calls to <OpenLayers.Lang.translate>.  Entry bodies are normal strings or strings formatted for use with <OpenLayers.String.format> calls.

OpenLayers. Lang[“da-DK”]

Dictionary for Danish.  Keys for entries are used in calls to <OpenLayers.Lang.translate>.  Entry bodies are normal strings or strings formatted for use with <OpenLayers.String.format> calls.

OpenLayers. Lang[“de”]

Dictionary for German.  Keys for entries are used in calls to <OpenLayers.Lang.translate>.  Entry bodies are normal strings or strings formatted for use with <OpenLayers.String.format> calls.

OpenLayers. Lang[“en-CA”]

Dictionary for English-CA.  This dictionary inherits from the standard English dictionary.  Override only those entries with language specific to the CA region.

Keys for entries are used in calls to <OpenLayers.Lang.translate>.  Entry bodies are normal strings or strings formatted for use with <OpenLayers.String.format> calls.

OpenLayers. Lang[“en”]

Dictionary for English.  Keys for entries are used in calls to <OpenLayers.Lang.translate>.  Entry bodies are normal strings or strings formatted for use with <OpenLayers.String.format> calls.

OpenLayers. Lang[“es”]

Dictionary for Spanish, UTF8 encoding.  Keys for entries are used in calls to <OpenLayers.Lang.translate>.  Entry bodies are normal strings or strings formatted for use with <OpenLayers.String.format> calls.

OpenLayers. Lang[“fr”]

Dictionary for French.  Keys for entries are used in calls to <OpenLayers.Lang.translate>.  Entry bodies are normal strings or strings formatted for use with <OpenLayers.String.format> calls.

OpenLayers. Lang[“hu”]

Dictionary for Hungarian.  Keys for entries are used in calls to <OpenLayers.Lang.translate>.  Entry bodies are normal strings or strings formatted for use with <OpenLayers.String.format> calls.

OpenLayers. Lang[“it”]

Dictionary for Italian.  Keys for entries are used in calls to <OpenLayers.Lang.translate>.  Entry bodies are normal strings or strings formatted for use with <OpenLayers.String.format> calls.

OpenLayers. Lang[“ja”]

Dictionary for Japanese.  Keys for entries are used in calls to <OpenLayers.Lang.translate>.  Entry bodies are normal strings or strings formatted for use with <OpenLayers.String.format> calls.

OpenLayers. Lang[“nb”]

Dictionary for norwegian bokm�l (Norway).  Keys for entries are used in calls to <OpenLayers.Lang.translate>.  Entry bodies are normal strings or strings formatted for use with <OpenLayers.String.format> calls.

OpenLayers. Lang[“nl”]

Dictionary for Dutch.  Keys for entries are used in calls to <OpenLayers.Lang.translate>.  Entry bodies are normal strings or strings formatted for use with <OpenLayers.String.format> calls.

OpenLayers. Lang[“pt-BR”]

Dictionary for Brazilian Portuguese.  Keys for entries are used in calls to <OpenLayers.Lang.translate>.  Entry bodies are normal strings or strings formatted for use with <OpenLayers.String.format> calls.

OpenLayers. Lang[“sv-SE”]

Dictionary for swedish (Sweden).  Keys for entries are used in calls to <OpenLayers.Lang.translate>.  Entry bodies are normal strings or strings formatted for use with <OpenLayers.String.format> calls.

OpenLayers. Lang[“zh-CN”]

Dictionary for Simplified Chinese.  Keys for entries are used in calls to <OpenLayers.Lang.translate>.  Entry bodies are normal strings or strings formatted for use with <OpenLayers.String.format> calls.

OpenLayers. Lang[“zh-TW”]

Dictionary for Traditional Chinese.  (Used Mainly in Taiwan) Keys for entries are used in calls to <OpenLayers.Lang.translate>.  Entry bodies are normal strings or strings formatted for use with <OpenLayers.String.format> calls.

Fusion. Widget. About

About widget to display a pop-up window about the application.  The contents of the page are come from an HTML page set as the AboutUrl extension property.

Summary
opens a pop-up window with the about information when invoked

Functions

About

Parameters

widgetTagJSON node for this widget from the Application definition

execute

opens a pop-up window with the about information when invoked

Fusion. Widget. ActivityIndicator

AcitivityIndicator is a widget that shows or hides its DOM element based on whether the map widget is busy or not.  The map widget becomes busy when loading maps, reloading maps or redrawing layers.

Fusion. Widget. BasemapSwitcher

A widget to allow selection of the basemaps display under the overlay MapGuide layer Currently, Google Street, Google Satellite, Google Hybrid, Yahoo Street, Yahoo Satellite, Yahoo Hybrid, Bing Street, Bing Satellite and Bing Hybrid is supported.

Fusion. Widget. Buffer

The Buffer widget prompts the user for some inputs and then creates a buffer around the current selection based on those inputs.

This version of the widget is not currently being used.

Use BufferPanel instead.  The 2 widgets will be merged eventually.

Fusion. Widget. BufferPanel

The BufferPanel widget prompts the user for some inputs and then creates a buffer around the current selection based on those inputs.

If the Target property points to TaskPane widget, the task will be listed in the menu list of the TaskPane and loaded there.  Otherwise if the target is an existing IFrame in the page it will be loaded there, otherwise it will open a new window with that name.

Fusion. Widget. CenterSelection

Center the current selection, if any, but maintain the current scale if possible.  Zoom out if not.

Fusion. Widget. ClearSelection

Clears the current selection, if any.

Fusion. Widget. ColorPicker

The user can pick from a palette of web-safe colours or enter a hex value.  The colour selected will be entered into the configured input element.

Fusion. Widget. CursorPosition

Displays the geographic position of the cursor when it is over the map.

Precision (integer, optional)

The number of digits to round the output to.  The geographic location is calculated with arbitrary precision and is often not necessary.  A value of less than 0 means no rounding (the default if parameter is missing).

Template (string, optional)

The format of the output string.  Use {x} and {y} as placeholders for the x and y location.  The default template is:

x: {x}, y: {y}

You can embed HTML in the template, but you must escape any characters that result in illegal HTML.  This would include:

< is &lt;

is &gt;

& is &amp;

So a two-line display would be

x: {x}&lt;br/&gt;y: {y}

Fusion. Widget. EditableScale

The user can manually type in a new scale

Fusion. Widget. ExtentHistory

Maintain and navigate through a history of extents

Fusion. Widget. FeatureInfo

The FeatureInfo widget displays information about selected polygons.

If the Target property points to TaskPane widget, the task will be listed in the menu list of the TaskPane and loaded there.  Otherwise if the target is an existing IFrame in the page it will be loaded there, otherwise it will open a new window with that name.

Fusion. Widget.Help

Display a user help page.

Fusion. Widget. InitialMapView

Restore the map to it’s full extents determined when it was initially loaded.

Fusion. Widget. InvokeScript

Executes an arbitrary piece of JavaScript code

Fusion. Widget. InvokeURL

A widget that will open the configured URL in the target element.

If the Target property points to TaskPane widget, the task will be listed in the menu list of the TaskPane and loaded there.  Otherwise if the target is an existing HTML elementt in the page it will be loaded there, otherwise it will open a new window with that name.

Fusion. Widget. LayerManager

Displays a LayerManager of all the layers in the map as a collapsable tree.

ShowRootFolder (boolean, optional)

This controls whether the tree will have a single root node that contains the name of the map as its label.  By default, the root node does not appear.  Set to “true” or “1” to make the root node appear.

RootFolderIcon: (string, optional)

The url to an image to use for the root folder.  This only has an affect if ShowRootFolder is set to show the root folder.

LayerThemeIcon: (string, optional)

The url to an image toTopography use for layers that are currently themed.

DisabledLayerIcon: (string, optional)

The url to an image to use for layers that are out of scale.

Fusion. Widget. Legend

A widget to display a legend of all layers.

Summary
{String} The default image for DWF layer
{String} The default image for Raster layer
{String} The default image for layers that are currently themed.
{String} The default image for layers that are out of scale.
{String} The default image for the root folder
{String} The default image for layer info
{String} The default image for groupd info

Constants

defaultLayerDWFIcon

{String} The default image for DWF layer

defaultLayerRasterIcon

{String} The default image for Raster layer

defaultLayerThemeIcon

{String} The default image for layers that are currently themed.

defaultDisabledLayerIcon

{String} The default image for layers that are out of scale.

defaultRootFolderIcon

{String} The default image for the root folder

defaultLayerInfoIcon

{String} The default image for layer info

defaultGroupInfoIcon

{String} The default image for groupd info

Fusion. Widget. Legend. LegendRenderer

This is a class designed to help users to create their own renderer for customize the legend.

Summary
{Fusion.Widget.Legend} The parent widget that uses the renderer.
{Groups} The groups of all layers.
Abstract method that have the main purpose to draw the legend.
Abstract method that handle the event: Fusion.Event.MAP_LOADED.
Abstract method that handle the event: Fusion.Event.MAP_RELOADED.
Helper method to obtains the map.

Properties

oLegend

{Fusion.Widget.Legend} The parent widget that uses the renderer.

layerRoot

{Groups} The groups of all layers.

Functions

renderLegend

renderLegend: function()

Abstract method that have the main purpose to draw the legend.  This method should be implemented by all concrete class.

mapLoaded

mapLoaded: function()

Abstract method that handle the event: Fusion.Event.MAP_LOADED.  This method occur only at the first load of the map and should be implemented by all concrete class.

mapReloaded

mapReloaded: function()

Abstract method that handle the event: Fusion.Event.MAP_RELOADED.  This method should be implemented by all concrete class.

getMap

getMap: function()

Helper method to obtains the map.

Returns

{<Fusion.Maps>} The map that uses the SelectionPanel Widget.

Fusion. Widget. Legend. LegendRendererDefault

This class provide a default legend as a collapsable tree.

Summary
{Boolean} This controls whether the tree will have a single root node that contains the name of the map as its label.
{Jx.TreeNode} The current selected node.
{Boolean} Determine if the map is drawn.
{Jx.TreeFolder} The current TreeFolder that the mouse will interact with.
{Boolean} Determine if non-visible layer must be draw in the legend.

Properties

showRootFolder

{Boolean} This controls whether the tree will have a single root node that contains the name of the map as its label.  By default, the root node does not appear.  Set to “true” or “1” to make the root node appear.

currentNode

{Jx.TreeNode} The current selected node.

bIsDrawn

{Boolean} Determine if the map is drawn.

targetFolder

{Jx.TreeFolder} The current TreeFolder that the mouse will interact with.

bIncludeVisToggle

{Boolean} Determine if non-visible layer must be draw in the legend.

Fusion. Widget. LinkToView

A widget that displays a link to the currently displayedd map view.

Fusion. Widget. MapMenu

A widget that displays a selection of maps that can be loaded into the application.  The list of maps is configured in the ApplicationDefinition.

Fusion. Widget. Maptip

Displays tooltips over the map when the mouse is hovered for some time.  You must configure tooltips for each layer using Studio or Web Studio by editing the LayerDefinition Settings and specifying an expression for the tooltip.

Delay (optional)

This is the delay, in milliseconds, that the user must keep the mouse in the same position in order for the maptip to appear.  The default, if not specified, is 350 milliseconds.

Layer (optional, multiple)

This is the name of a layer from the MapDefinition to get the tooltip from.  If no Layer elements are specified, then all layers will be queried and the top-most one will be displayed.  Multiple Layer tags can be added, allowing tooltips to come from different layers.

Fusion. Widget. Measure

The Measure widget allows the user to measure distances or areas on the map in one or more segments.  Area is positive if measured clockwise.

Fusion. Widget. Navigator

A widget that immplements an in-map navigation control with zoom and pan.

Fusion. Widget. OverviewMap

A widget that displays an overview map showing the current view of the primary map.

Fusion. Widget.Pan

A widget that allows for naviagtion by panning

Fusion. Widget. PanOnClick

Pans the map a fixed amount in a particular direction

Fusion. Widget. PanQuery

A widget that combines pan and query functionality.  If the mouse is moved before being released, a pan is performedd, otherwise a query is executed.

Fusion. Widget. Print

Print the current map.

Fusion. Widget. Query

The Query widget prompts the user for some inputs and then executes a query on the map.

If the Target property points to TaskPane widget, the task will be listed in the menu list of the TaskPane and loaded there.  Otherwise if the target is an existing IFrame in the page it will be loaded there, otherwise it will open a new window with that name.

Fusion. Widget. Redline

Allows the user to create a temporary OpenLayers Vector layer and draw POINT, LINE and POLYGON features on that layer.

Fusion. Widget. RefreshMap

Refreshes the current map view without changing zoom or center.

Fusion. Widget. SaveMap

Save the current map image on the client’s computer

usage

DWF format support requires a structure like this in the application definition’s widget tag extension: <Extension> <Format></Format> <ResourceId></ResourceId> <Scale></Scale> </Extension>

Fusion. Widget. Scalebar

A dynamically generated cartographic scalebar

uses JavaScript Scale Bar for MapServer (http://mapserver.commenspace.org/tools/scalebar/

Fusion. Widget. ScalebarDual

A dynamically generated cartographic scalebar that looks like the Google scalebar

Fusion. Widget. Search

A widget that displays a pre-configured search form to the user and then runs the search.  Searches are done on the attributes of specifiedd layers.

uses JavaScript Scale Bar for MapServer (http://mapserver.commenspace.org/tools/scalebar/

Fusion. Widget. Select

perform a selection on map features

Fusion. Widget. SelectPolygon

perform a selection using a polygon

Fusion. Widget. SelectRadius

perform a selection by radius from a point

Fusion. Widget. SelectRadiusValue

A widget to allow the user to specify the radius to use for a SelectRadius widget.

Fusion. Widget. SelectWithin

A widget to perform a selection within a currently selected set of features.

Fusion. Widget. SelectionInfo

Displays the number of features and number of layers in the current selection.

Template (string, optional)

The format of the output string.  Use {layers} and {features} as placeholders for the number of layers and features in the current selection.

You can embed HTML in the template, but you must escape any characters that result in illegal HTML.  This would include:

< is &lt;

is &gt;

& is &amp;

Fusion. Widget. SelectionPanel

A widget to display information about the currently selected set of features.

Summary
{String} The default image for Previous page button.
{String} The default image for Previous page button.

Properties

previousIcon

{String} The default image for Previous page button.

nextIcon

{String} The default image for Previous page button.

Fusion. Widget. SelectionPanel. SelectionRenderer

This is a class designed to help users to create their own renderer for customize display results.

Summary
{Fusion.Widget.SelectionPanel} The parent widget that uses the renderer.
{Array(int)} The index of the current position for pagination.
{int} The number of results per page for pagination.
Constructor for a new Fusion.Widget.SelectionPanel.SelectionRenderer instance.
Helper method to update the aiCurrentIndex array for pagination.
Get the next batches of features.
Get the previous batches of features.
Helper method to obtains the map.
Get a batches of features in a selection.
Abstract method that handle the event: Fusion.Event.MAP_SELECTION_ON.
Abstract method that handle the event: Fusion.Event.MAP_SELECTION_OFF.

Properties

oSelectionPanel

{Fusion.Widget.SelectionPanel} The parent widget that uses the renderer.

aiCurrentIndex

{Array(int)} The index of the current position for pagination.

iResultsPerPage

{int} The number of results per page for pagination.

Functions

Fusion. Widget. SelectionPanel. SelectionRenderer

Constructor for a new Fusion.Widget.SelectionPanel.SelectionRenderer instance.

Parameters

selectionPanel{Fusion.Widget.SelectionPanel} The parent widget that uses the renderer.

updateSelectionObject

Helper method to update the aiCurrentIndex array for pagination.

getNextPage

getNextPage: function(selectionLayer)

Get the next batches of features.  Wrapper of the getPage() method.  This method calcul the startIndex/endIndex of the next batch.

Parameters

selectionLayer{<Fusion.SelectionObject.Layer>} The layer that contains the set of features.

Returns

{Array(Array)} An array of all features with their properties.

getPreviousPage

getPreviousPage: function(selectionLayer)

Get the previous batches of features.  Wrapper of the getPage() method.  This method calcul the startIndex/endIndex of the previous batch.

Parameters

selectionLayer{<Fusion.SelectionObject.Layer>} The layer that contains the set of features.

Returns

{Array(Array)} An array of all features with their properties.

getMap

getMap: function()

Helper method to obtains the map.

Returns

{<Fusion.Maps>} The map that uses the SelectionPanel Widget.

getPage

getPage: function(selectionLayer,
startIndex,
endIndex)

Get a batches of features in a selection.

Parameters

selectionLayer{<Fusion.SelectionObject.Layer>} The layer that contains the set of features.
startIndex{int} The index of the first element.
endIndex{int} The index of the last element.

Returns

{Array(Array)} An array of all features with their properties.

updateSelection

updateSelection: function()

Abstract method that handle the event: Fusion.Event.MAP_SELECTION_ON.  This method should be implemented by all concrete class.

clearSelection

clearSelection: function()

Abstract method that handle the event: Fusion.Event.MAP_SELECTION_OFF.  This method should be implemented by all concrete class.

Fusion. Widget. SelectionPanel. SelectionRendererDefault

This class provide a default behavior for the selection panel.

Fusion. Widget. SelectionPanel. SelectionRendererHorizontal

This class provide a alternate behavior for the selection panel.  Generate a table which have one feature per row.

Fusion. Widget. TaskPane

A utility widget that holds output from other widgets.

Fusion. Widget. Theme

The Theme widget prompts the user for some inputs and then creates a new themed layer based on one of the existing map layers.

If the Target property points to TaskPane widget, the task will be listed in the menu list of the TaskPane and loaded there.  Otherwise if the target is an existing IFrame in the page it will be loaded there, otherwise it will open a new window with that name.

Fusion. Widget. ViewOptions

A widget to allow selection of the display units for various widgets

Fusion. Widget. ViewSize

Display the size of the current view in user-definable units

Fusion. Widget.Zoom

A widget that will zoom the map in or out.

Functions

zoomBox

Parameters

position{OpenLayers.Bounds} or {OpenLayers.Pixel}

Fusion. Widget. ZoomOnClick

Zoom the map by a fixed amount when a button is clicked

Fusion. Widget. ZoomToSelection

Zoom to the current selection, if any

Fusion. Layers. Generic

Implements the map layer for Generic mapping services.

Fusion. Layers. MapGuide

Implements the map widget for MapGuide Open Source services.

Summary
This function should be called after the map has loaded.
Returns an OpenLayers MapGuide layer object
Returns the MapGuide layer object as identified by the layer name
Returns the MapGuide layer object as identified by the layer unique id

Functions

loadScaleRanges

loadScaleRanges: function(userFunc)

This function should be called after the map has loaded.  It loads the scsle ranges for each layer.  I tis for now only used by the legend widget.

createOLLayer

createOLLayer: function(layerName,
bSingleTile,
behavior,
forceAsOverlay)

Returns an OpenLayers MapGuide layer object

getLayerByName

getLayerByName : function(name)

Returns the MapGuide layer object as identified by the layer name

getLayerById

getLayerById : function(id)

Returns the MapGuide layer object as identified by the layer unique id

Fusion. Layers. MapServer

Implementation of the map widget for MapServer CGI interface services

Summary
This function should be called after the map has loaded.

Functions

loadScaleRanges

loadScaleRanges: function(userFunc)

This function should be called after the map has loaded.  It loads the scsle ranges for each layer.  I tis for now only used by the legend widget.

initialize: function(options)
Initialize the Fusion application.
initializeLocale: function(locale)
Initialize the Strings hash with the requested locale.
setLoadState: function(state)
set the current initialization state of the application.
loadQueuedScripts: function()
load any scripts that have been queued for loading.
queueScript: function(url)
Insert a new script into the loading queue.
scriptFailed: function(url)
Called when a script fails to load for some reason.
scriptLoaded: function(url)
a script has loaded.
checkLoadingScripts: function()
check if scripts have loaded.
loadConfig: function()
asynchronously load the application definition.
getConfigCB: function(r)
the server has returned the application configuration file that contains enough information to bootstrap the application.
serverSet: function()
the server has returned the application configuration file that contains enough information to bootstrap the application.
serverFailed: function(r)
the application failed to load the application configuration file.
ajaxRequest: function(scriptURL,
options)
convenience function to issue an XmlHttpRequest to the server relative to the Fusion installation.
ajaxException: function(r,
e)
trap exceptions produced in handling an ajax response.
getXmlAsJson: function(url,
callback)
Convert XML to JSON using a server-side script for requests that aren’t available in JSON.
xml2json: function(callback,
r,
json)
Callback method to convert the XNR response into an actual json object and triggers the call to the callback method
getMapByName: function(name)
return a map widget with the given name
getMapById: function(id)
return a map widget that is associated with the given DOM element by id.
getMapByIndice: function(indice)
return the map widget at the given index if there are more than one map elements specified in the AppDef
getWidgetById: function(id)
return a reference to a widget by the id of the DOM Element that it was created in.
getApplicationURL: function()
returns the applicaiton’s absolute URL minus the filename.html part
getFusionURL: function()
returns the application’s absolute URL minus the filename.html part
getConfigurationItem: function(arch,
key)
returns individual elements out of the Fusion config.json file
getScriptLanguage: function()
Accessor to return the server-side script language
getRedirectScript: function()
Accessor to return the URL of the redirect script
getBroker: function()
Accessor to return the broker object (for MapGuide only).
require: function(url)
Marks a JavaScript file as required which puts it into the queue for loading during Fusion initialization.
reportError: function(o)
Triggers the Fusion.Event.FUSION_ERROR and passes along the error object to the callback functions registered for this event.
unitFromName: function(unit)
returns index into the units array for the given unit name or abbreviation
unitName: function(unit)
Given a unit, this method returns the units name
unitAbbr: function(unit)
Given a unit, this method returns the units abbreviation
toMeter: function(unit,
value)
Converts a length value from native units into meters.
fromMeter: function(unit,
value)
Converts a length value from meters into native units.
convert: function(unitsIn,
unitsOut,
value)
Converts a length value from one unit system into another.
initUnits: function(metersPerUnit)
initializes the meters per unit values when a new map is loaded.
getClosestUnits: function(metersPerUnit)
find the OpenLayers units identifier given the Fusion metersPerUnit value
addWidgetStyleSheet: function(url)
Dynamically load a CSS stylesheet.
parseQueryString: function()
An initialization time function to parse the application URL parameters and stores them in an array.
getQueryParam: function(p)
Returns the query parameter value for a given parameter name
_getScriptLocation: function ()
Return the path to this script for bootstrapping Fusion.
var createSessionId = function()
Pre-create a session to avoid the 401 Unauthorized dialog
_getScriptLocation: function ()
Return the path to this script.
OpenLayers.Util.getElement = function()
This is the old $() from prototype
OpenLayers.Util.removeItem = function(array,
item)
Remove an object from an array.
OpenLayers.Util.clearArray = function(array)
Deprecated.
OpenLayers.Util.indexOf = function(array,
obj)
Seems to exist already in FF, but not in MOZ.
OpenLayers.Util.modifyDOMElement = function(element,
id,
px,
sz,
position,
border,
overflow,
opacity)
Modifies many properties of a DOM element all at once.
OpenLayers.Util.createDiv = function(id,
px,
sz,
imgURL,
position,
border,
overflow,
opacity)
Creates a new div and optionally set some standard attributes.
OpenLayers.Util.createImage = function(id,
px,
sz,
imgURL,
position,
border,
opacity,
delayDisplay)
Creates an img element with specific attribute values.
OpenLayers.Util.setOpacity = function(element,
opacity)
Deprecated.
OpenLayers.Util.onImageLoad = function()
Bound to image load events.
OpenLayers.Util.onImageLoadError = function()
OpenLayers.Util.alphaHack = function()
Checks whether it’s necessary (and possible) to use the png alpha hack which allows alpha transparency for png images under Internet Explorer.
OpenLayers.Util.modifyAlphaImageDiv = function(div,
id,
px,
sz,
imgURL,
position,
border,
sizing,
opacity)
OpenLayers.Util.createAlphaImageDiv = function(id,
px,
sz,
imgURL,
position,
border,
sizing,
opacity,
delayDisplay)
OpenLayers.Util.upperCaseObject = function (object)
Creates a new hashtable and copies over all the keys from the passed-in object, but storing them under an uppercased version of the key at which they were stored.
OpenLayers.Util.applyDefaults = function (to,
from)
Takes an object and copies any properties that don’t exist from another properties, by analogy with OpenLayers.Util.extend() from Prototype.js.
OpenLayers.Util.getParameterString = function(params)
OpenLayers.Util.getImagesLocation = function()
{String} The fully formatted image location string
OpenLayers.Util.Try = function()
Execute functions until one of them doesn’t throw an error.
OpenLayers.Util.getNodes=function(p,
tagName)
These could/should be made namespace aware?
OpenLayers.Util._getNodes=function(nodes,
tagName)
OpenLayers.Util.getTagText = function (parent,
item,
index)
OpenLayers.Util.getXmlNodeValue = function(node)
OpenLayers.Util.mouseLeft = function (evt,
div)
OpenLayers.Util.toFloat = function (number,
precision)
Convenience method to cast an object to a Number, rounded to the desired floating point precision.
OpenLayers.Util.rad = function(x)
OpenLayers.Util.distVincenty=function(p1,
p2)
Given two objects representing points with geographic coordinates, this calculates the distance between those points on the surface of an ellipsoid.
OpenLayers.Util.getParameters = function(url)
Parse the parameters from a URL or from the current page itself into a JavaScript Object.
OpenLayers.Util.getArgs = function(url)
Deprecated.
OpenLayers.Util.createUniqueID = function(prefix)
Create a unique identifier for this session.
OpenLayers.Util.normalizeScale = function (scale)
OpenLayers.Util.getResolutionFromScale = function (scale,
units)
OpenLayers.Util.getScaleFromResolution = function (resolution,
units)
OpenLayers.Util.safeStopPropagation = function(evt)
Deprecated.
OpenLayers.Util.isEquivalentUrl = function(url1,
url2,
options)
Test two URLs for equivalence.
OpenLayers.Util.createUrlObject = function(url,
options)
OpenLayers.Util.removeTail = function(url)
Takes a url and removes everything after the ?
OpenLayers.Util.getBrowserName = function()
{String} A string which specifies which is the current browser in which we are running.
OpenLayers.Util.getRenderedDimensions = function(contentHTML,
size,
options)
Renders the contentHTML offscreen to determine actual dimensions for popup sizing.
OpenLayers.Class = function()
Base class used to construct all other classes.
toString:function()
Return the string representation of a size object
This class represents a longitude and latitude pair
clone:function()
Create a cloned instance of this bounds.
equals:function(bounds)
Test a two bounds for equivalence.
scale: function(ratio,
origin)
Scales the bounds around a pixel or lonlat.
OpenLayers.Bounds.oppositeQuadrant = function(quadrant)
Get the opposite quadrant for a given quadrant string.
hasClass: function(element,
name)
Tests if an element has the given CSS class name.
addClass: function(element,
name)
Add a CSS class name to an element.
removeClass: function(element,
name)
Remove a CSS class name from an element.
toggleClass: function(element,
name)
Remove a CSS class name from an element if it exists.
toString:function()
Return a readable string version of the lonlat
OpenLayers.LonLat.fromString = function(str)
Alternative constructor that builds a new OpenLayers.LonLat from a parameter string
Create a new map location.
toString:function()
Cast this object into a string
Instances of this class represent a width/height pair
This class represents a screen coordinate, in x and y coordinates
destroy: function()
Nullify references and remove event listeners to prevent circular references and memory leaks
clone: function()
{OpenLayers.Icon} A fresh copy of the icon.
Creates an icon, which is an image tag in a div.
setSize: function(size)
setUrl: function(url)
draw: function(px)
Move the div to the given pixel.
erase: function()
Erase the underlying image element.
setOpacity: function(opacity)
Change the icon’s opacity
moveTo: function (px)
move icon to passed in px.
display: function(display)
Hide or show the icon
Instances of this class represent bounding boxes.
fixPadding: function()
To be removed in 3.0, this function merely helps us to deal with the case where the user may have set an integer value for padding, instead of an OpenLayers.Bounds object.
Instances of OpenLayers.Map are interactive maps embedded in a web page.
destroy: function()
nullify references to prevent circular references and memory leaks
draw: function(px)
Constructs the elements that make up the popup.
updatePosition: function()
if the popup has a lonlat and its map members set, then have it move itself to its proper position
moveTo: function(px)
visible: function()
{Boolean} Boolean indicating whether or not the popup is visible
toggle: function()
Toggles visibility of the popup.
show: function()
Makes the popup visible.
hide: function()
Makes the popup invisible.
setSize:function(contentSize)
Used to adjust the size of the popup.
setBackgroundColor:function(color)
Sets the background color of the popup.
setOpacity:function(opacity)
Sets the opacity of the popup.
setBorder:function(border)
Sets the border style of the popup.
setContentHTML:function(contentHTML)
Allows the user to set the HTML content of the popup.
registerImageListeners: function()
Called when an image contained by the popup loaded.
getContentDivPadding: function()
Glorious, oh glorious hack in order to determine the css ‘padding’ of the contentDiv.
addCloseBox: function(callback)
panIntoView: function()
Pans the map such that the popup is totaly viewable (if necessary)
registerEvents:function()
Registers events on the popup.
onmousedown: function (evt)
When mouse goes down within the popup, make a note of it locally, and then do not propagate the mousedown (but do so safely so that user can select text inside)
onmousemove: function (evt)
If the drag was started within the popup, then do not propagate the mousemove (but do so safely so that user can select text inside)
onmouseup: function (evt)
When mouse comes up within the popup, after going down in it, reset the flag, and then (once again) do not propagate the event, but do so safely so that user can select text inside
onclick: function (evt)
Ignore clicks, but allowing default browser handling
onmouseout: function (evt)
When mouse goes out of the popup set the flag to false so that if they let go and then drag back in, we won’t be confused.
ondblclick: function (evt)
Ignore double-clicks, but allowing default browser handling
Base class for format reading/writing a variety of formats.
abort: function(response)
Abort an ongoing request.
Vector features use the OpenLayers.Geometry classes as geometry description.
success: function()
setExtent: function(extent,
resolutionChanged)
Set the visible part of the layer.
setSize: function(size)
Sets the size of the drawing surface.
getResolution: function()
Uses cached copy of resolution if available to minimize computing
drawFeature: function(feature,
style)
Draw the feature.
drawGeometry: function(geometry,
style,
featureId)
Draw a geometry.
drawText: function(featureId,
style,
location)
Function for drawing text labels.
removeText: function(featureId)
Function for removing text labels.
clear: function()
Clear all vectors from the renderer.
getFeatureIdFromEvent: function(evt)
Returns a feature id from an event on the renderer.
eraseFeatures: function(features)
This is called by the layer to erase features
eraseGeometry: function(geometry)
Remove a geometry from the renderer (by id).
moveRoot: function(renderer)
moves this renderer’s root to a (different) renderer.
getRenderLayerId: function()
Gets the layer that this renderer’s output appears on.
Instances of OpenLayers.Layer.Vector are used to render vector data from a variety of sources.
setLayer: function(layer)
Called to set the layer property.
{OpenLayers.Layer.Vector} The layer this strategy belongs to.
activate: function()
Activate the strategy.
deactivate: function()
Deactivate the strategy.
Base class to construct a higher-level handler for event sequences.
destroy: function ()
The destroy method is used to perform any clean up before the control is dereferenced.
setMap: function(map)
Set the map property for the control.
draw: function (px)
The draw method is called when the control is ready to be displayed on the page.
moveTo: function (px)
Sets the left and top style attributes to the passed in pixel coordinates.
activate: function ()
Explicitly activates a control and it’s associated handler if one has been set.
deactivate: function ()
Deactivates a control and it’s associated handler if any.
moveTo: function(px)
Since the popup is moving to a new px, it might need also to be moved relative to where the marker is.
calculateRelativePosition:function(px)
updateRelativePosition: function()
The popup has been moved to a new relative location, so we may want to make some cosmetic adjustments to it.
calculateNewPx:function(px)
eraseGeometry: function(geometry)
Erase a geometry from the renderer.
setExtent: function(extent)
Set the visible part of the layer.
setSize: function(size)
Sets the size of the drawing surface.
drawFeature: function(feature,
style)
Draw the feature.
drawGeometry: function(geometry,
style)
Used when looping (in redraw) over the features; draws the canvas.
drawExternalGraphic: function(pt,
style)
Called to draw External graphics.
setCanvasStyle: function(type,
style)
Prepare the canvas for drawing by setting various global settings.
drawPoint: function(geometry,
style)
This method is only called by the renderer itself.
drawLineString: function(geometry,
style)
This method is only called by the renderer itself.
drawLinearRing: function(geometry,
style)
This method is only called by the renderer itself.
drawPolygon: function(geometry,
style)
This method is only called by the renderer itself.
drawText: function(location,
style)
This method is only called by the renderer itself.
getLocalXY: function(point)
transform geographic xy into pixel xy
clear: function()
Clear all vectors from the renderer.
getFeatureIdFromEvent: function(evt)
Returns a feature id from an event on the renderer.
eraseFeatures: function(features)
This is called by the layer to erase features; removes the feature from the list, then redraws the layer.
redraw: function()
The real ‘meat’ of the function: any time things have changed, redraw() can be called to loop over all the data and (you guessed it) redraw it.
determineZIndex: function(node)
Determine the z-index for the current node if there isn’t one, and set the maximum value if we’ve found a new maximum.
Z_ORDER: function(indexer,
newNode,
nextNode)
This compare method is used by other comparison methods.
destroy: function()
clear: function()
Remove all the elements from the root
getNodeType: function(geometry,
style)
This function is in charge of asking the specific renderer which type of node to create for the given geometry and style.
drawGeometry: function(geometry,
style,
featureId)
Draw the geometry, creating new nodes, setting paths, setting style, setting featureId on the node.
redrawNode: function(id,
geometry,
style,
featureId)
redrawBackgroundNode: function(id,
geometry,
style,
featureId)
Redraws the node using special ‘background’ style properties.
drawGeometryNode: function(node,
geometry,
style)
Given a node, draw a geometry on the specified layer.
postDraw: function(node)
Things that have do be done after the geometry node is appended to its parent node.
drawPoint: function(node,
geometry)
Virtual function for drawing Point Geometry.
drawLineString: function(node,
geometry)
Virtual function for drawing LineString Geometry.
drawLinearRing: function(node,
geometry)
Virtual function for drawing LinearRing Geometry.
drawPolygon: function(node,
geometry)
Virtual function for drawing Polygon Geometry.
drawRectangle: function(node,
geometry)
Virtual function for drawing Rectangle Geometry.
drawCircle: function(node,
geometry)
Virtual function for drawing Circle Geometry.
drawSurface: function(node,
geometry)
Virtual function for drawing Surface Geometry.
removeText: function(featureId)
Removes a label
getFeatureIdFromEvent: function(evt)
eraseGeometry: function(geometry)
Erase a geometry from the renderer.
nodeFactory: function(id,
type)
Create new node of the specified type, with the (optional) specified id.
nodeTypeCompare: function(node,
type)
createNode: function(type,
id)
moveRoot: function(renderer)
moves this renderer’s root to a different renderer.
getRenderLayerId: function()
Gets the layer that this renderer’s output appears on.
isComplexSymbol: function(graphicName)
Determines if a symbol cannot be rendered using drawCircle
activate: function()
Activate the strategy: load data or add listener to load when visible
deactivate: function()
Deactivate the strategy.
load: function(options)
Tells protocol to load data and unhooks the visibilitychanged event
merge: function(resp)
Add all features to the layer.
play: function()
Calls the appropriate easing method
easeIn: function(t,
b,
c,
d)
easeOut: function(t,
b,
c,
d)
easeInOut: function(t,
b,
c,
d)
easeIn: function(t,
b,
c,
d)
easeOut: function(t,
b,
c,
d)
easeInOut: function(t,
b,
c,
d)
easeIn: function(t,
b,
c,
d)
easeOut: function(t,
b,
c,
d)
easeInOut: function(t,
b,
c,
d)
setMap: function(map)
Set the map property for the control.
setCenter: function()
As soon as a baseLayer has been loaded, we center and zoom ...and remove the handler.
configureLayers: function()
As soon as all the layers are loaded, cycle through them and hide or show them.
draw: function(px)
_addButton:function(id,
img,
xy,
sz)
_removeButton: function(btn)
removeButtons: function()
doubleClick: function (evt)
buttonDown: function (evt)
draw: function()
{DOMElement}
getBarLen: function(maxLen)
Given a number, round it down to the nearest 1,2,5 times a power of 10.
update: function()
Update the size of the bars, and the labels they contain.
element: function(event)
Cross browser event element detection.
isLeftClick: function(event)
Determine whether event was caused by a left click.
isRightClick: function(event)
Determine whether event was caused by a right mouse click.
stop: function(event,
allowDefault)
Stops an event from propagating.
findElement: function(event,
tagName)
observe: function(elementParam,
name,
observer,
useCapture)
stopObservingElement: function(elementParam)
Given the id of an element to stop observing, cycle through the element’s cached observers, calling stopObserving on each one, skipping those entries which can no longer be removed.
_removeElementObservers: function(elementObservers)
stopObserving: function(elementParam,
name,
observer,
useCapture)
unloadCache: function()
Cycle through all the element entries in the events cache and call stopObservingElement on each.
attachToElement: function (element)
on: function(object)
Convenience method for registering listeners with a common scope.
un: function(object)
Convenience method for unregistering listeners with a common scope.
remove: function(type)
Remove all listeners for a given event type.
handleBrowserEvent: function (evt)
Basically just a wrapper to the triggerEvent() function, but takes care to set a property ‘xy’ on the event with the current mouse position.
getMousePosition: function (evt)
read: function(data)
Read data from a string, and return an object whose type depends on the subclass.
write: function(object)
Accept an object, and return a string.
draw: function(px)
updateRelativePosition: function()
The popup has been moved to a new relative location, in which case we will want to re-do the rico corners.
setBorder:function(border)
Always sets border to 0.
setRicoCorners:function()
Update RICO corners according to the popup’s current relative postion.
getCornersToRound:function()
{String} The proper corners string (“tr tl bl br”) for rico to round.
toString: function()
Convert projection to string (getCode wrapper).
equals: function(projection)
Test equality of two projection instances.
destroy: function()
Destroy projection object.
inValidRange: function(x,
y,
xyOnly)
See #669 for more information
setExtent: function(extent,
resolutionChanged)
translate: function(x,
y)
Transforms the SVG coordinate system
setSize: function(size)
Sets the size of the drawing surface.
getNodeType: function(geometry,
style)
setStyle: function(node,
style,
options)
Use to set all the style attributes to a SVG node.
dashStyle: function(style,
widthFactor)
createNode: function(type,
id)
nodeTypeCompare: function(node,
type)
createRenderRoot: function()
{DOMElement} The specific render engine’s root element
createRoot: function(suffix)
createDefs: function()
{DOMElement} The element to which we’ll add the symbol definitions
drawPoint: function(node,
geometry)
This method is only called by the renderer itself.
drawCircle: function(node,
geometry,
radius)
This method is only called by the renderer itself.
drawLineString: function(node,
geometry)
This method is only called by the renderer itself.
drawLinearRing: function(node,
geometry)
This method is only called by the renderer itself.
drawPolygon: function(node,
geometry)
This method is only called by the renderer itself.
drawRectangle: function(node,
geometry)
This method is only called by the renderer itself.
drawSurface: function(node,
geometry)
This method is only called by the renderer itself.
drawText: function(featureId,
style,
location)
This method is only called by the renderer itself.
clipLine: function(badComponent,
goodComponent)
Given two points (one inside the valid range, and one outside), clips the line betweeen the two points so that the new points are both inside the valid range.
getShortString: function(point)
getPosition: function(node)
Finds the position of an svg node.
importSymbol: function (graphicName)
add a new symbol definition from the rendererer’s symbol hash
setExtent: function(extent,
resolutionChanged)
Set the renderer’s extent
setSize: function(size)
Set the size of the drawing surface
getNodeType: function(geometry,
style)
Get the node type for a geometry and style
setStyle: function(node,
style,
options,
geometry)
Use to set all the style attributes to a VML node.
graphicRotate: function(node,
xOffset,
yOffset)
If a point is to be styled with externalGraphic and rotation, VML fills cannot be used to display the graphic, because rotation of graphic fills is not supported by the VML implementation of Internet Explorer.
postDraw: function(node)
Some versions of Internet Explorer seem to be unable to set fillcolor and strokecolor to “none” correctly before the fill node is appended to a visible vml node.
setNodeDimension: function(node,
geometry)
Get the geometry’s bounds, convert it to our vml coordinate system, then set the node’s position, size, and local coordinate system.
dashStyle: function(style)
createNode: function(type,
id)
Create a new node
nodeTypeCompare: function(node,
type)
Determine whether a node is of a given type
createRenderRoot: function()
Create the renderer root
createRoot: function(suffix)
Create the main root element
drawPoint: function(node,
geometry)
Render a point
drawCircle: function(node,
geometry,
radius)
Render a circle.
drawLineString: function(node,
geometry)
Render a linestring.
drawLinearRing: function(node,
geometry)
Render a linearring
drawPolygon: function(node,
geometry)
Render a polygon
drawRectangle: function(node,
geometry)
Render a rectangle
drawText: function(featureId,
style,
location)
This method is only called by the renderer itself.
drawSurface: function(node,
geometry)
moveRoot: function(renderer)
moves this renderer’s root to a different renderer.
importSymbol: function (graphicName)
add a new symbol definition from the rendererer’s symbol hash
Constructor for a new OpenLayers.Tile instance.
unload: function()
Call immediately before destroying if you are listening to tile events, so that counters are properly handled if tile is still loading at destroy-time.
clone: function (obj)
draw: function()
Clear whatever is currently in the tile, then return whether or not it should actually be re-drawn.
moveTo: function (bounds,
position,
redraw)
Reposition the tile.
clear: function()
Clear the tile of any bounds/position-related data so that it can be reused in a new location.
getBoundsFromBaseLayer: function(position)
Take the pixel locations of the corner of the tile, and pass them to the base layer and ask for the location of those pixels, so that displaying tiles over Google works fine.
showTile: function()
Show the tile only if it should be drawn.
show: function()
Show the tile.
hide: function()
Hide the tile.
Contains public functions, grouped by namespace prefix, that will be applied when a namespaced node is found matching the function name.
setNamespace: function(alias,
uri)
Set a namespace alias and URI for the format.
createElementNSPlus: function(name,
options)
Shorthand for creating namespaced elements with optional attributes and child text nodes.
setAttributes: function(node,
obj)
Set multiple attributes given key value pairs from an object.
readNode: function(node,
obj)
Shorthand for applying one of the named readers given the node namespace and local name.
readChildNodes: function(node,
obj)
Shorthand for applying the named readers to all children of a node.
writeNode: function(name,
obj,
parent)
Shorthand for applying one of the named writers and appending the results to a node.
getThisOrNextEl: function(node,
name,
uri)
Return this node or the next element node.
setMap: function (map)
checkModifiers: function (evt)
Check the keyMask on the handler.
callback: function (name,
args)
Trigger the control’s named callback with the given arguments
register: function (name,
method)
register an event on the map
unregister: function (name,
method)
unregister an event from the map
setEvent: function(evt)
With each registered browser event, the handler sets its own evt property.
destroy: function ()
Deconstruct the handler.
Controls affect the display or behavior of the map.
A popup is a small div that can opened and closed on the map.
setLayerZIndex: function (layer,
zIdx)
resetLayersZIndex: function()
Reset each layer’s z-index based on layer’s array index
addControlToMap: function (control,
px)
getCurrentSize: function()
{OpenLayers.Size} A new OpenLayers.Size object with the dimensions of the map div
calculateBounds: function(center,
resolution)
moveTo: function(lonlat,
zoom,
options)
centerLayerContainer: function (lonlat)
This function takes care to recenter the layerContainerDiv.
isValidZoomLevel: function(zoomLevel)
isValidLonLat: function(lonlat)
getLonLatFromViewPortPx: function (viewPortPx)
getLonLatFromLayerPx: function (px)
The icon represents a graphical icon on the screen.
draw: function(px)
Calls draw on the icon, and returns that output.
erase: function()
Erases any drawn elements for this marker.
moveTo: function (px)
Move the marker to the new location.
onScreen:function()
{Boolean} Whether or not the marker is currently visible on screen.
inflate: function(inflate)
Englarges the markers icon by the specified ratio.
setOpacity: function(opacity)
Change the opacity of the marker by changin the opacity of its icon
setUrl: function(url)
Change URL of the Icon Image.
display: function(display)
Hide or show the icon
OpenLayers.Marker.defaultIcon = function()
Creates a default OpenLayers.Icon.
This is a class designed to designate a single tile, however it is explicitly designed to do relatively little.
Constructor for a new OpenLayers.Tile.Image instance.
clone: function (obj)
draw: function()
Check that a tile should be drawn, and draw it.
resetBackBuffer: function()
Triggered by two different events, layer loadend, and tile loadend.
renderTile: function()
Internal function to actually initialize the image tile, position it correctly, and set its url.
positionImage: function()
Using the properties currenty set on the layer, position the tile correctly.
clear: function()
Clear the tile of any bounds/position-related data so that it can be reused in a new location.
initImgDiv: function()
Creates the imgDiv property on the tile.
checkImgURL: function ()
Make sure that the image that just loaded is the one this tile is meant to display, since panning/zooming might have changed the tile’s URL in the meantime.
startTransition: function()
This method is invoked on tiles that are backBuffers for tiles in the grid.
show: function()
Show the tile by showing its frame.
hide: function()
Hide the tile by hiding its frame.
draw: function()
Render the control in the browser.
baseLayerDraw: function()
rectDrag: function(px)
Handle extent rectangle drag
mapDivClick: function(evt)
Handle browser events
maximizeControl: function(e)
Unhide the control.
minimizeControl: function(e)
Hide all the contents of the control, shrink the size, add the maximize icon
showToggle: function(minimize)
Hide/Show the toggle depending on whether the control is minimized
update: function()
Update the overview map after layers move.
isSuitableOverview: function()
Determines if the overview map is suitable given the extent and resolution of the main map.
createMap: function()
Construct the map that this control contains
updateRectToMap: function()
Updates the extent rectangle position and size to match the map extent
updateMapToRect: function()
Updates the map extent to match the extent rectangle position and size
setRectPxBounds: function(pxBounds)
Set extent rectangle pixel bounds.
getRectBoundsFromMapBounds: function(lonLatBounds)
Get the rect bounds from the map bounds.
getMapBoundsFromRectBounds: function(pxBounds)
Get the map bounds from the rect bounds.
getLonLatFromOverviewPx: function(overviewMapPx)
Get a map location from a pixel location
getOverviewPxFromLonLat: function(lonlat)
Get a pixel location from a map location
Instances of OpenLayers.Marker are a combination of a OpenLayers.LonLat and an OpenLayers.Icon.
destroy: function()
nullify references to prevent circular references and memory leaks
onScreen:function()
{Boolean} Whether or not the feature is currently visible on screen (based on its ‘lonlat’ property)
createMarker: function()
Based on the data associated with the Feature, create and return a marker object.
destroyMarker: function()
Destroys marker.
createPopup: function(closeBox)
Creates a popup object created from the ‘lonlat’, ‘popupSize’, and ‘popupContentHTML’ properties set in this.data.
destroyPopup: function()
Destroys the popup created via createPopup.
delayedCall: function(evt)
Sets timerId to null.
mouseup: function (evt)
Handle mouseup.
rightclick: function(evt)
Handle rightclick.
delayedRightCall: function(evt)
Sets rightclickTimerId to null.
{Number} The id of the right mouse timeout waiting to clear the delayedEvent.
dblclick: function(evt)
Handle dblclick.
click: function(evt)
Handle click.
passesTolerance: function(evt)
Determine whether the event is within the optional pixel tolerance.
clearTimer: function()
Clear the timer and set timerId to null.
{Number} The id of the timeout waiting to clear the delayedCall.
down: function(evt)
This method is called during the handling of the mouse down event.
move: function(evt)
This method is called during the handling of the mouse move event.
up: function(evt)
This method is called during the handling of the mouse up event.
out: function(evt)
This method is called during the handling of the mouse out event.
mousedown: function (evt)
Handle mousedown events
mousemove: function (evt)
Handle mousemove events
removeTimeout: function()
Private.
mouseup: function (evt)
Handle mouseup events
mouseout: function (evt)
Handle mouseout events
click: function (evt)
The drag handler captures the click event.
activate: function()
Activate the handler.
deactivate: function()
Deactivate the handler.
mousedown: function(evt)
Handle mouse down.
mouseup: function(evt)
Handle mouse up.
click: function(evt)
Handle click.
mousemove: function(evt)
Handle mouse moves.
dblclick: function(evt)
Handle dblclick.
geometryTypeMatches: function(feature)
Return true if the geometry type of the passed feature matches one of the geometry types in the geometryTypes array.
handle: function(evt)
triggerCallback: function(type,
mode,
args)
Call the callback keyed in the event map with the supplied arguments.
activate: function()
Turn on the handler.
deactivate: function()
Turn off the handler.
moveLayerToTop: function()
Moves the layer for this handler to the top, so mouse events can reach it.
moveLayerBack: function()
Moves the layer back to the position determined by the map’s layers array.
mousemove: function(evt)
Called when the mouse moves on the map.
mouseout: function(evt)
Called when the mouse goes out of the map.
passesTolerance: function(px)
Determine whether the mouse move is within the optional pixel tolerance.
clearTimer: function()
Clear the timer and set timerId to null.
delayedCall: function(evt)
Triggers pause callback.
destroy: function()
onWheelEvent: function(e)
Catch the wheel event and handle it xbrowserly
wheelZoom: function(e)
Given the wheel event, we carry out the appropriate zooming in or out, based on the ‘wheelDelta’ or ‘detail’ property of the event.
mousemove: function (evt)
Update the stored mousePosition on every move.
activate: function (evt)
deactivate: function (evt)
destroy: function(setNewBaseLayer)
Destroy is a destructor: this is to alleviate cyclic references which the Javascript garbage cleaner can not take care of on its own.
clone: function (obj)
moveTo:function(bounds,
zoomChanged,
dragging)
setMap: function(map)
Set the map property for the layer.
afterAdd: function()
Called at the end of the map.addLayer sequence.
initResolutions: function()
This method’s responsibility is to set up the ‘resolutions’ array for the layer -- this array is what the layer will use to interface between the zoom levels of the map and the resolution display of the layer.
getDataExtent: function ()
Calculates the max extent which includes all of the data for the layer.
getZIndex: function ()
{Integer} the z-index of this layer
setZIndex: function (zIndex)
adjustBounds: function (bounds)
This function will take a bounds, and if wrapDateLine option is set on the layer, it will return a bounds which is wrapped around the world.
destroy: function()
setBorder: function (color,
width)
Allow the user to change the box’s color and border width
draw: function(px,
sz)
onScreen:function()
{Boolean} Whether or not the marker is currently visible on screen.
display: function(display)
Hide or show the icon
OpenLayers.nullHandler = function(request)
@param {} request
OpenLayers.parseXMLString = function(text)
Parse XML into a doc structure
emptyFunction: function ()
getTransport: function()
{Object} Transport mechanism for whichever browser we’re in, or false if none available.
register: function(responderToAdd)
unregister: function(responderToRemove)
dispatch: function(callback,
request,
transport)
onCreate: function()
onComplete: function()
request: function(url)
onStateChange: function()
setRequestHeaders: function()
success: function()
{Boolean} -
getStatus: function()
respondToReadyState: function(readyState)
getHeader: function(name)
dispatchException: function(exception)
If the optional onException function is set, execute it and then dispatch the call to any other listener registered for onException.
getResponseHeader: function(name)
OpenLayers.Ajax.getElementsByTagNameNS = function(parentnode,
nsuri,
nsprefix,
tagname)
OpenLayers.Ajax.serializeXMLToString = function(xmldom)
Wrapper function around XMLSerializer, which doesn’t exist/work in IE/Safari.
draw: function()
Creates a Drag handler, using panMap and panMapDone as callbacks.
panMap: function(xy)
panMapDone: function(xy)
Finish the panning operation.
destroy: function()
nullify references to prevent circular references and memory leaks
clone: function ()
Create a clone of this vector feature.
onScreen:function(boundsOnly)
Determine whether the feature is within the map viewport.
createMarker: function()
destroyMarker: function()
createPopup: function()
atPoint: function(lonlat,
toleranceLon,
toleranceLat)
Determins whether the feature intersects with the specified location.
destroyPopup: function()
move: function(location)
Moves the feature and redraws it at its new location
toState: function(state)
Sets the new state
The drag handler is used to deal with sequences of browser events related to dragging.
setMap: function (map)
startBox: function (xy)
moveBox: function (xy)
endBox: function(end)
removeBox: function()
Remove the zoombox from the screen and nullify our reference to it.
activate: function ()
deactivate: function ()
Point geometry class.
down: function(evt)
Start drawing a new feature
move: function(evt)
Respond to drag move events
up: function(evt)
Finish drawing the feature
out: function(evt)
Finish drawing the feature.
createGeometry: function()
Create the new polygon geometry.
modifyGeometry: function()
Modify the polygon geometry in place.
calculateAngle: function(point,
evt)
Calculate the angle based on settings.
finalize: function()
Finish the geometry and call the “done” callback.
callback: function (name,
args)
Trigger the control’s named callback with the given arguments
setMap: function(map)
Set the map property for the layer.
loadWarningMessage:function()
If we can’t load the map lib, then display an error message to the user and tell them where to go for help.
getWarningHTML:function()
To be implemented by subclasses.
display: function(display)
Set the display on the pane
setZIndex: function (zIndex)
Set the z-index order for the pane.
moveTo:function(bounds,
zoomChanged,
dragging)
Handle calls to move the layer.
getLonLatFromViewPortPx: function (viewPortPx)
Get a map location from a pixel location
getViewPortPxFromLonLat: function (lonlat)
Get a pixel location from a map location
getOLLonLatFromMapObjectLonLat: function(moLonLat)
Get an OL style map location from a 3rd party style map location
getMapObjectLonLatFromOLLonLat: function(olLonLat)
Get a 3rd party map location from an OL map location.
getOLPixelFromMapObjectPixel: function(moPixel)
Get an OL pixel location from a 3rd party pixel location.
getMapObjectPixelFromOLPixel: function(olPixel)
Get a 3rd party pixel location from an OL pixel location
initResolutions: function()
Populate the resolutions array
getZoomForResolution: function(resolution)
Get the zoom level for a given resolution
getOLZoomFromMapObjectZoom: function(moZoom)
Get the OL zoom index from the map object zoom level
getMapObjectZoomFromOLZoom: function(olZoom)
Get the map object zoom level from the OL zoom level
selectUrl: function(paramString,
urls)
selectUrl() implements the standard floating-point multiplicative hash function described by Knuth, and hashes the contents of the given param string into a float between 0 and 1.
getFullRequestString:function(newParams,
altUrl)
Combine url with layer’s params and these newParams.
moveTo:function(bounds,
zoomChanged,
dragging)
clearMarkers: function()
This method removes all markers from a layer.
drawMarker: function(marker)
Calculate the pixel location for the marker, create it, and add it to the layer’s div
getExtent: function()
Get the map’s extent.
initMercatorParameters: function()
Set up the mercator parameters on the layer: resolutions, projection, units.
projectForward: function(point)
Given an object with x and y properties in EPSG:4326, modify the x,y properties on the object to be the Spherical Mercator projected coordinates.
projectInverse: function(point)
Given an object with x and y properties in Spherical Mercator, modify the x,y properties on the object to be the unprojected coordinates.
drawFeature: function(geometry)
updateHandler: function(handler,
options)
measureComplete: function(geometry)
Called when the measurement sketch is done.
measurePartial: function(point,
geometry)
Called each time a new point is added to the measurement sketch.
measure: function(geometry,
eventType)
getBestArea: function(geometry)
Based on the displaySystem returns the area of a geometry.
{String} Display system for output measurements.
getArea: function(geometry,
units)
getBestLength: function(geometry)
Based on the displaySystem returns the length of a geometry.
getLength: function(geometry,
units)
draw: function()
zoomBox: function (position)
read: function(wkt)
Deserialize a WKT string and return a vector feature or an array of vector features.
write: function(features)
Serialize a feature or array of features into a WKT string.
loadMapObject:function()
Load the GMap and register appropriate event listeners.
setMapType: function()
The map has been centered, and a map type was specified, so we set the map type on the gmap object, then unregister the listener so that we dont keep doing this every time the map moves.
display: function(display)
Hide or show the layer
addContainerPxFunction: function()
Hack-on function because GMAPS does not give it to us
clearGrid:function()
Go through and remove all tiles from the grid, calling destroy() on each of them to kill circular references
moveTo:function(bounds,
zoomChanged,
dragging)
This function is called whenever the map is moved.
getGridBounds: function()
Deprecated.
initSingleTile: function(bounds)
calculateGridLayout: function(bounds,
extent,
resolution)
Generate parameters for the grid layout.
initGriddedTiles:function(bounds)
spiralTileLoad: function()
Starts at the top right corner of the grid and proceeds in a spiral towards the center, adding tiles one at a time to the beginning of a queue.
addTileMonitoringHooks: function(tile)
This function takes a tile as input and adds the appropriate hooks to the tile so that the layer can keep track of the loading tiles.
removeTileMonitoringHooks: function(tile)
This function takes a tile as input and removes the tile hooks that were added in addTileMonitoringHooks()
moveGriddedTiles: function(bounds)
shiftRow:function(prepend)
Shifty grid work
shiftColumn: function(prepend)
Shift grid work in the other dimension
removeExcessTiles: function(rows,
columns)
When the size of the map or the buffer changes, we may need to remove some excess rows and columns.
onMapResize: function()
For singleTile layers, this will set a new tile size according to the dimensions of the map pane.
loadMapObject:function()
onMapResize: function()
loadMapObject:function()
onMapResize: function()
fixYahooEventPane: function()
The map has been centered, so the mysterious yahoo eventpane has been added.
createCallback: function(method,
response,
options)
Returns a function that applies the given public method with resp and options arguments.
handleRead: function(resp,
options)
Individual callbacks are created for read, create and update, should a subclass need to override each one separately.
handleCreate: function(resp,
options)
Called the the request issued by create is complete.
handleUpdate: function(resp,
options)
Called the the request issued by update is complete.
handleDelete: function(resp,
options)
Called the the request issued by delete is complete.
handleResponse: function(resp,
options)
Called by CRUD specific handlers.
parseFeatures: function(request)
Read HTTP response body and return features.
callUserCallback: function(resp,
options)
This method is used from within the commit method each time an an HTTP response is received from the server, it is responsible for calling the user-supplied callbacks.
This class represents an SLD Rule, as being used for rule-based SLD styling.
{Object} hash of style properties to use as default for merging rule-based style symbolizers onto.
createSymbolizer: function(feature)
creates a style by applying all feature-dependent rules to the base style.
applySymbolizer: function(rule,
style,
feature)
createLiterals: function(style,
feature)
creates literals for all style properties that have an entry in this.propertyStyles.
findPropertyStyles: function()
Looks into all rules for this style and the defaultStyle to collect all the style hash property names containing ${...}
addPropertyStyles: function(propertyStyles,
symbolizer)
getSymbolizerPrefix: function(geometry)
Returns the correct symbolizer prefix according to the geometry type of the passed geometry
OpenLayers.Style.createLiteral = function(value,
context,
feature)
converts a style value holding a combination of PropertyName and Literal into a Literal, taking the property values from the passed features.
The DragPan control pans the map with a drag of the mouse.
The ZoomBox control enables zooming directly to a given extent, by drawing a box on the map.
destroy: function()
The destroy method is used to perform any clean up before the control is dereferenced.
activate: function()
deactivate: function()
draw: function()
defaultDblClick: function (evt)
defaultDblRightClick: function (evt)
wheelChange: function(evt,
deltaZ)
wheelUp: function(evt)
User spun scroll wheel up
wheelDown: function(evt)
User spun scroll wheel down
disableZoomWheel : function()
enableZoomWheel : function()
Creates a geometry object.
destroy: function()
Destroy this geometry.
clearBounds: function()
Nullify this components bounds and that of its parent as well.
extendBounds: function(newBounds)
Extend the existing bounds to include the new bounds.
atPoint: function(lonlat,
toleranceLon,
toleranceLat)
getLength: function()
Calculate the length of this geometry.
getArea: function()
Calculate the area of this geometry.
toString: function()
Returns the Well-Known Text representation of a geometry
OpenLayers.Geometry.fromWKT = function(wkt)
Generate a geometry given a Well-Known Text string.
OpenLayers.Geometry.segmentsIntersect = function(seg1,
seg2,
options)
Determine whether two line segments intersect.
OpenLayers.Geometry.distanceToSegment = function(point,
segment)
clone: function (obj)
Create a clone of this layer
addTile:function(bounds,
position)
Creates a tile, initializes it, and adds it to the layer div.
getURL: function (bounds)
Return a query string for this layer
getFullRequestString:function(newParams,
altUrl)
getFullRequestString on MapGuide layers is special, because we do a regular expression replace on ‘,’ in parameters to ‘+’.
getImageFilePath:function(newParams,
altUrl)
special handler to request mapguide tiles from an http exposed tilecache
calculateGridLayout: function(bounds,
extent,
resolution)
Generate parameters for the grid layout.
clone: function (obj)
Create a clone of this layer
addTile:function(bounds,
position)
Creates a tile, initializes it, and adds it to the layer div.
getURL: function (bounds)
Return a query string for this layer
getFullRequestString:function(newParams,
altUrl)
combine the layer’s url with its params and these newParams.
destroy: function()
Destroy this layer
clone: function (obj)
Create a clone of this layer
getURL: function (bounds)
Return a GetMap query string for this layer
addTile:function(bounds,
position)
addTile creates a tile, initializes it, and adds it to the layer div.
getContext: function(feature)
Gets the context for evaluating this rule
This class represents a UserStyle obtained from a SLD, containing styling rules.
destroy: function()
createSymbolizer: function(feature,
intent)
Creates the symbolizer for a feature for a render intent.
addUniqueValueRules: function(renderIntent,
property,
symbolizers,
context)
Convenience method to create comparison rules for unique values of a property.
getComponentsString: function()
Get a string representing the components for this collection
addComponent: function(component,
index)
Add a new component (geometry) to the collection.
removeComponent: function(component)
Remove a component from this geometry.
calculateBounds: function ()
Create a new Bounds based on the lon/lat
toShortString: function()
{String} Shortened String representation of Point object.
Abstract vector layer strategy class.
Abstract vector layer protocol class.
This is the base class for all renderers.
refresh: function(obj)
Ask the layer to request features again and redraw them.
assignRenderer: function()
Iterates through the available renderer implementations and selects and assigns the first one whose “supported()” function returns true.
displayError: function()
Let the user know their browser isn’t supported.
setMap: function(map)
The layer has been added to the map.
afterAdd: function()
Called at the end of the map.addLayer sequence.
removeMap: function(map)
The layer has been removed from the map.
onMapResize: function()
Notify the renderer of the change in size.
moveTo: function(bounds,
zoomChanged,
dragging)
Reset the vector layer’s div so that it once again is lined up with the map.
eraseFeatures: function(features)
Erase features from the layer.
getFeatureFromEvent: function(evt)
Given an event, return a feature if the event occurred over one.
createFeature: function(pixel)
Add temporary features
destroyFeature: function()
Destroy the temporary geometries
finalize: function(cancel)
Finish the geometry and call the “done” callback.
click: function(evt)
Handle clicks.
dblclick: function(evt)
Handle double-clicks.
modifyFeature: function(pixel)
Modify the existing geometry given a pixel location.
drawFeature: function()
Render features on the temporary layer.
getGeometry: function()
Return the sketch geometry.
geometryClone: function()
Return a clone of the relevant geometry.
mousedown: function(evt)
Handle mouse down.
mousemove: function (evt)
Handle mouse move.
mouseup: function (evt)
Handle mouse up.
getSortedSegments: function()
{Array} An array of segment objects.
splitWithSegment: function(seg,
options)
Split this geometry with the given segment.
split: function(target,
options)
Use this geometry (the source) to attempt to split a target geometry.
splitWith: function(geometry,
options)
Split this geometry (the target) with the given geometry (the source).
containsPoint: function(point)
Test if a point is inside a linear ring.
A LineString is a Curve which, once two points have been added to it, can never be less than two points long.
split: function(geometry,
options)
Use this geometry (the source) to attempt to split a target geometry.
splitWith: function(geometry,
options)
Split this geometry (the target) with the given geometry (the source).
createFeature: function(pixel)
Add temporary geometries
destroyFeature: function()
Destroy temporary geometries
removePoint: function()
Destroy the temporary point.
addPoint: function(pixel)
Add point to geometry.
freehandMode: function(evt)
Determine whether to behave in freehand mode or not.
modifyFeature: function(pixel)
Modify the existing geometry given the new point
drawFeature: function()
Render geometries on the temporary layer.
getSketch: function()
Return the sketch feature.
getGeometry: function()
Return the sketch geometry.
mousedown: function(evt)
Handle mouse down.
mousemove: function (evt)
Handle mouse move.
mouseup: function (evt)
Handle mouse up.
dblclick: function(evt)
Handle double-clicks.
containsPoint: function(point)
Test if a point is inside a polygon.
Polygon is a collection of Geometry.LinearRings.
createFeature: function(pixel)
Add temporary geometries
destroyFeature: function()
Destroy temporary geometries
drawFeature: function()
Render geometries on the temporary layer.
getSketch: function()
Return the sketch feature.
getGeometry: function()
Return the sketch geometry.
dblclick: function(evt)
Handle double-clicks.
parseFeature: function(node)
This function is the core of the GML parsing code in OpenLayers.
parseAttributes: function(node)
createFeatureXML: function(feature)
Accept an OpenLayers.Feature.Vector, and build a GML node for it.
buildCoordinatesNode: function(geometry)
builds the coordinates XmlNode
read: function(data)
write: function(features)
setGeometryTypes: function()
Sets the geometryTypes mapping.
{Object} Maps OpenLayers geometry class names to GML element names.
write: function(features)
write: function(features)
setGeometryTypes: function()
Sets the geometryTypes mapping.
Jx.applyPNGFilter = function(o)
Static method that applies the PNG Filter Hack for IE browsers when showing 24bit PNG’s.
Jx.addToImgQueue = function(obj)
Request that an image be set to a DOM IMG element src attribute.
Jx.checkImgQueue = function()
An internal method that ensures no more than 2 images are loading at a time.
Jx.loadNextImg = function()
An internal method actually populate the DOM element with the image source.
Jx.createIframeShim = function()
Creates a new iframe element that is intended to fill a container to mask out other operating system controls (scrollbars, inputs, buttons, etc) when HTML elements are supposed to be above them.
Jx.getNumber = function(n,
def)
safely parse a number and return its integer value.
Jx.getPageDimensions = function()
return the dimensions of the browser client area.
getContentBoxSize : function()
return the size of the content area of an element.
getBorderBoxSize: function()
return the size of the border area of an element.
getMarginBoxSize: function()
return the size of the margin area of an element.
setContentBoxSize : function(size)
set either or both of the width and height of an element to the provided size.
setBorderBoxSize : function(size)
set either or both of the width and height of an element to the provided size.
getPaddingSize : function ()
returns the padding for each edge of an element
getBorderSize : function()
returns the border size for each edge of an element
descendantOf: function(node)
determines if the element is a descendent of the reference node.
findElement: function(type)
search the parentage of the element to find an element of the given tag name.
loadContent: function(element)
triggers loading of content based on options set for the current object.
checkRequest: function()
Is fired after a delay to check the request to make sure it’s not failing in AIR.
position: function(element,
relative,
options)
positions an element relative to another element based on the provided options.
makeChrome: function(element)
create chrome on an element.
showChrome: function(element)
show the chrome on an element.
hideChrome: function()
removes the chrome from the DOM.
addTo: function(reference,
where)
adds the object to the DOM relative to another element.
clicked : function(evt)
triggered when the user clicks the button, processes the actionPerformed event
isEnabled: function()
This returns true if the button is enabled, false otherwise
setEnabled: function(enabled)
enable or disable the button.
isActive: function()
For toggle buttons, this returns true if the toggle button is currently active and false otherwise.
setActive: function(active)
Set the active state of the button
setImage: function(path)
set the image of this button to a new image URL
setLabel: function(label)
sets the text of the button.
getLabel: function()
returns the text of the button.
setTooltip: function(tooltip)
sets the tooltip displayed by the button
focus: function()
capture the keyboard focus on this button
blur: function()
remove the keyboard focus from this button
Extends: Object
initialize: function(options)
construct a new instance of a flyout button.
clicked: function(e)
Override Jx.Button::clicked to hide/show the content area of the flyout.
hide: function()
Closes the flyout if open
windowResize: function()
when the window is resized, any Jx.Layout controlled elements that are direct children of the BODY element are resized
resize: function(options)
resize the element controlled by this Jx.Layout object.
clicked : function(evt)
triggered when the user clicks the button, processes the actionPerformed event
swatchOver: function(e)
handle the mouse moving over a colour swatch by updating the preview
swatchClick: function(e)
handle mouse click on a swatch by updating the color and hiding the panel.
changed: function()
handle the user entering a new colour value manually by updating the selected colour if the entered value is valid HEX.
alphaChanged: function()
handle the user entering a new alpha value manually by updating the selected alpha if the entered value is valid alpha (0-100).
setColor: function(color)
set the colour represented by this colour panel
setAlpha: function(alpha)
set the alpha represented by this colour panel
updateSelected: function()
update the colour panel user interface based on the current colour and alpha values
Extends: Jx.Button
clicked: function()
override Jx.Button.Flyout to use a singleton color palette.
hide: function()
hide the color panel
setColor: function(color)
set the color represented by this color panel
setAlpha: function(alpha)
set the alpha represented by this color panel
changed: function(panel)
handle the color changing in the palette by updating the preview swatch in the button and firing the change event.
updateSwatch: function()
Update the swatch color for the current color
add : function()
Add menu items to the sub menu.
deactivate: function()
Deactivate the menu by hiding it.
onMouseOver: function(e)
Handle the user moving the mouse over the button for this menu by showing this menu and hiding the other menu.
eventInMenu: function(e)
determine if an event happened inside this menu or a sub menu of this menu.
hide: function(e)
Hide the menu.
show : function(o)
Show the menu
setVisibleItem: function(obj)
Set the sub menu that is currently open
Create a new instance of Jx.ButtonSet
add : function()
Add one or more Jx.Buttons to the ButtonSet.
remove : function(button)
Remove a button from this Button.
setActiveButton: function(button)
Set the active button to the one passed to this method
add: function()
adds one or more buttons to the Multi button.
remove: function(button)
remove a button from a multi button
setActiveButton: function(button)
update the menu item to be the requested button.
setButton: function(button)
update the active button in the menu item, trigger the button’s action and hide the flyout that contains the buttons.
Extends: Object
setOwner: function(obj)
Set the owner of this menu item
hide: function()
Hide the menu item.
clicked: function(obj)
Handle the user clicking on the menu item, overriding the Jx.Button::clicked method to facilitate menu tracking
Extends: Jx.Button
setEnabled: function(enabled)
enable or disable the combo button.
valueChanged: function()
invoked when the current value is changed
onKeyPress: function(e)
Handle the user pressing a key by looking for an ENTER key to set the value.
add: function()
add a new item to the pick list
remove: function(idx)
Remove the item at the given index.
setValue: function(value)
set the value of the Combo
getValue: function()
Return the current value
layoutContent: function()
the sizeChange event of the Jx.Layout that manages the outer container is intercepted and passed through this method to handle resizing of the panel contents because we need to do some calculations if the panel is collapsed and if there are toolbars to put around the content area.
Extends: Object
setLabel: function(s)
Set the label in the title bar of this panel
getLabel: function()
Get the label of the title bar of this panel
finalize: function()
Clean up the panel
maximize: function()
Maximize this panel
setContent : function (html)
set the content of this panel to some HTML
setContentURL : function (url)
Set the content of this panel to come from some URL.
panelContentLoaded: function(html)
When the content of the panel is loaded from a remote URL, this method is called when the ajax request returns.
setBusy : function(isBusy)
Set the panel as busy or not busy, which displays a loading image in the title bar.
toggleCollapse: function(state)
sets or toggles the collapsed state of the panel.
close: function()
Closes the panel (completely hiding it).
Extends: Object
resize: function(width,
height,
autoPosition)
resize the dialog.
sizeChanged: function()
overload panel’s sizeChanged method
toggleCollapse: function(state)
sets or toggles the collapsed state of the panel.
show : function( )
show the dialog, external code should use the Jx.Dialog::open method to make the dialog visible.
open: function()
open the dialog.
hide : function()
hide the dialog, external code should use the Jx.Dialog::close method to hide the dialog.
close: function()
close the dialog and trigger the onClose callback function if necessary
openURL: function(url)
open the dialog and load content from the provided url.
prepareElement: function()
Prepare a new, empty element to go into a split area.
prepareBar: function()
Prepare a new, empty bar to go into between split areas.
establishConstraints: function()
Setup the initial set of constraints that set the behaviour of the bars between the elements in the split area.
dragHorizontal: function(obj)
In a horizontally split container, handle a bar being dragged left or right by resizing the elements on either side of the bar.
dragVertical: function(obj)
In a vertically split container, handle a bar being dragged up or down by resizing the elements on either side of the bar.
sizeChanged: function()
handle the size of the container being changed.
horizontalResize: function()
Resize a horizontally layed-out container
verticalResize: function()
Resize a vertically layed out container.
maximizePanel: function(panel)
Maximize a panel, taking up all available space (taking into consideration any minimum or maximum values)
onScroll: function()
handle the grid scrolling by updating the position of the headers
resize: function()
resize the grid to fit inside its container.
setModel: function(model)
set the model for the grid to display.
destroyGrid: function()
destroy the contents of the grid safely
createGrid: function()
create the grid for the current model
setRowHeaderHeight: function(row,
height)
set the height of a row.
gridChanged: function(model,
row,
col,
value)
called through the grid listener interface when data has changed in the underlying model
prelightRowHeader: function(row)
apply the jxGridRowHeaderPrelight style to the header cell of a row.
prelightColumnHeader: function(col)
apply the jxGridColumnHeaderPrelight style to the header cell of a column.
prelightRow: function(row)
apply the jxGridRowPrelight style to row.
prelightColumn: function(col)
apply the jxGridColumnPrelight style to a column.
prelightCell: function(row,
col)
apply the jxGridCellPrelight style to a cell.
selectCell: function(row,
col)
Select a cell and apply the jxGridCellSelected style to it.
selectRowHeader: function(row,
selected)
Apply the jxGridRowHeaderSelected style to the row header cell of a selected row.
selectRow: function(row,
selected)
Select a row and apply the jxGridRowSelected style to it.
selectColumnHeader: function(col,
selected)
Apply the jxGridColumnHeaderSelected style to the column header cell of a selected column.
selectColumn: function(col,
selected)
Select a column.
onMouseMoveGrid: function(e)
handle the mouse moving over the main grid.
onMouseMoveRowHeader: function(e)
handle the mouse moving over the row header cells.
onMouseMoveColumnHeader: function(e)
handle the mouse moving over the column header cells.
onClickGrid: function(e)
handle the user clicking on the grid.
onClickRowHeader: function(e)
handle the user clicking on the row header.
onClickColumnHeader: function(e)
handle the user clicking on the column header.
getRowColumnFromEvent: function(e)
retrieve the row and column indexes from an event click.
getColumnCount: function()
This function returns the number of columns of data in the model as an integer value.
getColumnHeaderHTML: function(col)
This function returns an HTML string to be placed in the column header for the given column index.
getColumnHeaderHeight: function()
This function returns an integer which is the height of the column header row in pixels.
getColumnWidth: function(col)
This function returns an integer which is the width of the given column in pixels.
getRowHeaderHTML: function(row)
This function returns an HTML string to be placed in the row header for the given row index
getRowHeaderWidth: function()
This function returns an integer which is the width of the row header column in pixels.
getRowHeight: function(row)
This function returns an integer which is the height of the given row in pixels.
getRowCount: function()
This function returns the number of rows of data in the model as an integer value.
getValueAt: function(row,
col)
This function returns an HTML string which is the text to place in the cell at the given row and column.
setColumnWidth: function()
This function is called with a column index and width in pixels when a column is resized.
isCellEditable: function()
This function returns a boolean value to indicate if a given cell is editable by the user.
setValueAt: function(row,
col,
value)
This function is called with the row and column of a cell and a new value for the cell.
rowSelected: function(grid,
row)
This function is called by the grid to indicate that the user has selected a row by clicking on the row header.
columnSelected: function(grid,
col)
This function is called by the grid to indicate that the user has selected a column by clicking on the column header.
cellSelected: function(grid,
row,
col)
This function is called by the grid to indicate that the user has selected a cell by clicking on the cell in the grid.
show : function(e)
Show the context menu at the location of the mouse click
Extends: Jx.Menu.Item
setOwner: function(obj)
Set the ownder of this menu item
Extends: Jx.Button
Create a new instance of Jx.SubMenu
setOwner: function(obj)
Set the owner of this sub menu
show: function()
Show the sub menu
hide: function()
Hide the sub menu
add : function()
Add menu items to the sub menu.
insertBefore: function(newItem,
targetItem)
Insert a menu item before another menu item.
remove: function(item)
Remove a single menu item from the menu.
deactivate: function(e)
Deactivate the sub menu
isActive: function()
Indicate if this sub menu is active
setActive: function(isActive)
Set the active state of the Jx.Menu that contains this sub menu
setVisibleItem: function(obj)
Set a sub menu of this menu to be visible and hide the previously visible one.
Extends: Object
toggleElement: function()
Snap the element open or closed.
addTo: function(parent)
add this toolbar to a DOM element automatically creating a toolbar container if necessary
add: function( )
Add an item to the toolbar.
remove: function(item)
remove an item from a toolbar.
deactivate: function()
Deactivate the Toolbar (when it is acting as a menu bar).
isActive: function()
Indicate if the toolbar is currently active (as a menu bar)
setActive: function(b)
Set the active state of the toolbar (for menus)
setVisibleItem: function(obj)
For menus, they want to know which menu is currently open.
Create a new instance of Jx.TabSet within a specific element of the DOM.
resizeTabBox: function()
Resize the tab set content area and propogate the changes to each of the tabs managed by the tab set.
add: function()
Add one or more Jx.Button.Tabs to the TabSet.
Extends: Jx.Button
remove: function(tab)
Remove a tab from this TabSet.
setActiveTab: function(tab)
Set the active tab to the one passed to this method
Extends: Object
Extends: Object
add : function()
Add one or more Jx.Tabs to the TabBox.
remove : function(tab)
Remove a tab from the TabSet.
add: function( )
Add a toolbar to the container.
remove: function(item)
remove an item from a toolbar.
scrollIntoView: function(item)
scrolls an item in one of the toolbars into the currently visible area of the container if it is not already fully visible
finalize: function()
Clean up the TreeItem and remove all DOM references
finalizeItem: function()
Clean up the TreeItem and remove all DOM references
clone : function()
Create a clone of the TreeItem
update : function(shouldDescend)
Update the CSS of the TreeItem’s DOM element in case it has changed position
selected : function(e)
Called when the DOM element for the TreeItem is clicked, the node is selected.
getName : function()
Get the label associated with a TreeItem
propertyChanged : function(obj)
A property of an object has changed, synchronize the state of the TreeItem with the state of the object
Extends: Object
finalize: function()
Clean up a TreeFolder.
finalizeFolder: function()
Internal method to clean up folder-related stuff.
clone : function()
Create a clone of the TreeFolder
isLastNode : function(node)
Indicates if a node is the last thing in the folder.
update : function(shouldDescend)
Update the CSS of the TreeFolder’s DOM element in case it has changed position.
append : function(node)
append a node at the end of the sub-tree
insert : function(node,
refNode)
insert a node after refNode.
remove : function(node)
remove the specified node from the tree
replace: function(newNode,
refNode)
Replace a node with another node
clicked : function(e)
handle the user clicking on this folder by expanding or collapsing it.
expand : function()
Expands the folder
collapse : function()
Collapses the folder
findChild : function(path)
Get a reference to a child node by recursively searching the tree
finalize: function()
Clean up a Jx.Tree instance
clear: function()
Clear the tree of all child nodes
update: function(shouldDescend)
Update the CSS of the Tree’s DOM element in case it has changed position
append: function(node)
Append a node at the end of the sub-tree
destroy: function()
parse : function()
start parsing the ApplicationDefinition file.
parseAppDef: function(json)
parse the ApplicationDefinition file into the appropriate Fusion objects
create: function()
Create the application definition.
getMapByName : function(name)
return a map widget with the given name
getMapById : function(id)
return a map widget with the given id
getMapByIndice : function(indice)
return the map widget at the given index
getMapGroup : function(mapGroupId)
return the specified map group from the application definition
addWidgetInstance: function(widget)
keep track of live widgets created in this widgetSet
getMapWidget: function()
return the map widget for this widget set
create: function(appDef)
create all the things required by this widgetSet, including containers and widgets.
getMapByName : function(name)
return the map widget from this widget set if the map’s name matches the requested name, or null.
create: function(widgetSet,
widgetName)
creates a new instance of the widget, optionally using a different name during instantiation to accomodate containers
getLocation: function()
returns the location of this widget relative to the installation of fusion.
mapLoaded: function()
Callback for when all maps have been loaded
setMenu: function()
Attaches a context menu as defined in the AppDef to the map
loadMapGroup: function(mapGroup)
Controls the creation of Layers based on the MapGroup object passed in
layerLoaded: function()
Called after each layer is loaded in the OL viewport.
wheelChange: function(evt,
deltaZ)
handles mouse wheel events by accummulating the events and setting a timer to do the actual zoom in/out
doWheelChange: function(evt,
deltaZ)
Carries out the actual map zoom based on the wheel movement
wheelUp: function(evt)
User spun scroll wheel up
wheelDown: function(evt)
User spun scroll wheel down
getDomObj: function()
returns the dom element for this widget
getMapName: function()
returns the name of the baselayer map
getMapTitle: function()
returns the Title of the baselayer map.
getSessionID: function()
returns the server session ID
getDomId: function()
returns the ID of dom element for this widget
setMapOptions: function(options)
sets options on the OpenLayers map object, a wrapper for the OL function
addMap: function(map)
adds a map/Layer to the map and registers some event handlers on the map
getAllMaps: function()
returns the array of map objects
reloadMap: function()
Called to reload all the map objects.
loadScaleRanges: function(userFunc)
Loads the ScaleRange objects separate from the LoadMap sequence since this also generates sprites and is a relatively expensive operation.
query: function(options)
dispatch query requests to the maps
selectionHandler: function()
handle selection events from maps and republish for widgets as appropriate
hasSelection: function()
cehck to see if any of the maps have an active selection
clearSelection: function()
clear the selection on all maps
getSelection: function(callback,
layers,
startcount)
initiates a call to get the current selection asynchronously in case we need to retrieve the details from the server
setSelection: function(selText,
zoomTo)
sets a Selection XML back to the server for each of the maps
accumulateSelection: function(map,
oSelection)
accumulate the selection results from each map and when all have reported in, pass the results to the callback function
setActiveLayer: function(oLayer)
sets the active layer for selection/manipulation
getActiveLayer: function()
returns the active layer for selection/manipulation
_addWorker: function()
indicate that a new asynchronous process has started and make sure the visual indicator is visible for the user.
_removeWorker: function()
indicate that an asynchronous process has completed and hide the visual indicator if no remaining processes are active.
mapExtentsChanged: function()
OpenLayers event handler for whenever the map changes either zoom level of the center has changed.
isBusy: function()
check to see if there are any outstanding requests to the server
sizeChanged: function()
callback for when the browser window size changes, simply calls resize on the map viewport layout object
resize: function()
handles the resizing of the maps and triggers a Fusion event
redraw: function()
redraws the map using current extents and zoom level.
setBackgroundColor: function(color)
sets the background color for the map
setExtents: function(oExtents)
handle selection events from maps and republish for widgets as appropriate
setInitialExtents: function()
1.
getMapGroupExtent: function(includeGenericLayers)
gets the intitial extents from all maps with or without including the extent of any Generic/commercial layers
fullExtents: function()
sets the extent of the map to the max as returned by loadMap
isMapLoaded: function()
returns if the map has finished loading (based on setting the _oCurrentExtent value)
zoom: function(fX,
fY,
nFactor)
sets the map zoom and extent.
getCurrentCenter: function()
returns the current center of the map view
getExtentFromPoint: function(fX,
fY,
fScale)
returns the Extent of the map given a center point and a scale (optional)
loadScaleRanges: function(userFunc)
This function should be called after the map has loaded.
isMapLoaded: function()
Returns true if the Map has been laoded succesfully form the server
A widget to display a legend of all layers.
renderLegend: function()
Abstract method that have the main purpose to draw the legend.
mapLoaded: function()
Abstract method that handle the event: Fusion.Event.MAP_LOADED.
mapReloaded: function()
Abstract method that handle the event: Fusion.Event.MAP_RELOADED.
getMap: function()
Helper method to obtains the map.
A widget to display information about the currently selected set of features.
Constructor for a new Fusion.Widget.SelectionPanel.SelectionRenderer instance.
getNextPage: function(selectionLayer)
Get the next batches of features.
getPreviousPage: function(selectionLayer)
Get the previous batches of features.
getMap: function()
Helper method to obtains the map.
getPage: function(selectionLayer,
startIndex,
endIndex)
Get a batches of features in a selection.
updateSelection: function()
Abstract method that handle the event: Fusion.Event.MAP_SELECTION_ON.
clearSelection: function()
Abstract method that handle the event: Fusion.Event.MAP_SELECTION_OFF.
loadScaleRanges: function(userFunc)
This function should be called after the map has loaded.
createOLLayer: function(layerName,
bSingleTile,
behavior,
forceAsOverlay)
Returns an OpenLayers MapGuide layer object
getLayerByName : function(name)
Returns the MapGuide layer object as identified by the layer name
getLayerById : function(id)
Returns the MapGuide layer object as identified by the layer unique id
loadScaleRanges: function(userFunc)
This function should be called after the map has loaded.
A set of classes that implement the functionlity required for applications
Construct a new bounds object.
Protocols return Response objects to their users.
Contains convenience functions for string manipulation.
A Geometry is a description of a geographic object.
Utility functions for event handling.
This class takes care of figuring out which order elements should be placed in the DOM based on given indexing methods.
This class offers several methods for interacting with a wrapped pro4js projection object.
This is another virtual class in that it should never be instantiated by itself as a Renderer.
Create a new VML renderer.
Construct an XML parser.
As a compliment to the readers property, this structure contains public writing functions grouped by namespace alias and named like the node names they produce.
Constructor for a new OpenLayers.Map instance.
The navigation control handles map browsing with mouse events (dragging, double-clicking, and scrolling the wheel).
The PanZoom is a visible control, composed of a OpenLayers.Control.PanPanel and a OpenLayers.Control.ZoomPanel.
The ArgParser control adds location bar querystring parsing functionality to an OpenLayers Map.
Standard-compliant (W3C) cross-browser implementation of the XMLHttpRequest object.
Create a new overview map
Constructor for features.
Create a new click handler.
Returns OpenLayers.Handler.Drag
{Number} The number of pixels the mouse can move between mousedown and mouseup for the event to still be considered a click.
The OpenLayers.Request namespace contains convenience methods for working with XMLHttpRequests.
{Object}
OpenLayers features can have a number of style attributes.
Features are combinations of geography and attributes.
Create a vector feature.
Create a new regular polygon handler.
Create a new event pane layer
Create a new parser for WKT
A mixin for layers that wraps up the pieces neccesary to have a coordinate conversion for working with commercial APIs which use a spherical mercator projection.
Base class for 3rd party layers.
Some Layers will already have established zoom levels (like google or ve).
Create a new grid layer
A class for giving layers generic HTTP protocol.
{Boolean} If set to true, the defaultStyle will extend the symbolizer of every rule.
Creates a UserStyle.
Create a new navigation control
Base class for layers that use a lattice of tiles.
Create a new Mapguide layer, either tiled or untiled.
Instances of OpenLayers.Tile.Image are used to manage the image tiles used by various layers.
Create a new MapServer layer object
Create a new WMS layer object
Creates a Rule.
Creates a Geometry Collection -- a list of geoms.
Create a new vector layer
Create a new MultiPoint Geometry
A Collection is exactly what it sounds like: A collection of different Geometries.
Create a new point handler.
{Boolean} Cast features to multi-part geometries before passing to the layer.
MultiPoint is a collection of Points.
A Curve is a MultiPoint, whose points are assumed to be connected.
Handler to draw a point on the map.
A Linear Ring is a special LineString which is closed.
Create a new MultiPolygon geometry
Handler to draw a path on the map.
Create a new parser for GML.
A MultiLineString is a geometry with multiple OpenLayers.Geometry.LineString components.
MultiPolygon is a geometry with multiple OpenLayers.Geometry.Polygon components.
Read and write XML.
Parses GML version 2.
Parses GML version 3.
Superclass for GML parsers.
A mix-in class that provides a helper function that allows an object to be added to an existing element on the page.
ContentLoader is a mix-in class that provides a consistent mechanism for other Jx controls to load content in one of four different ways:
Mix-in class that provides a method for positioning elements relative to other elements.
A mix-in class that provides chrome helper functions.
Extends: Object
Create a new instance of Jx.Layout.
Extends: Jx.Button.Flyout
Extends: Object
Create a new instance of Jx.TreeItem with the associated options
Create a new instance of Jx.TreeFolder
Extends: Jx.TreeItem
Utility class to parse an application definition