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. | | | | | | | | OpenLayers custom string, number and function functions are described here. | | Contains convenience functions for string manipulation. | | 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. | | | | | | | | | | 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? | | | | 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? | | | | | | | | | | | | | | 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. | | Background load a document. | | 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 OpenLayers.Console namespace is used for debugging and error logging. | | 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. | | Get the opposite quadrant for a given quadrant string. | | | | 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 | | 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. | | 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. | | Change the icon’s opacity | | move icon to passed in px. | | | | Internationalization namespace. | | | | {String} Current language code to use in OpenLayers. | | | | | | {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 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. | | | | | | | | | | | | | | | | | | | | Override to provide custom display output | | | | | | | | {Array(DOMElement)} Array of Button Divs | | | | | | | | | | | | | | | | | | | | | | Display 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. | | 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. | | | | | | 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. | | 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? | | {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. | | | | | | 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. | | Prepare the tile for a transition effect. | | Triggered by two different events, layer loadend, and tile loadend. | | Show the tile only if it should be drawn. | | | | | | 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. | | | | {Array(<OpenLayers.Popup>)} List of popups associated with the map | | | | {Float} The resolution of the map. | | {Integer} The current zoom level of the map | | {String} Used to store a unique identifier that changes when the map view changes. | | {OpenLayers.Tween} Animated panning tween object, see panTo() | | {Function} The Easing function to be used for tweening. | | | | | | 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. | | 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. | | | | | | 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. | | | | | | | | Check that a tile should be drawn, and draw it. | | Internal function to actually initialize the image tile, position it correctly, and set its url. | | 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. | | Create an overview map to display the extent of your main map and provide additional navigation control. | | | | {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 | | A handler for mouse clicks. | | | | {Number} The id of the timeout waiting to clear the delayedCall. | | | | | | 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. | | | | | | | | | | | | 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 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. | | {Boolean} The layer is displayable at the current map’s current resolution. | | 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. | | | | 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. | | | | | | | | {OpenLayers.Control.TYPES} | | | | | | | | | | Finish the panning operation. | | Handler for dragging a rectangle across the map. | | | | | | | | | | | | | | | | | | Remove the zoombox from the screen and nullify our reference to it. | | | | | | | | | | {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. | | | | | | {OpenLayers.Control.TYPE} | | {Boolean} Should the control be used for zooming out? | | | | | | | | 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. | | 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 | | | | | | 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 | | | | | | | | Create a new Mapguide layer, either tiled or untiled. | | 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 ‘+’. | | 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. | | Combine the layer’s url with its params and these newParams. |
_scriptName{String} Relative path of this script.
_getScriptLocation_getScriptLocation: function () |
Return the path to this script. Returns{String} Path to this script
OpenLayers Base TypesOpenLayers custom string, number and function functions are described here.
OpenLayers. StringContains convenience functions for string manipulation.
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);
isPrototypeDeprecated. This is no longer needed and will be removed at 3.0.
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? | | | | 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? | | | | | | | | | | | | | | 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. | | Background load a document. | | Parse XML into a doc structure |
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) |
createDivCreates 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.d
zIndex is NOT setParametersid | {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. | delayDisplay | {Boolean} If true waits until the image has been loaded. | opacity | {Float} Fractional value (0.0 - 1.0) |
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() |
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 alpha has 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” delayDisplay{Boolean} |
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}
radOpenLayers.Util.rad = function( | x | ) |
|
ParametersReturns{Float}
distVincentyOpenLayers.Util.distVincenty=function( | p1, | | p2 | ) |
|
ParametersReturns{Float}
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)
normalzeScaleParametersReturns{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 | ) |
|
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 Parameterssize | {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. |
Returns{OpenLayers.Size}
loadURLOpenLayers.loadURL = function( | uri, | | params, | | caller, | | onComplete, | | onFailure | ) |
|
Background load a document. Parametersuri | {String} URI of source doc | params | {String} Params on get (doesnt seem to work) | caller | {Object} object which gets callbacks | onComplete | {Function} Optional callback for success. The callback will be called with this set to caller and will receive the request object as an argument. | onFailure | {Function} Optional callback for failure. In the event of a failure, the callback will be called with this set to caller and will receive the request object as an argument. |
Returns{XMLHttpRequest} The request object. To abort loading, call request.abort().
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. RequestInheritSummary | | | | | | | | | | | | | | | | | | | | | | | 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. 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.
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. | | 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.
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.
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. 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. 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) { alert(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 properties- object {Object} A reference to control.events.object (a reference to the control).
- element {DOMElement} A reference to control.events.element (which will be null unless documented otherwise).
Supported map event types- activate 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.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. | | 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
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.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. 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. ArgParserInherits 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. MousePositionSummary | | | | | | | | | | | | | | | | | Override to provide custom display output | | |
OpenLayers. Control. MousePositionParametersoptions | {DOMElement} Options for control. |
formatOutputformatOutput: function( | lonLat | ) |
|
Override to provide custom display output Parameters
OpenLayers. Control. PanZoomInherits 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.
doubleClickdoubleClick: function ( | evt | ) |
|
ParametersReturns{Boolean}
buttonDownbuttonDown: function ( | evt | ) |
|
Parameters
OpenLayers. Control. ScaleLineDisplay a small line indicator representing the current map scale on 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. 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. | | 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}
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? |
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. 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. 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. Parametersoptions | {Object} An optional object with properties to set on the format |
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.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? | | {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. | | | | | | 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. | | Prepare the tile for a transition effect. | | Triggered by two different events, layer loadend, and tile loadend. | | 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?
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.
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
startTransitionstartTransition: function() |
Prepare the tile for a transition effect. To be implemented by subclasses.
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
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. 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. | | | | {Array(<OpenLayers.Popup>)} List of popups associated with the map | | | | {Float} The resolution of the map. | | {Integer} The current zoom level of the map | | {String} Used to store a unique identifier that changes when the map view changes. | | {OpenLayers.Tween} Animated panning tween object, see panTo() | | {Function} The Easing function to be used for tweening. | | | | | | 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
- popupopen triggered after a popup opens
- popupclose triggered after a popup opens
- 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 triggered after the start of a drag
- drag triggered after a drag
- dragend triggered after the end of a drag
- 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.
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.
popups{Array(<OpenLayers.Popup>)} List of popups associated with the map
resolution{Float} The resolution of the map.
zoom{Integer} The current zoom level of the map
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()
panMethod{Function} The Easing function to be used for tweening. Default is OpenLayers.Easing.Expo.easeOut. Setting this to ‘null’ turns off animated panning.
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. Parametersdiv | {String} Id of an element in your page that will contain the map. | options | {Object} Optional object with properties to tag onto the map. |
Examples// 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);
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. | | 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
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. 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. | | | | | | | | Check that a tile should be drawn, and draw it. | | Internal function to actually initialize the image tile, position it correctly, and set its url. | | 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.
drawCheck that a tile should be drawn, and draw it. Returns{Boolean} Always returns true.
renderTileInternal function to actually initialize the image tile, position it correctly, and set its url.
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. OverviewMapCreate an overview map to display the extent of your main map and provide additional navigation control. 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. 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. | | | | | | 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.
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.
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. | | | | | | | | | | | | 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.
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.
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. 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. | | {Boolean} The layer is displayable at the current map’s current resolution. | | 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. | | | | 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 properties- object {Object} A reference to layer.events.object.
- element {DOMElement} A reference to layer.events.element.
Supported map event types- loadstart 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.
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
calculateInRangecalculateInRange: function() |
Returns{Boolean} The layer is displayable at the current map’s current resolution.
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}
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. Control. DragPanDragPan control. Inherits fromSummary | | | {OpenLayers.Control.TYPES} | | | | | | | | | | Finish the panning operation. |
type{OpenLayers.Control.TYPES}
panMapDoneFinish the panning operation. Only call setCenter (through panMap) if the map has actually been moved. Parameters
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 | | | | | | | | | | | | | | | | | Remove the zoombox from the screen and nullify our reference to it. | | | | |
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.
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. Control. ZoomBoxInherits fromSummary | | | {OpenLayers.Control.TYPE} | | {Boolean} Should the control be used for zooming out? | | | | | | |
type{OpenLayers.Control.TYPE}
out{Boolean} Should the control be used for zooming out?
zoomBoxzoomBox: function ( | position | ) |
|
Parameters
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. 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
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. 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 | | | | | | | | Create a new Mapguide layer, either tiled or untiled. | | 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 ‘+’. | | 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
OpenLayers. Layer. MapGuideCreate a new Mapguide layer, either tiled or untiled. For tiled layers, the ‘groupName’ and ‘mapDefnition’ options must be specified as options. For untiled layers, specify either combination of ‘mapName’ and ‘session’, or ‘mapDefinition’ and ‘locale’. 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 serer. 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
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. | | Combine the layer’s url with its params and these newParams. |
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
getFullRequestStringgetFullRequestString:function( | newParams, | | altUrl | ) |
|
Combine the layer’s url with its params and these newParams. Add the SRS parameter from projection -- this is probably more eloquently done via a setProjection() method, but this works for now and always. ParametersnewParams | {Object} | altUrl | {String} Use this as the url instead of the layer’s url |
Returns{String}
|