Closed msokolDOIT closed 10 years ago
This is debatable. If you want a TOC control there are two third party solutions that you can integrate into the viewer with minimal effort here: http://www.arcgis.com/home/item.html?id=98d9e760d6d1496487ca583b0e8ce73c and http://www.arcgis.com/home/item.html?id=9b6280a6bfb0430f8d1ebc969276b109
Read the "side note" section in the second link above on even having a TOC. I tend to agree. There are better ways to control what layers you view.
Thanks for the links!
I've used NLiu's TOC and I like it but it seems like it has problems working with secure services in IE.
I have also had problems with getting it to use Feature Layers. I'm still just learning JS so perhaps I'm not doing something right.
David, can you provide some general direction on how to rewrite NLiu's TOC to conform to your framework using AMD?
Basically you need to upgrade the module to AMD. AMD was introduced at dojo 1.7. There is a guide found here: http://dojotoolkit.org/reference-guide/1.8/releasenotes/migration-17.html
It should work as is until dojo 2.0, is it not working? I can't provide much support here as its not a module I wrote.
Thanks. Understand about the support bit. It is not working but I am not sure about how to install within the CV (configurable Viewer) framework. Do you think you could provide some specific guidance on this so that I know how to approach in the future when adding legacy code?
From: David Spriggs [mailto:notifications@github.com] Sent: Wednesday, May 15, 2013 1:34 PM To: DavidSpriggs/ConfigurableViewerJSAPI Cc: Keith KG. Gerhartz Subject: Re: [ConfigurableViewerJSAPI] Legend Layers On/Off (#8)
Basically you need to upgrade the module to AMD. AMD was introduced at dojo 1.7. There is a guide found here: http://dojotoolkit.org/reference-guide/1.8/releasenotes/migration-17.html
It should work as is until dojo 2.0, is it not working? I can't provide much support here as its not a module I wrote.
— Reply to this email directly or view it on GitHubhttps://github.com/DavidSpriggs/ConfigurableViewerJSAPI/issues/8#issuecomment-17953684.
In my opinion while the side note logic makes sense, working in a government office we hear a lot of users asking for the ability to have more control especially the public when using an app like this. It really depends on the audience in my opinion. For example realtors have many different uses of a web map, some might want to see controls, others want to see addresses, some just want to see the outline of parcels, some hydrology. While giving the user the capability to potentially slow down the map one could also argue that not giving them options also limits the map. The ability to turn layers on and off seems important to me.
If the person authoring the map services takes into account the other map services currently being used in the application then I would think things could be built in such a fashion that they do not overlap. For example the one I was just given is,"well I do not always need to see the parcel number as a label sometimes I just want to see the address". Well if I combined all that info as a label there would certainly be overlap. So I had to create another map service so the user could toggle off the parcel number and turn on addresses. This is also because some but not all users need/want to see parcel dimensions which is another layer that uses annotation.
I agree the subject is debatable but in my opinion not giving the user the option to turn things on and off also limits the application. If there is a cleaner way of handling a situation like I described above I would be very interested in learning. thanks again for all your work David!
Hi David Would a check box for turning on and off layers be appropriate? Yes, please.
Yes I need to do this. Look for it soon...
David, thanks for the great work on this project! Any progress on turn layer on/off feature? Thanks!
Sorry for my english and for my meddling , first this application is great for a start because give you the ways to build your own widgets or use others ,probably David dont want to give a tool not enough tested but you could give a turn around using this http://gmaps-utility-gis.googlecode.com/svn/tags/agsjs/latest/docs/toc/examples.html or http://www.arcgis.com/home/item.html?id=9b6280a6bfb0430f8d1ebc969276b109 first you could follow the toc (Table of Contents) example, to add in david's application you only need to put the css and the package location ,later In the config.js section you put this in widgets
TOC: {
include: true,
title: "Layers",
open: false,
position: 5
},
and in the Controller.js section of widgets
if (config.widgets.TOC && config.widgets.TOC.include) {
var TOCTP = this._createTitlePane(config.widgets.TOC.title, config.widgets.TOC.position, config.widgets.TOC.open);
require(['agsjs/dijit/TOC'], lang.hitch(this, function (TOC) {
this.toc = new TOC({
map: this.map,
layerInfos: this.legendLayerInfos
}, domConstruct.create("div")).placeAt(TOCTP.containerNode);
}));
}
You could configure the toc layers where the legendLayerInfos is pushing the layers or getting the properties from the operationlayer declaration here a bad example that works(because all layers will have slider and no legend):
this.legendLayerInfos.push({
layer: l,
title: layer.title || null,
slider: true,
noLegend : true
});
with this you could have the toc tool and if u configure it in TOC.js File you could show it like you want ,a simple example: I hope this works for someone and sorry david for meddling.
No worries. I have been meaning to put this in for awhile. I will do so soon, with some mods to the toc.
Done. Widget is included now.
This template is terrific! I've been trying to do a lot of this stuff on my own and been getting hung up on a lot of things.
Would a check box for turning on and off layers be appropriate?