gxp.plugins.BingSource¶
-
class
gxp.plugins.BingSource(config)¶ Plugin for using Bing layers with
gxp.Viewerinstances.Available layer names are “Road”, “Aerial” and “AerialWithLabels”
Example Use¶
The configuration in the sources property of the gxp.Viewer is
straightforward:
"bing": {
ptype: "gxp_bingsource"
}
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: "bing",
title: "Bing Road Map",
name: "Road"
}
Config Options¶
Configuration properties in addition to those listed for Ext.util.Observable.
-
aerialTitle StringA descriptive title for the Aerial layer (i18n).
-
apiKey StringAPI key generated from http://bingmapsportal.com/ for your domain.
-
labeledAerialTitle StringA descriptive title for the AerialWithLabels layer (i18n).
-
roadTitle StringA descriptive title for the Road layer (i18n).
-
title StringA descriptive title for this layer source (i18n).
Public Properties¶
Public properties in addition to those listed for Ext.util.Observable.
BooleanSet to true if you don’t want this LayerSource to show up in the AddLayers dialog. Defaults to false.
-
BingSource.lazy¶ Boolean. true when the source is ready, but its store hasn’t been loaded yet (i.e. lazy source). Read-only.
-
BingSource.store¶ GeoExt.data.LayerStore. Will contain records with “Road” and “Aerial” as name field values.
-
BingSource.title¶ StringA descriptive title for this layer source.
Public Methods¶
Public methods in addition to those listed for Ext.util.Observable.
-
BingSource.createLayerRecord()¶ Parameters: config – ObjectThe application config for this layer.Returns: GeoExt.data.LayerRecordCreate a layer record given the config.
-
BingSource.createStore()¶ Creates a store of layer records. Fires “ready” when store is loaded.
-
BingSource.getConfigForRecord()¶ Parameters: record – GeoExt.data.LayerRecordReturns: ObjectCreate a config object that can be used to recreate the given record.
-
BingSource.getProjection()¶ Parameters: layerRecord – GeoExt.data.LayerRecorda record from this source’s storeReturns: OpenLayers.ProjectionA 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.
-
BingSource.getState()¶ Returns: ObjectGets the configured source state.
-
BingSource.init()¶ Parameters: target – ObjectThe 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.