OpenLayers. Control. OverviewMap

Create 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 from

Summary
Create an overview map to display the extent of your main map and provide additional navigation control.
{String} For div.id
{DOMElement} The DOM element that contains the overview map
{OpenLayers.Map} A reference to the overvew map itself.
{OpenLayers.Size} The overvew map size in pixels.
{Array(OpenLayers.Layer)} Ordered list of layers in the overview map.
{Float} The ratio of the overview map resolution to the main map resolution at which to zoom farther out on the overview map.
{Float} The ratio of the overview map resolution to the main map resolution at which to zoom farther in on the overview map.
{Object} An object containing any non-default properties to be sent to the overview map’s map constructor.
Create a new overview map
Deconstruct the control
Render the control in the browser.
Handle browser events
Handle browser events
Handle browser events
Handle browser events
Handle browser events
Handle browser events
Unhide the control.
Hide all the contents of the control, shrink the size, add the maximize icon
Hide/Show the toggle depending on whether the control is minimized
Update the overview map after layers move.
Determines if the overview map is suitable given the extent and resolution of the main map.
Construct the map that this control contains
Updates the extent rectangle position and size to match the map extent
Updates the map extent to match the extent rectangle position and size
Get extent rectangle pixel bounds
Set extent rectangle pixel bounds.
Get the rect bounds from the map bounds.
Get the map bounds from the rect bounds.
Get a map location from a pixel location
Get a pixel location from a map location

Properties

id

{String} For div.id

element

{DOMElement} The DOM element that contains the overview map

ovmap

{OpenLayers.Map} A reference to the overvew map itself.

size

{OpenLayers.Size} The overvew map size in pixels.  Note that this is the size of the map itself - the element that contains the map (default class name olControlOverviewMapElement) may have padding or other style attributes added via CSS.

layers

{Array(OpenLayers.Layer)} Ordered list of layers in the overview map.  If none are sent at construction, the base layer for the main map is used.

minRatio

{Float} The ratio of the overview map resolution to the main map resolution at which to zoom farther out on the overview map.

maxRatio

{Float} The ratio of the overview map resolution to the main map resolution at which to zoom farther in on the overview map.

mapOptions

{Object} An object containing any non-default properties to be sent to the overview map’s map constructor.  These should include any non-default options that the main map was constructed with.

Constructor

OpenLayers. Control. OverviewMap

Create a new overview map

Parameters

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

Functions

destroy

destroy: function()

Deconstruct the control

draw

draw: function()

Render the control in the browser.

baseLayerDraw

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

rectMouseOut

rectMouseOut: function (evt)

Handle browser events

Parameters

evt{OpenLayers.Event} evt

rectMouseDown

rectMouseDown: function (evt)

Handle browser events

Parameters

evt{OpenLayers.Event} evt

rectMouseMove

rectMouseMove: function(evt)

Handle browser events

Parameters

evt{OpenLayers.Event} evt

rectMouseUp

rectMouseUp: function(evt)

Handle browser events

Parameters

evt{OpenLayers.Event} evt

rectDblClick

rectDblClick: function(evt)

Handle browser events

Parameters

evt{OpenLayers.Event} evt

mapDivClick

mapDivClick: function(evt)

Handle browser events

Parameters

evt{OpenLayers.Event} evt

maximizeControl

maximizeControl: function(e)

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

Parameters

e{OpenLayers.Event}

minimizeControl

minimizeControl: function(e)

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

Parameters

e{OpenLayers.Event}

showToggle

showToggle: function(minimize)

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

Parameters

minimize{Boolean}

update

update: function()

Update the overview map after layers move.

isSuitableOverview

isSuitableOverview: function()

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

createMap

createMap: function()

Construct the map that this control contains

updateRectToMap

updateRectToMap: function()

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

updateMapToRect

updateMapToRect: function()

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

getRectPxBounds

getRectPxBounds: function()

Get extent rectangle pixel bounds

Returns

{OpenLayers.Bounds} A bounds which is the extent rectangle’s pixel bounds (relative to the parent element)

setRectPxBounds

setRectPxBounds: function(pxBounds)

Set extent rectangle pixel bounds.

Parameters

pxBounds{OpenLayers.Bounds}

getRectBoundsFromMapBounds

getRectBoundsFromMapBounds: function(lonLatBounds)

Get the rect bounds from the map bounds.

Parameters

lonLatBounds{OpenLayers.Bounds}

Returns

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

getMapBoundsFromRectBounds

getMapBoundsFromRectBounds: function(pxBounds)

Get the map bounds from the rect bounds.

Parameters

pxBounds{OpenLayers.Bounds}

Returns

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

getLonLatFromOverviewPx

getLonLatFromOverviewPx: function(overviewMapPx)

Get a map location from a pixel location

Parameters

overviewMapPx{OpenLayers.Pixel}

Returns

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

getOverviewPxFromLonLat

getOverviewPxFromLonLat: function(lonlat)

Get a pixel location from a map location

Parameters

lonlat{OpenLayers.LonLat}

Returns

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

Instances of OpenLayers.Map are interactive maps embedded in a web page.
Instances of this class represent a width/height pair
destroy: function()
Deconstruct the control
draw: function()
Render the control in the browser.
baseLayerDraw: function()
rectMouseOut: function (evt)
Handle browser events
rectMouseDown: function (evt)
Handle browser events
rectMouseMove: function(evt)
Handle browser events
rectMouseUp: function(evt)
Handle browser events
rectDblClick: function(evt)
Handle browser events
mapDivClick: function(evt)
Handle browser events
maximizeControl: function(e)
Unhide the control.
minimizeControl: function(e)
Hide all the contents of the control, shrink the size, add the maximize icon
showToggle: function(minimize)
Hide/Show the toggle depending on whether the control is minimized
update: function()
Update the overview map after layers move.
isSuitableOverview: function()
Determines if the overview map is suitable given the extent and resolution of the main map.
createMap: function()
Construct the map that this control contains
updateRectToMap: function()
Updates the extent rectangle position and size to match the map extent
updateMapToRect: function()
Updates the map extent to match the extent rectangle position and size
getRectPxBounds: function()
Get extent rectangle pixel bounds
setRectPxBounds: function(pxBounds)
Set extent rectangle pixel bounds.
getRectBoundsFromMapBounds: function(lonLatBounds)
Get the rect bounds from the map bounds.
getMapBoundsFromRectBounds: function(pxBounds)
Get the map bounds from the rect bounds.
getLonLatFromOverviewPx: function(overviewMapPx)
Get a map location from a pixel location
getOverviewPxFromLonLat: function(lonlat)
Get a pixel location from a map location
Create a new overview map
Controls affect the display or behavior of the map.
{Object} An object containing any non-default properties to be sent to the overview map’s map constructor.
Utility functions for event handling.
Instances of this class represent bounding boxes.
This class represents a screen coordinate, in x and y coordinates
This class represents a longitude and latitude pair