Community
All Communities
Products
ArcGIS Pro
ArcGIS Survey123
ArcGIS Online
ArcGIS Enterprise
Data Management
ArcGIS Experience Builder
Geoprocessing
ArcGIS Web AppBuilder
ArcGIS Dashboards
ArcGIS Field Maps
ArcGIS StoryMaps
All Products Communities
Industries
Education
Water Resources
State & Local Government
Transportation
Gas and Pipeline
Water Utilities
Roads and Highways
Telecommunications
Natural Resources
Electric
Imagery and Remote Sensing Insights (IRIS) COP
All Industries Communities
Developers
Python
JavaScript Maps SDK
Native Maps SDKs
ArcGIS API for Python
ArcGIS Pro SDK
ArcObjects SDK
Developers - General
ArcGIS REST APIs and Services
ArcGIS Online Developers
Game Engine Maps SDKs
File Geodatabase API
All Developers Communities
Global
Comunidad Esri Colombia - Ecuador - Panamá
ArcGIS 開発者コミュニティ
Czech GIS
ArcNesia
Europe
Esri India
Americas
Asia Pacific
Comunidad GEOTEC
GeoDev Germany
ArcGIS Content - Esri Nederland
All Global Communities
All Communities
Developers
User Groups
Industries
Services
Community Resources
Global
Events
Learning
Networks
ArcGIS Topics
Products
View All Communities
ArcGIS Ideas
GIS Life
Community Resources
Community Help Documents
Community Blog
Community Feedback
Member Introductions
All Community Resources
Sign In
cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
Show
only
|
Search instead for
Did you mean:
Cancel
Home
:
All Communities
:
Developers
:
JavaScript Maps SDK
:
JavaScript Maps SDK Questions
:
TOC Widget - Slider is not working
Options
Subscribe to RSS Feed
Mark Topic as New
Mark Topic as Read
Float this Topic for Current User
Bookmark
Subscribe
Mute
Printer Friendly Page
Select to view content in your preferred language
Translate Now
TOC Widget - Slider is not working
Subscribe
824
4
05-14-2014 09:54 AM
by
EdibertoAlves1
Deactivated User
05-14-2014
09:54 AM
Mark as New
Bookmark
Subscribe
Mute
Subscribe to RSS Feed
Permalink
Print
Hi!
I am developing an application using the TOC Widget from this source:
http://gmaps-utility-gis.googlecode.com/svn/tags/agsjs/latest/docs/toc/examples.html
However, I'm not getting the slide tool to make transparency. On the moment that the user select the layer that desire to work and the layer is loaded.
Below the code snippet.
var dynaLayer1, dynaLayer2;
var toc, toogleLayer;
var dynaLayer1, dynaLayer2;
var toc, toogleLayer;
require([
"dojo/_base/connect",
"dojo/dom",
"dojo/parser",
"dojo/on",
"dojo/_base/Color",
"esri/map",
"esri/geometry/Extent",
"esri/layers/FeatureLayer",
"esri/layers/ArcGISTiledMapServiceLayer",
"esri/layers/ArcGISDynamicMapServiceLayer",
"esri/symbols/SimpleFillSymbol",
"esri/renderers/ClassBreaksRenderer",
"agsjs/dijit/TOC",
"dijit/layout/BorderContainer",
"dijit/layout/ContentPane",
"dojo/fx",
"dojo/domReady!",
"dojo/dom-construct",
"dijit/registry"
],
function (connect, dom, parser, on, Color,
Map, Extent, FeatureLayer, ArcGISTiledMapServiceLayer, ArcGISDynamicMapServiceLayer,
SimpleFillSymbol, ClassBreaksRenderer,
TOC, domConstruct, registry) {
parser.parse();
var mapServer = dojo.byId('selEmpreendimento'); // options from select with url mapservers
dynaLayer1 = new ArcGISDynamicMapServiceLayer(mapServer.value, {
mode: FeatureLayer.MODE_ONDEMAND
});
map.on('LayersAddResult', function (evt) {
toc = new agsjs.dijit.TOC({
map: map,
layerInfos: [
//{
// layer: featLayer1,
// title: "Fotos",
// //collapsed: false, // whether this root layer should be collapsed initially, default false.
// slider: true // whether to display a transparency slider.
//},
{
layer: dynaLayer1,
title: dynaLayer1.layerInfos.name,
//collapsed: false, // whether this root layer should be collapsed initially, default false.
slider: true // whether to display a transparency slider.
}]
}, 'tocDiv');
toc.startup();
map.addLayer(dynaLayer1);
});
on(mapServer, 'change', function (evt) {
dynaLayer2 = new ArcGISDynamicMapServiceLayer(mapServer.value, {
mode: FeatureLayer.MODE_ONDEMAND
});
map.addLayer(dynaLayer2);
toogleLayer = map.on('LayerAddResult', function (evt) {
toc.layerInfos.splice(0, 1, {
layer: dynaLayer2,
title: dynaLayer2.layerInfos.name,
slider: true
});
toc.refresh();
toogleLayer.remove();
});
});
});
What I am make wrong?
Thanks
Tags
(2)
Tags:
javascript
web_developers
Reply
0
Kudos
All Posts
Previous Topic
Next Topic
4 Replies
by
EdibertoAlves1
Deactivated User
05-15-2014
06:30 AM
Mark as New
Bookmark
Subscribe
Mute
Subscribe to RSS Feed
Permalink
Print
Anyone can help?
Reply
0
Kudos
by
KenBuja
MVP Esteemed Contributor
05-15-2014
09:18 AM
Mark as New
Bookmark
Subscribe
Mute
Subscribe to RSS Feed
Permalink
Print
Could you put this into something like
JSBin
to show what exactly is happening?
Reply
0
Kudos
by
JeffPace
MVP Alum
05-15-2014
10:10 AM
Mark as New
Bookmark
Subscribe
Mute
Subscribe to RSS Feed
Permalink
Print
first glance
your require is out of order. domReady needs to be last. And you are missing alot of aliases to the require (bordercontainer, fx, etc..)
These need to match exactly.
Reply
0
Kudos
by
GauriDeshmukh
Deactivated User
05-26-2014
08:14 PM
Mark as New
Bookmark
Subscribe
Mute
Subscribe to RSS Feed
Permalink
Print
Did you get the solution? If You find please post it here.
Reply
0
Kudos
Post Reply