ListDataFrames ( mxd, 'Webmap' ) # Get a list of all service layer names in the map serviceLayersNames = # Create a list of all possible vector layer names in the map that could have a # corresponding service layer vectorLayersNames = # Get a list of all vector layers that don't have a corresponding service layer removeLayerNameList = # Remove all vector layers that don't have a corresponding service layer for lyr in arcpy. mapDocument # Reference the data frame that contains the webmap # Note: ConvertWebMapToMapDocument renames the active dataframe in the template_mxd to "Webmap" df = arcpy. ConvertWebMapToMapDocument ( Web_Map_as_JSON, templateMxd ) mxd = result. join ( templatePath, Layout_Template + '.mxd' ) # Convert the WebMap to a map document result = arcpy. lower () = 'true' : Georef_info_bol = True # Get the requested map document templateMxd = os. lower () = 'false' : Georef_info_bol = False elif Georef_info. GetParameterAsText ( 3 ) if Georef_info = '#' or not Georef_info : Georef_info = "False" # Convert Georef_info string to boolean if Georef_info. GetParameterAsText ( 2 ) if Layout_Template = '#' or not Layout_Template : Layout_Template = "NorthwesternUSA" # Extra parameter - georef_info Georef_info = arcpy. GetParameterAsText ( 1 ) if Format = '#' or not Format : Format = "PDF" # Input Layout template Layout_Template = arcpy. GetParameterAsText ( 0 ) # Format for output Format = arcpy. Import arcpy import os import uuid # The template location in the registered folder (as UNC path) templatePath = '//M圜omputerName/MyDataStore/USA' # Input WebMap json Web_Map_as_JSON = arcpy. Remember to use the forward slash (/) in your path.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |