Show:

ia.AGSLayer Class

Extends ia.ImageLayer
Module: ia

For handling ArcGIS Server layers.

f
Description: The response format. The default response format is html. If the format is image, the image bytes are directly streamed to the client.
Values: html | json | image | kmz

bbox    
Required
Description: The extent (bounding box) of the exported image. Unless the bboxSR parameter has been specified, the bbox is assumed to be in the spatial reference of the map.
Syntax: , , , 
Example: bbox=-104,35.6,-94.32,41
The bboxcoordinates should always use a period as the decimal separator even in countries where traditionally a comma is used.

size    
Description: The size (width * height) of the exported image in pixels. If the size is not specified, an image with a default size of 400 * 400 will be exported.
Syntax: , 
Example: size=600,550

dpi    
Description: The device resolution of the exported image (dots per inch). If the dpi is not specified, an image with a default DPI of 96 will be exported.
Example: dpi=200

imageSR    
Description: The well-known ID of the spatial reference of the exported image. If the imageSR is not specified, the image will be exported in the spatial reference of the map.

bboxSR    
Description: The well-known ID of the spatial reference of the bbox. If the bboxSR is not specified, the bbox is assumed to be in the spatial reference of the map.

format    
Description: The format of the exported image. The default format is png.
Values: png | png8 | png24 | jpg | pdf | bmp | gif | svg | png32 
Note: Support for the png32 format was added at 9.3.1. This format is only available for map services whose supportedImageFormatTypes property includes PNG32

layerDefs    
Description: Allows you to filter the features of individual layers in the exported map 
by specifying definition expressions for those layers. 
Syntax: layerId1:layerDef1;layerId2:layerDef2
where layerId1, layerId2 are the layer ids returned by the map service resource 
Example: 0:POP2000 > 1000000;5:AREA > 100000

layers    
Description: Determines which layers appear on the exported map. There are four ways to specify which layers are shown:
show: Only the layers specified in this list will be exported.
hide: All layers except those specified in this list will be exported.
include: In addition to the layers exported by default, the layers specified in this list will be exported.
exclude: The layers exported by default excluding those specified in this list will be exported.
Syntax: [show | hide | include | exclude]:layerId1,layerId2
where layerId1, layerId2are the layer ids returned by the map service resource
Example: layers=show:2,4,7

transparent    
Description: If true, the image will be exported with the background color of the map set as its transparent color. 
The default is false. Only the png and gif formats support transparency.  
Internet Explorer 6 does not display transparency correctly for png24 image formats.
Values: true | false

Constructor

ia.AGSLayer

()

Methods

_mapEventHandler

(
  • event
)
private

Handles when to carry out hit tests.

Parameters:

addCanvases

()

Adds drawing canvases for the layer when the layer is shown. This method was introduced to fix a bug a chrome when multiple canvases were affecting rendering. It basically reduces the number of unused canvases which are taking up memory.

addEventListener

(
  • eventType
  • fnc
  • obj
)

Add an event listener.

Parameters:

  • eventType String

    The type of event to listen for.

  • fnc Function

    The function to call when the event occurs.

  • obj Object

    An optional parent object.

clear

()

Clears all canvases in the layer.

createCanvas

() HTML Canvas

Creates a new canvas.

Returns:

HTML Canvas: The canvas.

dispatchEvent

(
  • event
)

Dispatch an event to the listeners.

Parameters:

  • event Object

    The event object.

draw

(
  • ctx
)

Draws the image without reloading it.

Parameters:

  • ctx HTML Canvas Context

    The context to render to.

getUrl

() String

Inherited from ia.ImageLayer but overwritten in ia\maps\layers\AGSLayer.js:73

Returns the required url.

Returns:

String: The url for retrieving the ags image.

getVisible

() Boolean

Gets the visibility of the layer.

Returns:

Boolean: true/false.

loadSource

()

Loads the source data.

removeCanvases

()

Removes drawing canvases for the layer when the layer is hidden. This method was introduced to fix a bug a chrome when multiple canvases were affecting rendering. It basically reduces the number of unused canvases which are taking up memory.

removeListener

(
  • obj
)

Removes all event listeners for the given object.

Parameters:

  • obj Object

    The object.

render

()

Inherited from ia.LayerBase but overwritten in ia\maps\layers\ImageLayer.js:67

Renders the image.

setMap

(
  • map
  • map
)

Sets the map and canvas for the layer.

Parameters:

  • map ia.Map

    The map.

  • map HTML Element

    The container.

setVisible

(
  • value
)

Sets the visibility of the layer.

Parameters:

  • value Boolean

    true/false.

Properties

bBox

ia.BoundingBox

The bounding box for the layer.

canvas

HTML Canvas

The canvas associated with this layer.

context

HTML Canvas Context

The canvas context associated with this layer.

id

String

The id of the layer.

Default: ""

interactive

Boolean

Is selection and highlighting switched on.

Default: false

isLoaded

Boolean

Indicates whether the layer is loaded.

Default: false

layers

String

Determines which layers appear on the exported map.

Default: ""

map

ia.Map

The map associated with this layer.

name

String

The name of the layer.

Default: ""

params

String

Any additional params.

Default: ""

showDataTips

Boolean

Are data tips displayed.

Default: trueE

showInLayerList

Boolean

Should the layer be displayed ina layer list.

Default: false

showLabels

Boolean

Show labels.

Default: false

srs

String

The spatial reference system.

Default: ""

url

String

The url.

Default: ""

version

String

The version number.

Default: ""