|
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
|
1054
|
|
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
|
866
|
|
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
|
1105
|
|
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
|
623
|
|
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
|
1653
|
|
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
|
623
|
|
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
|
835
|
|
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
|
682
|
|
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
|
434
|
|
POST
|
You can change the language of the program by going to the home button (round button in top left corner of AGX). Then click the ArcGIS explorer options button. Click common on the left. Towards the bottom there are a bunch of languages to select from. If you are looking for a language other than what is there I can't help you..
... View more
07-20-2011
11:11 AM
|
0
|
0
|
868
|
|
POST
|
That worked perfectly on a IMS server hosted by USGS. I can't get it to work on the nowcoast server. It just hangs AGX up. At this point is seems more like an issue with AGX than anything else. As I said before the connection to nowcoast to ArcGIS Desktop works great.
... View more
07-20-2011
07:55 AM
|
0
|
0
|
835
|
|
POST
|
I just realized that this is to remove layers from the service. I thought it was just choosing which ones to show. I actually need to remove about 100 layers from the srvice. This is not going to be fun. But if it the only way to do it, so be it.
... View more
07-20-2011
05:04 AM
|
0
|
0
|
835
|
|
POST
|
Steve- Thanks for your reply. I am atempting to use your method but when connecting to the nowcoast.noaa.gov ArcIMS server, it is just locking up AGX for long periods of time. I am not sure why this is happening. Using ArcGIS Desktop I have no issue connecting and layers display fairly quickly. If anyone has a chance to (or has in the past) connect to http://nowcoast.noaa.gov ArcIMS server, please let me know if it works for you. I have never connected to an IMS server in AGX before. Hopefully there is not a known issue with this. Thanks.. Dim theMapItem As MapItem
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()
'Add the layer to the map.
'Check to see whether the connection was successful
If (connected) Then
'Add the layer to the map.
theMapItem = svcLayer.FindByName("Tropical Cyclone Track Lines")
If Not (theMapItem Is Nothing) Then
theMapItem.RemoveFromParent()
theMapItem = Nothing
End If
m_disp.Map.ChildItems.Add(svcLayer)
Else
'Investigate connection issue.
MsgBox("Server Connection Failed!")
Dim status As ConnectionStatus = svcLayer.ConnectionStatus
If status.HasError Then
System.Diagnostics.Debug.Print(status.ErrorString)
End If
End If
... View more
07-20-2011
05:00 AM
|
0
|
0
|
835
|
|
POST
|
Take a look at the samples provided with the AGX SDK located @ C:\Program Files\Explorer\DeveloperKit\Samples. I found them to be very helpful.
... View more
07-19-2011
12:03 PM
|
0
|
0
|
469
|
| Title | Kudos | Posted |
|---|---|---|
| 4 | 03-12-2025 11:01 AM | |
| 2 | 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 |
11-18-2025
04:51 PM
|