|
POST
|
What happens if you set the ComboBox's DisplayMemberPath to "Name"? Thanks for the suggestion. I will give it a try when I have a chance. I was able to populate my combo box with the following code. private void updateQueryCombo()
{
foreach (Field field in (MapApplication.Current.SelectedLayer as FeatureLayer).LayerInfo.Fields)
{
QueryComboBox.Items.Add(field.Name.ToString());
}
}
... View more
02-21-2012
03:28 AM
|
0
|
0
|
556
|
|
POST
|
Hi All, I am usingthe following code to try to populate a combo box as explaned in this thread. The combobox populates but all the entries are "ESRI.ArcGIS.Client.Field". I can not figure out how to populate the box with the field values. Any ideas.. QueryComboBox.ItemsSource = (MapApplication.Current.SelectedLayer as FeatureLayer).LayerInfo.Fields;
... View more
02-15-2012
08:31 AM
|
0
|
0
|
2593
|
|
POST
|
Is there a way to get the column names of a dynamic map service into a drop down. What i am trying to do is build a tool that would allow me to select a field name from the drop down and enter a search term for that field to filter the layer. Any help is appreciated.
... View more
02-15-2012
05:51 AM
|
0
|
3
|
4285
|
|
POST
|
Thanks Dominique. I was not sure if this was an issue with the the ArcGIS API for silverlight of the silverlight viewer so I wne ahead and posted here after I could not find any info on the beta forum.
... View more
01-12-2012
05:06 AM
|
0
|
0
|
940
|
|
POST
|
I have the Silverlight Application Builder for Silverlight installed as that is what I am usinfg to build my demo maps with. I am looking to begin building add-ins for those maps and that is when i hit this roadblock. I hope this isn't part of the sharepoint packagae as I would have no need to install that. Thanks!
... View more
01-12-2012
03:28 AM
|
0
|
0
|
940
|
|
POST
|
This is my first time attempting to develop with silverlight. I am working with some of the ESRI API samples but I can seem to find the following reference. ESRI.ArcGIS.Client.Extensibility; Any ideas?
... View more
01-11-2012
08:20 AM
|
0
|
4
|
1359
|
|
POST
|
That first thought was that the problem was a large one to analyze. I hope to upgrade the computer we are running on soon. I am running a few locations at a time. That is the reason for the Expression Parameter on the select function. I have not played around with Iterations yet. I will have to research them and give it a try. For now I am just running manually and using the merge tool manually to combine all my outputs. One last question. Why is my parameter window appearing as a table? (see attachment) I am not used to seeing it this way. Thanks for your help.
... View more
09-16-2011
10:54 AM
|
0
|
0
|
1117
|
|
POST
|
I am new to model builder and I am attempting to create a drive time model to create drive times around our branch locations. The model is functioning when using small drive times. I am attempting to do 1 and 2 hour drive times around our 43 branch locations and I am getting unexpected errors. I am wondering if there is a was to streamline the model to make it more effecient. Any ideas?
... View more
09-15-2011
11:37 AM
|
0
|
3
|
1356
|
|
POST
|
I have made progress with this. Although there is still more work to do like making my query dynamic, the concept is done. Here is the code I used. It will fill a DataGridView first when display data is clicked. Then you can choose to add a selected item or all items to the maps as notes. Here is the code. Hope it helps. Imports System.Data.SqlClient
Imports System.Data
Imports System.Drawing
Imports System.Windows.Forms
Imports ESRI.ArcGISExplorer
Imports ESRI.ArcGISExplorer.Application
Imports ESRI.ArcGISExplorer.Geometry
Imports ESRI.ArcGISExplorer.Mapping
Imports ESRI.ArcGISExplorer.Data
Imports ESRI.ArcGISExplorer.Threading
Public Class Form1
' Initialize constants for connecting to the database
' and displaying a connection error to the user.
Protected Const SqlConnectionString As String = _
"Server=Your Server Name;" & _
"DataBase=YourDBName;" & _
"Integrated Security=SSPI"
Protected Const ConnectionErrorMessage As String = _
"To run this sample, you must have SQL " & _
"installed. For " & _
"instructions on installing SQL, view the documentation file."
Protected didPreviouslyConnect As Boolean = False
Protected didCreateTable As Boolean = False
Protected connectionString As String = SqlConnectionString
#Region "Display data"
' Handles the click event for the Display button. This handler gets the product
' information from the Contact table puts it into a DataSet which is used to
' bind to a DataGrid for display. Custom style objects are used to give the
' DataGrid a nice appearance.
Private Sub btnDisplay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplay.Click
If IsNothing(DataGridView1.DataSource) Then
Dim strSQL As String = _
"USE YourDBName" & vbCrLf & _
"SELECT * " & _
"FROM dbo.tblGIS"
Try
' The SqlConnection class allows you to communicate with SQL Server.
' The constructor accepts a connection string as an argument. This
' connection string uses Integrated Security, which means that you
' must have a login in SQL Server, or be part of the Administrators
' group for this to work.
Dim dbConnection As New SqlConnection(connectionString)
' A SqlCommand object is used to execute the SQL commands.
Dim cmd As New SqlCommand(strSQL, dbConnection)
' The SqlDataAdapter is responsible for using a SqlCommand object to
' fill a DataSet.
Dim da As New SqlDataAdapter(cmd)
Dim sqlData As New DataSet()
da.Fill(sqlData, "Data")
With Me.DataGridView1
.Visible = True
.AutoGenerateColumns = False
.AlternatingRowsDefaultCellStyle.BackColor = Color.Lavender
.BackColor = Color.WhiteSmoke
.ForeColor = Color.MidnightBlue
.CellBorderStyle = DataGridViewCellBorderStyle.None
.ColumnHeadersDefaultCellStyle.Font = New Font("Tahoma", 8.0!, FontStyle.Bold)
.ColumnHeadersDefaultCellStyle.BackColor = Color.MidnightBlue
.ColumnHeadersDefaultCellStyle.ForeColor = Color.WhiteSmoke
.DefaultCellStyle.ForeColor = Color.MidnightBlue
.DefaultCellStyle.BackColor = Color.WhiteSmoke
End With
Me.DataGridView1.DataSource = sqlData.Tables(0)
Dim newColumn As Integer = Me.DataGridView1.Columns.Add("ID", "ID")
Me.DataGridView1.Columns(newColumn).DataPropertyName = "ID"
newColumn = Me.DataGridView1.Columns.Add("Name", "Name")
Me.DataGridView1.Columns(newColumn).DataPropertyName = "Name"
newColumn = Me.DataGridView1.Columns.Add("Address", "Address")
Me.DataGridView1.Columns(newColumn).DataPropertyName = "Address"
newColumn = Me.DataGridView1.Columns.Add("City", "City")
Me.DataGridView1.Columns(newColumn).DataPropertyName = "City"
newColumn = Me.DataGridView1.Columns.Add("State", "State")
Me.DataGridView1.Columns(newColumn).DataPropertyName = "State"
newColumn = Me.DataGridView1.Columns.Add("Zip", "Zip")
Me.DataGridView1.Columns(newColumn).DataPropertyName = "Zip"
newColumn = Me.DataGridView1.Columns.Add("X", "X")
Me.DataGridView1.Columns(newColumn).DataPropertyName = "X"
newColumn = Me.DataGridView1.Columns.Add("Y", "Y")
Me.DataGridView1.Columns(newColumn).DataPropertyName = "Y"
newColumn = Me.DataGridView1.Columns.Add("Geog", "Geog")
Me.DataGridView1.Columns(newColumn).DataPropertyName = "Geog"
newColumn = Me.DataGridView1.Columns.Add("Data1", "Data1")
Me.DataGridView1.Columns(newColumn).DataPropertyName = "Data1"
newColumn = Me.DataGridView1.Columns.Add("Data2", "Data2")
Me.DataGridView1.Columns(newColumn).DataPropertyName = "Data2"
Catch sqlExc As SqlException
MessageBox.Show(sqlExc.ToString, "SQL Exception Error!", _
MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End If
End Sub
#End Region
#Region "Create Layer"
'Add all the elements of the table to the map as notes in a notes folder.
Sub btnAddNotes_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddNotes.Click
Dim mapDisp As MapDisplay = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay
'create a folder
Dim fold As New Folder("SQL Notes")
mapDisp.Map.ChildItems.Add(fold)
'get coordinates of 1st selected record
Dim strX As String = Me.DataGridView1.SelectedRows(0).Cells("X").Value
Dim strY As String = Me.DataGridView1.SelectedRows(0).Cells("Y").Value
Dim strName As String = Me.DataGridView1.SelectedRows(0).Cells("Name").Value
Dim point As ESRI.ArcGISExplorer.Geometry.Point = ESRI.ArcGISExplorer.Geometry.Point.CreateFromLatitudeLongitude(strX, strY)
Dim note As New ESRI.ArcGISExplorer.Mapping.Note(strName, point, ESRI.ArcGISExplorer.Mapping.Symbol.Marker.Pushpin.Blue)
fold.ChildItems.Add(note)
End Sub
Sub btnAddAllNotes_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddAllNotes.Click
Dim mapDisp As MapDisplay = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay
'create a folder
Dim fold As New Folder("SQL Notes")
mapDisp.Map.ChildItems.Add(fold)
For Each dgvr As DataGridViewRow In DataGridView1.Rows
Dim strX As String = dgvr.Cells("X").Value
Dim strY As String = dgvr.Cells("Y").Value
Dim strName As String = dgvr.Cells("Name").Value
Dim point As ESRI.ArcGISExplorer.Geometry.Point = ESRI.ArcGISExplorer.Geometry.Point.CreateFromLatitudeLongitude(strX, strY)
Dim note As New ESRI.ArcGISExplorer.Mapping.Note(strName, point, ESRI.ArcGISExplorer.Mapping.Symbol.Marker.Pushpin.Blue)
fold.ChildItems.Add(note)
Next
End Sub
#End Region
Private Sub exitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles exitToolStripMenuItem.Click
Me.Close()
End Sub
End Class
... View more
08-26-2011
12:09 PM
|
0
|
0
|
970
|
|
POST
|
Graydon, Any chance you would be able to share your code used to create notes from a dbf file? I am looking to do something similar with a SQL server connection. I would love to see how you are accomplishing this. Tahnks!
... View more
08-16-2011
11:49 AM
|
0
|
0
|
2188
|
|
POST
|
George, I am lookign into connecting to a SQL server as well. I wanted to see if you made any progress with this before I start my attempts. I appreciate any insight you can give. Thanks..
... View more
08-12-2011
05:48 AM
|
0
|
0
|
970
|
|
POST
|
Well I am getting closer. The following code allows me to add only the layers I want. The only problem is that the layers show up in the contents but nothing is on the map display. Any ideas? Dim m_disp As MapDisplay = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay
'Define the connection properties
Dim connProps As ServiceConnectionProperties = New ServiceConnectionProperties(ServiceType.Ims, New Uri("http://nowcoast.noaa.gov"), "nowcoast")
'Create a new ServiceLayer
Dim svcLayer As ServiceLayer = New ServiceLayer(connProps)
'Name Layer
svcLayer.Name = "Hurricane Track"
'Connect to Service
Dim connected As Boolean = svcLayer.Connect()
'Array list of layers to connect to
Dim LayerList As New ArrayList()
LayerList.Add("Tornado Warnings")
LayerList.Add("Flood Warnings")
LayerList.Add("Flash Flood Warnings")
LayerList.Add("Severe Thunderstorm Warnings")
LayerList.Add("Extreme Wind Warnings")
'Check to see whether the connection was successful and add layers from Array List
If (connected) Then
For Each NOAALayer As String In LayerList
For Each lyr As ServiceChildLayer In svcLayer.ChildItems
If lyr.Name = NOAALayer Then
lyr.Visible = True
m_disp.Map.ChildItems.Add(lyr)
Else
lyr.Visible = False
End If
Next
Next
Else
'Investigate connection issue.
Dim status As ConnectionStatus = svcLayer.ConnectionStatus
MsgBox("Server Connection Failed!" & status.ErrorString)
If status.HasError Then
System.Diagnostics.Debug.Print(status.ErrorString)
End If
End If
End Sub
... View more
07-26-2011
12:06 PM
|
0
|
0
|
1140
|
|
POST
|
Is there any way to change the parameters of a WMS request in AGX? I need to pull in Nowcoast data using WMS but the resolution of the labels is terrible. I want to change the image request size width/height to see if the quality would increase.
... View more
07-26-2011
09:19 AM
|
0
|
0
|
781
|
|
POST
|
If you want to use VB script you can start with this. '32 or 64 bit
Set WshShell = WScript.CreateObject("WScript.Shell")
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"
strValueName = "PROCESSOR_ARCHITECTURE"
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
Call MsgBox("Current Processor Archiecture: " & strValue, vbOKOnly + vbInformation, "Installed OS")
Select Case strValue
Case "x86"
strKeyPath = "SOFTWARE\ESRI\Explorer1700\Settings"
strValueName = "Change for correct value"
dwValue = change to what you want
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
Case "x64"
strKeyPath = "SOFTWARE\Wow6432Node\ESRI\Explorer1700\Settings "
strValueName = "Change for correct value"
dwValue = change to what you want
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
End Select
... View more
07-22-2011
10:33 AM
|
0
|
0
|
683
|
| Title | Kudos | Posted |
|---|---|---|
| 4 | 03-12-2025 11:01 AM | |
| 3 | 01-08-2025 09:26 AM | |
| 1 | 01-08-2025 07:19 AM | |
| 1 | 12-06-2024 04:52 AM | |
| 2 | 03-19-2024 04:36 AM |
| Online Status |
Offline
|
| Date Last Visited |
yesterday
|