OpenLayersThe OpenLayers object provides a namespace for all things OpenLayers Summary | 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. | | | | 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. | | | | 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} 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. | | | | {Integer} The ever-incrementing count variable. | | Create a unique identifier for this session. | | | | | | {Integer} 72 (A sensible default) | | | | | | | | | | | | 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. | | | | | | 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. | | | | | | 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 | | | | 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. | | | | | | | | | | | | | | | | | | Creates an icon, which is an image tag in a div. | | Nullify references and remove event listeners to prevent circular references and memory leaks | | | | | | | | Move the div to the given pixel. | | Erase the underlying image element. | | Change the icon’s opacity | | move icon to passed in px. | | | | A popup is a small div that can opened and closed on the map. | | | | | | {String} the unique identifier assigned to this popup. | | | | {DOMElement} the div that contains this 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 | | | | 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 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. | | | | | | {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. | | | | | | | | | | | | | | | | This is the base class for all renderers. | | | | | | | | | | {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 | | | | | | 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. | | | | | | {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. | | | | | | Controls affect the display or behavior of the map. | | | | | | { OpenLayers.Map} this gets set in the addControl() function in OpenLayers.Map | | | | {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. | | | | | | | | {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. | | | | 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. | | | | | | 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. | | | | | | | | | | | | | | {<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. | | | | | | | | | | | | | | | | | | 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. | | | | | | 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 | | | | Tells protocol to load data and unhooks the visibilitychanged event | | Add all features to the layer. | | | | | | {int} Interval in milliseconds between 2 steps | | | | | | {int} Interval id returned by window.setInterval | | {Boolean} Tells if the easing is currently playing | | | | | | Calls the appropriate easing method | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 | | | | | | | | | | | | | | | | | | | | | | | | | | 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. | | | | | | | | Create a new scale line control. | | | | 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. | | | | | | | | | | | | | | | | | | | | | | | | 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 | | | | | | 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. | | | | | | | | {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. | | | | Update RICO corners according to the popup’s current relative postion. | | {String} The proper corners string (“tr tl bl br”) for rico to round. | | | | | | Class for coordinate transforms between coordinate systems. | | | | {Object} Proj4js.Proj instance. | | | | | | 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. | | | | | | | | | | | | {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 | | | | | | | | 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 | | | | | | | | 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. | | | | | | Determine whether a node is of a given type | | | | Create the main root element | | | | | | | | | | | | | | | | 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 | | | | | | 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} url of the request. | | | | | | {Boolean} Is the tile loading? | | | | | | 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. | | | | 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. | | | | | | | | | | {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. | | | | | | 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. | | | | | | | | | | {Event} This property references the last event handled by the 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. | | | | | | 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. | | | | 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. | | | | {Boolean} The map is currently being dragged. | | | | {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. | | | | | | | | {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. | | | | | | 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 | | | | | | | | | | This function takes care to recenter the layerContainerDiv. | | | | | | | | | | | | {Integer} 256 Default tile width (unless otherwise specified) | | {Integer} 256 Default tile height (unless otherwise specified) | | | | | | | | | | | | | | | | | | 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. | | | | | | 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. | | | | | | | | 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 | | | | | | | | Create a new overview map | | Render the control in the browser. | | | | Handle extent rectangle drag | | | | | | 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. | | | | | | | | | | | | | | | | | | 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. | | | | 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. | | | | {Number} The id of the right mouse timeout waiting to clear the <delayedEvent>. | | | | Create a new click handler. | | | | | | | | | | | | | | Determine whether the event is within the optional pixel tolerance. | | Clear the timer and set 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. | | | | | | | | | | {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. | | | | | | | | | | | | The drag handler captures the click event. | | | | | | 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. | | | | | | | | | | {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. | | | | | | | | | | | | | | | | 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. | | | | | | 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. | | | | Handler for wheel up/down events. | | | | | | { 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. | | | | | | | | | | | | | | | | Allow the user to change the box’s color and border width | | | | {Boolean} Whether or not the marker is currently visible on screen. | | | | Standard-compliant (W3C) cross-browser implementation of the XMLHttpRequest object. | | | | | | Parse XML into a doc structure | | | | | | | | {Object} Transport mechanism for whichever browser we’re in, or false if none available. | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the optional onException function is set, execute it and then dispatch the call to any other listener registered for onException. | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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} | | | | {Integer} The number of milliseconds that should ellapse before panning the map again. | | | | | | | | Finish the panning operation. | | Vector features use the OpenLayers.Geometry classes as geometry description. | | | | | | { 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} rendering intent currently being used | | | | | | 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 | | | | | | 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. | | | | | | | | | | 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. | | | | | | | | 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. | | | | | | 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. | | | | | | | | | | | | 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. | | | | | | | | | | {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. | | | | 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. | | | | | | 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. | | | | | | 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() | | | | | | 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. | | | | | | | | | | {Array(Float)} Hardcode these resolutions so that they are more closely tied with the standard wms projection | | | | | | | | | | | | | | | | | | {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 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. | | | | | | | | Creates a geometry object. | | | | 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] | | | | | | | | 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 | | | | | | | | Create a new WMS layer object | | | | 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. | | | | | | 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. | | | | | | 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(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. | | | | | | | | {Boolean} Cast features to multi-part geometries before passing to the layer. | | {Boolean} A point is being drawn | | {Boolean} The mouse is down | | | | | | {Object} Any optional properties to be set on the sketch layer. | | | | Create a new point handler. | | | | Destroy the temporary geometries | | Finish the geometry and call the “done” callback. | | | | | | 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. | | | | | | | | 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. | | | | | | {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. | | | | | | | | Destroy temporary geometries | | Destroy the temporary point. | | | | 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. | | | | | | | | | | 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. | | | | | | {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. | | | | Destroy temporary geometries | | Render geometries on the temporary layer. | | Return the sketch feature. | | Return the sketch geometry. | | | | | | | | 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. | | | | | | | | {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. | | | | | | {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. |
_scriptName{String} Relative path of this script.
_getScriptLocation_getScriptLocation: function () |
Return the path to this script. Returns{String} Path to this script
UtilSummary | | | This is the old $() from prototype | | Remove an object from an array. | | | | 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. | | | | 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} 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. | | | | {Integer} The ever-incrementing count variable. | | Create a unique identifier for this session. | | | | | | {Integer} 72 (A sensible default) | | | | | | | | | | | | 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. |
getElementOpenLayers.Util.getElement = function() |
This is the old $() from prototype
removeItemOpenLayers.Util.removeItem = function( | array, | | item | ) |
|
Remove an object from an array. Iterates through the array to find the item, then removes it. ParametersReturn {Array} A reference to the array
clearArrayOpenLayers.Util.clearArray = function( | array | ) |
|
Deprecated. This function will disappear in 3.0. Please use “array.length = 0” instead. Parameters
indexOfOpenLayers.Util.indexOf = function( | array, | | obj | ) |
|
Seems to exist already in FF, but not in MOZ. ParametersReturns{Integer} The index at, which the object was found in the array. If not found, returns -1.
modifyDOMElementOpenLayers.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. Parametersid | {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) |
createDivOpenLayers.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. Parametersid | {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.
createImageOpenLayers.Util.createImage = function( | id, | | px, | | sz, | | imgURL, | | position, | | border, | | opacity, | | delayDisplay | ) |
|
Creates an img element with specific attribute values. Parametersid | {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.
setOpacityOpenLayers.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 Parameterselement | {DOMElement} Set the opacity on this DOM element | opacity | {Float} Opacity value (0.0 - 1.0) |
onImageLoadOpenLayers.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
onImageLoadErrorOpenLayers.Util.onImageLoadError = function() |
alphaHackNeeded{Boolean} true if the png alpha hack is necessary and possible, false otherwise.
alphaHackOpenLayers.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.
modifyAlphaImageDivOpenLayers.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) |
createAlphaImageDivOpenLayers.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.
upperCaseObjectOpenLayers.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. ParametersReturns{Object} A new Object with all the same keys but uppercased
applyDefaultsOpenLayers.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. Parametersto | {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.
getParameterStringOpenLayers.Util.getParameterString = function( | params | ) |
|
ParametersReturns{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).
getImagesLocationOpenLayers.Util.getImagesLocation = function() |
Returns{String} The fully formatted image location string
TryOpenLayers.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.
getNodesOpenLayers.Util.getNodes=function( | p, | | tagName | ) |
|
These could/should be made namespace aware? ParametersReturns{Array}
_getNodesOpenLayers.Util._getNodes=function( | nodes, | | tagName | ) |
|
Parametersnodes | {Array} | tagName | {String} |
Returns{Array}
getTagTextOpenLayers.Util.getTagText = function ( | parent, | | item, | | index | ) |
|
Parametersparent | {} | item | {String} | index | {Integer} |
Returns{String}
getXmlNodeValueOpenLayers.Util.getXmlNodeValue = function( | node | ) |
|
ParametersReturns{String} The text value of the given node, without breaking in firefox or IE
mouseLeftOpenLayers.Util.mouseLeft = function ( | evt, | | div | ) |
|
Parametersevt | {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.
toFloatOpenLayers.Util.toFloat = function ( | number, | | precision | ) |
|
Convenience method to cast an object to a Number, rounded to the desired floating point precision. Parametersnumber | {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.
radOpenLayers.Util.rad = function( | x | ) |
|
ParametersReturns{Float}
distVincentyOpenLayers.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. ParametersReturns{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.
getParametersOpenLayers.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. Parametersurl | {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.
getArgsOpenLayers.Util.getArgs = function( | url | ) |
|
Deprecated. Will be removed in 3.0. Please use instead <OpenLayers.Util.getParameters> Parametersurl | {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.
createUniqueIDOpenLayers.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. Parametersprefix {String} Optionsal string to prefix unique id. Default is “id_”. Returns{String} A unique id string, built on the passed in prefix.
DOTS_PER_INCH{Integer} 72 (A sensible default)
normalizeScaleOpenLayers.Util.normalizeScale = function ( | scale | ) |
|
ParametersReturns{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
getResolutionFromScaleOpenLayers.Util.getResolutionFromScale = function ( | scale, | | units | ) |
|
Parametersscale | {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.
getScaleFromResolutionOpenLayers.Util.getScaleFromResolution = function ( | resolution, | | units | ) |
|
Parametersresolution | {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.
safeStopPropagationOpenLayers.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
pagePositonCalculates the position of an element on the page. ParametersReturns{Array} two item array, L value then T value.
isEquivalentUrlOpenLayers.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)
Parametersurl1 | {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
createUrlObjectOpenLayers.Util.createUrlObject = function( | url, | | options | ) |
|
Parametersurl | {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
removeTailOpenLayers.Util.removeTail = function( | url | ) |
|
Takes a url and removes everything after the ? and # Parametersurl | {String} The url to process |
Returns{String} The string with all queryString and Hash removed
getBrowserNameOpenLayers.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.
getRenderedDimensionsOpenLayers.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 ParameterscontentHTML 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. ConsoleThe 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. NoteNote 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. |
OpenLayers Base TypesOpenLayers custom string, number and function functions are described here.
OpenLayers. StringContains convenience functions for string manipulation. Summary | | | Used to find tokens in a string. | | Used to test strings as numbers. |
OpenLayers. String. tokenRegExUsed to find tokens in a string. Examples: ${a}, ${a.b.c}, ${a-b}, ${5}
OpenLayers. String. numberRegExUsed to test strings as numbers.
OpenLayers. NumberContains convenience functions for manipulating numbers. Summary | | | Decimal separator to use when formatting numbers. | | Thousands separator to use when formatting numbers. |
decimalSeparatorDecimal separator to use when formatting numbers.
thousandsSeparatorThousands separator to use when formatting numbers.
OpenLayers. FunctionContains convenience functions for function manipulation.
OpenLayers. ArrayContains convenience functions for array manipulation. Summary | | | Base class used to construct all other classes. | | | | |
OpenLayers. ClassOpenLayers.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 syntaxvar 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.
isPrototypeDeprecated. This is no longer needed and will be removed at 3.0.
OpenLayers.SizeInstances of this class represent a width/height pair Summary | | | Create an instance of OpenLayers.Size | | Return the string representation of a size object |
OpenLayers.SizeCreate an instance of OpenLayers.Size Parametersw | {Number} width | h | {Number} height |
toStringReturn the string representation of a size object Returns{String} The string representation of OpenLayers.Size object. (ex. <i>”w=55,h=66”</i>)
OpenLayers. BoundsInstances 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 casebounds = 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. | | | | | | 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. |
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.
OpenLayers. BoundsConstruct a new bounds object. Parametersleft | {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. |
cloneCreate a cloned instance of this bounds. Returns{OpenLayers.Bounds} A fresh copy of the bounds
equalsTest a two bounds for equivalence. ParametersReturns{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.
scalescale: 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. ParametersReturns{<OpenLayers.Bound>} A new bounds that is scaled by ratio from origin.
oppositeQuadrantOpenLayers.Bounds.oppositeQuadrant = function( | quadrant | ) |
|
Get the opposite quadrant for a given quadrant string. Parametersquadrant | {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. ElementSummary | | | 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. |
hasClasshasClass: function( | element, | | name | ) |
|
Tests if an element has the given CSS class name. Parameterselement | {DOMElement} A DOM element node. | name | {String} The CSS class name to search for. |
Returns{Boolean} The element has the given class name.
addClassaddClass: function( | element, | | name | ) |
|
Add a CSS class name to an element. Safe where element already has the class name. Parameterselement | {DOMElement} A DOM element node. | name | {String} The CSS class name to add. |
Returns{DOMElement} The element.
removeClassremoveClass: function( | element, | | name | ) |
|
Remove a CSS class name from an element. Safe where element does not have the class name. Parameterselement | {DOMElement} A DOM element node. | name | {String} The CSS class name to remove. |
Returns{DOMElement} The element.
toggleClasstoggleClass: function( | element, | | name | ) |
|
Remove a CSS class name from an element if it exists. Add the class name if it doesn’t exist. Parameterselement | {DOMElement} A DOM element node. | name | {String} The CSS class name to toggle. |
Returns{DOMElement} The element.
OpenLayers. LonLatThis class represents a longitude and latitude pair Summary | | | Create a new map location. | | Return a readable string version of the lonlat | | |
OpenLayers. LonLatCreate a new map location. Parameterslon | {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. |
toStringReturn a readable string version of the lonlat Returns{String} String representation of OpenLayers.LonLat object. (ex. <i>”lon=5,lat=42”</i>)
fromStringOpenLayers.LonLat.fromString = function( | str | ) |
|
Alternative constructor that builds a new OpenLayers.LonLat from a parameter string Parametersstr | {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. PixelThis class represents a screen coordinate, in x and y coordinates Summary | | | Create a new OpenLayers.Pixel instance | | Cast this object into a string |
OpenLayers. PixelCreate a new OpenLayers.Pixel instance Parametersx | {Number} The x coordinate | y | {Number} The y coordinate |
ReturnsAn instance of OpenLayers.Pixel
toStringCast this object into a string Returns{String} The string representation of Pixel. ex: “x=200.4,y=242.2”
OpenLayers.IconThe 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 | | | | | | | | | | | | | | | | | Creates an icon, which is an image tag in a div. | | Nullify references and remove event listeners to prevent circular references and memory leaks | | | | | | | | Move the div to the given pixel. | | Erase the underlying image element. | | Change the icon’s opacity | | move icon to passed in px. | | |
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)
OpenLayers.IconCreates an icon, which is an image tag in a div.
destroyNullify references and remove event listeners to prevent circular references and memory leaks
drawMove the div to the given pixel. ParametersReturns{DOMElement} A new DOM Image of this icon set at the location passed-in
eraseErase the underlying image element.
setOpacitysetOpacity: function( | opacity | ) |
|
Change the icon’s opacity Parameters
moveTomove icon to passed in px. Parameters
displaydisplay: function( | display | ) |
|
Hide or show the icon Parameters
OpenLayers. PopupA 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. Examplepopup = new OpenLayers.Popup("chicken", new OpenLayers.LonLat(5,40), new OpenLayers.Size(200,200), "example popup", true);
map.addPopup(popup);
Summary | | | | | {String} the unique identifier assigned to this popup. | | | | {DOMElement} the div that contains this 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 | | | | 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 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 |
id{String} the unique identifier assigned to this popup.
div{DOMElement} the div that contains this 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.
fixPaddingTo 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. PopupCreate a popup. Parametersid | {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. |
destroynullify references to prevent circular references and memory leaks
drawConstructs the elements that make up the popup. ParametersReturns{DOMElement} Reference to a div that contains the drawn popup
updatePositionupdatePosition: function() |
if the popup has a lonlat and its map members set, then have it move itself to its proper position
visibleReturns{Boolean} Boolean indicating whether or not the popup is visible
toggleToggles visibility of the popup.
hideMakes the popup invisible.
setSizesetSize:function( | contentSize | ) |
|
Used to adjust the size of the popup. ParameterscontentSize | {OpenLayers.Size} the new size for the popup’s contents div (in pixels). |
setBackgroundColorsetBackgroundColor:function( | color | ) |
|
Sets the background color of the popup. Parameterscolor | {String} the background color. eg “#FFBBBB” |
setOpacitysetOpacity:function( | opacity | ) |
|
Sets the opacity of the popup. Parametersopacity | {float} A value between 0.0 (transparent) and 1.0 (solid). |
setBordersetBorder:function( | border | ) |
|
Sets the border style of the popup. Parametersborder | {String} The border style value. eg 2px |
setContentHTMLsetContentHTML:function( | contentHTML | ) |
|
Allows the user to set the HTML content of the popup. ParameterscontentHTML | {String} HTML for the div. |
registerImageListenersregisterImageListeners: function() |
Called when an image contained by the popup loaded. this function updates the popup size, then unregisters the image load listener.
getContentDivPaddinggetContentDivPadding: 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}
addCloseBoxaddCloseBox: function( | callback | ) |
|
Parameterscallback | {Function} The callback to be called when the close button is clicked. |
panIntoViewPans the map such that the popup is totaly viewable (if necessary)
registerEventsregisterEvents: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.
onmousedownonmousedown: 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
onmousemoveonmousemove: 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
onmouseuponmouseup: 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
onclickIgnore clicks, but allowing default browser handling Parameters
onmouseoutonmouseout: 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
ondblclickondblclick: function ( | evt | ) |
|
Ignore double-clicks, but allowing default browser handling Parameters
OpenLayers. ProtocolAbstract vector layer protocol class. Not to be instantiated directly. Use one of the protocol subclasses instead. Summary | | | | | {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. |
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.
OpenLayers. ProtocolAbstract class for vector protocols. Create instances of a subclass. Parametersoptions | {Object} Optional object whose properties will be set on the instance. |
abortabort: function( | response | ) |
|
Abort an ongoing request. Parameters
OpenLayers. Protocol. ResponseProtocols return Response objects to their users. Summary | | | | | {String} The type of request this response corresponds to. | | | | | | | | | | | | | | |
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. |
OpenLayers. Protocol. ResponseParametersoptions | {Object} Optional object whose properties will be set on the instance. |
successReturns{Boolean} | true on success, false otherwise |
OpenLayers. RendererThis 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 | | | | | | | | | {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 | | | | | | 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. |
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()
OpenLayers. RendererParameterscontainerID | {String} | options | {Object} options for this renderer. See sublcasses for supported options. |
setExtentsetExtent: 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
setSizeSets 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
getResolutiongetResolution: function() |
Uses cached copy of resolution if available to minimize computing ReturnsThe current map’s resolution
drawFeaturedrawFeature: 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(). ParametersReturns{Boolean} true if the feature has been drawn completely, false if not, undefined if the feature had no geometry
drawGeometrydrawGeometry: 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
drawTextdrawText: function( | featureId, | | style, | | location | ) |
|
Function for drawing text labels. This method is only called by the renderer itself. Parameters
removeTextremoveText: function( | featureId | ) |
|
Function for removing text labels. This method is only called by the renderer itself. Parameters
clearClear all vectors from the renderer. virtual function.
getFeatureIdFromEventgetFeatureIdFromEvent: 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. ParametersReturns{String} A feature id or null.
eraseFeatureseraseFeatures: function( | features | ) |
|
This is called by the layer to erase features Parameters
eraseGeometryeraseGeometry: function( | geometry | ) |
|
Remove a geometry from the renderer (by id). virtual function. Parameters
moveRootmoveRoot: 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
getRenderLayerIdgetRenderLayerId: 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. StrategyAbstract vector layer strategy class. Not to be instantiated directly. Use one of the strategy subclasses instead. Summary | | | | | {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. | | | | |
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.
OpenLayers. StrategyAbstract class for vector strategies. Create instances of a subclass. Parametersoptions | {Object} Optional object whose properties will be set on the instance. |
activateActivate 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.
deactivateDeactivate 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. ControlControls 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. ExampleThe 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 | | | | | { OpenLayers.Map} this gets set in the addControl() function in OpenLayers.Map | | | | {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. | | | | | | | | {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. |
map{OpenLayers.Map} this gets set in the addControl() function in OpenLayers.Map
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.
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 propertiesobject | {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 typesactivate | Triggered when activated. | deactivate | Triggered when deactivated. |
OpenLayers. ControlCreate 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
destroyThe 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.
setMapSet 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
drawThe 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. ParametersReturns{DOMElement} A reference to the DIV DOMElement containing the control
moveToSets the left and top style attributes to the passed in pixel coordinates. Parameters
activateExplicitly 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.
deactivateDeactivates 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.LangInternationalization namespace. Contains dictionaries in various languages and methods to set and get the current language. Summary | | | {String} Current language code to use in OpenLayers. |
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. AnchoredInherits fromSummary | | | | | 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. | | |
OpenLayers. Popup. Anchored
moveToSince 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
calculateRelativePositioncalculateRelativePosition:function( | px | ) |
|
ParametersReturns{String} The relative position (“br” “tr” “tl” “bl”) at which the popup should be placed.
updateRelativePositionupdateRelativePosition: 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.
calculateNewPxcalculateNewPx:function( | px | ) |
|
ParametersReturns{OpenLayers.Pixel} The the new px position of the popup on the screen relative to the passed-in px.
OpenLayers. Renderer. CanvasA renderer based on the 2D ‘canvas’ drawing element.element InheritsSummary | | | {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. | | | | 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. | | | | |
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.
OpenLayers. Renderer. Canvas
eraseGeometryeraseGeometry: 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
setExtentsetExtent: function( | extent | ) |
|
Set the visible part of the layer. Resolution has probably changed, so we nullify the resolution cache (this.resolution), then redraw. Parameters
setSizeSets the size of the drawing surface. Once the size is updated, redraw the canvas. Parameters
drawFeaturedrawFeature: function( | feature, | | style | ) |
|
Draw the feature. Stores the feature in the features list, then redraws the layer. Parameters
drawGeometrydrawGeometry: function( | geometry, | | style | ) |
|
Used when looping (in redraw) over the features; draws the canvas. Parameters
drawExternalGraphicdrawExternalGraphic: function( | pt, | | style | ) |
|
Called to draw External graphics. Parameters
setCanvasStylesetCanvasStyle: function( | type, | | style | ) |
|
Prepare the canvas for drawing by setting various global settings. Parameterstype | {String} one of ‘stroke’, ‘fill’, or ‘reset’ | style | {Object} Symbolizer hash |
drawPointdrawPoint: function( | geometry, | | style | ) |
|
This method is only called by the renderer itself. Parameters
drawLineStringdrawLineString: function( | geometry, | | style | ) |
|
This method is only called by the renderer itself. Parameters
drawLinearRingdrawLinearRing: function( | geometry, | | style | ) |
|
This method is only called by the renderer itself. Parameters
drawPolygondrawPolygon: function( | geometry, | | style | ) |
|
This method is only called by the renderer itself. Parameters
drawTextdrawText: function( | location, | | style | ) |
|
This method is only called by the renderer itself. Parameterslocation | {<OpenLayers.Point>} | style | {Object} |
getLocalXYgetLocalXY: function( | point | ) |
|
transform geographic xy into pixel xy Parameters
clearClear all vectors from the renderer. virtual function.
getFeatureIdFromEventgetFeatureIdFromEvent: function( | evt | ) |
|
Returns a feature id from an event on the renderer. ParametersReturns{String} A feature id or null.
eraseFeatureseraseFeatures: function( | features | ) |
|
This is called by the layer to erase features; removes the feature from the list, then redraws the layer. Parameters
redrawThe 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.
OpenLayers. Renderer. Canvas. LABEL_ALIGN
OpenLayers. ElementsIndexerThis 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. |
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.
determineZIndexdetermineZIndex: 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
OpenLayers. ElementsIndexer. IndexingMethodsThese 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. |
Z_ORDERZ_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. ParametersReturns{Integer}
OpenLayers. Renderer. ElementsThis 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. InheritsSummary | | | | | | | | | | | | | {<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. | | | | | | | | | | | | | | | | | | 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. | | | | | | 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. |
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.
OpenLayers. Renderer. ElementsParameterscontainerID | {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.
clearRemove all the elements from the root
getNodeTypegetNodeType: 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. ParametersReturns{String} The corresponding node type for the specified geometry
drawGeometrydrawGeometry: 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. ParametersReturns{Boolean} true if the geometry has been drawn completely; null if incomplete; false otherwise
redrawNoderedrawNode: function( | id, | | geometry, | | style, | | featureId | ) |
|
ParametersReturns{Boolean} true if the complete geometry could be drawn, null if parts of the geometry could not be drawn, false otherwise
redrawBackgroundNoderedrawBackgroundNode: 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. ParametersReturns{Boolean} true if the complete geometry could be drawn, null if parts of the geometry could not be drawn, false otherwise
drawGeometryNodedrawGeometryNode: 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. ParametersReturns{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)
postDrawThings that have do be done after the geometry node is appended to its parent node. To be overridden by subclasses. Parameters
drawPointdrawPoint: function( | node, | | geometry | ) |
|
Virtual function for drawing Point Geometry. Should be implemented by subclasses. This method is only called by the renderer itself. ParametersReturns{DOMElement} or false if the renderer could not draw the point
drawLineStringdrawLineString: function( | node, | | geometry | ) |
|
Virtual function for drawing LineString Geometry. Should be implemented by subclasses. This method is only called by the renderer itself. ParametersReturns{DOMElement} or null if the renderer could not draw all components of the linestring, or false if nothing could be drawn
drawLinearRingdrawLinearRing: function( | node, | | geometry | ) |
|
Virtual function for drawing LinearRing Geometry. Should be implemented by subclasses. This method is only called by the renderer itself. ParametersReturns{DOMElement} or null if the renderer could not draw all components of the linear ring, or false if nothing could be drawn
drawPolygondrawPolygon: function( | node, | | geometry | ) |
|
Virtual function for drawing Polygon Geometry. Should be implemented by subclasses. This method is only called by the renderer itself. ParametersReturns{DOMElement} or null if the renderer could not draw all components of the polygon, or false if nothing could be drawn
drawRectangledrawRectangle: function( | node, | | geometry | ) |
|
Virtual function for drawing Rectangle Geometry. Should be implemented by subclasses. This method is only called by the renderer itself. ParametersReturns{DOMElement} or false if the renderer could not draw the rectangle
drawCircledrawCircle: function( | node, | | geometry | ) |
|
Virtual function for drawing Circle Geometry. Should be implemented by subclasses. This method is only called by the renderer itself. ParametersReturns{DOMElement} or false if the renderer could not draw the circle
drawSurfacedrawSurface: function( | node, | | geometry | ) |
|
Virtual function for drawing Surface Geometry. Should be implemented by subclasses. This method is only called by the renderer itself. ParametersReturns{DOMElement} or false if the renderer could not draw the surface
removeTextremoveText: function( | featureId | ) |
|
Removes a label Parameters
getFeatureIdFromEventgetFeatureIdFromEvent: function( | evt | ) |
|
ParametersReturns{OpenLayers.Geometry} A geometry from an event that happened on a layer.
eraseGeometryeraseGeometry: 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
nodeFactorynodeFactory: 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. Parametersid | {String} | type | {String} type Kind of node to draw. |
Returns{DOMElement} A new node of the given type and id.
nodeTypeComparenodeTypeCompare: function( | node, | | type | ) |
|
Parametersnode | {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.
createNodecreateNode: function( | type, | | id | ) |
|
Parameterstype | {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.
moveRootmoveRoot: function( | renderer | ) |
|
moves this renderer’s root to a different renderer. Parameters
getRenderLayerIdgetRenderLayerId: 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.
isComplexSymbolisComplexSymbol: function( | graphicName | ) |
|
Determines if a symbol cannot be rendered using drawCircle ParametersReturns {Boolean} true if the symbol is complex, false if not
OpenLayers. Renderer. symbolCoordinate arrays for well known (named) symbols.
OpenLayers. Strategy. FixedA simple strategy that requests features once and never requests new data. Inherits fromSummary | | | Create a new Fixed strategy. | | Activate the strategy: load data or add listener to load when visible | | | | Tells protocol to load data and unhooks the visibilitychanged event | | Add all features to the layer. |
OpenLayers. Strategy. FixedCreate a new Fixed strategy. Parametersoptions | {Object} Optional object whose properties will be set on the instance. |
activateActivate 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.
deactivateDeactivate the strategy. Undo what is done in activate. Returns{Boolean} The strategy was successfully deactivated.
loadTells protocol to load data and unhooks the visibilitychanged event Parametersoptions | {Object} options to pass to protocol read. |
mergeAdd all features to the layer.
OpenLayers. TweenSummary | | | {int} Interval in milliseconds between 2 steps | | | | | | {int} Interval id returned by window.setInterval | | {Boolean} Tells if the easing is currently playing | | | | | | Calls the appropriate easing method |
INTERVAL{int} Interval in milliseconds between 2 steps
interval{int} Interval id returned by window.setInterval
playing{Boolean} Tells if the easing is currently playing
OpenLayers. TweenCreates a Tween. Parameterseasing | {<OpenLayers.Easing>(Function)} easing function method to use |
playCalls the appropriate easing method
OpenLayers. Easing. Linear
easeIneaseIn: function( | t, | | b, | | c, | | d | ) |
|
Parameterst | {Float} time | b | {Float} beginning position | c | {Float} total change | d | {Float} duration of the transition |
easeOuteaseOut: function( | t, | | b, | | c, | | d | ) |
|
Parameterst | {Float} time | b | {Float} beginning position | c | {Float} total change | d | {Float} duration of the transition |
easeInOuteaseInOut: function( | t, | | b, | | c, | | d | ) |
|
Parameterst | {Float} time | b | {Float} beginning position | c | {Float} total change | d | {Float} duration of the transition |
easeIneaseIn: function( | t, | | b, | | c, | | d | ) |
|
Parameterst | {Float} time | b | {Float} beginning position | c | {Float} total change | d | {Float} duration of the transition |
easeOuteaseOut: function( | t, | | b, | | c, | | d | ) |
|
Parameterst | {Float} time | b | {Float} beginning position | c | {Float} total change | d | {Float} duration of the transition |
easeInOuteaseInOut: function( | t, | | b, | | c, | | d | ) |
|
Parameterst | {Float} time | b | {Float} beginning position | c | {Float} total change | d | {Float} duration of the transition |
easeIneaseIn: function( | t, | | b, | | c, | | d | ) |
|
Parameterst | {Float} time | b | {Float} beginning position | c | {Float} total change | d | {Float} duration of the transition |
easeOuteaseOut: function( | t, | | b, | | c, | | d | ) |
|
Parameterst | {Float} time | b | {Float} beginning position | c | {Float} total change | d | {Float} duration of the transition |
easeInOuteaseInOut: function( | t, | | b, | | c, | | d | ) |
|
Parameterst | {Float} time | b | {Float} beginning position | c | {Float} total change | d | {Float} duration of the transition |
OpenLayers. Control. ArgParserThe 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 fromSummary | | | | | 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. |
OpenLayers. Control. ArgParser
setMapSet the map property for the control. Parameters
setCenterAs soon as a baseLayer has been loaded, we center and zoom ...and remove the handler.
configureLayersconfigureLayers: function() |
As soon as all the layers are loaded, cycle through them and hide or show them.
OpenLayers. Control. PanZoomThe 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 fromSummary | | | {Array(DOMElement)} Array of Button Divs | | | | | | | | | | | | | | | | | | | | | | | | |
buttons{Array(DOMElement)} Array of Button Divs
OpenLayers. Control. PanZoom
drawParametersReturns{DOMElement} A reference to the container div for the PanZoom control.
_addButton_addButton:function( | id, | | img, | | xy, | | sz | ) |
|
ParametersReturns{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
removeButtonsremoveButtons: function() |
doubleClickdoubleClick: function ( | evt | ) |
|
ParametersReturns{Boolean}
buttonDownbuttonDown: function ( | evt | ) |
|
Parameters
OpenLayers. Control. ScaleLineThe 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 fromIs 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. | | | | | | | | Create a new scale line control. | | | | 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. |
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.
OpenLayers. Control. ScaleLineCreate a new scale line control. Parametersoptions | {Object} An optional object whose properties will be used to extend the control. |
getBarLengetBarLen: 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. ParametersmaxLen | {float} the number we’re rounding down from |
Returns{Float} the rounded number (less than or equal to maxLen)
updateUpdate the size of the bars, and the labels they contain.
OpenLayers. EventUtility functions for event handling. Summary | | | {Object} A hashtable cache of the event observers. | | | | | | | | | | | | | | | | | | | | | | | | 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. |
observers{Object} A hashtable cache of the event observers. Keyed by element._eventCacheID
elementCross browser event element detection. ParametersReturns{DOMElement} The element that caused the event
isLeftClickisLeftClick: function( | event | ) |
|
Determine whether event was caused by a left click. ParametersReturns{Boolean}
isRightClickisRightClick: function( | event | ) |
|
Determine whether event was caused by a right mouse click. ParametersReturns{Boolean}
stopstop: function( | event, | | allowDefault | ) |
|
Stops an event from propagating. Parametersevent | {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 |
findElementfindElement: function( | event, | | tagName | ) |
|
Parametersevent | {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
observeobserve: function( | elementParam, | | name, | | observer, | | useCapture | ) |
|
ParameterselementParam | {DOMElement || String} | name | {String} | observer | {function} | useCapture | {Boolean} |
stopObservingElementstopObservingElement: 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. parameterselementParam | {DOMElement || String} |
_removeElementObservers_removeElementObservers: function( | elementObservers | ) |
|
ParameterselementObservers | {Array(Object)} Array of (element, name, observer, usecapture) objects, taken directly from hashtable |
stopObservingstopObserving: function( | elementParam, | | name, | | observer, | | useCapture | ) |
|
ParameterselementParam | {DOMElement || String} | name | {String} | observer | {function} | useCapture | {Boolean} |
Returns{Boolean} Whether or not the event observer was removed
unloadCacheCycle through all the element entries in the events cache and call stopObservingElement on each.
OpenLayers. EventsSummary | | | {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 | | | | | | 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. | | |
BROWSER_EVENTS{Array(String)} supported events
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
OpenLayers. EventsConstruct an OpenLayers.Events object. Parametersobject | {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. |
attachToElementattachToElement: function ( | element | ) |
|
Parameterselement | {HTMLDOMElement} a DOM element to attach browser events to |
onConvenience method for registering listeners with a common scope. Example useevents.on({ "loadstart": loadStartListener, "loadend": loadEndListener, scope: object });
unConvenience method for unregistering listeners with a common scope. Example useevents.un({ "loadstart": loadStartListener, "loadend": loadEndListener, scope: object });
removeRemove all listeners for a given event type. If type is not registered, does nothing. Parameters
handleBrowserEventhandleBrowserEvent: 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
getMousePositiongetMousePosition: function ( | evt | ) |
|
ParametersReturns{OpenLayers.Pixel} The current xy coordinate of the mouse, adjusted for offsets
OpenLayers. FormatBase 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. |
options{Object} A reference to options passed to the constructor.
OpenLayers. FormatInstances of this class are not useful. See one of the subclasses. Parametersoptions | {Object} An optional object with properties to set on the format |
Valid optionskeepData | {Boolean} If true, upon read, the data property will be set to the parsed object (e.g. the json or xml object). |
ReturnsAn instance of OpenLayers.Format
readRead data from a string, and return an object whose type depends on the subclass. Parametersdata | {string} Data to read/parse. |
ReturnsDepends on the subclass
writeAccept an object, and return a string. Parametersobject | {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. AnchoredBubbleInherits fromSummary | | | {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. | | | | Update RICO corners according to the popup’s current relative postion. | | {String} The proper corners string (“tr tl bl br”) for rico to round. | | | | |
rounded{Boolean} Has the popup been rounded yet?
OpenLayers. Popup. AnchoredBubble
drawParametersReturns{DOMElement} Reference to a div that contains the drawn popup.
updateRelativePositionupdateRelativePosition: function() |
The popup has been moved to a new relative location, in which case we will want to re-do the rico corners.
setBordersetBorder:function( | border | ) |
|
Always sets border to 0. Bubble Popups can not have a border. Parameters
setRicoCornerssetRicoCorners:function() |
Update RICO corners according to the popup’s current relative postion.
getCornersToRoundgetCornersToRound:function() |
Returns{String} The proper corners string (“tr tl bl br”) for rico to round.
CORNER_SIZE{Integer} 5. Border space for the RICO corners.
OpenLayers. ProjectionClass 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. | | | | | | 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. |
proj{Object} Proj4js.Proj instance.
OpenLayers. ProjectionThis class offers several methods for interacting with a wrapped pro4js projection object. ParametersprojCode | {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.
toStringConvert projection to string (getCode wrapper). Returns{String} The projection code.
equalsequals: function( | projection | ) |
|
Test equality of two projection instances. Determines equality based soley on the projection code. Returns{Boolean} The two projections are equivalent.
destroyDestroy projection object.
transformsTransforms 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. Note | Properties 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.SVGInheritsSummary | | | | | | | | | {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 | | | | | | | | 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 | | | | | | |
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.
translationParameters{Object} Hash with “x” and “y” properties
symbolSize{Object} Cache for symbol sizes according to their svg coordinate space
inValidRangeinValidRange: function( | x, | | y, | | xyOnly | ) |
|
See #669 for more information Parametersx | {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.
setExtentsetExtent: function( | extent, | | resolutionChanged | ) |
|
ParametersReturns{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.
translateTransforms the SVG coordinate system ParametersReturns{Boolean} true if the translation parameters are in the valid coordinates range, false otherwise.
setSizeSets the size of the drawing surface. Parameters
getNodeTypegetNodeType: function( | geometry, | | style | ) |
|
ParametersReturns{String} The corresponding node type for the specified geometry
setStylesetStyle: 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 Parametersnode | {SVGDomElement} An SVG element to decorate | style | {Object} | options | {Object} Currently supported options include ‘isFilled’ {Boolean} and ‘isStroked’ {Boolean} |
dashStyledashStyle: function( | style, | | widthFactor | ) |
|
Parametersstyle | {Object} | widthFactor | {Number} |
Returns{String} A SVG compliant ‘stroke-dasharray’ value
createNodecreateNode: function( | type, | | id | ) |
|
Parameterstype | {String} Kind of node to draw | id | {String} Id for node |
Returns{DOMElement} A new node of the given type and id
nodeTypeComparenodeTypeCompare: function( | node, | | type | ) |
|
Parametersnode | {SVGDomElement} An SVG element | type | {String} Kind of node |
Returns{Boolean} Whether or not the specified node is of the specified type
createRenderRootcreateRenderRoot: function() |
Returns{DOMElement} The specific render engine’s root element
createRootcreateRoot: function( | suffix | ) |
|
Parametersuffix | {String} suffix to append to the id |
Returns{DOMElement}
createDefsReturns{DOMElement} The element to which we’ll add the symbol definitions
drawPointdrawPoint: function( | node, | | geometry | ) |
|
This method is only called by the renderer itself. ParametersReturns{DOMElement} or false if the renderer could not draw the point
drawCircledrawCircle: function( | node, | | geometry, | | radius | ) |
|
This method is only called by the renderer itself. ParametersReturns{DOMElement} or false if the renderer could not draw the circle
drawLineStringdrawLineString: function( | node, | | geometry | ) |
|
This method is only called by the renderer itself. ParametersReturns{DOMElement} or null if the renderer could not draw all components of the linestring, or false if nothing could be drawn
drawLinearRingdrawLinearRing: function( | node, | | geometry | ) |
|
This method is only called by the renderer itself. ParametersReturns{DOMElement} or null if the renderer could not draw all components of the linear ring, or false if nothing could be drawn
drawPolygondrawPolygon: function( | node, | | geometry | ) |
|
This method is only called by the renderer itself. ParametersReturns{DOMElement} or null if the renderer could not draw all components of the polygon, or false if nothing could be drawn
drawRectangledrawRectangle: function( | node, | | geometry | ) |
|
This method is only called by the renderer itself. ParametersReturns{DOMElement} or false if the renderer could not draw the rectangle
drawSurfacedrawSurface: function( | node, | | geometry | ) |
|
This method is only called by the renderer itself. ParametersReturns{DOMElement} or false if the renderer could not draw the surface
drawTextdrawText: function( | featureId, | | style, | | location | ) |
|
This method is only called by the renderer itself. Parameters
getComponentStringParameterscomponents | {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)
clipLineclipLine: 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. ParametersbadComponent | {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. |
getShortStringgetShortString: function( | point | ) |
|
ParametersReturns{String} or false if point is outside the valid range
getPositiongetPosition: function( | node | ) |
|
Finds the position of an svg node. ParametersReturns{Object} hash with x and y properties, representing the coordinates within the svg coordinate system
importSymbolimportSymbol: function ( | graphicName | ) |
|
add a new symbol definition from the rendererer’s symbol hash ParametersgraphicName | {String} name of the symbol to import |
Returns{String} | id of the imported symbol |
OpenLayers. Renderer. SVG. LABEL_ALIGN
OpenLayers. Renderer. SVG. LABEL_VSHIFT
OpenLayers. Renderer.VMLRender 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 fromSummary | | | {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. | | | | | | Determine whether a node is of a given type | | | | Create the main root element | | | | | | | | | | | | | | | | 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 | | | | |
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
OpenLayers. Renderer.VMLCreate a new VML renderer. ParameterscontainerID | {String} The id for the element that contains the renderer |
setExtentsetExtent: function( | extent, | | resolutionChanged | ) |
|
Set the renderer’s extent ParametersReturns{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.
setSizeSet the size of the drawing surface Parameters
getNodeTypegetNodeType: function( | geometry, | | style | ) |
|
Get the node type for a geometry and style ParametersReturns{String} The corresponding node type for the specified geometry
setStylesetStyle: function( | node, | | style, | | options, | | geometry | ) |
|
Use to set all the style attributes to a VML node. Parametersnode | {DOMElement} An VML element to decorate | style | {Object} | options | {Object} Currently supported options include ‘isFilled’ {Boolean} and ‘isStroked’ {Boolean} | geometry | {OpenLayers.Geometry} |
graphicRotategraphicRotate: 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. Parametersnode | {DOMElement} | xOffset | {Number} rotation center relative to image, x coordinate | yOffset | {Number} rotation center relative to image, y coordinate |
postDrawSome 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
setNodeDimensionsetNodeDimension: 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
dashStyledashStyle: function( | style | ) |
|
ParametersReturns{String} A VML compliant ‘stroke-dasharray’ value
createNodecreateNode: function( | type, | | id | ) |
|
Create a new node Parameterstype | {String} Kind of node to draw | id | {String} Id for node |
Returns{DOMElement} A new node of the given type and id
nodeTypeComparenodeTypeCompare: function( | node, | | type | ) |
|
Determine whether a node is of a given type Parametersnode | {DOMElement} An VML element | type | {String} Kind of node |
Returns{Boolean} Whether or not the specified node is of the specified type
createRenderRootcreateRenderRoot: function() |
Create the renderer root Returns{DOMElement} The specific render engine’s root element
createRootcreateRoot: function( | suffix | ) |
|
Create the main root element Parameterssuffix | {String} suffix to append to the id |
Returns{DOMElement}
drawPointdrawPoint: function( | node, | | geometry | ) |
|
Render a point ParametersReturns{DOMElement} or false if the point could not be drawn
drawCircledrawCircle: function( | node, | | geometry, | | radius | ) |
|
Render a circle. Size and Center a circle given geometry (x,y center) and radius ParametersReturns{DOMElement} or false if the circle could not ne drawn
drawLineStringdrawLineString: function( | node, | | geometry | ) |
|
Render a linestring. ParametersReturns{DOMElement}
drawLinearRingdrawLinearRing: function( | node, | | geometry | ) |
|
Render a linearring ParametersReturns{DOMElement}
DrawLineRender a line. Parametersnode | {DOMElement} | geometry | {OpenLayers.Geometry} | closeLine | {Boolean} Close the line? (make it a ring?) |
Returns{DOMElement}
drawPolygondrawPolygon: function( | node, | | geometry | ) |
|
Render a polygon ParametersReturns{DOMElement}
drawRectangledrawRectangle: function( | node, | | geometry | ) |
|
Render a rectangle ParametersReturns{DOMElement}
drawTextdrawText: function( | featureId, | | style, | | location | ) |
|
This method is only called by the renderer itself. Parameters
drawSurfacedrawSurface: function( | node, | | geometry | ) |
|
ParametersReturns{DOMElement}
moveRootmoveRoot: function( | renderer | ) |
|
moves this renderer’s root to a different renderer. Parametersrenderer | {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
importSymbolimportSymbol: function ( | graphicName | ) |
|
add a new symbol definition from the rendererer’s symbol hash ParametersgraphicName | {String} name of the symbol to import |
Returns{Object} | hash of {DOMElement} “symbol” and {Number} “size” |
OpenLayers. Renderer. VML. LABEL_SHIFT
OpenLayers.TileThis 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.0 | remove reference to url in above paragraph |
Summary | | | {Array(String)} Supported application event types | | | | | | | | {String} url of the request. | | | | | | {Boolean} Is the tile loading? | | | | | | 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. | | | | 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. | | | | |
EVENT_TYPES{Array(String)} Supported application event types
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.
isLoading{Boolean} Is the tile loading?
unloadCall 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.
drawClear 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.
moveTomoveTo: function ( | bounds, | | position, | | redraw | ) |
|
Reposition the tile. Parameters
clearClear the tile of any bounds/position-related data so that it can be reused in a new location. To be implemented by subclasses.
getBoundsFromBaseLayergetBoundsFromBaseLayer: 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. ParametersReturns
showTileShow the tile only if it should be drawn.
showShow the tile. To be implemented by subclasses.
hideHide the tile. To be implemented by subclasses.
OpenLayers. Format.XMLRead 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 fromSummary | | | {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. | | | | | | 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. |
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.
readersContains 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.
writersAs 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.
OpenLayers. Format.XMLConstruct 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. Parametersoptions | {Object} Optional object whose properties will be set on the object. |
setNamespacesetNamespace: function( | alias, | | uri | ) |
|
Set a namespace alias and URI for the format. Parametersalias | {String} The namespace alias (prefix). | uri | {String} The namespace URI. |
createElementNSPluscreateElementNSPlus: function( | name, | | options | ) |
|
Shorthand for creating namespaced elements with optional attributes and child text nodes. Parametersname | {String} The qualified node name. | options | {Object} Optional object for node configuration. |
Valid optionsuri | {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.
setAttributessetAttributes: function( | node, | | obj | ) |
|
Set multiple attributes given key value pairs from an object. Parametersnode | {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. |
readNodereadNode: 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. Parametersnode | {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).
readChildNodesreadChildNodes: 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. Parametersnode | {DOMElement} The node to be read (required). | obj | {Object} The object to be modified (optional). |
Returns{Object} The input object, modified.
writeNodewriteNode: 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. Parametersname | {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.
getThisOrNextElgetThisOrNextEl: 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. Parametersnode | {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. HandlerBase 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 | | | | | | | | | {Event} This property references the last event handled by the 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. | | | | | | 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. | | |
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.
OpenLayers. HandlerConstruct a handler. Parameterscontrol | {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. |
checkModifierscheckModifiers: 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.
callbackcallback: function ( | name, | | args | ) |
|
Trigger the control’s named callback with the given arguments Parametersname | {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). |
registerregister: function ( | name, | | method | ) |
|
register an event on the map
unregisterunregister: function ( | name, | | method | ) |
|
unregister an event from the map
setEventWith 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). Parametersevt | {Event} The browser event. |
OpenLayers. Handler. MOD_NONEIf set as the <keyMask>, checkModifiers returns false if any key is down.
OpenLayers. Handler. MOD_SHIFTIf set as the <keyMask>, checkModifiers returns false if Shift is down.
OpenLayers. Handler. MOD_CTRLIf set as the <keyMask>, checkModifiers returns false if Ctrl is down.
OpenLayers. Handler. MOD_ALTIf set as the <keyMask>, checkModifiers returns false if Alt is down.
OpenLayers.MapInstances 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. | | | | {Boolean} The map is currently being dragged. | | | | {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. | | | | | | | | {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. | | | | | | 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 | | | | | | | | | | This function takes care to recenter the layerContainerDiv. | | | | | | | | | | | | {Integer} 256 Default tile width (unless otherwise specified) | | {Integer} 256 Default tile height (unless otherwise specified) |
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
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.
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:
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.
OpenLayers.MapConstructor for a new OpenLayers.Map instance. There are two possible ways to call the map constructor. See the examples below. Parametersdiv | {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 two | single 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" });
unloadDestroyFunction that is called to destroy the map on page unload. stored here so that if map is manually destroyed, we can unregister this.
updateSizeDestroyWhen 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.
setLayerZIndexsetLayerZIndex: function ( | layer, | | zIdx | ) |
|
Parameters
resetLayersZIndexresetLayersZIndex: function() |
Reset each layer’s z-index based on layer’s array index
addControlToMapaddControlToMap: function ( | control, | | px | ) |
|
Parameters
calculateBoundscalculateBounds: function( | center, | | resolution | ) |
|
Parameterscenter | {OpenLayers.LonLat} Default is this.getCenter() | resolution | {float} Default is this.getResolution() |
Returns{OpenLayers.Bounds} A bounds based on resolution, center, and current mapsize.
moveTomoveTo: function( | lonlat, | | zoom, | | options | ) |
|
Parameters
centerLayerContainercenterLayerContainer: function ( | lonlat | ) |
|
This function takes care to recenter the layerContainerDiv. Parameters
isValidZoomLevelisValidZoomLevel: function( | zoomLevel | ) |
|
ParametersReturns{Boolean} Whether or not the zoom level passed in is non-null and within the min/max range of zoom levels.
isValidLonLatisValidLonLat: function( | lonlat | ) |
|
ParametersReturns{Boolean} Whether or not the lonlat passed in is non-null and within the maxExtent bounds
getLonLatFromViewPortPxgetLonLatFromViewPortPx: function ( | viewPortPx | ) |
|
ParametersReturns{OpenLayers.LonLat} An OpenLayers.LonLat which is the passed-in view port OpenLayers.Pixel, translated into lon/lat by the current base layer.
getLonLatFromLayerPxgetLonLatFromLayerPx: function ( | px | ) |
|
ParametersReturns{OpenLayers.LonLat}
TILE_WIDTH{Integer} 256 Default tile width (unless otherwise specified)
TILE_HEIGHT{Integer} 256 Default tile height (unless otherwise specified)
OpenLayers. MarkerInstances 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. Examplevar 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 | | | | | | | | | | | | | | | 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. | | | | |
drawCalls draw on the icon, and returns that output. ParametersReturns{DOMElement} A new DOM Image with this marker’s icon set at the location passed-in
eraseErases any drawn elements for this marker.
moveToMove the marker to the new location. Parameters
onScreenReturns{Boolean} Whether or not the marker is currently visible on screen.
inflateinflate: function( | inflate | ) |
|
Englarges the markers icon by the specified ratio. Parametersinflate | {float} the ratio to enlarge the marker by (passing 2 will double the size). |
setOpacitysetOpacity: function( | opacity | ) |
|
Change the opacity of the marker by changin the opacity of its icon Parametersopacity | {float} Specified as fraction (0.4, etc) |
setUrlChange URL of the Icon Image.
displaydisplay: function( | display | ) |
|
Hide or show the icon
defaultIconOpenLayers.Marker.defaultIcon = function() |
Creates a default OpenLayers.Icon. Returns{OpenLayers.Icon} A default OpenLayers.Icon to use for a marker
OpenLayers. RequestThe 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. |
DEFAULT_CONFIG{Object} Default configuration for all requests.
OpenLayers. Tile. ImageInstances 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 fromSummary | | | {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. | | | | | | | | 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. |
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.
drawCheck that a tile should be drawn, and draw it. Returns{Boolean} Always returns true.
resetBackBufferresetBackBuffer: 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
renderTileInternal function to actually initialize the image tile, position it correctly, and set its url.
positionImagepositionImage: 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.
clearClear the tile of any bounds/position-related data so that it can be reused in a new location.
initImgDivCreates the imgDiv property on the tile.
checkImgURLMake 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
startTransitionstartTransition: 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.
showShow the tile by showing its frame.
hideHide the tile by hiding its frame.
OpenLayers. Control. OverviewMapThe 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 fromSummary | | | {DOMElement} The DOM element that contains the overview map | | | | | | | | Create a new overview map | | Render the control in the browser. | | | | Handle extent rectangle drag | | | | | | 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 |
element{DOMElement} The DOM element that contains the overview map
OpenLayers. Control. OverviewMapCreate a new overview map Parametersobject | {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. |
drawRender the control in the browser.
baseLayerDrawbaseLayerDraw: function() |
Draw the base layer | called if unable to complete in the initial draw |
rectDragHandle extent rectangle drag Parameters
mapDivClickmapDivClick: function( | evt | ) |
|
Handle browser events Parameters
maximizeControlmaximizeControl: function( | e | ) |
|
Unhide the control. Called when the control is in the map viewport. Parameters
minimizeControlminimizeControl: function( | e | ) |
|
Hide all the contents of the control, shrink the size, add the maximize icon Parameters
showToggleshowToggle: function( | minimize | ) |
|
Hide/Show the toggle depending on whether the control is minimized Parameters
updateUpdate the overview map after layers move.
isSuitableOverviewisSuitableOverview: function() |
Determines if the overview map is suitable given the extent and resolution of the main map.
createMapConstruct the map that this control contains
updateRectToMapupdateRectToMap: function() |
Updates the extent rectangle position and size to match the map extent
updateMapToRectupdateMapToRect: function() |
Updates the map extent to match the extent rectangle position and size
setRectPxBoundssetRectPxBounds: function( | pxBounds | ) |
|
Set extent rectangle pixel bounds. Parameters
getRectBoundsFromMapBoundsgetRectBoundsFromMapBounds: function( | lonLatBounds | ) |
|
Get the rect bounds from the map bounds. ParametersReturns{OpenLayers.Bounds}A bounds which is the passed-in map lon/lat extent translated into pixel bounds for the overview map
getMapBoundsFromRectBoundsgetMapBoundsFromRectBounds: function( | pxBounds | ) |
|
Get the map bounds from the rect bounds. ParametersReturns{OpenLayers.Bounds} Bounds which is the passed-in overview rect bounds translated into lon/lat bounds for the overview map
getLonLatFromOverviewPxgetLonLatFromOverviewPx: function( | overviewMapPx | ) |
|
Get a map location from a pixel location ParametersReturns{OpenLayers.LonLat} Location which is the passed-in overview map OpenLayers.Pixel, translated into lon/lat by the overview map
getOverviewPxFromLonLatgetOverviewPxFromLonLat: function( | lonlat | ) |
|
Get a pixel location from a map location ParametersReturns{OpenLayers.Pixel} Location which is the passed-in OpenLayers.LonLat, translated into overview map pixels
OpenLayers. FeatureFeatures are combinations of geography and attributes. The OpenLayers.Feature class specifically combines a marker and a lonlat. Summary | | | | | | | | | | | | | | | | | 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. | | | | Creates a popup object created from the ‘lonlat’, ‘popupSize’, and ‘popupContentHTML’ properties set in this.data. | | Destroys the popup created via createPopup. |
destroynullify references to prevent circular references and memory leaks
onScreenReturns{Boolean} Whether or not the feature is currently visible on screen (based on its ‘lonlat’ property)
createMarkerBased 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. Note | this.marker is set to return value |
destroyMarkerdestroyMarker: function() |
Destroys marker. If user overrides the createMarker() function, s/he should be able to also specify an alternative function for destroying it
createPopupcreatePopup: 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. Note | the 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 | Note | this.popup is set to return value |
ParameterscloseBox | {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.
destroyPopupDestroys 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. ClickA 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 fromSummary | | | {Number} The id of the timeout waiting to clear the delayedCall. | | | | {Number} The id of the right mouse timeout waiting to clear the <delayedEvent>. | | | | Create a new click handler. | | | | | | | | | | | | | | Determine whether the event is within the optional pixel tolerance. | | Clear the timer and set timerId to null. | | |
timerId{Number} The id of the timeout waiting to clear the delayedCall.
rightclickTimerId{Number} The id of the right mouse timeout waiting to clear the <delayedEvent>.
OpenLayers. Handler. ClickCreate a new click handler. Parameterscontrol | {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. |
mousedownHandle mousedown. Only registered as a listener if pixelTolerance is a non-zero value at construction. Returns{Boolean} Continue propagating this event.
mouseupHandle mouseup. Installed to support collection of right mouse events. Returns{Boolean} Continue propagating this event.
rightclickrightclick: 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.
delayedRightCalldelayedRightCall: function( | evt | ) |
|
Sets rightclickTimerId to null. And optionally triggers the rightclick callback if evt is set.
dblclickHandle 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.
clickHandle click. Returns{Boolean} Continue propagating this event.
passesTolerancepassesTolerance: 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).
clearTimerClear the timer and set timerId to null.
delayedCalldelayedCall: function( | evt | ) |
|
Sets timerId to null. And optionally triggers the click callback if evt is set.
OpenLayers. Handler.DragThe 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 fromSummary | | | {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. | | | | | | | | | | {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. | | | | | | | | | | | | The drag handler captures the click event. | | | | |
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.
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.
OpenLayers. Handler.DragReturns OpenLayers.Handler.Drag Parameterscontrol | {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} |
downThis method is called during the handling of the mouse down event. Subclasses can do their own processing here. Parametersevt | {Event} The mouse down event |
moveThis method is called during the handling of the mouse move event. Subclasses can do their own processing here. Parametersevt | {Event} The mouse move event |
upThis method is called during the handling of the mouse up event. Subclasses can do their own processing here. Parametersevt | {Event} The mouse up event |
outThis method is called during the handling of the mouse out event. Subclasses can do their own processing here. Parametersevt | {Event} The mouse out event |
mousedownmousedown: function ( | evt | ) |
|
Handle mousedown events ParametersReturns{Boolean} Let the event propagate.
mousemovemousemove: function ( | evt | ) |
|
Handle mousemove events ParametersReturns{Boolean} Let the event propagate.
removeTimeoutremoveTimeout: function() |
Private. Called by mousemove() to remove the drag timeout.
mouseupHandle mouseup events ParametersReturns{Boolean} Let the event propagate.
mouseoutHandle mouseout events ParametersReturns{Boolean} Let the event propagate.
clickThe 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. ParametersReturns{Boolean} Let the event propagate.
activateActivate the handler. Returns{Boolean} The handler was successfully activated.
deactivateDeactivate the handler. Returns{Boolean} The handler was successfully deactivated.
OpenLayers. Handler. FeatureHandler 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. | | | | | | | | | | {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. | | | | | | | | | | | | | | | | 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. | | | | | | 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. |
EVENTMAP{Object} A object mapping the browser events to objects with callback keys for in and out.
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.
geometryTypesTo 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.
OpenLayers. Handler. FeatureParameterscontrol | {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} |
mousedownHandle mouse down. Stop propagation if a feature is targeted by this event (stops map dragging during feature selection). Parameters
mouseupHandle mouse up. Stop propagation if a feature is targeted by this event. Parameters
clickHandle click. Call the “click” callback if click on a feature, or the “clickout” callback if click outside any feature. ParametersReturns{Boolean}
mousemoveHandle mouse moves. Call the “over” callback if moving in to a feature, or the “out” callback if moving out of a feature. ParametersReturns{Boolean}
dblclickHandle dblclick. Call the “dblclick” callback if dblclick on a feature. ParametersReturns{Boolean}
geometryTypeMatchesgeometryTypeMatches: function( | feature | ) |
|
Return true if the geometry type of the passed feature matches one of the geometry types in the geometryTypes array. Parametersfeature | {<OpenLayers.Vector.Feature>} |
Returns{Boolean}
handleParametersReturns{Boolean} The event occurred over a relevant feature.
triggerCallbacktriggerCallback: 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
activateTurn on the handler. Returns false if the handler was already active. Returns{Boolean}
deactivateTurn off the handler. Returns false if the handler was already active. Returns{Boolean}
moveLayerToTopmoveLayerToTop: function() |
Moves the layer for this handler to the top, so mouse events can reach it.
moveLayerBackmoveLayerBack: function() |
Moves the layer back to the position determined by the map’s layers array.
OpenLayers. Handler. HoverThe 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 fromSummary | | | | | | | | | 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. | | |
px{<OpenLayers.Pixel>} | The location of the last mousemove, expressed in pixels. |
timerId{Number} | The id of the timer. |
OpenLayers. Handler. HoverConstruct a hover handler. Parameterscontrol | {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. |
mousemoveCalled when the mouse moves on the map. ParametersReturns{Boolean} Continue propagating this event.
mouseoutCalled when the mouse goes out of the map. ParametersReturns{Boolean} Continue propagating this event.
passesTolerancepassesTolerance: function( | px | ) |
|
Determine whether the mouse move is within the optional pixel tolerance. ParametersReturns{Boolean} The mouse move is within the pixel tolerance.
clearTimerClear the timer and set timerId to null.
delayedCalldelayedCall: function( | evt | ) |
|
Triggers pause callback. Parameters
OpenLayers. Handler. MouseWheelHandler for wheel up/down events. Inherits fromSummary | | | | | { 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. | | | | |
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.
OpenLayers. Handler. MouseWheelParameterscontrol | {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} |
onWheelEventonWheelEvent: function( | e | ) |
|
Catch the wheel event and handle it xbrowserly Parameters
wheelZoomGiven the wheel event, we carry out the appropriate zooming in or out, based on the ‘wheelDelta’ or ‘detail’ property of the event. Parameters
mousemovemousemove: function ( | evt | ) |
|
Update the stored mousePosition on every move. Parametersevt | {Event} The browser event |
Returns{Boolean} Allow event propagation
deactivatedeactivate: function ( | evt | ) |
|
OpenLayers. LayerSummary | | | {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. |
opacity{Float} The layer’s opacity. Float number between 0.0 and 1.0.
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 propertiesobject | {Object} A reference to layer.events.object. | element | {DOMElement} A reference to layer.events.element. |
Supported map event typesloadstart | Triggered when layer loading starts. | loadend | Triggered when layer loading ends. | loadcancel | Triggered when layer loading is canceled. | visibilitychanged | Triggered when layer visibility is changed. | move | Triggered when layer moves (triggered with every mousemove during a drag). | moveend | Triggered when layer is done moving, object passed as argument has a zoomChanged boolean property which tells that the zoom has changed. |
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.
OpenLayers. LayerParametersname | {String} The layer name | options | {Object} Hashtable of extra options to tag onto the layer |
destroydestroy: 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. ParameterssetNewBaseLayer | {Boolean} Set a new base layer when this layer has been destroyed. Default is true. |
moveTomoveTo:function( | bounds, | | zoomChanged, | | dragging | ) |
|
Parametersbound | {OpenLayers.Bounds} | zoomChanged | {Boolean} Tells when zoom has changed, as layers have to do some init work in that case. | dragging | {Boolean} |
setMapSet 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
afterAddCalled at the end of the map.addLayer sequence. At this point, the map will have a base layer. To be overridden by subclasses.
initResolutionsinitResolutions: 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
getDataExtentgetDataExtent: 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}
getZIndexReturns{Integer} the z-index of this layer
setZIndexsetZIndex: function ( | zIndex | ) |
|
Parameters
adjustBoundsadjustBounds: 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
OpenLayers. Marker.BoxInherits fromSummary | | | | | | | | | | | | | Allow the user to change the box’s color and border width | | | | {Boolean} Whether or not the marker is currently visible on screen. | | |
setBordersetBorder: function ( | color, | | width | ) |
|
Allow the user to change the box’s color and border width Parameterscolor | {String} Default is “red” | width | {int} Default is 2 |
drawParametersReturns{DOMElement} A new DOM Image with this marker´s icon set at the location passed-in
onScreenRreturn{Boolean} Whether or not the marker is currently visible on screen.
displaydisplay: function( | display | ) |
|
Hide or show the icon Parameters
OpenLayers. Request. XMLHttpRequestStandard-compliant (W3C) cross-browser implementation of the XMLHttpRequest object. From http://code.google.com/p/xmlhttprequest/. Summary | | | | | Parse XML into a doc structure |
OpenLayers. nullHandlerOpenLayers.nullHandler = function( | request | ) |
|
@param {} request
parseXMLStringOpenLayers.parseXMLString = function( | text | ) |
|
Parse XML into a doc structure ParametersReturns{?} Parsed AJAX Responsev
OpenLayers.AjaxSummary | | | | | {Object} Transport mechanism for whichever browser we’re in, or false if none available. | | | | |
emptyFunctionemptyFunction: function () |
getTransportReturns{Object} Transport mechanism for whichever browser we’re in, or false if none available.
OpenLayers. Ajax. Responders
registerregister: function( | responderToAdd | ) |
|
Parameters
unregisterunregister: function( | responderToRemove | ) |
|
Parameters
dispatchdispatch: function( | callback, | | request, | | transport | ) |
|
Parameterscallback | {?} | request | {?} | transport | {?} |
OpenLayers. Ajax. RequestDeprecated. Use OpenLayers.Request method instead. InheritSummary | | | | | | | | | | | | | | | | | | | | | | | If the optional onException function is set, execute it and then dispatch the call to any other listener registered for onException. | | | | |
OpenLayers. Ajax. RequestParametersurl | {String} | options | {Object} |
onStateChangeonStateChange: function() |
setRequestHeaderssetRequestHeaders: function() |
respondToReadyStaterespondToReadyState: function( | readyState | ) |
|
Parameters
getHeadergetHeader: function( | name | ) |
|
ParametersReturns{?} | response header for the given name |
dispatchExceptiondispatchException: 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
OpenLayers. Ajax. ResponseSummary | | | | | | | | | | | | | | | | | | | | | Wrapper function around XMLSerializer, which doesn’t exist/work in IE/Safari. |
OpenLayers. Ajax. Response
getResponseHeadergetResponseHeader: function( | name | ) |
|
Returns{?} | response header for given name |
getElementsByTagNameNSOpenLayers.Ajax.getElementsByTagNameNS = function( | parentnode, | | nsuri, | | nsprefix, | | tagname | ) |
|
Parametersparentnode | {?} | nsuri | {?} | nsprefix | {?} | tagname | {?} |
Returns{?}
serializeXMLToStringOpenLayers.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 Parametersxmldom {XMLNode} xml dom to serialize Returns{?}
OpenLayers. Control. DragPanThe DragPan control pans the map with a drag of the mouse. Inherits fromSummary | | | {OpenLayers.Control.TYPES} | | | | {Integer} The number of milliseconds that should ellapse before panning the map again. | | | | | | | | Finish the panning operation. |
type{OpenLayers.Control.TYPES}
interval{Integer} The number of milliseconds that should ellapse before panning the map again. Set this to increase dragging performance. Defaults to 25 milliseconds.
panMapDoneFinish the panning operation. Only call setCenter (through panMap) if the map has actually been moved. Parameters
OpenLayers. Feature. VectorVector 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 fromSummary | | | | | { 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} rendering intent currently being used | | | | | | 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 | | | | | | OpenLayers features can have a number of style attributes. |
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.
renderIntent{String} rendering intent currently being used
OpenLayers. Feature. VectorCreate a vector feature. Parametersgeometry | {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. |
destroynullify references to prevent circular references and memory leaks
cloneCreate a clone of this vector feature. Does not set any non-standard properties. Returns{OpenLayers.Feature.Vector} An exact clone of this vector feature.
onScreenonScreen: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. ParametersboundsOnly | {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).
createMarkerHACK | we need to decide if all vector features should be able to create markers |
Returns{OpenLayers.Marker} For now just returns null
destroyMarkerdestroyMarker: function() |
HACK | we 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
createPopupHACK | we need to decide if all vector features should be able to create popups |
Returns{OpenLayers.Popup} For now just returns null
atPointatPoint: function( | lonlat, | | toleranceLon, | | toleranceLat | ) |
|
Determins whether the feature intersects with the specified location. Parameterslonlat | {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
destroyPopupHACK | we need to decide if all vector features should be able to delete popups |
moveMoves the feature and redraws it at its new location Parametersstate | {OpenLayers.LonLat or OpenLayers.Pixel} the location to which to move the feature. |
toStateSets the new state Parameters
OpenLayers. Feature. Vector. styleOpenLayers 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 propertiesfill | {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.BoxHandler for dragging a rectangle across the map. Box is displayed on mouse down, moves on mouse move, and is finished on mouse up. Inherits fromSummary | | | | | {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. |
boxCharacteristics{Object} Caches some box characteristics from css. This is used by the getBoxCharacteristics method.
OpenLayers. Handler.BoxParameterscontrol | {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} |
removeBoxRemove the zoombox from the screen and nullify our reference to it.
getCharacteristicsDetermines 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. RegularPolygonHandler 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 fromSummary | | | {Float} The angle from the origin (mouse down) to the current mouse position, in radians. | | {Boolean} The polygon has a fixed radius. | | | | | | | | | | 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 |
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.
OpenLayers. Handler. RegularPolygonCreate a new regular polygon handler. Parameterscontrol | {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 callbackscreate | Called when a sketch is first created. Callback called with the creation point geometry and sketch feature. | done | Called when the sketch drawing is finished. The callback will recieve a single argument, the sketch geometry. | cancel | Called when the handler is deactivated while drawing. The cancel callback will receive a geometry. |
downStart drawing a new feature Parametersevt | {Event} The drag start event |
moveRespond to drag move events Parameters
upFinish drawing the feature Parametersevt | {Event} The mouse up event |
outFinish drawing the feature. Parametersevt | {Event} The mouse out event |
createGeometrycreateGeometry: 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.
modifyGeometrymodifyGeometry: function() |
Modify the polygon geometry in place.
calculateAnglecalculateAngle: function( | point, | | evt | ) |
|
Calculate the angle based on settings. Parameters
finalizeFinish the geometry and call the “done” callback.
callbackcallback: function ( | name, | | args | ) |
|
Trigger the control’s named callback with the given arguments Parametersname | {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. EventPaneBase class for 3rd party layers. Create a new event pane layer with the OpenLayers.Layer.EventPane constructor. Inherits fromSummary | | | {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 |
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
OpenLayers. Layer. EventPaneCreate a new event pane layer Parametersname | {String} | options | {Object} Hashtable of extra options to tag onto the layer |
setMapSet 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
loadWarningMessageloadWarningMessage: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.
getWarningHTMLgetWarningHTML:function() |
To be implemented by subclasses. Returns{String} String with information on why layer is broken, how to get it working.
displaydisplay: function( | display | ) |
|
Set the display on the pane Parameters
setZIndexsetZIndex: function ( | zIndex | ) |
|
Set the z-index order for the pane. Parameters
moveTomoveTo:function( | bounds, | | zoomChanged, | | dragging | ) |
|
Handle calls to move the layer. Parameters
getLonLatFromViewPortPxgetLonLatFromViewPortPx: function ( | viewPortPx | ) |
|
Get a map location from a pixel location ParametersReturns{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
getViewPortPxFromLonLatgetViewPortPxFromLonLat: function ( | lonlat | ) |
|
Get a pixel location from a map location ParametersReturns{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
getOLLonLatFromMapObjectLonLatgetOLLonLatFromMapObjectLonLat: 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
getMapObjectLonLatFromOLLonLatgetMapObjectLonLatFromOLLonLat: function( | olLonLat | ) |
|
Get a 3rd party map location from an OL map location. ParametersReturns{Object} A MapObject LonLat, translated from the passed in OpenLayers.LonLat Returns null if null value is passed in
getOLPixelFromMapObjectPixelgetOLPixelFromMapObjectPixel: function( | moPixel | ) |
|
Get an OL pixel location from a 3rd party pixel location. ParametersReturns{OpenLayers.Pixel} An OpenLayers.Pixel, translated from the passed in MapObject Pixel Returns null if null value is passed in
getMapObjectPixelFromOLPixelgetMapObjectPixelFromOLPixel: function( | olPixel | ) |
|
Get a 3rd party pixel location from an OL pixel location ParametersReturns{Object} A MapObject Pixel, translated from the passed in OpenLayers.Pixel Returns null if null value is passed in
OpenLayers. Layer. FixedZoomLevelsSome 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 FixedZoomLevelsThe 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 |
OpenLayers. Layer. FixedZoomLevelsCreate a new fixed zoom levels layer.
initResolutionsinitResolutions: function() |
Populate the resolutions array
getZoomForResolutiongetZoomForResolution: function( | resolution | ) |
|
Get the zoom level for a given resolution ParametersReturns{Integer} A suitable zoom level for the specified resolution. If no baselayer is set, returns null.
getOLZoomFromMapObjectZoomgetOLZoomFromMapObjectZoom: function( | moZoom | ) |
|
Get the OL zoom index from the map object zoom level ParametersReturns{Integer} An OpenLayers Zoom level, translated from the passed in zoom Returns null if null value is passed in
getMapObjectZoomFromOLZoomgetMapObjectZoomFromOLZoom: function( | olZoom | ) |
|
Get the map object zoom level from the OL zoom level ParametersReturns{Integer} A MapObject level, translated from the passed in olZoom Returns null if null value is passed in
OpenLayers. Layer. HTTPRequestInherits fromSummary | | | {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. |
URL_HASH_FACTOR{Float} Used to hash URL param strings for multi-WMS server selection. Set to the Golden Ratio per Knuth’s recommendation.
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
OpenLayers. Layer. HTTPRequestParametersname | {String} | url | {Array(String) or String} | params | {Object} | options | {Object} Hashtable of extra options to tag onto the layer |
selectUrlselectUrl: 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. ParametersparamString | {String} | urls | {Array(String)} |
Returns{String} An entry from the urls array, deterministically selected based on the paramString.
getFullRequestStringgetFullRequestString: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. ParametersnewParams | {Object} | altUrl | {String} Use this as the url instead of the layer’s url |
Returns{String}
OpenLayers. Layer. MarkersInherits fromSummary | | | {Boolean} internal state of drawing. | | | | | | | | 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 |
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.
OpenLayers. Layer. MarkersCreate a Markers layer. Parametersname | {String} | options | {Object} Hashtable of extra options to tag onto the layer |
moveTomoveTo:function( | bounds, | | zoomChanged, | | dragging | ) |
|
Parameters
clearMarkersThis method removes all markers from a layer. The markers are not destroyed by this function, but are removed from the list of markers.
drawMarkerdrawMarker: function( | marker | ) |
|
Calculate the pixel location for the marker, create it, and add it to the layer’s div Parameters
OpenLayers. Layer. SphericalMercatorA 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 informationProj4 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 WKT900913=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 | | | | | 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. |
initMercatorParametersinitMercatorParameters: function() |
Set up the mercator parameters on the layer: resolutions, projection, units.
projectForwardprojectForward: 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. Parameterspoint | {Object} An object with x and y properties. |
Returns{Object} The point, with the x and y properties transformed to spherical mercator.
projectInverseprojectInverse: 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. Parameterspoint | {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 declaredTransforms from EPSG:4326 to EPSG:900913 and from EPSG:900913 to EPSG:4326 are set by this class.
OpenLayers. Control. DrawFeatureThe DrawFeature control draws point, line or polygon features on a vector layer when active. Inherits fromSummary | | | | | {Object} The functions that are sent to the handler for callback | | | | | | | | | | |
callbacks{Object} The functions that are sent to the handler for callback
EVENT_TYPESSupported event typesfeatureadded | Triggered when a feature is added |
OpenLayers. Control. DrawFeature
drawFeaturedrawFeature: function( | geometry | ) |
|
OpenLayers. Control. MeasureAllows for drawing of features for measurements. Inherits fromSummary | | | {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. | | | | | | | | | | |
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)measure | Triggered when a measurement sketch is complete. Listeners will receive an event with measure, units, order, and geometry properties. | measurepartial | Triggered when a new point is added to the measurement sketch. Listeners receive an event with measure, units, order, and geometry. |
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.
OpenLayers. Control. Measure
updateHandlerupdateHandler: function( | handler, | | options | ) |
|
Parametershandler | {Function} One of the sketch handler constructors. | options | {Object} Options for the handler. |
measureCompletemeasureComplete: function( | geometry | ) |
|
Called when the measurement sketch is done. Parameters
measurePartialmeasurePartial: function( | point, | | geometry | ) |
|
Called each time a new point is added to the measurement sketch. Parameters
measuremeasure: function( | geometry, | | eventType | ) |
|
Parameters
getBestAreagetBestArea: function( | geometry | ) |
|
Based on the displaySystem returns the area of a geometry. ParametersReturns{Array([Float, String])} Returns a two item array containing the area and the units abbreviation.
getAreagetArea: function( | geometry, | | units | ) |
|
ParametersReturns{Float} The geometry area in the given units.
getBestLengthgetBestLength: function( | geometry | ) |
|
Based on the displaySystem returns the length of a geometry. ParametersReturns{Array([Float, String])} Returns a two item array containing the length and the units abbreviation.
getLengthgetLength: function( | geometry, | | units | ) |
|
ParametersReturns{Float} The geometry length in the given units.
OpenLayers. Control. ZoomBoxThe 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 fromSummary | | | {OpenLayers.Control.TYPE} | | {Boolean} Should the control be used for zooming out? | | {Boolean} Always zoom in/out, when box drawed | | | | | | |
type{OpenLayers.Control.TYPE}
out{Boolean} Should the control be used for zooming out?
alwaysZoom{Boolean} Always zoom in/out, when box drawed
zoomBoxzoomBox: function ( | position | ) |
|
Parameters
OpenLayers. Format.WKTClass for reading and writing Well-Known Text. Create a new instance with the OpenLayers.Format.WKT constructor. Inherits fromSummary | | | 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. |
OpenLayers. Format.WKTCreate a new parser for WKT Parametersoptions | {Object} An optional object whose properties will be set on this instance |
Returns{OpenLayers.Format.WKT} A new WKT parser.
readDeserialize 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. ParametersReturns{<OpenLayers.Feature.Vector>|Array} A feature or array of features for GEOMETRYCOLLECTION WKT.
writewrite: function( | features | ) |
|
Serialize a feature or array of features into a WKT string. Parametersfeatures | {<OpenLayers.Feature.Vector>|Array} A feature or array of features |
Returns{String} The WKT string representation of the input geometries
OpenLayers. Layer. GoogleInherits fromSummary | | | | | | | {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. | | | | Hack-on function because GMAPS does not give it to us |
RESOLUTIONS{Array(Float)} Hardcode these resolutions so that they are more closely tied with the standard wms projection
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
OpenLayers. Layer. GoogleParametersname | {String} A name for the layer. | options | {Object} An optional object whose properties will be set on the layer. |
loadMapObjectLoad the GMap and register appropriate event listeners. If we can’t load GMap2, then display a warning message.
setMapTypeThe 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.
displaydisplay: function( | display | ) |
|
Hide or show the layer Parameters
addContainerPxFunctionaddContainerPxFunction: function() |
Hack-on function because GMAPS does not give it to us ParametersReturns{GPoint} A GPoint specifying gLatLng translated into “Container” coords
OpenLayers. Layer.GridBase class for layers that use a lattice of tiles. Create a new grid layer with the OpenLayers.Layer.Grid constructor. Inherits fromSummary | | | {Array(Array( OpenLayers.Tile))} This is an array of rows, each row is an array of tiles. | | | | | | 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. | | | | | | 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() | | | | | | 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. |
grid{Array(Array(OpenLayers.Tile))} This is an array of rows, each row is an array of tiles.
OpenLayers. Layer.GridCreate a new grid layer Parametersname | {String} | url | {String} | params | {Object} | options | {Object} Hashtable of extra options to tag onto the layer |
clearGridGo through and remove all tiles from the grid, calling destroy() on each of them to kill circular references
moveTomoveTo: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
getGridBoundsgetGridBounds: 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)
initSingleTileinitSingleTile: function( | bounds | ) |
|
Parameters
calculateGridLayoutcalculateGridLayout: function( | bounds, | | extent, | | resolution | ) |
|
Generate parameters for the grid layout. This ParametersReturnsObject containing properties tilelon, tilelat, tileoffsetlat, tileoffsetlat, tileoffsetx, tileoffsety
initGriddedTilesinitGriddedTiles:function( | bounds | ) |
|
Parameters
spiralTileLoadspiralTileLoad: 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.
addTileMonitoringHooksaddTileMonitoringHooks: 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
removeTileMonitoringHooksremoveTileMonitoringHooks: function( | tile | ) |
|
This function takes a tile as input and removes the tile hooks that were added in addTileMonitoringHooks() Parameters
moveGriddedTilesmoveGriddedTiles: function( | bounds | ) |
|
Parameters
shiftRowshiftRow:function( | prepend | ) |
|
Shifty grid work Parametersprepend | {Boolean} if true, prepend to beginning. if false, then append to end |
shiftColumnshiftColumn: function( | prepend | ) |
|
Shift grid work in the other dimension Parametersprepend | {Boolean} if true, prepend to beginning. if false, then append to end |
removeExcessTilesremoveExcessTiles: function( | rows, | | columns | ) |
|
When the size of the map or the buffer changes, we may need to remove some excess rows and columns. Parametersrows | {Integer} Maximum number of rows we want our grid to have. | colums | {Integer} Maximum number of columns we want our grid to have. |
onMapResizeFor singleTile layers, this will set a new tile size according to the dimensions of the map pane.
OpenLayers. Layer. VirtualEarthInherits fromSummary | | | | | | | {Array(Float)} Hardcode these resolutions so that they are more closely tied with the standard wms projection | | | | | | | | |
RESOLUTIONS{Array(Float)} Hardcode these resolutions so that they are more closely tied with the standard wms projection
OpenLayers. Layer. VirtualEarthParametersname | {String} | options | {Object} |
OpenLayers. Layer. YahooInherits fromSummary | | | | | | | {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. |
RESOLUTIONS{Array(Float)} Hardcode these resolutions so that they are more closely tied with the standard wms projection
OpenLayers. Layer. YahooParametersname | {String} | options | {Object} |
fixYahooEventPanefixYahooEventPane: 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.HTTPA basic HTTP protocol for vector layers. Create a new instance with the OpenLayers.Protocol.HTTP constructor. Inherits fromSummary | | | {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. |
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.
OpenLayers. Protocol.HTTPA class for giving layers generic HTTP protocol. Parametersoptions | {Object} Optional object whose properties will be set on the instance. |
Valid options includeurl | {String} | headers | {Object} | params | {Object} | format | {OpenLayers.Format} | callback | {Function} | scope | {Object} |
createCallbackcreateCallback: function( | method, | | response, | | options | ) |
|
Returns a function that applies the given public method with resp and options arguments. Parametersmethod | {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). |
handleReadhandleRead: function( | resp, | | options | ) |
|
Individual callbacks are created for read, create and update, should a subclass need to override each one separately. Parametersresp | {OpenLayers.Protocol.Response} The response object to pass to the user callback. | options | {Object} The user options passed to the read call. |
handleCreatehandleCreate: function( | resp, | | options | ) |
|
Called the the request issued by <create> is complete. May be overridden by subclasses. Parametersresp | {OpenLayers.Protocol.Response} The response object to pass to any user callback. | options | {Object} The user options passed to the create call. |
handleUpdatehandleUpdate: function( | resp, | | options | ) |
|
Called the the request issued by <update> is complete. May be overridden by subclasses. Parametersresp | {OpenLayers.Protocol.Response} The response object to pass to any user callback. | options | {Object} The user options passed to the update call. |
handleDeletehandleDelete: function( | resp, | | options | ) |
|
Called the the request issued by <delete> is complete. May be overridden by subclasses. Parametersresp | {OpenLayers.Protocol.Response} The response object to pass to any user callback. | options | {Object} The user options passed to the delete call. |
handleResponsehandleResponse: function( | resp, | | options | ) |
|
Called by CRUD specific handlers. Parametersresp | {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. |
parseFeaturesparseFeatures: function( | request | ) |
|
Read HTTP response body and return features. Parametersrequest | {XMLHttpRequest} The request object |
Returns{Array({OpenLayers.Feature.Vector})} or {OpenLayers.Feature.Vector} Array of features or a single feature.
callUserCallbackcallUserCallback: 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
OpenLayers. StyleThis 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 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. |
title{String} Title of this style (set if included in SLD)
description{String} Description of this style (set if abstract is included in SLD)
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.
OpenLayers. StyleCreates a UserStyle. Parametersstyle | {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 optionsReturn{OpenLayers.Style}
createSymbolizercreateSymbolizer: function( | feature | ) |
|
creates a style by applying all feature-dependent rules to the base style. ParametersReturns{Object} symbolizer hash
applySymbolizerapplySymbolizer: function( | rule, | | style, | | feature | ) |
|
Parametersrule | {OpenLayers.Rule} | style | {Object} | feature | {<OpenLayer.Feature.Vector>} |
Returns{Object} A style with new symbolizer applied.
createLiteralscreateLiterals: function( | style, | | feature | ) |
|
creates literals for all style properties that have an entry in <this.propertyStyles>. Parametersstyle | {Object} style to create literals for. Will be modified inline. | feature | {Object} |
Returns{Object} the modified style
findPropertyStylesfindPropertyStyles: 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;
addPropertyStylesaddPropertyStyles: function( | propertyStyles, | | symbolizer | ) |
|
ParameterspropertyStyles | {Object} hash to add new property styles to. Will be modified inline | symbolizer | {Object} search this symbolizer for property styles |
Returns{Object} propertyStyles hash
getSymbolizerPrefixgetSymbolizerPrefix: function( | geometry | ) |
|
Returns the correct symbolizer prefix according to the geometry type of the passed geometry Parametersgeometry {OpenLayers.Geometry} Returns{String} key of the according symbolizer
createLiteralOpenLayers.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. Parametersvalue | {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”.
OpenLayers. Style. SYMBOLIZER_PREFIXES{Array} prefixes of the sld symbolizers. These are the same as the main geometry types
OpenLayers. Control. NavigationThe 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). InheritsSummary | | | | | | | | | 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 | | | | |
OpenLayers. Control. NavigationCreate a new navigation control Parametersoptions | {Object} An optional object whose properties will be set on the control |
destroyThe 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.
defaultDblClickdefaultDblClick: function ( | evt | ) |
|
Parameters
defaultDblRightClickdefaultDblRightClick: function ( | evt | ) |
|
Parameters
wheelChangewheelChange: function( | evt, | | deltaZ | ) |
|
Parametersevt | {Event} | deltaZ | {Integer} |
wheelUpUser spun scroll wheel up Parameters
wheelDownUser spun scroll wheel down Parameters
disableZoomWheeldisableZoomWheel : function() |
enableZoomWheelenableZoomWheel : function() |
OpenLayers. GeometryA 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. | | | | | | | | Creates a geometry object. | | | | 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. | | |
id{String} A unique identifier for this geometry.
parent{OpenLayers.Geometry}This is set when a Geometry is added as component of another geometry
OpenLayers. GeometryCreates a geometry object.
clearBoundsNullify this components bounds and that of its parent as well.
extendBoundsextendBounds: 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
atPointatPoint: function( | lonlat, | | toleranceLon, | | toleranceLat | ) |
|
Note | This is only an approximation based on the bounds of the geometry. |
Parameterslonlat | {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
getLengthCalculate the length of this geometry. This method is defined in subclasses. Returns{Float} The length of the collection by summing its parts
getAreaCalculate the area of this geometry. This method is defined in subclasses. Returns{Float} The area of the collection by summing its parts
toStringReturns the Well-Known Text representation of a geometry Returns{String} Well-Known Text
OpenLayers. Geometry. fromWKTOpenLayers.Geometry.fromWKT = function( | wkt | ) |
|
Generate a geometry given a Well-Known Text string. Parameterswkt | {String} A string representing the geometry in Well-Known Text. |
Returns{OpenLayers.Geometry} A geometry of the appropriate class.
OpenLayers. Geometry. segmentsIntersectOpenLayers.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. Parametersseg1 | {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 optionspoint | {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. distanceToSegmentOpenLayers.Geometry.distanceToSegment = function( | point, | | segment | ) |
|
Parameterspoint | {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. MapGuideInstances of OpenLayers.Layer.MapGuide are used to display data from a MapGuide OS instance. Inherits fromSummary | | | {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] | | | | | | | | 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. |
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]
OpenLayers. Layer. MapGuideCreate 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 conversionfactor 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. Parametersname | {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 |
addTileaddTile:function( | bounds, | | position | ) |
|
Creates a tile, initializes it, and adds it to the layer div. ParametersReturns{OpenLayers.Tile.Image} The added OpenLayers.Tile.Image
getURLgetURL: function ( | bounds | ) |
|
Return a query string for this layer ParametersReturns{String} A string with the layer’s url and parameters and also the passed-in bounds and appropriate tile size specified as parameters.
getFullRequestStringgetFullRequestString: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. ParametersaltUrl | {String} Alternative base URL to use. |
Returns{String} A string with the layer’s url appropriately encoded for MapGuide
getImageFilePathgetImageFilePath:function( | newParams, | | altUrl | ) |
|
special handler to request mapguide tiles from an http exposed tilecache ParametersaltUrl | {String} Alternative base URL to use. |
Returns{String} A string with the url for the tile image
calculateGridLayoutcalculateGridLayout: function( | bounds, | | extent, | | resolution | ) |
|
Generate parameters for the grid layout. This ParametersReturnsObject containing properties tilelon, tilelat, tileoffsetlat, tileoffsetlat, tileoffsetx, tileoffsety
OpenLayers. Layer. MapServerInstances of OpenLayers.Layer.MapServer are used to display data from a MapServer CGI instance. Inherits fromSummary | | | {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. |
DEFAULT_PARAMS{Object} Hashtable of default parameter key/value pairs
OpenLayers. Layer. MapServerCreate a new MapServer layer object Parametersname | {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 |
addTileaddTile:function( | bounds, | | position | ) |
|
Creates a tile, initializes it, and adds it to the layer div. ParametersReturns{OpenLayers.Tile.Image} The added OpenLayers.Tile.Image
getURLgetURL: function ( | bounds | ) |
|
Return a query string for this layer ParametersReturns{String} A string with the layer’s url and parameters and also the passed-in bounds and appropriate tile size specified as parameters.
getFullRequestStringgetFullRequestString:function( | newParams, | | altUrl | ) |
|
combine the layer’s url with its params and these newParams. ParameternewParams | {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.WMSInstances 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 fromSummary | | | {Object} Hashtable of default parameter key/value pairs | | | | | | | | Create a new WMS layer object | | | | 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. |
DEFAULT_PARAMS{Object} Hashtable of default parameter key/value pairs
reprojectDeprecated. 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.
OpenLayers. Layer.WMSCreate a new WMS layer object Examplevar wms = new OpenLayers.Layer.WMS("NASA Global Mosaic", "http://wms.jpl.nasa.gov/wms.cgi", {layers: "modis,global_mosaic"});
Parametersname | {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 |
getURLgetURL: function ( | bounds | ) |
|
Return a GetMap query string for this layer ParametersReturns{String} A string with the layer’s url and parameters and also the passed-in bounds and appropriate tile size specified as parameters.
addTileaddTile:function( | bounds, | | position | ) |
|
addTile creates a tile, initializes it, and adds it to the layer div. ParametersReturns{OpenLayers.Tile.Image} The added OpenLayers.Tile.Image
OpenLayers.RuleThis 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. | | | | | | Gets the context for evaluating this rule |
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.
OpenLayers.RuleCreates a Rule. Parametersoptions | {Object} An optional object with properties to set on the rule |
Returns{OpenLayers.Rule}
getContextgetContext: function( | feature | ) |
|
Gets the context for evaluating this rule Paramters
OpenLayers. StyleMapSummary | | | 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. |
stylesHash 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.
OpenLayers. StyleMapParametersstyle | {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 |
createSymbolizercreateSymbolizer: function( | feature, | | intent | ) |
|
Creates the symbolizer for a feature for a render intent. Parametersfeature | {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
addUniqueValueRulesaddUniqueValueRules: 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 ParametersrenderIntent | {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. CollectionA 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 fromSummary | | | {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. |
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.
OpenLayers. Geometry. CollectionCreates a Geometry Collection -- a list of geoms. Parameters
getComponentsStringgetComponentsString: function() |
Get a string representing the components for this collection Returns{String} A string representation of the components of this geometry
addComponentaddComponent: 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. Parameterscomponent | {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
removeComponentremoveComponent: function( | component | ) |
|
Remove a component from this geometry. Parameters
OpenLayers. Geometry. PointPoint geometry class. Inherits fromSummary | | | Construct a point geometry. | | Create a new Bounds based on the lon/lat | | {String} Shortened String representation of Point object. |
OpenLayers. Geometry. PointConstruct a point geometry. Parameters
calculateBoundscalculateBounds: function () |
Create a new Bounds based on the lon/lat
toShortStringtoShortString: function() |
Returns{String} Shortened String representation of Point object. (ex. <i>”5, 42”</i>)
OpenLayers. Layer. VectorInstances 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 fromSummary | | | {Array(String)} Supported application event types. | | | | | | {Object} hash of features, keyed by feature.id, that the renderer failed to draw | | | | | | | | {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. |
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 propertiesobject | {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)beforefeatureadded | Triggered 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. | beforefeaturesadded | Triggered 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. | featureadded | Triggered after a feature is added. The event object passed to listeners will have a feature property with a reference to the added feature. | featuresadded | Triggered after features are added. The event object passed to listeners will have a features property with a reference to an array of added features. | beforefeatureremoved | Triggered before a feature is removed. Listeners will receive an object with a feature property referencing the feature to be removed. | featureremoved | Triggerd after a feature is removed. The event object passed to listeners will have a feature property with a reference to the removed feature. | featuresremoved | Triggered after features are removed. The event object passed to listeners will have a features property with a reference to an array of removed features. | featureselected | Triggered after a feature is selected. Listeners will receive an object with a feature property referencing the selected feature. | featureunselected | Triggered after a feature is unselected. Listeners will receive an object with a feature property referencing the unselected feature. | beforefeaturemodified | Triggered when a feature is selected to be modified. Listeners will receive an object with a feature property referencing the selected feature. | featuremodified | Triggered when a feature has been modified. Listeners will receive an object with a feature property referencing the modified feature. | afterfeaturemodified | Triggered when a feature is finished being modified. Listeners will receive an object with a feature property referencing the modified feature. | vertexmodified | Triggered 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. | sketchstarted | Triggered 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. | sketchmodified | Triggered 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. | sketchcomplete | Triggered 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. | refresh | Triggered when something wants a strategy to ask the protocol for a new set of features. |
unrenderedFeatures{Object} hash of features, keyed by feature.id, that the renderer failed to draw
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.
OpenLayers. Layer. VectorCreate a new vector layer Parametersname | {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
refreshAsk the layer to request features again and redraw them. Triggers the refresh event if the layer is in range and visible. Parametersobj | {Object} Optional object with properties for any listener of the refresh event. |
assignRendererassignRenderer: function() |
Iterates through the available renderer implementations and selects and assigns the first one whose “supported()” function returns true.
displayErrorLet the user know their browser isn’t supported.
setMapThe 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
afterAddCalled 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.
removeMapThe layer has been removed from the map. Parameters
onMapResizeNotify the renderer of the change in size.
moveTomoveTo: 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
eraseFeatureseraseFeatures: function( | features | ) |
|
Erase features from the layer. Parameters
getFeatureFromEventgetFeatureFromEvent: function( | evt | ) |
|
Given an event, return a feature if the event occurred over one. Otherwise, return null. ParametersReturns{OpenLayers.Feature.Vector} A feature if one was under the event.
OpenLayers. Geometry. MultiPointMultiPoint is a collection of Points. Create a new instance with the OpenLayers.Geometry.MultiPoint constructor. Inherits fromSummary | | | {Array(String)} An array of class names representing the types of components that the collection can include. | | | | Create a new MultiPoint Geometry |
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.
OpenLayers. Handler. PointHandler 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 fromSummary | | | | | | | {Boolean} Cast features to multi-part geometries before passing to the layer. | | {Boolean} A point is being drawn | | {Boolean} The mouse is down | | | | | | {Object} Any optional properties to be set on the sketch layer. | | | | Create a new point handler. | | | | Destroy the temporary geometries | | Finish the geometry and call the “done” callback. | | | | | | 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. | | | | | | |
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
layerOptions{Object} Any optional properties to be set on the sketch layer.
OpenLayers. Handler. PointCreate a new point handler. Parameterscontrol | {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 callbackscreate | Called when a sketch is first created. Callback called with the creation point geometry and sketch feature. | modify | Called with each move of a vertex with the vertex (point) geometry and the sketch feature. | done | Called when the point drawing is finished. The callback will recieve a single argument, the point geometry. | cancel | Called when the handler is deactivated while drawing. The cancel callback will receive a geometry. |
createFeaturecreateFeature: function( | pixel | ) |
|
Add temporary features Parameters
destroyFeaturedestroyFeature: function() |
Destroy the temporary geometries
finalizefinalize: function( | cancel | ) |
|
Finish the geometry and call the “done” callback. Parameterscancel | {Boolean} Call cancel instead of done callback. Default is false. |
clickHandle clicks. Clicks are stopped from propagating to other listeners on map.events or other dom elements. Parametersevt | {Event} The browser event |
Returns{Boolean} Allow event propagation
dblclickHandle double-clicks. Double-clicks are stopped from propagating to other listeners on map.events or other dom elements. Parametersevt | {Event} The browser event |
Returns{Boolean} Allow event propagation
modifyFeaturemodifyFeature: function( | pixel | ) |
|
Modify the existing geometry given a pixel location. Parameters
drawFeatureRender features on the temporary layer.
geometryClonegeometryClone: function() |
Return a clone of the relevant geometry. Returns{OpenLayers.Geometry}
mousedownHandle mouse down. Adjust the geometry and redraw. Return determines whether to propagate the event on the map. Parametersevt | {Event} The browser event |
Returns{Boolean} Allow event propagation
mousemovemousemove: function ( | evt | ) |
|
Handle mouse move. Adjust the geometry and redraw. Return determines whether to propagate the event on the map. Parametersevt | {Event} The browser event |
Returns{Boolean} Allow event propagation
mouseupHandle mouse up. Send the latest point in the geometry to the control. Return determines whether to propagate the event on the map. Parametersevt | {Event} The browser event |
Returns{Boolean} Allow event propagation
OpenLayers. Geometry. CurveA 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. InheritsSummary | | | {Array(String)} An array of class names representing the types of components that the collection can include. | | | | |
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.
OpenLayers. Geometry. Curve
OpenLayers. Geometry. LineStringA LineString is a Curve which, once two points have been added to it, can never be less than two points long. Inherits fromSummary | | | 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). |
OpenLayers. Geometry. LineStringCreate a new LineString geometry Parameters
getSortedSegmentsgetSortedSegments: 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.
splitWithSegmentsplitWithSegment: function( | seg, | | options | ) |
|
Split this geometry with the given segment. Parametersseg | {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 optionsedge | {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).
splitsplit: function( | target, | | options | ) |
|
Use this geometry (the source) to attempt to split a target geometry. Parameterstarget | {OpenLayers.Geometry} The target geometry. | options | {Object} Properties of this object will be used to determine how the split is conducted. |
Valid optionsmutual | {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.
splitWithsplitWith: function( | geometry, | | options | ) |
|
Split this geometry (the target) with the given geometry (the source). Parametersgeometry | {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 optionsmutual | {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. LinearRingA 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 InheritsSummary | | | {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. |
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.
OpenLayers. Geometry. LinearRingLinear 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
containsPointcontainsPoint: 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. ParametersReturns{Boolean | Number} The point is inside the linear ring. Returns 1 if the point is coincident with an edge. Returns boolean otherwise.
OpenLayers. Geometry. MultiLineStringA MultiLineString is a geometry with multiple OpenLayers.Geometry.LineString components. Inherits fromSummary | | | {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). |
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.
OpenLayers. Geometry. MultiLineStringConstructor for a MultiLineString Geometry. Parameters
splitsplit: function( | geometry, | | options | ) |
|
Use this geometry (the source) to attempt to split a target geometry. Parameterstarget | {OpenLayers.Geometry} The target geometry. | options | {Object} Properties of this object will be used to determine how the split is conducted. |
Valid optionsmutual | {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.
splitWithsplitWith: function( | geometry, | | options | ) |
|
Split this geometry (the target) with the given geometry (the source). Parametersgeometry | {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 optionsmutual | {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.PathHandler to draw a path on the map. Path is displayed on mouse down, moves on mouse move, and is finished on mouse up. Inherits fromSummary | | | | | {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. | | | | | | | | Destroy temporary geometries | | Destroy the temporary point. | | | | 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. | | | | | | | | |
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’.
OpenLayers. Handler.PathCreate a new path hander Parameterscontrol | {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 callbackscreate | Called when a sketch is first created. Callback called with the creation point geometry and sketch feature. | modify | Called with each move of a vertex with the vertex (point) geometry and the sketch feature. | point | Called as each point is added. Receives the new point geometry. | done | Called when the point drawing is finished. The callback will recieve a single argument, the linestring geometry. | cancel | Called when the handler is deactivated while drawing. The cancel callback will receive a geometry. |
createFeaturecreateFeature: function( | pixel | ) |
|
Add temporary geometries Parameters
destroyFeaturedestroyFeature: function() |
Destroy temporary geometries
removePointDestroy the temporary point.
addPointaddPoint: function( | pixel | ) |
|
Add point to geometry. Send the point index to override the behavior of LinearRing that disregards adding duplicate points. Parameters
freehandModefreehandMode: function( | evt | ) |
|
Determine whether to behave in freehand mode or not. Returns{Boolean}
modifyFeaturemodifyFeature: function( | pixel | ) |
|
Modify the existing geometry given the new point Parameters
drawFeatureRender geometries on the temporary layer.
mousedownHandle mouse down. Add a new point to the geometry and render it. Return determines whether to propagate the event on the map. Parametersevt | {Event} The browser event |
Returns{Boolean} Allow event propagation
mousemovemousemove: function ( | evt | ) |
|
Handle mouse move. Adjust the geometry and redraw. Return determines whether to propagate the event on the map. Parametersevt | {Event} The browser event |
Returns{Boolean} Allow event propagation
mouseupHandle mouse up. Send the latest point in the geometry to the control. Return determines whether to propagate the event on the map. Parametersevt | {Event} The browser event |
Returns{Boolean} Allow event propagation
dblclickHandle double-clicks. Finish the geometry and send it back to the control. Parametersevt | {Event} The browser event |
Returns{Boolean} Allow event propagation
OpenLayers. Geometry. PolygonPolygon is a collection of Geometry.LinearRings. Inherits fromSummary | | | {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. |
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.
OpenLayers. Geometry. PolygonConstructor 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
containsPointcontainsPoint: function( | point | ) |
|
Test if a point is inside a polygon. Points on a polygon edge are considered inside. ParametersReturns{Boolean | Number} The point is inside the polygon. Returns 1 if the point is on an edge. Returns boolean otherwise.
OpenLayers. Geometry. MultiPolygonMultiPolygon is a geometry with multiple OpenLayers.Geometry.Polygon components. Create a new instance with the OpenLayers.Geometry.MultiPolygon constructor. Inherits fromSummary | | | {Array(String)} An array of class names representing the types of components that the collection can include. | | | | Create a new MultiPolygon geometry |
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.
OpenLayers. Geometry. MultiPolygonCreate a new MultiPolygon geometry Parameters
OpenLayers. Handler. PolygonHandler to draw a polygon on the map. Polygon is displayed on mouse down, moves on mouse move, and is finished on mouse up. Inherits fromSummary | | | Create a Polygon Handler. | | | | Destroy temporary geometries | | Render geometries on the temporary layer. | | Return the sketch feature. | | Return the sketch geometry. | | |
OpenLayers. Handler. PolygonCreate a Polygon Handler. Parameterscontrol | {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 callbackscreate | Called when a sketch is first created. Callback called with the creation point geometry and sketch feature. | modify | Called with each move of a vertex with the vertex (point) geometry and the sketch feature. | point | Called as each point is added. Receives the new point geometry. | done | Called when the point drawing is finished. The callback will recieve a single argument, the polygon geometry. | cancel | Called when the handler is deactivated while drawing. The cancel callback will receive a geometry. |
createFeaturecreateFeature: function( | pixel | ) |
|
Add temporary geometries Parameters
destroyFeaturedestroyFeature: function() |
Destroy temporary geometries
drawFeatureRender geometries on the temporary layer.
dblclickHandle double-clicks. Finish the geometry and send it back to the control. Parameters
OpenLayers. Format.GMLRead/Wite GML. Create a new instance with the OpenLayers.Format.GML constructor. Supports the GML simple features profile. Inherits fromSummary | | | 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 |
OpenLayers. Format.GMLCreate a new parser for GML. Parametersoptions | {Object} An optional object whose properties will be set on this instance. |
parseFeatureparseFeature: 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. Parametersnode | {DOMElement} A GML feature node. |
parseGeometryProperties of this object are the functions that parse geometries based on their type.
parseGeometry. pointGiven a GML node representing a point geometry, create an OpenLayers point geometry. Parametersnode | {DOMElement} A GML node. |
Returns{OpenLayers.Geometry.Point} A point geometry.
parseGeometry. multipointGiven a GML node representing a multipoint geometry, create an OpenLayers multipoint geometry. Parametersnode | {DOMElement} A GML node. |
Returns{OpenLayers.Geometry.MultiPoint} A multipoint geometry.
parseGeometry. linestringGiven a GML node representing a linestring geometry, create an OpenLayers linestring geometry. Parametersnode | {DOMElement} A GML node. |
Returns{OpenLayers.Geometry.LineString} A linestring geometry.
parseGeometry. multilinestringGiven a GML node representing a multilinestring geometry, create an OpenLayers multilinestring geometry. Parametersnode | {DOMElement} A GML node. |
Returns{OpenLayers.Geometry.MultiLineString} A multilinestring geometry.
parseGeometry. polygonGiven a GML node representing a polygon geometry, create an OpenLayers polygon geometry. Parametersnode | {DOMElement} A GML node. |
Returns{OpenLayers.Geometry.Polygon} A polygon geometry.
parseGeometry. multipolygonGiven a GML node representing a multipolygon geometry, create an OpenLayers multipolygon geometry. Parametersnode | {DOMElement} A GML node. |
Returns{OpenLayers.Geometry.MultiPolygon} A multipolygon geometry.
parseAttributesparseAttributes: function( | node | ) |
|
ParametersReturns{Object} An attributes object.
createFeatureXMLcreateFeatureXML: function( | feature | ) |
|
Accept an OpenLayers.Feature.Vector, and build a GML node for it. ParametersReturns{DOMElement} A node reprensting the feature in GML.
buildGeometryObject containing methods to do the actual geometry node building based on geometry type.
buildGeometry. pointGiven an OpenLayers point geometry, create a GML point. ParametersReturns{DOMElement} A GML point node.
buildGeometry. multipointGiven an OpenLayers multipoint geometry, create a GML multipoint. ParametersReturns{DOMElement} A GML multipoint node.
buildGeometry. linestringGiven an OpenLayers linestring geometry, create a GML linestring. ParametersReturns{DOMElement} A GML linestring node.
buildGeometry. multilinestringGiven an OpenLayers multilinestring geometry, create a GML multilinestring. ParametersReturns{DOMElement} A GML multilinestring node.
buildGeometry. linearringGiven an OpenLayers linearring geometry, create a GML linearring. ParametersReturns{DOMElement} A GML linearring node.
buildGeometry. polygonGiven an OpenLayers polygon geometry, create a GML polygon. ParametersReturns{DOMElement} A GML polygon node.
buildGeometry. multipolygonGiven an OpenLayers multipolygon geometry, create a GML multipolygon. ParametersReturns{DOMElement} A GML multipolygon node.
buildGeometry. boundsGiven an OpenLayers bounds, create a GML box. Parametersbounds | {<OpenLayers.Geometry.Bounds>} A bounds object. |
Returns{DOMElement} A GML box node.
buildCoordinatesbuildCoordinatesNode: function( | geometry | ) |
|
builds the coordinates XmlNode <gml:coordinates decimal="." cs="," ts=" ">...</gml:coordinates>
Parameters: geometry - {OpenLayers.Geometry} Returns{XmlNode} created xmlNode
OpenLayers. Format. GML.BaseSuperclass for GML parsers. Inherits fromSummary | | | {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. | | |
namespaces{Object} Mapping of namespace aliases to namespace URIs.
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.
regExesCompiled regular expressions for manipulating strings.
OpenLayers. Format. GML.BaseInstances of this class are not created directly. Use the OpenLayers.Format.GML.v2 or OpenLayers.Format.GML.v3 constructor instead. Parametersoptions | {Object} An optional object whose properties will be set on this instance. |
Valid options propertiesfeatureType | {Array(String) or String} Local (without prefix) feature typeName(s) (required). | featureNS | {String} Feature namespace (required). | geometryName | {String} Geometry element name. |
readParametersdata | {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.
readersContains 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.
writewrite: function( | features | ) |
|
ParametersReturns{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.
writersAs a compliment to the readers property, this structure contains public writing functions grouped by namespace alias and named like the node names they produce.
setGeometryTypessetGeometryTypes: function() |
Sets the geometryTypes mapping.
OpenLayers. Format. GML.v2Parses GML version 2. Inherits fromSummary | | | {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. |
schemaLocation{String} Schema location for a particular minor version.
OpenLayers. Format. GML.v2Create a parser for GML v2. Parametersoptions | {Object} An optional object whose properties will be set on this instance. |
Valid options propertiesfeatureType | {String} Local (without prefix) feature typeName (required). | featureNS | {String} Feature namespace (required). | geometryName | {String} Geometry element name. |
readersContains 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.
writewrite: function( | features | ) |
|
ParametersReturns{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.
writersAs 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.v3Parses GML version 3. Inherits fromSummary | | | {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. |
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.v3Create a parser for GML v3. Parametersoptions | {Object} An optional object whose properties will be set on this instance. |
Valid options propertiesfeatureType | {String} Local (without prefix) feature typeName (required). | featureNS | {String} Feature namespace (required). | geometryName | {String} Geometry element name. |
readersContains 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.
writewrite: function( | features | ) |
|
ParametersReturns{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.
writersAs a compliment to the readers property, this structure contains public writing functions grouped by namespace alias and named like the node names they produce.
setGeometryTypessetGeometryTypes: function() |
Sets the <geometryTypes> mapping.
|