Skip to content

Esri/arcgis-dijit-layer-swipe-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

arcgis-dijit-layer-swipe-js

Features

A swipe widget to partially show a layer by dragging it left or right.

App

View Demo

Instructions

Basic use

var swipeWidget = new LayerSwipe({
    map: map,
    layers: [layer]
}, "LayerSwipe");
swipeWidget.startup();

All options

 var swipeWidget = new LayerSwipe({
    theme: "LayerSwipe", // applies css class to the widget container
    map: myMap, // map to use for the widget
    layers: [myLayer], // layer to use for the swipe widget or string id of the layer eg: "layerId".
    tool: "vertical", // type of the swipe tool to use. Options are "vertical", "horizontal" or "scope".
    toolClip: 9, // pixels to clip the scope image for rounded corners.
    toolOffsetTop: null // Starting offset for the tool from the top. Defaults to null and uses 1/4 map width for horizontal and center for scope.
    toolOffsetLeft: null // Starting offset for the tool from the left. Defaults null and uses 1/4 map height on vertical and center for scope.
}, "LayerSwipe"); // div to use the widget
swipeWidget.startup();

Hiding the widget

// option 1
swipeWidget.set("visible", false); // setting the visible value to false

// option 2
swipeWidget.hide(); // calling the hide method

// option 3
myLayer.hide(); // hiding the layer assigned to the widget

New to Github? Get started here.

Requirements

  • Notepad or HTML editor
  • A little background with Javascript
  • Experience with the ArcGIS Javascript API would help.

Resources

Issues

Find a bug or want to request a new feature? Please let us know by submitting an issue.

Contributing

Anyone and everyone is welcome to contribute.

Licensing

Copyright 2012 Esri

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

A copy of the license is available in the repository's license.txt file.

[](Esri Tags: ArcGIS JavaScript API Dijit module swipe Widget Public swipemap LayerSwipe) [](Esri Language: JavaScript)