Select to view content in your preferred language

WebMap.print() not working with custom print templates.

05-10-2024 10:22 AM
New Contributor

We're using RHEL7 and ArcGIS Enterprise 10.9.1

Whenever I invoke the WebMap.print() method, while using a custom print template, the legend is not added to the layout and locked down layers are not rendered on the map. I resorted to editing the arcgis.mapping._types module.


# Here are the edits I made

        # Commenting this out because layoutOptions doesn't belong in the map_options dict.
        # if layout_options:
        #     map_options["layoutOptions"] = layout_options

        # compose export options
        export_options = {"dpi": dpi, "outputSize": output_dimensions}

        # This allows for printing locked down layers
        for layer in self._webmapdict["operationalLayers"]:
            layer["token"] = self._con.token

        print_options = {
            "mapOptions": map_options,
            "operationalLayers": self._webmapdict["operationalLayers"],
            "baseMap": self._basemap,
            "exportOptions": export_options,

        # layout_options belongs in the print_options dict.
        if layout_options:
            print_options["layoutOptions"] = layout_options



Figure I should bring this to the community's attention. 

Tags (3)
0 Kudos
0 Replies