Class: OverviewMap

OverviewMap()

new OverviewMap()

An GeoExt.component.OverviewMap displays an overview map of a parent map. You can use this component as any other Ext.Component, e.g give it as an item to a panel. Example:
Source:
Example
preview
    var olMap = new ol.Map({
        layers: [
            new ol.layer.Tile({
               source: new ol.source.OSM()
            })
        ],
        view: new ol.View({
            center: ol.proj.fromLonLat([-8.751278, 40.611368]),
            zoom: 12,
            rotation: -Math.PI / 6
        })
    });
    var mapComponent = Ext.create('GeoExt.component.Map', {
        map: olMap
    });
    var mapPanel = Ext.create('Ext.panel.Panel', {
       title: 'Map',
       region: 'center',
       layout: 'fit',
       items: mapComponent
    });
    var overviewMapPanel = Ext.create('Ext.panel.Panel', {
        title: 'OverviewMap',
        region: 'west',
        layout: 'fit',
        width: 160,
        // create the overview by passing the ol.Map:
        items: Ext.create('GeoExt.component.OverviewMap', {
            parentMap: olMap
        })
    });
    Ext.create('Ext.panel.Panel', {
       height: 300,
       layout: 'border',
       items: [mapPanel, overviewMapPanel],
       renderTo: Ext.getBody()
    });

Methods

(static) applyAnchorStyle(style) → {ol.Style}

The applier for the anchor style.
Parameters:
Name Type Description
style ol.Style The new style for the anchor feature that was set.
Source:
Returns:
The new style for the anchor feature.
Type
ol.Style

(static) applyBoxStyle(style) → {ol.Style}

The applier for the box style.
Parameters:
Name Type Description
style ol.Style The new style for the box feature that was set.
Source:
Returns:
The new style for the box feature.
Type
ol.Style

(static) applyEnableBoxDrag(shallEnableBoxDrag) → {boolean}

The applier for the #enableBoxDrag configuration. Takes care of initially setting up an interaction if desired or destroying when dragging is not wanted.
Parameters:
Name Type Description
shallEnableBoxDrag boolean The value for #enableBoxDrag that was set.
Source:
Returns:
The value for #enableBoxDrag that was passed.
Type
boolean

(static) applyRecenterOnClick(shallRecenter) → {boolean}

The applier for the #recenterOnClick configuration. Takes care of initially registering an appropriate eventhandler and also unregistering if the property changes.
Parameters:
Name Type Description
shallRecenter boolean The value for #recenterOnClick that was set.
Source:
Returns:
The value for #recenterOnClick that was passed.
Type
boolean

(static) constructor()

The constructor of the OverviewMap component.
Source:

(static) destroyDragBehaviour()

Disable / destroy everything we need to be able to drag the extent box on the overview map. Unregisters any events we might have added and removes the `ol.interaction.Translate`.
Source:

(static) disableBoxUpdate()

Disables the update of the box by unbinding the updateBox function from the postrender event of the parent map.
Source:

(static) enableBoxUpdate()

Enables the update of the box by binding the updateBox function to the postrender event of the parent map.
Source:

(static) initComponent()

Initializes the GeoExt.component.OverviewMap.
Source:

(static) onBeforeDestroy()

Cleanup any listeners we may have bound.
Source:

(static) recenterParentFromBox()

Recenters the #parentMap to the center of the extent of the #boxFeature. Called when dragging of the #boxFeature ends.
Source:

(static) repositionAnchorFeature()

Repositions the #anchorFeature during dragging sequences of the box. Called while the #boxFeature is being dragged.
Source:

(static) setOverviewMapProperty(key)

Set an OverviewMap property (center or resolution).
Parameters:
Name Type Description
key string The name of the property, either `'center'` or `'resolution'`
Source:

(static) setupDragBehaviour()

Enable everything we need to be able to drag the extent box on the overview map, and to properly handle drag events (e.g. recenter on finished dragging).
Source:

(static) updateBox()

Updates the Geometry of the extentLayer.
Source: