Integrating the IMAP's Photoviewer and ArcGIS 9.x
Hotlinks Overview:
Hotlinks use a field in the database to store the hyperlink address for a web page, document, or macro. When a hotlink is created for a feature layer, every feature in the layer is linked to the item listed in its hotlink field. If hotlink field is empty for a feature, that feature is simply not linked. Hotlinks support three link types: documents, urls, and macros.
*If you don't see the windows on the left Click View->Project Explorer and Click again for Properties Window(F4).
is selected, change your symbology if these symbols are difficult to see.
Double click on a blue point to launch the Photoviewer and view the associated photos. A jump to URL dialog box will appear when multple points are selected that contain hotlinks.
Hotlinks use a field in the database to store the hyperlink address for a web page, document, or macro. When a hotlink is created for a feature layer, every feature in the layer is linked to the item listed in its hotlink field. If hotlink field is empty for a feature, that feature is simply not linked. Hotlinks support three link types: documents, urls, and macros.
Photoviewer Requirements:
- ArcGIS 9.x
- ESRI shapefile containing a text field called PhotoURL with the following path structure:
"http://imaps.dfg.ca.gov/photoviewer/photos/viewer.asp?id=" + SurveyID value - An Internet connection
Note: It's recommended that RAP HQ pre-populate the PhotoURL field for those features that have associated data in the PHOTO_INFO table. This can be accomplished by creating a join in ArcGIS with the RADB PHOTO_INFO table using the SurvID field. Contact staff members in RAP HQ for further assistance if needed.
At this point if you use the info button on a point scroll down the link and click the link and the viewer will appear. For a more robust solution continue below.
Implementation:
- Open ArcGIS 9.x and paste the code below into the Visual Basic Editor (VBA). VBA can be opened by clicking Alt+F11 or selecting Tools>Macros>Visual Basic Editor. In the Normal(Normal.mxt)->Modules Insert a new module. Call it AddHotlink(Change the name under Properties on the left hand side) and paste the following code into it.
Public Sub AddHotlink() Dim pMxDoc As IMxDocument Dim pContentsView As IContentsView Dim pHotlinkContainer As IHotlinkContainer Set pMxDoc = Application.Document Set pContentsView = pMxDoc.CurrentContentsView If TypeOf pContentsView.SelectedItem Is IFeatureLayer Then Set pHotlinkContainer = pContentsView.SelectedItem pHotlinkContainer.HotlinkField = "PhotoURL" pHotlinkContainer.HotlinkType = esriHyperlinkTypeURL End If End Sub |
*If you don't see the windows on the left Click View->Project Explorer and Click again for Properties Window(F4).
- Save and Close the VBA editor window. You can now add a button to use the Macro(Version 2 Below) or simply use the macro.
- Select a feature layer possessing a "PhotoURL" field that contains at least one Photoviewer web address.
- Run the AddHotlink Macro by selecting Alt+F8 or selecting Tools>Macros>Macros...,
- Select and run the Hyperlink tool macro. This macro will be labeled "AddHotlink.AddHotlink" and is visible once the "Macros in:" selection is changed to "Normal.mxt" or "<All Standard Projects>"
- Click Tools->Customize, then the Commands Tab, and scroll down to Macros.
- Drag the Normal.AddHotlink.Addhotlink to your toolbar, if you don't like the icon right-click->change button image and pick a different one. Now Close the customize box, select a layer to apply to and click your new button.
Double click on a blue point to launch the Photoviewer and view the associated photos. A jump to URL dialog box will appear when multple points are selected that contain hotlinks.