ALKMaps.Layer.BaseMap

Instances of ALKMaps.Layer.BaseMap are used to display data from ALK Web Service Create a new ALK Map layer with the ALKMaps.Layer.BaseMap constructor.

Inherits from

Summary
ALKMaps.Layer.BaseMapInstances of ALKMaps.Layer.BaseMap are used to display data from ALK Web Service Create a new ALK Map layer with the ALKMaps.Layer.BaseMap constructor.
Constants
DEFAULT_PARAMS{Object} Hashtable of default parameter key/value pairs
Properties
isBaseLayer{Boolean} Default is true for WMS layer
encodeBBOX{Boolean} Should the BBOX commas be encoded? 
displayOutsideMaxExtent{Boolean} If wrapDateLine is true, zoom level gets adjusted to prevent user zooming way out.
singleTile{Boolean} Use tiles for single image dynamic map.
tileOrigin{ALKMaps.LonLat} Tile origin
zoomOffset{Number} Using zoomOffset is an alternative to setting serverResolutions if you only want to expose a subset of the server resolutions.
transparentOverlayLayer{ALKMaps.Layer.BaseMap} Transparent overlay on satellite map.
Constructor
ALKMaps.Layer.BaseMapCreate a new ALK map base layer object
Functions
setMap
destroyDestroy this layer
cloneCreate a clone of this layer
getURLReturn a GetMap query string for this layer
getTileXYZCalculates x, y and z for the given bounds.
mergeNewParamsCatch changeParams and uppercase the new params to be merged in before calling changeParams on the super class.
getFullRequestStringCombine the layer’s url with its params and these newParams.
changeStyleUsed to switch map styles.
setVisibilityChange layer visibility.
afterAddWhen satellite or terrain layer is added as a base layer, add the transparent layer at the same time.
cloneOverlayLayerClones the base map layer with some modifications.
setContentInitialize drawergroups and then add map drawers.
addContentAdd map drawers.
removeContentRemove map drawers Drawers could be a comma-delimited string, an array of strings, or an array of comma-delimited strings.
setSatelliteImageSourceSets the satellite provider, and redraws layer and updates attribution if in the satellite style.

Constants

DEFAULT_PARAMS

{Object} Hashtable of default parameter key/value pairs

Properties

isBaseLayer

{Boolean} Default is true for WMS layer

encodeBBOX

{Boolean} Should the BBOX commas be encoded?  The WMS spec says ‘no’, but some services want it that way.  Default false.

displayOutsideMaxExtent

{Boolean} If wrapDateLine is true, zoom level gets adjusted to prevent user zooming way out.  Set this property to true will cancel this behavior.

singleTile

{Boolean} Use tiles for single image dynamic map.

tileOrigin

{ALKMaps.LonLat} Tile origin

zoomOffset

{Number} Using zoomOffset is an alternative to setting serverResolutions if you only want to expose a subset of the server resolutions.

transparentOverlayLayer

{ALKMaps.Layer.BaseMap} Transparent overlay on satellite map.  It is a special layer that is added by the system.  User doesn’t need to know the existence of this layer usually.

Constructor

ALKMaps.Layer.BaseMap

Create a new ALK map base layer object

Parameters

name{String} A name for the layer
params{Object} An object with key/value pairs representing the GetMap query string parameters and parameter values.
options{Object} Hashtable of extra options to tag onto the layer.  These options include all properties listed above, plus the ones inherited from superclasses.
var layer = new ALKMaps.Layer.BaseMap( "ALK Maps",
     {
         style: ALKMaps.STYLE.DATADARK,
         region: 'NA'
     },
     {
         sphericalMercator: true,
         singleTile: false,
         zoomOffset:0, // Positive whole number from 0 to 18
         wrapDateLine: true,
         displayInLayerSwitcher: false,
         resolutions: [],
         attribution: "Your attribution info",
         attrUseHyperlink: true
     }
);

Functions

setMap

setMap: function(map)

destroy

destroy: function()

Destroy this layer

clone

clone: function(obj)

Create a clone of this layer

Returns

{ALKMaps.Layer.BaseMap} An exact clone of this layer

getURL

getURL: function(bounds)

Return a GetMap query string for this layer

Parameters

bounds{ALKMaps.Bounds} A bounds representing the bbox for the request.

Returns

{String} A string with the layer’s url and parameters and also the passed-in bounds and appropriate tile size specified as parameters.

getTileXYZ

getTileXYZ: function(bounds)

Calculates x, y and z for the given bounds.

Parameters

bounds{ALKMaps.Bounds}

Returns

{Object}an object with x, y and z properties.

mergeNewParams

mergeNewParams: function(newParams)

Catch changeParams and uppercase the new params to be merged in before calling changeParams on the super class.

Once params have been changed, the tiles will be reloaded with the new parameters.

Parameters

newParams{Object} Hashtable of new params to use

getFullRequestString

getFullRequestString: function(newParams,
altUrl)

Combine the layer’s url with its params and these newParams.

Add the SRS parameter from projection -- this is probably more eloquently done via a setProjection() method, but this works for now and always.

Parameters

newParams{Object}
altUrl{String} Use this as the url instead of the layer’s url

Returns

{String}

changeStyle

changeStyle: function(style)

Used to switch map styles.  Map will redraw.

Parameters

style{ALKMaps.STYLE} Such as ALKMaps.STYLE.SATELLITE, ALKMaps.STYLE.DEFAULT and more

setVisibility

setVisibility: function(visibility)

Change layer visibility.  When satellite layer visibility is changed, update the transparent layer�s visibility at the same time.

parameters

visibility{Boolean} true: make the layer visible.

afterAdd

afterAdd: function()

When satellite or terrain layer is added as a base layer, add the transparent layer at the same time.

cloneOverlayLayer

cloneOverlayLayer: function(style)

Clones the base map layer with some modifications.  Mainly used for overlaying transparent map on satellite map at this time.

setContent

setContent: function (content)

Initialize drawergroups and then add map drawers.  Drawers could be a comma-delimited string, an array of strings, or an array of comma-delimited strings. do processing to ensure it’s an array of strings.

addContent

addContent: function (contentToAdd)

Add map drawers.  Drawers could be a comma-delimited string, an array of strings, or an array of comma-delimited strings. do processing to ensure it’s an array of strings.

removeContent

removeContent: function (contentToRemove)

Remove map drawers Drawers could be a comma-delimited string, an array of strings, or an array of comma-delimited strings. do processing to ensure it’s an array of strings.

setSatelliteImageSource

setSatelliteImageSource: function(imgSrc)

Sets the satellite provider, and redraws layer and updates attribution if in the satellite style.

Create a new ALK map base layer object
{Number} Using zoomOffset is an alternative to setting serverResolutions if you only want to expose a subset of the server resolutions.
setMap: function(map)
destroy: function()
Destroy this layer
clone: function(obj)
Create a clone of this layer
getURL: function(bounds)
Return a GetMap query string for this layer
getTileXYZ: function(bounds)
Calculates x, y and z for the given bounds.
mergeNewParams: function(newParams)
Catch changeParams and uppercase the new params to be merged in before calling changeParams on the super class.
getFullRequestString: function(newParams,
altUrl)
Combine the layer’s url with its params and these newParams.
changeStyle: function(style)
Used to switch map styles.
setVisibility: function(visibility)
Change layer visibility.
afterAdd: function()
When satellite or terrain layer is added as a base layer, add the transparent layer at the same time.
cloneOverlayLayer: function(style)
Clones the base map layer with some modifications.
setContent: function (content)
Initialize drawergroups and then add map drawers.
addContent: function (contentToAdd)
Add map drawers.
removeContent: function (contentToRemove)
Remove map drawers Drawers could be a comma-delimited string, an array of strings, or an array of comma-delimited strings.
setSatelliteImageSource: function(imgSrc)
Sets the satellite provider, and redraws layer and updates attribution if in the satellite style.
Base class for layers that use a lattice of tiles.
Instances of this class represent bounding boxes.
Close