POST
|
Did you get any resolution to this? I think I may be having the same issue in 3.15.
... View more
02-16-2016
03:42 PM
|
0
|
1
|
870
|
POST
|
Hi Robert, yes I do, if that makes the most sense. I'm not sure how to access the selected photo's attributes though.
... View more
02-16-2016
12:08 PM
|
0
|
15
|
534
|
POST
|
Hi All, I have a point dataset which represents the x,y of where photos were taken. Each photo is a member of a route (as identified by an attribute column). When a particular photo is clicked, I would like all of the photos in that route to be selected and added to the resulting infoWindow so the user can scroll back and forth along the particular route. I currently have an IdentifyTask setup on this layer and am wondering if it's easiest to just modify that in some way? Any hints would be much appreciated, I have no idea where to begin. My code for the identify is below, it's basically the same as in the ESRI sample. identifyAssetsParams = new IdentifyParameters();
identifyAssetsParams.tolerance = 3;
identifyAssetsParams.returnGeometry = true;
identifyAssetsParams.layerOption = IdentifyParameters.LAYER_OPTION_VISIBLE;
identifyAssetsParams.width = mapObj.width;
identifyAssetsParams.height = mapObj.height;
identifyAssetsParams.geometry = event.mapPoint;
identifyAssetsParams.mapExtent = mapObj.extent;
identifyAssetsParams.layerIds = layerAssets.visibleLayers;
var assetsDeferred = identifyAssetsTask
.execute(identifyAssetsParams)
.addCallback(function (response) {
return arrayUtils.map(response, function (result) {
var feature = result.feature;
var layerName = result.layerName;
feature.attributes.layerName = layerName;
if (layerName === 'Primary Direction'){
var assetsTemplate = new InfoTemplate();
assetsTemplate.setTitle("Primary Direction");
feature.setInfoTemplate(assetsTemplate);
assetsTemplate.setContent("</br> ID: ${ID} </br> Route: ${ROUTE} \n\
</br><img src='${REL_PATH}'/>");
}
if (layerName === 'Opposite Direction'){
var assetsTemplate = new InfoTemplate();
assetsTemplate.setTitle("Opposite Direction");
feature.setInfoTemplate(assetsTemplate);
assetsTemplate.setContent("</br> ID: ${ID} </br> Route: ${ROUTE} \n\
</br><img src='${REL_PATH}'/>");
}
if (layerName === 'SeaView'){
var assetsTemplate = new InfoTemplate();
assetsTemplate.setTitle("SeaView");
feature.setInfoTemplate(assetsTemplate);
assetsTemplate.setContent("Series: ${Series} \n\
</br><img src='${REL_PATH}' width='200'/>");
}
else {
var generalTemplate = new InfoTemplate(layerName);
feature.setInfoTemplate(generalTemplate);
}
return feature;
});
});
mapObj.infoWindow.clearFeatures();
mapObj.infoWindow.setFeatures([assetsDeferred]);
mapObj.infoWindow.show(event.mapPoint);
... View more
02-16-2016
09:36 AM
|
0
|
17
|
2651
|
BLOG
|
Thank you for posting this. I have referred back to it many, many times over the last few months!
... View more
02-12-2016
01:39 PM
|
0
|
0
|
109
|
POST
|
I would like to customize the InfoTemplate that pops up when the search widget is used, but I'm having some unexpected results. Here is my code for the search source: //Lots layer
sources.push({
featureLayer: lyrLots,
searchFields: ["PID", "LOT_NO", "OWNER"],
exactMatch: false,
outFields: ["*"],
displayField: "LOT_NO",
suggestionTemplate: "PID: ${PID}, Lot #: ${LOT_NO}, Owner: ${OWNER}",
name: "Lots",
placeholder: "Search Lots",
maxResults: 6,
maxSuggestions: 6,
//Create an InfoTemplate and include fields
infoTemplate: new InfoTemplate("Lots", "PID: ${PID}</br>Lot #: ${LOT_NO}</br>Owner: ${OWNER}</br>Title Link: ${TITLE_LINK:testLink}"),
minCharacters: 0
}); And the code to customize "Title Link" depending on whether a link is present or not: //The following determines whether a hyperlink is present in a field. If no hyperlink, the field will
//show "Not available" in the infoWindow. If there is a hyperlink, the field will show "Click to open" as a hyperlink
testLink = function (value, key, data) {
var result = "";
//If hyperlink field is null or contains a space, add "Not available" to the infoWindow
if((value === " " && typeof value === "string")||(value === null && typeof value === "object") || (typeof value === "undefined")){
result = "Not available";
}
//Add the hyperlink if present
else {
result = "<a href ='" + value + "' target='_blank'>Click to open</a>";
}
alert("Result: " + result);
return result;
}; If I open my map and do a search immediately, it seems "testLink" is not firing. I tried placing an alert window in testLink and it does not pop up so I know testLink is not even running. However, if I do an "Identify" (which also uses testLink to format links in its resulting infoWindow) and then do a search, "testLink" does run and format things correctly. Once an "identify" has been performed, testLink will run when subsequent searches are performed but I have no idea why this is. Does anyone have any ideas?
... View more
01-22-2016
09:37 AM
|
0
|
0
|
1694
|
POST
|
In case anyone comes across this, I ended up getting a solution from ESRI tech support. I had an array containing the layerId of the layers to be updated using setVisibleLayers. This worked fine, but did not translate to the print task - the array contained text values when the print task requires integers. So the fix was to add parseInt() to convert each layerId before pushing it to the array: for (var i = 0; i < inputsAgreementsCount; i++) {
if (inputsAgreements.checked) {
visibleAgreementsLayerIds.push(parseInt(inputsAgreements.value));
}
}
layerAgreements.setVisibleLayers(visibleAgreementsLayerIds); Each checkbox in my map has a value that corresponds to its layerId, so the above loop takes inventory of all the values of the checked checkboxes, puts them into an array, the uses that array to update the layer visibility.
... View more
01-21-2016
10:04 AM
|
1
|
0
|
265
|
POST
|
Hi Jimmy, targetOrtho = orthoArray; Assigns the value to targetOrtho
... View more
01-20-2016
11:36 AM
|
0
|
1
|
509
|
POST
|
Hi all, I'm not sure where I'm going wrong. I have many many ArcGISTiledMapServiceLayers in my map that need to be hidden/shown en masse. So I created an array containing the names of each layer, and would like to use a loop to go through the array and hide each element. var swipeLayerOrthos2015 = new ArcGISTiledMapServiceLayer("http://cop-gis4:6080/arcgis/rest/services/Orthos/Orthos2015_WGS1984_MIXED/MapServer");
var swipeLayerOrthos2014 = new ArcGISTiledMapServiceLayer("http://cop-gis4:6080/arcgis/rest/services/Orthos/Orthos2014_WGS1984_MIXED/MapServer");
var swipeLayerOrthos2014RB = new ArcGISTiledMapServiceLayer("http://cop-gis4:6080/arcgis/rest/services/Orthos/Orthos2014RB_WGS1984_MIXED/MapServer");
var orthoArray = [];
orthoArray.push('swipeLayerOrthos2015', 'swipeLayerOrthos2014', 'swipeLayerOrthos2014RB');
updateOrthos();
function updateOrthos(){
var targetOrtho;
for (var i = 0; i < orthoArray.length; i++) {
targetOrtho = orthoArray;
targetOrtho.hide();
}
} When I run this, I get an 'Uncaught TypeError: targetOrtho.hide is not a function' I'm not sure what I'm doing wrong, if I change things so that a variable holds the ortho's name and then hide that, it works ie. var targetOrtho = swipeLayerOrthos2010;
targetOrtho.hide(); Works just fine. I'm not sure how my loop is really different from that. I've tried printing out each item in orthoArray to the console and it looks ok to me. Does anyone see what I'm missing? I can make a jsfiddle if the above isn't clear.
... View more
01-20-2016
11:22 AM
|
0
|
5
|
1791
|
POST
|
I should clarify - 'inputsAgreementsCount' holds the length of a separate array, which contains all the checkboxes.
... View more
01-19-2016
11:24 AM
|
0
|
0
|
977
|
POST
|
Hi Thomas, I did end up getting a solution from ESRI technical support. Apparently a string value works for setVisibleLayers, however this does not pass properly into the printTask. In my situation I needed to convert the string value to an integer. I'm not sure how you've gone about yours but mine was looping through a bunch of checkboxes and updating an array based on which ones were checked, then using that array in setVisibleLayers. Here's my code: for (var i = 0; i < inputsAgreementsCount; i++) {
if (inputsAgreements.checked) {
visibleAgreementsLayerIds.push(parseInt(inputsAgreements.value));
}
}
layerAgreements.setVisibleLayers(visibleAgreementsLayerIds); Where 'inputsAgreementsCount' holds the length of the array, 'inputsAgreements' is the checkbox, and 'visibleAgreementsLayerIds' is the array containing the layerId of each layer that should be visible. Previously I didn't have parseInt in the loop to convert the layerId to an integer. As soon as I added that, everything worked! Hopefully this is some help to you too.
... View more
01-19-2016
11:19 AM
|
1
|
2
|
977
|
POST
|
I've discovered from reading other threads (here and elsewhere) that this seems to be an issue between the Print Task and ArcGISDynamicMapServiceLayer's setVisibleLayers method. Once you use setVisibleLayers (triggered when a user checks a layer on or off in my map), it wipes out the legend in the Print Task for unknown reasons. I can change all my hundreds of layers to feature layers, but this seems like a really cumbersome workaround. Turning on and off dynamic layers and having the resulting layers show up in a printout seems like a very basic function that should work.
... View more
12-17-2015
09:51 AM
|
0
|
1
|
265
|
POST
|
Wow, that's disappointing to hear! I'm using 3.15 and the issue still seems to be present. I posted a new question here on geonet but no replies so far. Thanks for your quick response.
... View more
12-16-2015
03:43 PM
|
0
|
2
|
977
|
POST
|
Thomas, did you ever figure this out? I'm running into the same issue.
... View more
12-16-2015
03:29 PM
|
0
|
4
|
977
|
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
|