new Map()
A component that renders an `ol.Map` and that can be used in any ExtJS
layout.
An example: A map component rendered inside of a panel:
- Source:
Example
preview
var mapComponent = Ext.create('GeoExt.component.Map', {
map: 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
})
})
});
var mapPanel = Ext.create('Ext.panel.Panel', {
title: 'GeoExt.component.Map Example',
height: 200,
items: [mapComponent],
renderTo: Ext.getBody()
});
Methods
(static) addLayer(layer)
Add a layer to the map.
Parameters:
Name | Type | Description |
---|---|---|
layer |
ol.layer.Base | The layer to add. |
- Source:
(static) applyPointerRest(val) → {boolean}
Whenever the value of #pointerRest is changed, this method will take
care of registering or unregistering internal event listeners.
Parameters:
Name | Type | Description |
---|---|---|
val |
boolean | The new value that someone set for `pointerRest`. |
- Source:
Returns:
The passed new value for `pointerRest` unchanged.
- Type
- boolean
(static) applyPointerRestInterval(val) → {boolean}
Whenever the value of #pointerRestInterval is changed, this method will
take to reinitialize the #bufferedPointerMove method and handlers to
actually trigger the event.
Parameters:
Name | Type | Description |
---|---|---|
val |
boolean | The new value that someone set for `pointerRestInterval`. |
- Source:
Returns:
The passed new value for `pointerRestInterval`
unchanged.
- Type
- boolean
(static) applyState(mapState)
Apply the provided map state object. The following keys are interpreted:
* `center`
* `zoom`
* `rotation`
Parameters:
Name | Type | Description |
---|---|---|
mapState |
Object | The state object |
- Source:
(static) bindStateOlEvents()
Forwards the OpenLayers events so they become usable in the #statedEvents
array and a possible `GeoExt.state.PermalinkProvider` can change the
state when one of the events gets fired.
- Source:
(static) constructor()
- Source:
(static) getCenter() → {ol.Coordinate}
Returns the center coordinate of the view.
- Source:
Returns:
The center of the map view as `ol.Coordinate`.
- Type
- ol.Coordinate
(static) getExtent() → {ol.Extent}
Returns the extent of the current view.
- Source:
Returns:
The extent of the map view as `ol.Extent`.
- Type
- ol.Extent
(static) getLayers() → {ol.Collection}
Returns the layers of the map.
- Source:
Returns:
The layer collection.
- Type
- ol.Collection
(static) getStore() → {GeoExt.data.store.Layers}
Returns the `GeoExt.data.store.Layers`.
- Source:
Returns:
The layer store.
(static) getView() → {ol.View}
Returns the view of the map.
- Source:
Returns:
The `ol.View` of the map.
- Type
- ol.View
(static) isMouseOverIgnoreEl() → {boolean}
Checks if the mouse is positioned over
an ignore element.
- Source:
Returns:
Whether the mouse is positioned over an ignore element.
- Type
- boolean
(static) onResize()
(Re-)render the map when size changes.
- Source:
(static) removeLayer(layer)
Remove a layer from the map.
Parameters:
Name | Type | Description |
---|---|---|
layer |
ol.layer.Base | The layer to remove. |
- Source:
(static) setCenter(center)
Set the center of the view.
Parameters:
Name | Type | Description |
---|---|---|
center |
ol.Coordinate | The new center as `ol.Coordinate`. |
- Source:
(static) setExtent(extent)
Set the extent of the view.
Parameters:
Name | Type | Description |
---|---|---|
extent |
ol.Extent | The extent as `ol.Extent`. |
- Source:
(static) setView(view)
Set the view of the map.
Parameters:
Name | Type | Description |
---|---|---|
view |
ol.View | The `ol.View` to use for the map. |
- Source:
(static) unregisterPointerRestEvents()
Unregisters the #bufferedPointerMove event listener and unbinds the
over- and out-listeners.
- Source: