When you set MapLogic’s Layout Manager to index a particular boundary, in this case hydrologic basins, the software does a god job zooming you in to different basins when you select different maps but you always see the boundaries of adjacent basins. The following procedure and code will allow you to create a definition query to display only the boundary being indexed on a particular map.
To set up the map series to select one feature, we need to add a macro to the Visual Basic Editor:
1. Right click on the Map Series name in the TOC.
2. Select Properties
3. Navigate to the Data Frame Properties → Map Series → Custom Code tab
4. Complete the section titled: BEFORE (runs macros before activating the next page in series) as shown
5. Double click on Module1 to view the current code Replace the existing code with: (see Screen shot below)
Dim mxDoc As IMxDocument
Set mxDoc = ThisDocument
Dim featureName As String
‘ identify the feature the map series is zooming to
‘ in this case, the (1) represents the first field in the layer being selected against…change as needed
‘ note: The fields are zero based. Normally, the objectID is field number 0.
featureName = pFeature.Value(1)
Dim fLayerDefinition As IFeatureLayerDefinition
Set fLayerDefinition = pIndexLayer
‘determine what the field name is.
‘in this case, the field name is BASIN…change as needed
fLayerDefinition.DefinitionExpression = “BASIN = ‘” & featureName & “‘”
Juan Tobar, Supervisor Geographers, Regulation GIS, SFWMD
Linda McCafferty, Geographer 3, Regulation GIS, SFWMD