Select to view content in your preferred language

Map Series Background for area around selected polygon extent

833
3
Jump to solution
01-12-2023 11:19 AM
LaurenCammack01
Occasional Contributor

I'm attempting to create a map series that references a polygon layer as the extent. I would like the area around the current page's polygon to have a gray tint over it so that the current polygon being displayed is the main focus. Any suggestions on how to do this? 

1 Solution

Accepted Solutions
AubriKinghorn
Esri Regular Contributor

You can use page queries to do this! A page query will update for each page in the map series. Any layer can have a page query as long as the layer has an attribute the corresponds to the name of the map series page. With a page query you can choose to show only the data that matches that attribute or the data that doesn't. 

So if I had a map series going through all the counties in a state, I could add a layer that symbolizes all counties with a gray tint. Then I apply a page query to that layer to draw only the data that doesn't match the map series page name. This draws the tint over every polygon except the one for the current map series page, highlighting it.

You can learn more about page queries here: https://pro.arcgis.com/en/pro-app/latest/help/layouts/page-queries.htm

AubriKinghorn_0-1673565877552.png

 

Cheers,
Aubri

View solution in original post

3 Replies
RMaron
by
Occasional Contributor

Duplicate the layer containing the polygons with the map sections. Symbolise one of these layers as the active section should look (e.g. only a black frame and without fill colour). The second layer is symbolised as the neighbouring sections should look (e.g. with a grey frame and light grey or white fill colour with 50% transparency, so that the map image behind it is less dominant).


While iterating through the FeatureClass with the map sections, you continuously update a DefinitionQuery on both layers: On one layer so that only the current polygon feature is loaded, on the other so that all except the current polygon features are loaded.

Unfortunately I don't have a corresponding script in Python 3 and with arcpy.mp-Package at hand, but here is an example in Python 2, i think the principle stays the same in APRO/Py3:

with arcpy.da.SearchCursor(fcMapextent, ["Sheet_Nr", "SHAPE@"]) as cursor:
    for row in cursor:
        # config. definition queries
        queryActive = "Sheet_Nr =  '"  + row[0] + "'"
        queryInactive = "Sheet_Nr <>  '"  + row[0] + "'"

        # config. layers
        lyrActive = arcpy.mapping.ListLayers(mxd, "Map_Extent_active")[0]
        lyrInactive = arcpy.mapping.ListLayers(mxd, "Map_Extent_inactive")[0]
        lyrActive.definitionQuery = queryActive
        lyrInactive.definitionQuery = queryInactive

        # pan and scale
        df.extent = row[1].extent
        df.scale = 2000

        # export
        arcpy.RefreshTOC
        arcpy.RefreshActiveView
        arcpy.mapping.ExportToPNG(mxd,path + r"\Output\\" + "Sheet_" + row[0] + ".png", resolution = 300)

 

Sorry that I can't provide a finished script for Arcgis Pro yet, but I hope this helps to at least get the idea.

0 Kudos
BarryNorthey
Frequent Contributor
0 Kudos
AubriKinghorn
Esri Regular Contributor

You can use page queries to do this! A page query will update for each page in the map series. Any layer can have a page query as long as the layer has an attribute the corresponds to the name of the map series page. With a page query you can choose to show only the data that matches that attribute or the data that doesn't. 

So if I had a map series going through all the counties in a state, I could add a layer that symbolizes all counties with a gray tint. Then I apply a page query to that layer to draw only the data that doesn't match the map series page name. This draws the tint over every polygon except the one for the current map series page, highlighting it.

You can learn more about page queries here: https://pro.arcgis.com/en/pro-app/latest/help/layouts/page-queries.htm

AubriKinghorn_0-1673565877552.png

 

Cheers,
Aubri