|
POST
|
In IE I had to click "SHOW ALL CONTENT" and then everything showed up.. still cant get it to show up in Chrome or Firefox???? hmmmmm
... View more
06-04-2014
08:15 AM
|
0
|
0
|
2966
|
|
POST
|
really weird....I ran this in IE and it ran fine????? Chrome is where I was having issues... hmmmmm
... View more
06-04-2014
08:07 AM
|
0
|
0
|
2966
|
|
POST
|
Trying to get the TOC example working http://www.arcgis.com/home/item.html?id=9b6280a6bfb0430f8d1ebc969276b109 I downloaded the files ... USING 2.10 ...I get most of the website to display including the map but nothing in the TOC shows up. I am using the code pretty much using the code from the Source HTML. I put a few Alerts in the code below...I am getting Alert 1,2,4 BUT for some reason not Alert 3 anyone have any thoughts as to why the TOC is not appearing and why I am not getting into Alert 3 <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=7,IE=9" /> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/> <title>TOC</title> <link rel="stylesheet" type="text/css" href="https://js.arcgis.com/3.9/js/dojo/dijit/themes/claro/claro.css"> <link rel="stylesheet" type="text/css" href="https://js.arcgis.com/3.9/js/esri/css/esri.css" /> <link rel="stylesheet" type="text/css" href="src/agsjs/css/agsjs.css" /> <style> html, body { height: 98%; width: 98%; margin: 0; padding: 5px; font-family: helvetica, arial, sans-serif; font-size: 90%; } #leftPane { width: 280px; overflow: auto } /* this line hide layers when out of scale for the inline TOC */ .agsjsTOCOutOfScale { /* display: none;*/ } </style> <script type="text/javascript"> // helpful for understanding dojoConfig.packages vs. dojoConfig.paths: // http://www.sitepen.com/blog/2013/06/20/dojo-faq-what-is-the-difference-packages-vs-paths-vs-aliases/ var dojoConfig = { paths: { //if you want to host on your own server, download and put in folders then use path like: agsjs: location.pathname.replace(/\/[^/]+$/, '') + '/src/agsjs' } }; </script> <script src="https://js.arcgis.com/3.8/"> </script> <script type="text/javascript"> var map, toc, dynaLayer1, dynaLayer2, featLayer1; 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!"], function(connect, dom, parser, on,Color, Map, Extent, FeatureLayer, ArcGISTiledMapServiceLayer, ArcGISDynamicMapServiceLayer, SimpleFillSymbol,ClassBreaksRenderer, TOC){ // call the parser to create the dijit layout dijits parser.parse(); // note djConfig.parseOnLoad = false; map = new Map("map", { basemap: "topo", center: [-85.75, 38.25], zoom: 13 }); dynaLayer1 = new ArcGISDynamicMapServiceLayer("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/PublicSafety/PublicSafetyOperationalLayers/MapServer", { opacity: 0.8 }); featLayer1 = new FeatureLayer("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/1", { mode: FeatureLayer.MODE_SNAPSHOT, outFields: ["POP07_SQMI"] }); featLayer1.setDefinitionExpression("STCOFIPS='21111'"); //Louisville, KY alert("1"); map.on('layers-add-result', function(evt){ // overwrite the default visibility of service. // TOC will honor the overwritten value. dynaLayer1.setVisibleLayers([2, 5, 8, 11]); //try { toc = new TOC({ map: map, layerInfos: [{ layer: featLayer1, title: "FeatureLayer1" }, { layer: dynaLayer1, title: "DynamicMapServiceLayer1" //collapsed: false, // whether this root layer should be collapsed initially, default false. //slider: false // whether to display a transparency slider. }] }, 'tocDiv'); toc.startup(); alert("2"); toc.on('load', function(){ alert("3"); if (console) console.log('TOC loaded'); dom.byId("ChangeFeatureRenderer").disabled = false; dom.byId("SetVisibleLayersProgramatically").disabled = false; dom.byId("FindNodeByLayer").disabled = false; dom.byId("InsertNewLayer").disabled = false; dom.byId("HandleNodeCheckEvent").disabled = false; }); //} catch (e) { alert(e); } }); map.addLayers([dynaLayer1, featLayer1]); alert("4"); // REMOVED ACTIONS HERE ARE IN THE NEXT POST }); </script> </head> <body class="claro"> <div id="content" data-dojo-type="dijit/layout/BorderContainer" design="headline" gutters="true" style="width: 100%; height: 100%; margin: 0;"> <div id="header" data-dojo-type="dijit/layout/ContentPane" region="top"> <div> <b>Table Of Content (TOC/Legend) Widget</b> <a href='toc_classic.html'>Classic Style </a> | <a href='toc.html'>AMD style</a> <div style="right:20px;position: absolute"> <a href="../docs/toc/examples.html">Documentation</a> </div> </div> <ul style="margin:2px"> <li> Click check box in TOC to turn on/off layers. When click on groups, all sublayers will be turned on/off. </li> <li> Click <button id="ChangeFeatureRenderer" disabled="disabled"> ChangeFeatureRenderer </button>, notice in "FeatureLayer1", TOC refreshed to reflect the new renderer of FeatureLayer. </li> <li> Click <button id="SetVisibleLayersProgramatically" disabled="disabled""> SetVisibleLayersProgramatically </button> to programatically turn layer on/off (Set DynaLayer1 [8, 17, 18, 19, 20] on), notice TOC automatically sync with model(no refresh needed). </li> <li> Click <button id="FindNodeByLayer" disabled="disabled"> FindNodeByLayer </button> to programatically find node for layer inside a map service, then either hide (layer id=12,"Damage Assessment") or collapse (layer id=0,"Public Safety") it. </li> <li> Click <button id="InsertNewLayer" disabled="disabled"> InsertNewLayer </button> to programmtically insert a layer (DynamicMapServiceLayer2, Census) then refresh TOC. </li> <li> Click <button id="SetOpacity" disabled="disabled"> SetOpacityProgramitically </button> to programmtically set transparency of a newly added layer to 0.2 with slider enabled (after click "InsertNewLayer"). </li> <li> Click <button id="HandleNodeCheckEvent" disabled="disabled"> HandleNodeCheckEvent </button> Handle Check Event to allow only one layer visible in "public saftety" service. When a layer is checked on, all other layers are off. </li> </ul> </div> <div data-dojo-type="dijit/layout/ContentPane" id="leftPane" region="left" splitter="true"> <div id="tocDiv"> </div> </div> <div id="map" data-dojo-type="dijit/layout/ContentPane" region="center"> </div> </div> </body> </html>
... View more
06-04-2014
07:39 AM
|
1
|
15
|
8228
|
|
POST
|
Nope I am really confused... As the check boxes are being created on the fly I am not understanding where I can apply the infoTemplate if the check box is checked...bit different than your example above.... I assume that it does not matter how many check boxes are checked rather that I am assigning the correct infoTemplate to the specific MapService index??? Really confused on this one. Just need a little guidance to get me on the right path here. http://jsfiddle.net/vCW8W/7/
... View more
06-04-2014
05:12 AM
|
0
|
0
|
476
|
|
POST
|
Looking at your example again I think I know what you were getting at....going to try a few things....brb
... View more
06-04-2014
04:37 AM
|
0
|
0
|
1312
|
|
POST
|
Just not sure how to set up an infoTemplate for each of the Map services when done this way.... Unless there is another way to build a list of Layers and put them in a container to turn on and off? Noting that all or and variation may be displayed at any given moment. I love the ability to build the list automatically but need to identify on these layers as well. Any thoughts?
... View more
06-03-2014
12:38 PM
|
0
|
0
|
1312
|
|
POST
|
exactly what I was looking for....thanks....reading up on it....
... View more
06-03-2014
11:38 AM
|
0
|
0
|
990
|
|
POST
|
Thanks....was looking at this example and it does not mention the autocomplete https://developers.arcgis.com/javascript/jssamples/locator_simple.html And different code....confusing sometimes
var geocoder = new Geocoder({
map: map
}, "search");
geocoder.startup();
var geocoder = new Geocoder({
autoComplete: true,
map: map,
}, dom.byId("search"));
geocoder.startup();
... View more
06-03-2014
10:44 AM
|
0
|
0
|
719
|
|
POST
|
I am using the NavToolbar example for a zoom tool.... I can select the zoom tool and zoom in fine...and then hit the deactivate tool and it deactivates the zoom . But I want the Zoom to deactivate after each usage...I cant put the "navToolbar.deactivate();" in the Zoom function or it will not run... Anyone know how I can accomplish turning off the Zoom function after each usage? Or is there an easier way to do this? <div id="navToolbar" data-dojo-type="dijit/Toolbar"> <div data-dojo-type="dijit/form/Button" id="zoomin" data-dojo-props="iconClass:'zoominIcon'"></div> </div> <div id="navToolbar2" data-dojo-type="dijit/Toolbar"> <div data-dojo-type="dijit/form/Button" id="deactivate" data-dojo-props="iconClass:'deactivateIcon'">Deactivate</div> </div> var navToolbar = new Navigation(app.map); registry.byId("zoomin").on("click", function () { navToolbar.activate(Navigation.ZOOM_IN); }); registry.byId("deactivate").on("click", function () { //ClearGraphicsZoomTools(); navToolbar.deactivate(); });
... View more
06-03-2014
08:45 AM
|
0
|
2
|
944
|
|
POST
|
I want to be able to test if a specific container is open or closed...then open or close it based on the outcome...know a simply If Then statement will work but confused on the syntax to determine if its open or closed, show or hidden? On load this specific one is shown....say I want a button that when clicked determines if it is open and if so closes it... app.map.on("load", configNavigation); function configNavigation(evt) { dojo.byId("divSplashScreenContainer").style.display = "block"; }
... View more
06-03-2014
08:07 AM
|
0
|
4
|
1352
|
|
POST
|
Have been looking at the Geocoders on JavaScript Api site and they all work fine....but looking for a widget that displays possible options as the user is typing in the location. Is there an example like that out there? As I start typing "rich" a drop down would appear with the options for location that start with "rich" thus allowing the user to select the one they want Thanks
... View more
06-03-2014
07:47 AM
|
0
|
4
|
1229
|
|
POST
|
I think this (https://developers.arcgis.com/javascript/jssamples/widget_identitymanager_client_side.html) sort of addresses Number 2 above. It allows to the credentials to be stored and a refresh does not kick off the login window again. I guess my ONLY question now is how to modify the login window? Is this possible? Even if I was able to change the text, color, transparency etc..... Thoughts?
... View more
06-02-2014
05:51 AM
|
0
|
0
|
503
|
|
POST
|
When you create a JS app and add Secured Services it automatically creates a popup window to Authenticate the user and the data that is trying to access. Questions: 1. How can I modify this popup and change its appearance and location in the app (If possible). Can I recreate its appearance? 2. Is there a widget that I can leverage that will completely replace this and allow the user to login to a main page and then create some sort of session variable that will time out but allow the user to refresh without having to add their credentials every time. Thanks
... View more
06-02-2014
05:46 AM
|
0
|
2
|
1024
|
|
POST
|
Here is a JSFiddle of my issue. http://jsfiddle.net/vCW8W/5/ The layer list is being created from the Map Service that I am referencing. I want to add an Identify. Normally I create an infoTemplate for each Service to feed a container to display the results. But in this case I am only referencing the Map Service as a whole. There was a comment to figure out which item was checked and then apply a specific infoTemplate. BUT in my case 1, 2, or all three could be displayed at any given moment. How do I define the template for each layer in the Service in this case? Maybe something in the identify function that determines which Layer in the Service was selected? Thanks
... View more
06-02-2014
05:07 AM
|
0
|
0
|
1312
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-20-2018 11:09 AM | |
| 1 | 09-10-2018 06:26 AM | |
| 1 | 09-15-2022 11:02 AM | |
| 1 | 05-21-2021 07:35 AM | |
| 1 | 08-09-2022 12:39 PM |
| Online Status |
Offline
|
| Date Last Visited |
09-19-2022
09:23 PM
|