<< Click to Display Table of Contents >>

 

new sg.controls.LayerSwipe()

 

 

Description

Create a LayerSwipe object.

 

Position

controls.js

 

 

Parameters

 

Parameter

Type

Description

param

 

 

 

 

Object

set object

Name

Type

Description

map

MapBase

target MapBase

layers

Array.<Object>        

target layer array

left

Number

controls horizontal placement

top

Number

controls vertical placement

type

String

type of the drag able button

set object

node

DOMNODE

LayerSwipe node

 

 

Properties

 

Property

Type

Description

layers

Array.<Object>

the layer added to.

left

Number

drag able button position. Only works when type is vertical.

map

MapBase

target MapBase

top

Number

drag able button position. Only works when type is horizontal.

node

DOMNODE

LayerSwipe node

type

String

type of LayerSwipe, which controls the direction of the drag able button. Default is vertical. Another option is horizontal.

 

 

Methods

 

Method

Type

Description

destroy()

none

Remove LayerSwipe

hide()

none

Hide LayerSwipe

show()

none

Show LayerSwipe

startup()

none

Initialize LayerSwipe

 

 

Example

 

 

<script type="text/javascript" src="scripts/Tasks.js"></script>

 

var layerSwipe = new sg.controls.LayerSwipe({

    map: gMapBase,

    layers: [pLyr2],

    type: "vertical" //or horizontal

    }, "swipe");

 

layerSwipe.startup();

 

 

 

See live demo

 


©2015 Supergeo Technologies Inc.