Table Of Contents

Previous topic

gxp.plugins.Styler

Next topic

gxp.plugins.Timeline

gxp.plugins.TMSSource

Extends
ptype
gxp_tmssource
class gxp.plugins.TMSSource(config)

Plugin for using TMS layers with gxp.Viewer instances. The plugin issues a Capabilities request to create a store of the TMS’s tile maps. It is currently not supported to use this source type directly in the viewer config, it is only used to add a TMS service dynamically through the AddLayers plugin.

Config Options

Configuration properties in addition to those listed for Ext.util.Observable.

url

String TMS service URL for this source

version

String TMS version to use, defaults to 1.0.0

Public Properties

Public properties in addition to those listed for Ext.util.Observable.

TMSSource.hidden

Boolean Set to true if you don’t want this LayerSource to show up in the AddLayers dialog. Defaults to false.

TMSSource.lazy

Boolean. true when the source is ready, but its store hasn’t been loaded yet (i.e. lazy source). Read-only.

TMSSource.store

GeoExt.data.LayerStore

TMSSource.title

String A descriptive title for this layer source.

Public Methods

Public methods in addition to those listed for Ext.util.Observable.

TMSSource.createLayerRecord()
Parameters:configObject The application config for this layer.
Returns:GeoExt.data.LayerRecord or null when the source is lazy.

Create a layer record given the config.

TMSSource.createStore()

Creates a store of layer records. Fires “ready” when store is loaded.

TMSSource.getConfigForRecord()
Parameters:recordGeoExt.data.LayerRecord
Returns:Object

Create a config object that can be used to recreate the given record.

TMSSource.getProjection()
Parameters:layerRecordGeoExt.data.LayerRecord a record from this source’s store
Returns:OpenLayers.Projection A suitable projection for the layerRecord. If the layer is available in the map projection, the map projection will be returned. Otherwise an equal projection, or null if none is available.

Get the projection that the source will use for the layer created in createLayerRecord. If the layer is not available in a projection that fits the map projection, null will be returned.

TMSSource.getState()
Returns:Object

Gets the configured source state.

TMSSource.init()
Parameters:targetObject The object initializing this plugin.

Calls createStore() with a callback that fires the ‘ready’ event.

Events

Events in addition to those listed for Ext.util.Observable.

failure

Fires if the layer source fails to load.

ready

Fires when the layer source is ready for action.