gxp.plugins.ArcRestSource
¶
-
class
gxp.plugins.
ArcRestSource
(config)¶ Plugin for using ArcGIS REST MapServer layers with
gxp.Viewer
instances.
Example Use¶
The configuration in the sources
property of the gxp.Viewer
is
straightforward:
defaultSourceType: "gxp_arcrestsource",
sources: {
"arcgisrest": {
url: "http://cga6.cga.harvard.edu/arcgis/rest/services/darmc/roman/MapServer"
}
}
A typical configuration for a layer from this source (in the layers
array of the viewer’s map
config option would look like this:
{
source: "arcgisrest",
name: "Routes",
layerid: "show:74"
}
Public Properties¶
Public properties in addition to those listed for Ext.util.Observable.
Boolean
Set to true if you don’t want this LayerSource to show up in the AddLayers dialog. Defaults to false.
-
ArcRestSource.
lazy
¶ Boolean
. true when the source is ready, but its store hasn’t been loaded yet (i.e. lazy source). Read-only.
-
ArcRestSource.
store
¶ GeoExt.data.LayerStore
-
ArcRestSource.
title
¶ String
A descriptive title for this layer source.
Public Methods¶
Public methods in addition to those listed for Ext.util.Observable.
-
ArcRestSource.
createLayerRecord
()¶ Parameters: config – Object
The application config for this layer.Returns: GeoExt.data.LayerRecord
Create a layer record given the config.
-
ArcRestSource.
createStore
()¶ Creates a store of layer records. Fires “ready” when store is loaded.
-
ArcRestSource.
getConfigForRecord
()¶ Parameters: record – GeoExt.data.LayerRecord
Returns: Object
Create a config object that can be used to recreate the given record.
-
ArcRestSource.
getProjection
()¶ Parameters: layerRecord – GeoExt.data.LayerRecord
a record from this source’s storeReturns: OpenLayers.Projection
A suitable projection for thelayerRecord
. 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.
-
ArcRestSource.
getState
()¶ Returns: Object
Gets the configured source state.
-
ArcRestSource.
init
()¶ Parameters: target – Object
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.