|
POST
|
Also, having them double-click on a parcel to get the info window to pop up makes the map zoom in, which is a bit annoying and is something I don't want. As I said before, in ArcGIS Online when you use the measure tool it doesn't select any underlying features, so it must be possible to do what I want to do ... somehow.
... View more
11-02-2017
11:44 AM
|
0
|
1
|
2456
|
|
POST
|
I have a basemap and a parcel layer, which is a feature layer. Pretty standard stuff. Another thing I just tried is to set the activation of the IdentityTask info window on a double click instead of a single click. That way when the user selects a measure tool they only click once to get the measurement started and the popup doesn't pop up. Unfortunately, they need to double-click to complete the measurement, at which point the info window still pops up anyway. So all I did was reduce the # of popups from two to one.
... View more
11-02-2017
11:41 AM
|
0
|
2
|
2456
|
|
POST
|
Doesn't work. I need a way to have the user disable the popup when they click on a measurement tool. I tried this: measurement.on("tool-change", disablepopup); function disablepopup() { map.setInfoWindowOnClick(false); } This would make it so that when the user clicked on one of the measurement tools to make a measurement, the popup would be disabled. Then, I would do something like this: measurement.on("measure-end", enablepopup); function enablepopup() { map.setInfoWindowOnClick(true); } Unfortunately, the first one (disable) does nothing. I know the function is getting invoked because when I put an alert box in there it does pop up, but it doesn't disable my info window. I think maybe the setInfoWindowOnClick event only lasts the duration of the function I've put it in. I tried writing it like: measurement.on("tool-change", map.setInfoWindowOnClick(false)); ...but it just hangs.
... View more
11-02-2017
11:18 AM
|
0
|
4
|
2456
|
|
POST
|
I have a Measurement tool that is also selecting the underlying parcel layer when the user clicks on the map to make a measurement. When that happens I have a popup with some features from that parcel layer that also pops up. That is, when the user tries to make a measurement they also get this annoying popup from the parcel they happened to click on. If I could temporarily disable the parcel layer's selectability I could have them make a measurement without having this other annoying popup come up. In ArcGIS Online somehow they manage to make the measurement tool not select the underlying layers when you're clicking on the map to make a measurement. But I don't know how they achieve that. That's what I'm trying to replicate. In general the whole selectability issue is a bit annoying, because even when I set my parcel layer to "not visible" or turn it off, it's *still* selectable.
... View more
11-02-2017
08:20 AM
|
0
|
6
|
2456
|
|
POST
|
Hello, I'm creating a web map in which I will need to change/toggle the selectability of a Feature layer. Is there any way to do this? I've looked through the API for the FeatureLayer class but don't see anything like what I'm looking for: FeatureLayer | API Reference | ArcGIS API for JavaScript 3.22 I would expect to see something like "IsSelectable" or "Seletable" but don't see anything like it. In Server Manager there is also nothing to change the selectability of my service. Is it not possible to do this at all, or am I missing something? Thanks
... View more
11-02-2017
07:51 AM
|
0
|
28
|
6401
|
|
POST
|
#include <iostream.h>
void main(void)
{
cout << "Thanks!";
}
... View more
12-20-2016
10:55 AM
|
0
|
0
|
1195
|
|
POST
|
Actually, I think I just figured out that it is the redrawing of my pie chart I need to defer. Hopefully that'll make it easier.
... View more
12-20-2016
09:25 AM
|
0
|
0
|
1195
|
|
POST
|
My issue now is, while your (2nd) example calls a deferred function directly from the event handler, due to the complexity of my program, I need that event handler to first call a RedrawLayer function, which in turn will call one of 13 other functions in a switch statement. In those 13 other functions is where I assign a global variable based on a queryCount (which is used to make a pie chart). I *could* turn those 13 other functions into one giant if-else tree, which would let me make the RedrawLayer function be the deferred function, but that would be an incredible mess. So now, basically I'm trying to figure out where and what to defer. Interestingly, if I put an alert popup at certain spots, the whole thing works. But if I do nothing more than comment out that alert popup it *doesn't* work and it seems it's not grabbing my global variable and my chart doesn't draw. Ultimately I don't want the alert popup to be there so I have to figure out how to make it work without the popup. It's hard to figure out exactly what is being drawn, and when it is being drawn, in what order. BTW how do you insert code like you've been doing? Don't see any kind of "insert code" function in the toolbar.
... View more
12-20-2016
09:01 AM
|
0
|
3
|
1195
|
|
POST
|
Eh, I take that back, it didn't solve the problem. It just moved it somewhere else.
... View more
12-20-2016
08:17 AM
|
0
|
5
|
1195
|
|
POST
|
I finally figured it out. Thanks, your comment above was helpful. My code is actually a lot more complicated than the examples I gave above so it was really hard to figure out where to put things.
... View more
12-20-2016
08:00 AM
|
0
|
6
|
1195
|
|
POST
|
I've narrowed down the issue. According to your code I should be doing this: ---------------------------------------- getFeatureCnt(); on(dijit.byId("cntBtn"), "click", function(){ alert(featCnt); // this gets saved globally },this); function getFeatureCnt() { var query = new Query(); query.where = "Zip = '64108'"; featureLayer.queryCount(query, function(count) { featCnt = count; }); } -------------------------------------- However, I *need* to call the getFeatureCnt function from within the button handler, like this: -------------------------------------- on(dijit.byId("cntBtn"), "click", function(){ getFeatureCnt(); alert(featCnt); // this does not get saved globally },this); function getFeatureCnt() { var query = new Query(); query.where = "Zip = '64108'"; featureLayer.queryCount(query, function(count) { featCnt = count; }); } ---------------------------- Once you arrange it like that, you notice it does not save featCnt globally and you get an "undefined" error message, which is what 's been happening to me. The reason I need to arrange it that way is because I need to do an if-else decision depending on what another variable is, and depending on the answer, pass in a certain value into those functions. Sort of like this: on(dijit.byId("cntBtn"), "click", function(){ if (x=="one") getFeatureCnt(1); else if (x=="two") getFeatureCnt(2); else getFeatureCnt(3); alert(featCnt); // this does not get saved globally },this); So I'm gonna have to figure out something else.
... View more
12-19-2016
02:44 PM
|
0
|
8
|
1540
|
|
POST
|
Didn't notice the missing comma. Works now. I'll let you know if I can figure out how to get this into my code.
... View more
12-19-2016
01:01 PM
|
0
|
0
|
1540
|
|
POST
|
The first two are working now, but that's not what I want to do. Just the last one with the global variable still doesn't work - which unfortunately is what I want to do. The button loads but then it just hangs there. I need to have several variables which I need to access outside of the queryCount function, and even outside of the button handler. The variables would be created via the queryCount function, so basically I need that function to return a value. Every time I assign my global variables inside the queryCount function, the value disappears once you get outside the function (again, even though they're declared globally).
... View more
12-19-2016
12:38 PM
|
0
|
11
|
1540
|
|
POST
|
Your examples aren't working. I think you have a problem with the feature layers (they don't seem to be loading at all). My attempts to use a global variable are essentially the same you have above. I declare the variable in the same spot you do, and assign it in basically the same queryCount function you have, but whenever I try to access it *outside* the queryCount function, it returns as undefined.
... View more
12-19-2016
12:20 PM
|
0
|
13
|
1540
|
|
POST
|
Almost forgot ... I realize I have double-inner function calls and thus need to do a double-return, so I've also tried something like this: var query = new Query(); query.where = "Zip = '" + SelectedZip + "'"; var num; num = featLayer.queryCount(query, num = function(count) { return count; } return count;); And variations thereof. But I can't do the "num = function(count)" without getting a syntax error.
... View more
12-19-2016
10:38 AM
|
0
|
1
|
1540
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 04-08-2016 09:09 AM | |
| 1 | 12-19-2016 06:19 AM | |
| 1 | 09-01-2016 01:26 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|