|
POST
|
I originally posted this in the ArcGIS Server 10.0 forum but I haven't received any responses. Trying my luck in this forum- We're developing basemaps (in ArcGIS Server 10.0) and I'm now working on road annotation for one of the services. I used Maplex to create the initial labels, and then did some additional clean up. The annotation layer is currently in a File Geodatabase and included in a MXD which has (for the time being) been served up as a dynamic map service based on an MSD file. In the screenshot I've attached, the MXD view is displayed on the left, and the javascript viewer of the map service is on the right side. What I've noticed is that my anno text is getting "condensed" in the map service (right side) but displays fine in Arcmap (left side). For example, the label for "Paradise Lake Rd" in the right center of each display. The "e" and "L" have collapsed on top of each other. What would cause this and what can I do about it? Thank you! Steve
... View more
08-08-2012
01:49 PM
|
0
|
2
|
1265
|
|
POST
|
FYI- I just came across my notes from the ESRI UC workshop I mentioned in my original post. Their slide says to look at Knowledge Base 30494 for the US Streets example. I just searched on that number and nothing was returned..
... View more
08-08-2012
01:28 PM
|
0
|
0
|
2779
|
|
POST
|
Awesome! Thanks, Elliott. Your file imported just fine..
... View more
08-03-2012
01:51 PM
|
0
|
0
|
2779
|
|
POST
|
At the conference in the workshop about using Maplex, the presenters mentioned that there was a USPS abbreviation dictionary available but I can't seem to find it on any of the ESRI pages (or desktop help). Am I just missing the link?
... View more
07-31-2012
08:16 AM
|
0
|
7
|
7913
|
|
POST
|
Not sure what the best way to accomplish this via the API. Let's say I have a routed layer of roads or stream network. I want to return the milepost location (or River Mile) at the map location that the user clicks on. Can I extract this information using the Identify task or do I need to use the esri.tasks.RouteTask option? The code snippits and examples seem more focused on connecting two locations together on a network rather than identifying a single location. Thanks! Steve
... View more
07-05-2012
01:30 PM
|
0
|
2
|
1113
|
|
POST
|
Thanks again, Derek. Look forward to this feature getting implemented..
... View more
06-26-2012
11:01 AM
|
0
|
0
|
1395
|
|
POST
|
Excellent, thanks Derek. I'll look into the Print Task.
... View more
06-26-2012
10:51 AM
|
0
|
0
|
896
|
|
POST
|
One more question- I'd like to add an overview map to my map but in all of the samples using overview maps that I've seen, the overview map pans and zooms (albeit at the specification ratio compared to the main map). I don't want this behavior. Is it possible to "lock" the background of the overview map to a specified extent and have just the main map's map extent move around? I want my overview map to show the full extent of my county and just have the representation of the main map's map extent move around. Thanks! Steve
... View more
06-26-2012
09:11 AM
|
0
|
3
|
1791
|
|
POST
|
Is is possible to "print" without having a user initiate the process by clicking a button? From my review of the API documentation, it appears to me that it is required to have a dijit button on your web map to set up some of the printing parameters and then the click event of the button is what triggers the actual print event. I'm hoping I can trigger a print event in another fashion such as a when my page has been idle for a certain amount of time or perhaps loses focus. Under the current structure of the API, I don't think this is possible. These circumstances seem odd but I have a reason for doing it this way. Thanks! Steve
... View more
06-26-2012
09:04 AM
|
0
|
2
|
1301
|
|
POST
|
GENIUS! I feel so dumb. Thanks- that was the problem!
... View more
05-21-2012
12:55 PM
|
0
|
0
|
1020
|
|
POST
|
I'm building a small app that has a basemap and one featureLayer that has an infoWindow associated with it. When the user clicks on one of those features, I also need to retrieve the coordinates of the feature that the user clicked on. My understanding is that you can use the OnClick event with dojo.connect to do this: dojo.connect(map,"onClick",function(evt){ var query = new esri.tasks.Query(); query.geometry = pointToExtent(map,evt.mapPoint,10); var deferred = theFeatureLayer.selectFeatures(query,esri.layers.FeatureLayer.SELECTION_NEW); map.infoWindow.setFeatures([deferred]); map.infoWindow.show(evt.mapPoint); alert('Made it here!'); var pt = new esri.geometry.Point(evt.mapPoint.y,evt.mapPoint.x, new esri.SpatialReference({wkid:3857})); var MercPt = esri.geometry.webMercatorToGeographic(evt.mapPoint); var theLong = MercPt.x; var theLat = MercPt.y; var didSucceed = window.clipboardData.setData('Text', '@Coord:' + theLong.toString() + ',' + theLat.toString() ); }); If a user clicks on the map where there isn't a feature, the OnClick event captures it and I'm able to access the click point's coordinates. If they click on a feature, it seems to bypass the OnClick code (hence my small alert line in the code above). What's the best way to capture the coordinates of a clicked feature?? Thanks! Steve
... View more
05-21-2012
12:34 PM
|
0
|
2
|
1453
|
|
POST
|
Thanks, Neil. You were correct in all of your points. Sometimes the ESRI Help Docs are more confusing than helpful and that OpenFromFile for FileGeodatabases was one of those times for me. While waiting for replies in my thread, I found another thread on an unrelated topic but it helped me debug my problem. Here's my revised code which I have tested and works: Public Sub addPhotoToGeoDatabase(ByVal theGTagInfo As geoTaggedInfo)
Try
Dim ptable As ITable
Dim dbPath As String = "G:\PublicWk\geoTagging\pwPhotoDatabaseTest.gdb"
' Create a file geodatabase workspace factory.
Dim factoryType As Type = Type.GetTypeFromProgID("esriDataSourcesGDB.FileGDBWorkspaceFactory")
Dim WorkspaceFactory As IWorkspaceFactory = New ESRI.ArcGIS.DataSourcesGDB.FileGDBWorkspaceFactory
Dim Workspace As IFeatureWorkspace = CType(WorkspaceFactory.OpenFromFile(dbPath, 0), IFeatureWorkspace)
' Cast the workspace to the IWorkspaceEdit2 interface.
Dim workspaceEdit As IWorkspaceEdit = CType(workspace, IWorkspaceEdit)
' Start an edit session. An undo/redo stack isn't necessary in this case.
workspaceEdit.StartEditing(False)
' Start an edit operation.
workspaceEdit.StartEditOperation()
ptable = workspace.OpenTable("tblGeotaggedPhotos")
' Create a row. The row's attribute values should be set here and if
' a feature is being created, the shape should be set as well.
Dim row As IRow = ptable.CreateRow()
row.Value(ptable.FindField("Latitude")) = theGTagInfo.latitude
row.Value(ptable.FindField("Longitude")) = theGTagInfo.longitude
row.Value(ptable.FindField("Descrip")) = theGTagInfo.description
row.Value(ptable.FindField("Keywords")) = theGTagInfo.keywords
row.Value(ptable.FindField("gTagByUser")) = theGTagInfo.taggedByUserName
row.Value(ptable.FindField("gTagByFullName")) = theGTagInfo.tageedByFullName
row.Value(ptable.FindField("gTagDate")) = theGTagInfo.dateTagged
row.Value(ptable.FindField("FileName")) = theGTagInfo.filename
row.Value(ptable.FindField("FullPath")) = theGTagInfo.fullpath
row.Store()
' Save the edit operation. To cancel an edit operation, the AbortEditOperation
' method can be used.
workspaceEdit.StopEditOperation()
' Stop the edit session. The saveEdits parameter indicates the edit session
' will be committed.
workspaceEdit.StopEditing(True)
Catch ex As Exception
globalErrorHandler(ex)
End Try
End Sub Thanks also for the tip about setting variables to NOTHING. I'm coming from a lengthy time in VBA (Access & Arcobjects) so that's almost second nature to me. Great to know I no longer need to do that! Steve
... View more
04-26-2012
02:05 PM
|
0
|
0
|
1157
|
|
POST
|
I have a small subroutine in a VB.NET add-in I'm developing and it's sole purpose is to open a standalone table stored in a file geodatabase and add a new record to it. I searched through help and the forum to cobble together some similar code which compiles but errors once it's called. Here's the subroutine: Public Sub addPhotoToGeoDatabase(ByVal theGTagInfo As geoTaggedInfo) Try Dim ptable As ITable ' Create a file geodatabase workspace factory. Dim factoryType As Type = Type.GetTypeFromProgID("esriDataSourcesGDB.FileGDBWorkspaceFactory") Dim workspaceFactory As IWorkspaceFactory = CType(Activator.CreateInstance(factoryType), IWorkspaceFactory) ' Create a file geodatabase. Dim workspaceName As IWorkspaceName = workspaceFactory.OpenFromFile("G:\PublicWk\geoTagging\pwPhotoDatabaseTest.gdb", 0) ' Open the geodatabase using the name object. Dim Name As ESRI.ArcGIS.esriSystem.IName = CType(workspaceName, ESRI.ArcGIS.esriSystem.IName) Dim workspace As IWorkspace = CType(Name.Open(), IWorkspace) ' Cast the workspace to the IWorkspaceEdit2 interface. Dim workspaceEdit As IWorkspaceEdit = CType(workspace, IWorkspaceEdit) ' Start an edit session. An undo/redo stack isn't necessary in this case. workspaceEdit.StartEditing(False) ' Start an edit operation. workspaceEdit.StartEditOperation() ptable = workspace.OpenTable("tblGeotaggedPhotos") ' Create a row. The row's attribute values should be set here and if ' a feature is being created, the shape should be set as well. Dim row As IRow = ptable.CreateRow() row.Value("Latitude") = theGTagInfo.latitude row.Value("Longitude") = theGTagInfo.longitude row.Value("Descrip") = theGTagInfo.description row.Value("Keywords") = theGTagInfo.keywords row.Value("gTagByUser") = theGTagInfo.taggedByUserName row.Value("gTagByFullName") = theGTagInfo.tageedByFullName row.Value("DateGeotagged") = theGTagInfo.dateTagged row.Value("FileName") = theGTagInfo.filename row.Value("FullPath") = theGTagInfo.fullpath row.Store() ' Save the edit operation. To cancel an edit operation, the AbortEditOperation ' method can be used. workspaceEdit.StopEditOperation() ' Stop the edit session. The saveEdits parameter indicates the edit session ' will be committed. workspaceEdit.StopEditing(True) ptable = Nothing row = Nothing workspace = Nothing workspaceEdit = Nothing factoryType = Nothing workspaceFactory = Nothing Catch ex As Exception globalErrorHandler(ex) End Try End Sub and I have the following imported at the top of my module: Imports ESRI.ArcGIS.Geodatabase Imports ESRI.ArcGIS.Carto When the subroutine is called, it gets to the following line and crashes: Dim workspaceName As IWorkspaceName = workspaceFactory.OpenFromFile("G:\PublicWk\geoTagging\pwPhotoDatabaseTest.gdb", 0) The exact error returned is.. ERROR DESCRIPTION: Unable to cast COM object of type 'System.__ComObject' to interface type 'ESRI.ArcGIS.Geodatabase.IWorkspaceName'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{FADD975C-E36F-11D1-AA81-00C04FA33A15}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)). TYPE OF ERROR: System.InvalidCastException STACK TRACE: at geoTagPhotos2.usrFunctions.addPhotoToGeoDatabase(geoTaggedInfo theGTagInfo) in C:\Visual Studio 2008\Projects\geoTagPhotos2\geoTagPhotos2\usrFunctions.vb:line 407 So what am I doing wrong? I was using a code snippit for creating a file geodatabase and I noticed that in that example, there's an ampersand (@) before the file path. Didn't know what that was about and if I needed it while using the OpenFromFile method. Thanks! Steve
... View more
04-26-2012
12:13 PM
|
0
|
2
|
3895
|
|
POST
|
Has anyone migrated Bill Huber's Avenue script to VBA or Python?? I tried but couldn't get it to work (something about the LOG statment that tripped me up in ArcObjects). I've also tried converting it to python but I haven't had any success. I used to still have Arcview 3 w/ Spatial Analyst so I could still run the original script but now I no longer have that option. THANK YOU!! Steve
... View more
04-13-2012
08:40 AM
|
0
|
0
|
732
|
|
POST
|
I'm not exactly sure what you're asking. I think I only have the one (theForm). I'm still a bit green with VB.NET to answer authoritatively! The code snippit I had provided all comes from the same Sub procedure (OnMouseDown for my Add-in component). The full sub code would be this: Protected Overrides Sub OnMouseDown(ByVal arg As ESRI.ArcGIS.Desktop.AddIns.Tool.MouseEventArgs)
MyBase.OnMouseDown(arg)
Dim application As ESRI.ArcGIS.Framework.IApplication
Dim pMxDoc As ESRI.ArcGIS.ArcMapUI.IMxDocument
Dim pPoint As ESRI.ArcGIS.Geometry.IPoint
Dim pClone As ESRI.ArcGIS.esriSystem.IClone
Dim pGeometry As ESRI.ArcGIS.Geometry.IGeometry
Dim pSpatialRefFactory As ESRI.ArcGIS.Geometry.ISpatialReferenceFactory
Dim pSpatialRef As ESRI.ArcGIS.Geometry.ISpatialReference
Dim pGeographicCoordSys As ESRI.ArcGIS.Geometry.IGeographicCoordinateSystem
Dim pProjectedCoordSys As ESRI.ArcGIS.Geometry.IProjectedCoordinateSystem
Dim theForm As frmPhotoDlg
Dim theResults As String
Try
'Get the point where the user clicked
application = My.ArcMap.Application
Dim document As ESRI.ArcGIS.Framework.IDocument = application.Document
pMxDoc = CType(document, ESRI.ArcGIS.ArcMapUI.IMxDocument)
If pMxDoc.CurrentLocation.IsEmpty Then Exit Sub
'Clone the point because we don't want to alter
'the actual document's current location point
pClone = pMxDoc.CurrentLocation
pPoint = pClone.Clone
pGeometry = pPoint
'Create a new geographic coordinate system to use in the conversion
pSpatialRefFactory = New ESRI.ArcGIS.Geometry.SpatialReferenceEnvironment
pGeographicCoordSys = pSpatialRefFactory.CreateGeographicCoordinateSystem(ESRI.ArcGIS.Geometry.esriSRGeoCSType.esriSRGeoCS_NAD1983)
pSpatialRef = pGeographicCoordSys 'QI
pSpatialRef.SetFalseOriginAndUnits(-180, -90, 1000000)
pGeometry.Project(pSpatialRef)
Dim theDegrees As Double
Dim theMinutes As Double
Dim theSeconds As Double
Dim longDms As String
Dim latDms As String
Dim longDD As Double
Dim latDD As Double
longDD = Math.Abs(pPoint.X)
latDD = pPoint.Y
theDegrees = Int(longDD)
theMinutes = (longDD - theDegrees) * 60
theSeconds = Int((theMinutes - Int(theMinutes)) * 60)
longDms = theDegrees & "° " & Int(theMinutes) & "' " & theSeconds & Chr(34)
theDegrees = Int(latDD)
theMinutes = (latDD - theDegrees) * 60
theSeconds = Int((theMinutes - Int(theMinutes)) * 60)
latDms = theDegrees & "° " & Int(theMinutes) & "' " & theSeconds & Chr(34)
theResults = "DECIMAL DEGREES:" & vbNewLine & vbNewLine & vbTab & "Latitude: " & pPoint.Y & vbNewLine
theResults = theResults & vbTab & "Longitude: " & pPoint.X & vbNewLine & vbNewLine & "DEGREES/MINUTES/SECONDS:"
theResults = theResults & vbNewLine & vbNewLine & vbTab & "Latitude: " & latDms & vbNewLine & vbTab & "Longitude: " & longDms
'My.Computer.Clipboard.SetText(theResults)
theForm = System.Windows.Forms.Application.OpenForms(0)
theForm.txtLatitude.Text = pPoint.Y
theForm.txtLongitude.Text = pPoint.X
'MsgBox(theResults, vbInformation, "Geographic Results")
pSpatialRefFactory = Nothing
pGeographicCoordSys = Nothing
pProjectedCoordSys = Nothing
pSpatialRef = Nothing
pClone = Nothing
pPoint = Nothing
pGeometry = Nothing
pMxDoc = Nothing
application = Nothing
document = Nothing
Catch ex As Exception
globalErrorHandler(ex)
End Try
End Sub
... View more
03-27-2012
02:10 PM
|
0
|
0
|
2052
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 03-12-2026 01:43 PM | |
| 1 | 03-12-2026 08:41 AM | |
| 2 | 03-10-2026 10:10 AM | |
| 1 | 02-18-2026 09:20 AM | |
| 3 | 01-22-2026 02:03 PM |