|
POST
|
I have a project that let's the user change which attribute field is used in the display. It's based on the sample https://developers.arcgis.com/javascript/jssamples/renderer_dynamic_layer_change_attribute.html For the legend, I'm creating it if it doesn't exist, but if it does, then I just want it to refresh. My problem is that the title is based on a variable, defined based on the change event of the FilteringSelect list of fields. When I change the field, the legend itself updates, but it still has the title from its initial creation. Can I change just the title? It doesn't seem to be honoring my title definition when I specify legend.refresh(). In this example, fields is the array of attributes from my layer and fieldChoice is the selected item from the FilteringSelect.
domConstruct.empty("legendDiv");
if (!legend){
legend = new Legend({
map: map,
layerInfos: [{ "layer": featureLayer, "title": fields[fieldChoice] }]
},"legendDiv");
legend.startup();
}else{
legend.refresh();
}
... View more
08-26-2014
09:05 AM
|
0
|
4
|
2278
|
|
POST
|
I think it might be specific to version 3.10. I have some slightly older code at version 3.9, and it draws fine. If I switch my 3.10 references to 3.9, it works. I take that back. In the 3.9 version, it wanted the field name as ${fieldname}. In 3.10, it only worked if without the $. Obviously there's been some changes made between the version. Let's hope ESRI staff read these threads for this sort of thing.
... View more
08-25-2014
01:11 PM
|
0
|
1
|
2122
|
|
POST
|
I'm experiencing a similar problem. I've looked through the reference, but I don't see anything that lets you place overlapping labels. When I noticing is that no matter how far I zoom in, I have at least one label that never does draw. These are my county boundaries, which I use all the time, so I can't imagine there is anything wrong the layer itself. This county is shaped a little differently, sort of an upside down L. I wonder if the labeling for polygons is based on extent. In this case the center of that extent doesn't fall within the polygon itself. The county name is Iron, so it's not like its a long name! It seems like a bug to me. I'm using version 3.10 of the API.
... View more
08-25-2014
06:37 AM
|
0
|
0
|
2122
|
|
POST
|
Not that I know of. I don't think changing to a featureLayer gains you much, if anything. The whole idea of the cluster is that is processes all your records and determines which should be combined.
... View more
08-19-2014
06:05 AM
|
0
|
2
|
3109
|
|
POST
|
It sounds like you need to do some more reading on the differences between AMD and legacy style code. AMD is not new. Throughout the samples and help pages, you'll see syntax that might say either 'legacy code' or AMD. It has to do with how the modules are first loaded, among other things. Here's another thread that discusses the differences. It's hard to know specifically what your problem is from the small amount of code you've provided. https://community.esri.com/thread/79966
... View more
08-18-2014
09:15 AM
|
0
|
2
|
3109
|
|
POST
|
We have a project coming up, where one of the 'wish list' items is to be able to dynamically change the number of maps shown, with different content, as well as charts, data etc. I'm sure they are envisioning some sort of dashboard. I know I can get it all laid out nicely if the number of each is a known quantity. However, sometimes they might just want to see one map, and other times, they might want to see a series of maps, one for each year in a series. It will vary based on the number of fields that are available for any given layer. I'm wondering if anyone has experimented with using something like dojox/layout/GridContainer to manage all the panes. That would let the user reorder the frames, expand, collapse etc. I'm looking at the examples from here http://dojotoolkit.org/reference-guide/1.10/dojox/layout/GridContainer.html#dojox-layout-gridcontainer I'm hesitant to work with something that is marked experimental, but my early attempts calling the ESRI scripts and styles like
<link rel="stylesheet" href="https://js.arcgis.com/3.10/js/dojo/dojox/widget/Portlet/Portlet.css">
<link rel="stylesheet" type="text/css" href="https://js.arcgis.com/3.10/js/dojo/dojox/layout/resources/GridContainer.css">
<link rel="stylesheet" type="text/css" href="https://js.arcgis.com/3.10/js/dojo/dojox/layout/resources/DndGridContainer.css">
seem to include everything I'm looking for. I'm I setting myself up for disaster if I decide to use these components in my project?
... View more
08-15-2014
08:49 AM
|
0
|
0
|
945
|
|
POST
|
Keep in mind that many of the ESRI samples and most of what is posted on the forums are written in AMD style, which doesn't support the code assist functionality.
... View more
08-14-2014
10:06 AM
|
0
|
1
|
1700
|
|
POST
|
It's hard to know why you're getting that error w/o seeing the entire context. The post you replied to is 2 years old and was in legacy (nonAMD) code. Maybe you're getting stuck there. There was both a legacy and AMD version of clusterLayers are one point, right when AMD first came out. Generally when I have the sort of error you're describing, it's nothing to do with the function, it's because I don't have something right toward the top, either in my dojoConfig definition or when I'm setting all my requires.
... View more
08-14-2014
09:56 AM
|
0
|
1
|
3109
|
|
POST
|
I ended up creating several images from my gfx that I had created and using those within a filteringSelect. It's not exactly what I had in mind, but it does give the user a color ramp to choose from. The only thing I don't like about this is that even though my image shows up in the dropdown, the display within the filteringSelect box is still just my value. I see that I can specify labelAttr and labelType. Maybe I could be using something else for my value? function populateColorBox (){ colorStore = new Memory({data: [ {id: 1, value:"Greens", label:"<img src='./images/arrayGreen.png' />"}, {id: 2, value:"Reds", label:"<img src='./images/arrayRed.png' alt='red' />"}, {id: 3, value:"Blues", label:"<img src='./images/arrayBlue.png' alt='blue' />"}, {id: 4, value:"Oranges", label:"<img src='./images/arrayOrange.png' alt='orange' />"}, {id: 5, value:"Grays", label:"<img src='./images/arrayGray.png' alt='gray' />"}, {id: 6, value:"Purples", label:"<img src='./images/arrayPurple.png' alt='purple' />"} ] }); var colorSelect2 = new FilteringSelect({ id: "colorSelect2", value: 1, store: colorStore, searchAttr: "value", // name: "xyz", labelAttr: "label", labelType: "html" }, dom.byId("colorDiv")); colorSelect2.startup(); }
... View more
08-12-2014
02:43 PM
|
0
|
0
|
962
|
|
POST
|
That was it, thanks! I had it right in another section of my code, I just went a little too far editing the pizza sample.
... View more
08-12-2014
02:21 PM
|
0
|
0
|
6570
|
|
POST
|
It is executing, but its still not styled correctly. The first checked item retains a filled look. I'm sure I have something out of order. What is the true parameter for ? HTML <ul style="list-style-type: none"> <li> <input id="btnQuantile" name="quantile" type="radio" value="quantile" checked data-dojo-type="dijit/form/RadioButton"> <label for="btnQuantile">Quantile</label> </li> <li> <input id="btnEqInterval" name="eqInterval" type="radio" value="equal_interval" data-dojo-type="dijit/form/RadioButton"> <label for="btnEqInterval">Equal Interval</label> </li> </ul> JAVASCRIPT registry.byId("btnQuantile").on("click", function(isChecked){ if(isChecked){ currentMethod="quantile"; drawFeatureLayer(); } }, true); registry.byId("btnEqInterval").on("click", function(isChecked){ if(isChecked){ currentMethod="equal_interval"; drawFeatureLayer(); } }, true);
... View more
08-12-2014
02:12 PM
|
0
|
2
|
6570
|
|
POST
|
I am working on a menu that lets the use select a classification method, either quantile or equal interval, as well as letting them change the color or the number of intervals. The number of classes is in a dijit/form/NumberSpinner. The colors I have in a FilteringSelect. For both of those, I was able to have an event listener such as
registry.byId('classSelect').on ('change', function (){
numClass = registry.byId("classSelect").value;
drawFeatureLayer();
});
This lets the user change the interval and it immediately executes the functions that do the drawing. I like the look of a radio buttons and I want to use those for my classification methods. First I tried a dijit/formRadioButton. This looks OK, but selecting between the two choices doesn't have very good styling. The first button still has a little fill color to it, and the 2nd one does too, so it looks like both of them are selected.
<h4>Classification method: </h4>
<form id="classForm" action="">
<input type="class-method" name="method" id="btnQuantile" value="quantile" data-dojo-type="dijit/form/RadioButton" checked="checked"/> <label for="btnQuantile">Quantile</label> <br />
<input type="class-method" name="method" id="btnEqInterval" value="equal_interval" data-dojo-type="dijit/form/RadioButton" /> <label for="btnEqInterval">Equal Interval </label> <br />
</form>
The other thing I'm not sure about is how I might have an event listener to the change in buttons. All I can figure out is to add a 'Go' button which will read the classification and then execute my drawing function.
registry.byId('btnClassify').on('click', function (){
var clsForm = dom.byId("classForm");
for(var i = 0; i < clsForm.method.length; i++) {
if(clsForm.method.checked){
currentMethod = clsForm.method.value;
}
}
drawFeatureLayer();
});
Since I figured out I don't need a 'Go' button for either the number of classes or my colors, I'd really like to get rid of it all together and not have to have it just for my classification method. I suppose I could use another type of menu, but I only have two methods. It looks klunky to have a dropdown menu that has just one other option in it. Am I missing something obvious on how to detect when one of those two buttons are selected?
... View more
08-12-2014
01:49 PM
|
0
|
5
|
9886
|
|
POST
|
I found some code on github that lets you specify the number of classifications, color and type to create thematic maps. It included a set of color ramps already written up from colorbrewer, so I didn't have to dig it out. There is no GUI on this set of functions that calculate the classifications. One thing I'd like to do, since I have all these great colors already, is create graphics from the color ramps and let that be what the user clicks on. Unfortunately I don't see that I can add that kind of click event on a shape. There are click events, but I don't see how I can pass the color name as an argument, anyway. The next thing would be to add a checkbox next to the ramps. This is where I'm getting stuck. Since I'm dealing with gfx, I'm not sure where to add checkboxes next to each graphic. Mostly it's Friday afternoon and I'm getting tired. I created a fiddle for this. For some reason it is only flashing the colors instead of leaving the color graphics on the screen. If someone is available to help me out on this, I think it would be a nice way of offering color choices, rather than presenting either a list of color names, or the generic color palette. http://jsfiddle.net/8bx4vdv2/ I think I'm getting stuck on the fiddle because I'm attempting to only paste part of the colors I have available and I made a syntax error somewhere.
... View more
08-08-2014
01:16 PM
|
0
|
1
|
1484
|
|
POST
|
I don't know what ESRI has done to their search engine. I can't see1/2 the entries I used to be able to find. There were several threads that used to come up toward the top on the old forum if you searched on Identifytask and spatialreference. I wish I could find the thread again or the project where I had to put the workaround. There is a particular place in the code that you have to specify the spatialReference again, since it doesn't inherit from either the layer or the map. Hopefully they'll fix the task in a future release.
... View more
08-07-2014
01:10 PM
|
0
|
0
|
2268
|
|
POST
|
If you search a little more on these forums, you'll see this is a known bug.
... View more
08-07-2014
12:54 PM
|
0
|
4
|
2268
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-02-2017 02:38 PM | |
| 2 | 03-18-2022 10:14 AM | |
| 2 | 02-18-2016 06:28 AM | |
| 1 | 03-18-2024 07:29 AM | |
| 4 | 08-02-2023 06:08 AM |
| Online Status |
Offline
|
| Date Last Visited |
02-25-2025
01:56 PM
|