|
POST
|
Hi all, I am using Chris Sergent's print used in his simple map somewhat successfully, however not all of my layers are getting sent to the legend - only the one layer that is visible when the map is loaded is turning up in the legend. I have several checkboxes where the user can turn on and off other layers, and if this is done, these layers are not being sent to the legend. They do end up in the printed map, with the exception of the layer that was visible by default on map load. For some reason turning on/off any other layers causes this one layer to be removed from the final print. Is there some sort of refresh of the print tool that can be done?
... View more
12-15-2015
03:10 PM
|
0
|
2
|
2963
|
|
POST
|
Yep, thanks Ken - for some reason NetBeans was showing an error when I first tried undefined without the quotations, but it's working now!
... View more
11-19-2015
11:13 AM
|
0
|
0
|
1303
|
|
POST
|
I have also tried testing for zoomPoint.x or y === "", but this did not work. zoomPoint is actually a geometry point, not the text box contents - I'm trying to determine if the user entered valid coordinates, ie. in case the user puts an "N" before or after the longitude, or gets some other text characters in by accident, etc - I think Ken's answer is working for this.
... View more
11-19-2015
11:12 AM
|
0
|
0
|
1303
|
|
POST
|
I have a function that grabs coordinates from a text input box, and zooms to that point using centerAndZoom. I want to detect if the user enters something invalid, so I can pop up an alert informing them of the valid format, and abort the zoom. Currently it zooms to NaN, NaN if something invalid is entered. The point retrieved from the textbox is called zoomPoint. I've tried: if (zoomPoint === "undefined") if (zoomPoint === "NaN") if (zoomPoint === null) if ((zoomPoint.x === "undefined") || (zoomPoint.y === "undefined")) if ((zoomPoint.x === "NaN") || (zoomPoint.y === "NaN")) if ((zoomPoint.x === null) || (zoomPoint.y === null)) None of these work when something invalid is entered, and the map zooms to coordinates NaN, NaN. When I popup an alert box containing zoompoint.x or zoompoint.y, the value shows as undefined - why doesn't the test if ((zoomPoint.x === "undefined") || (zoomPoint.y === "undefined")) work then?
... View more
11-19-2015
10:42 AM
|
0
|
4
|
4334
|
|
POST
|
Your solution worked in this jsfiddle, but not in my map - not sure why.
... View more
11-18-2015
12:56 PM
|
0
|
0
|
1623
|
|
POST
|
In case anyone else has the same question, working from the ESRI sample here I did the following: var agrOnlyTemplate = new InfoTemplate();
agrOnlyTemplate.setTitle("Agreement");
feature.setInfoTemplate(agrOnlyTemplate);
agrOnlyTemplate.setContent("Occupied Status: ${OCCUPIED} </br> Entry Date: ${ENTRY_DATE} </br>
Renewal Date: ${Renew_Date} </br> Contact: ${CONTACT} \n\</br> WebLink: ${WebLink:compare} </br>
Non-Exclusive: ${NONEXCL}");
} compare = function (value, key, data) {
var result = "";
//If field is blank or contains a space, do nothing
if((data.WebLink === " " && typeof data.WebLink === "string")||(data.WebLink === null && typeof data.WebLink === "object")){
return;
}
//Add the hyperlink if present
else {
result = "<a href ='" + data.WebLink + "' target='_blank'>Click to open</a>";
}
return result;
};
... View more
11-18-2015
10:48 AM
|
0
|
0
|
1623
|
|
POST
|
Thanks for pointing me in the right direction - haven't had the time to implement yet but it looks fairly straightforward.
... View more
11-16-2015
08:14 AM
|
0
|
0
|
1623
|
|
POST
|
Hi all, I'm wondering if there is some way to use some kind of "if" statement in my infowindow. What I want to do is display a field that has a hyperlink, replacing the hyperlink's text with "Click to open" (this is the "WebLink" field below). However some items don't have a hyperlink, so I want to leave it blank in those cases. Here's my template code, which currently places "Click to open" regardless if there is anything in the field or not: var agrTemplate = new InfoTemplate(layerName, "Occupied Status: ${OCCUPIED} </br> Entry Date: ${ENTRY_DATE} </br>
Renewal Date: ${Renew_Date} </br> Contact: ${CONTACT} \n\</br>
WebLink: <a href =${WebLink} target='_blank'>Click to open</a> </br> Non-Exclusive: ${NONEXCL}");
feature.setInfoTemplate(agrTemplate); Is there some kind of pretest I could do? Such as if WebLink = null, show this template, else show another one? I think there's something I'm just not thinking of here.
... View more
11-06-2015
10:53 AM
|
0
|
7
|
3739
|
|
POST
|
Perfect - thanks Robert. It doesn't need to be a meaningful error; it's just to alert the user that there is an error that needs to be reported to the GIS team. I plopped this in my map and it works!
... View more
10-30-2015
12:08 PM
|
0
|
0
|
178
|
|
POST
|
Hi Robert, I did have that reference already but it's still not working. I've created a jsfiddle - f12 tells me "array is not defined"?
... View more
10-30-2015
11:01 AM
|
0
|
2
|
1593
|
|
POST
|
Hi Robert, I'm getting an error on array.map - do I need to define 'array' or add a reference? I was using layer-add-result so that it would add the error for each service to arrayErrors so I could show them all at the end in one alert box (triggered by layers-add-result). But if this does the same (adds each service's error message to the array) that's great.
... View more
10-30-2015
08:22 AM
|
0
|
4
|
1593
|
|
POST
|
Hmmmm...now the console shows: error:undefinedlayer:[object Object] And the alert box does not pop up at all.
... View more
10-29-2015
02:40 PM
|
0
|
6
|
1593
|
|
POST
|
Hi Robert, This is progress, as the alert box after the "if" statement now pops up - so it seems an error is being triggered - however, it says that errMess is undefined and it's also popping up for all 9 services instead of just the two that are stopped. In the console, I get: error:[object Object]layer:undefined for each of my 9 services.
... View more
10-29-2015
02:22 PM
|
0
|
8
|
1593
|
|
POST
|
I'm trying to set up an alert box to fire if my layers do not load to let the user know which ones did not load. I am not sure why when I convert from some sample code I found using dojo.connect, it no longer works. This works: var arrayErrors = [];
dojo.connect(mapObj, "onLayerAddResult", function(error){
if (error) {
var errMess = error.message;
arrayErrors.push(errMess);
alert("Added to array\n" + errMess);
}
}); Whereas this does not: var arrayErrors = [];
on(mapObj, "layer-add-result", function(error){
if (error) {
var errMess = error.message;
arrayErrors.push(errMess);
alert("Added to array\n" + errMess);
}
}); Using dojo.connect in the first code block, the alert box pops up with the error message for each service that does not load. In the second code block the alert box does not pop up at all. However if I put an alert box before the "if" block, that one will pop up - so for some reason an error is not being logged? Does anyone see any problems in my code?
... View more
10-29-2015
01:56 PM
|
0
|
10
|
4722
|
|
POST
|
Alright, I may have figured something out. If I go around my web adaptor url, I'm not getting the login box. This only happens when I use the web adaptor url. The print service is not secured though. So I'm a bit stumped why a login box is popping up. We are trying to route all services (whether secured or not) through the web adaptor as standard practice so if in future we want to secure some layers, it's just a matter of doing so in Server Manager.
... View more
08-27-2015
10:46 AM
|
0
|
0
|
1694
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 03-09-2016 10:46 AM | |
| 1 | 01-21-2016 10:04 AM | |
| 1 | 06-23-2015 10:58 AM | |
| 1 | 01-19-2016 11:19 AM | |
| 1 | 08-10-2016 02:06 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|