|
POST
|
Can you post more of your code (like the executeIdentifyTask) or set up a Fiddle to replicate your issue?
... View more
07-03-2013
04:52 AM
|
0
|
0
|
1730
|
|
POST
|
Thanks, Brittney, Since dojo.AddOnLoad has been depreciated, I'd like to write this using the newer version. However, I've tried using dojo/ready and the code
ready(function () {
dojo.byId("divDialogMessage").innerHTML = parameters.welcomeText;
dijit.byId("dialogWelcome").show();
});
but that returns the error "TypeError: dijit.byId(...) is undefined" and trying "dom.byId("dialogWelcome").show();" give me the error "dom.byId(...) is null" It turns out that I was overthinking the syntax. This works
ready(function () {
divDialogMessage.innerHTML = parameters.welcomeText;
dialogWelcome.show();
});
... View more
07-02-2013
08:31 AM
|
0
|
0
|
2590
|
|
POST
|
Thanks, Brittney, Since dojo.AddOnLoad has been depreciated, I'd like to write this using the newer version. However, I've tried using dojo/ready and the code
ready(function () {
dojo.byId("divDialogMessage").innerHTML = parameters.welcomeText;
dijit.byId("dialogWelcome").show();
});
but that returns the error "TypeError: dijit.byId(...) is undefined" and trying "dom.byId("dialogWelcome").show();" give me the error "dom.byId(...) is null"
... View more
07-01-2013
12:37 PM
|
0
|
0
|
2590
|
|
POST
|
When a user starts my application, I would like to show a splash screen that would include some background about the project, contact information, required links, etc. I have a Fiddle that shows a splash screen when I click a button, but how do I code that so the splash screen comes up when opening the application?
... View more
07-01-2013
10:27 AM
|
0
|
5
|
4954
|
|
POST
|
The Geoprocessing reference that you made need to add won't be found under the "Add ArcGIS Reference". Instead, you'll have to open the "Add Reference" tool, and in the .NET tab, select "ESRI.ArcGIS.Geoprocessor". You should also set the Specific Version property on this reference to False.
... View more
07-01-2013
05:35 AM
|
0
|
0
|
744
|
|
POST
|
I don't know who has marked this thread as Answered. I'm still looking for a code for Select By Location dialog. If you're not going to mark it as answered, you should at least click the "This post was helpful" up arrow.
... View more
07-01-2013
05:27 AM
|
0
|
0
|
1574
|
|
POST
|
I have mine set up slightly differently where I load and set the visibleLayers of the layer, then wait until the load is complete before initializing the TOC. And now that I think back, I also discovered that I should have been setting the visibleLayers in the executeIdentifyTask function. That would change the visible layers when you turned various layers on and off using the TOC tool for each time you click on the map. I believe that's why you were originally having the problem with the LAYER_OPTION_VISIBLE giving you all the layers.
layerDynamic= new esri.layers.ArcGISDynamicMapServiceLayer(parameters.url, {
id: 'Dynamic'
});
map.addLayers([layerDynamic]);
layerDynamic.setVisibleLayers(parameters.visibleLayers);
map.on("layers-add-result", function (event) {
try {
var toc = new agsjs.dijit.TOC({
map: map,
layerInfos: [{
layer: layerDynamic,
title: "Legend",
slider: true
}]
}, 'tocDiv');
toc.startup();
}
catch (e) {
console.log(e.message);
}
mapReady(map);
});
function mapReady(map) {
map.on("click", executeIdentifyTask);
identifyTask = new esri.tasks.IdentifyTask(parameters.url);
identifyParams = new esri.tasks.IdentifyParameters();
identifyParams.tolerance = 3;
identifyParams.returnGeometry = true;
//identifyParams.layerIds = [0, 117];
identifyParams.layerIds = layerDynamic.visibleLayers;
identifyParams.layerOption = esri.tasks.IdentifyParameters.LAYER_OPTION_VISIBLE;
identifyParams.width = map.width;
identifyParams.height = map.height;
map.infoWindow.resize(415, 200);
map.infoWindow.setContent(tc.domNode);
map.infoWindow.setTitle("Results");
}
function executeIdentifyTask(evt) {
map.graphics.clear();
identifyParams.geometry = evt.mapPoint;
identifyParams.mapExtent = map.extent;
identifyParams.layerIds = layerDynamic.visibleLayers;
... View more
06-28-2013
11:41 AM
|
0
|
0
|
1904
|
|
POST
|
That leads to the question of why you have the 15 different layers. Is that required by the TOC control you're using? I'm using this TOC control and use it with only one layer (layerDynamic) with many sublayers. Thus when I use the code
identifyParams.layerIds = layerDynamic.visibleLayers;
identifyParams.layerOption = esri.tasks.IdentifyParameters.LAYER_OPTION_VISIBLE; it only returns the attributes for the sublayers I have turned on through the TOC.
... View more
06-28-2013
07:40 AM
|
0
|
0
|
1904
|
|
POST
|
In that case, you'll have to set the array yourself, like identifyParams.layerIds = [0, 1, 4, 7, 17]; or you'll have to write some code to build the array according to how they are turned on by the TOC
... View more
06-28-2013
07:31 AM
|
0
|
0
|
1904
|
|
POST
|
Take a look at the additional edit I made to my previous post about using layerIds.
... View more
06-28-2013
07:27 AM
|
0
|
0
|
1904
|
|
POST
|
Try changing identifyParams.layerOption = esri.tasks.IdentifyParameters.LAYER_OPTION_ALL; to identifyParams.layerOption = esri.tasks.IdentifyParameters.LAYER_OPTION_VISIBLE; Also, did you set the layerIds property to use only the visible layers? identifyParams.layerIds = yourLayer.visibleLayers; FYI, using the layerOption property along with the layerIds property will be important if you have layers are visible only at certain scales.
... View more
06-28-2013
07:19 AM
|
0
|
0
|
1904
|
|
POST
|
Would it be faster to loop through all the extents and use the Union method on the extent than to use a geometry service?
... View more
06-27-2013
10:57 AM
|
0
|
0
|
1943
|
|
POST
|
I had noticed that the error was returned with the additional "target" object when I was debugging the application. I was hoping the Esri JavaScript team would respond to this issue. Hopefully it will encourage them to update the documentation for the events using "on".
... View more
06-27-2013
07:50 AM
|
0
|
0
|
1410
|
|
POST
|
Here's how I return a feature class from a geoprocessing process. This example uses the geoprocessing tool "CreateFeatureClass". You can also return a feature layer from the function ReturnObjectfromResult.
Friend Function CreateFeatureClass(ByVal FCLocation As String, ByVal FCName As String, ByVal pSR As ESRI.ArcGIS.Geometry.ISpatialReference3, ByVal GeometryType As String) As ESRI.ArcGIS.Geodatabase.IFeatureClass
Dim CreateFClass As New ESRI.ArcGIS.DataManagementTools.CreateFeatureclass
Dim Result As ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult2
Try
Using releaser As New ESRI.ArcGIS.ADF.ComReleaser
releaser.ManageLifetime(CreateFClass)
CreateFClass.out_path = FCLocation
CreateFClass.out_name = FCName
CreateFClass.spatial_reference = pSR
CreateFClass.geometry_type = GeometryType
Result = RunTool(CreateFClass, Nothing, True)
If Result Is Nothing Then Return Nothing
Return ReturnObjectfromResult(Result, "Feature Class")
End Using
Catch ex As Exception
System.Windows.Forms.MessageBox.Show(ex.ToString & vbNewLine & ex.StackTrace.ToString, "Create Feature Class")
Return Nothing
End Try
End Function
Friend Function RunTool(ByVal Process As ESRI.ArcGIS.Geoprocessor.IGPProcess, ByVal TC As ESRI.ArcGIS.esriSystem.ITrackCancel2, Optional ByVal AddOutput As Boolean = False) As ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult2
Dim Result As ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult2
Try
System.Windows.Forms.Cursor.Current = Windows.Forms.Cursors.WaitCursor
Dim GP As New ESRI.ArcGIS.Geoprocessor.Geoprocessor
GP.AddOutputsToMap = AddOutput
GP.OverwriteOutput = True
Result = CType(GP.Execute(Process, Nothing), ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult2)
If Result.Status <> ESRI.ArcGIS.esriSystem.esriJobStatus.esriJobSucceeded Then ReturnMessages(Result, "Geoprocessing Error")
GP.ClearMessages()
Catch ex As Exception
ReturnMessages(Result, "Fail")
System.Windows.Forms.MessageBox.Show(ex.ToString, "Run Geoprocessor")
End Try
Return Result
End Function
Private Sub ReturnMessages(ByVal pResult As ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult2, ByVal Title As String)
If pResult Is Nothing Then Exit Sub
Dim ErrorMessage As String
If pResult.MessageCount > 0 Then
For Count As Integer = 0 To pResult.MessageCount - 1
ErrorMessage += pResult.GetMessage(Count)
Next
End If
System.Windows.Forms.MessageBox.Show(ErrorMessage, Title)
End Sub
Friend Function ReturnObjectfromResult(ByVal result As ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult2, ByVal Type As String) As Object
Dim GPVal As ESRI.ArcGIS.Geodatabase.IGPValue
Dim InMemFC As String
Dim GPUtil As ESRI.ArcGIS.Geoprocessing.IGPUtilities3 = New ESRI.ArcGIS.Geoprocessing.GPUtilities
Try
GPVal = result.GetOutput(0)
InMemFC = GPVal.GetAsText()
Select Case Type
Case "Feature Class"
Return GPUtil.OpenFeatureClassFromString(InMemFC)
Case "Table"
Return GPUtil.OpenTableFromString(InMemFC)
Case "Feature Layer"
Return GPUtil.OpenFeatureLayerFromString(InMemFC)
Case Else
Return Nothing
End Select
Catch ex As Exception
System.Windows.Forms.MessageBox.Show(ex.ToString, "ReturnObjectfromResult error")
Return Nothing
End Try
End Function
... View more
06-27-2013
06:14 AM
|
0
|
0
|
909
|
|
POST
|
I have converted the code from using the "onUpdateEnd" event on an ArcGISDynamicMapServiceLayer to the class.on style event //before connect.connect(layer, "onUpdateEnd", function (error) { if (error) { alert("Update complete with error: " & error); } }); //after layer.on("update-end", function (error) { if (error) { alert("Update complete with error: " & error); } }); I am now getting an error returned for this event. I have created a Fiddle that shows this. Running the code with the "connect.connect" line (line 44) un-commented does not return an error, while the "layer.on" line (line 43) un-commented returns the error. Why is the error returned using this syntax?
... View more
06-26-2013
10:03 AM
|
0
|
5
|
1566
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-04-2025 06:39 AM | |
| 1 | 05-01-2026 08:26 AM | |
| 1 | 04-10-2026 12:01 PM | |
| 1 | 04-13-2026 09:11 AM | |
| 1 | 10-11-2023 06:18 AM |
| Online Status |
Online
|
| Date Last Visited |
yesterday
|