ArcGIS Desktop

  • Documentation
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

MXD to Web map

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

Creates a web map within a portal (Portal for ArcGIS or a local portal) from an MXD (map document). Requires an account that can authenticate with ArcGIS.com or a local portal to publish services and create the web map.

Usage

  • Valid feature layers inside the input map document will be published as a feature service to the portal set in the ArcGIS Administrator. Raster layers will be converted into a tiled cached service. These two service types will be combined along with the selected basemap to produce the output web map.

    Unsupported items inside the map document, such as feature services and basemaps, will be excluded from the resulting services and web map. Warning messages will be provided for each invalid item.

  • A full link (URL) to the webmap will be presented as the last tool message, as well as a derived output parameter. You will either need to copy this URL, or open your portal content to launch the webmap.

  • The active portal is set in the ArcGIS Administrator. A default deployment of ArcGIS Desktop will publish to ArcGIS.com. You will need a named user with publish permissions to publish the services and web map.

    If the active portal has been set to a local portal in the ArcGIS Administrator, all outputs will be created there.

    To change the active portal and where the outputs are created, you will need to close ArcGIS Desktop, open the ArcGIS Administrator, and set the new active portal. You can then reopen ArcGIS Desktop and publish your map to a web map.

  • Maps which have been defined as a basemap in the active portal will be available for selection from the basemap parameter. These maps are set by a portal administrator. You will need to contact the portal administrator to have a particular basemap added to your portal if you do not see it listed.

    Note:

    If the list of basemaps is empty, the portal did not return any valid basemaps. This could happen because no basemaps have been set for the active portal. Your map will be created with the portal's default basemap. You can modify the webmaps basemap afterward through your portal content.

  • If the webmap or services to be created (based on the webmap name) already exist in your portal, an error will be thrown and the tool will not continue. You will either need to choose a new webmap name, or delete items from your portal. The tool will not overwrite or delete any existing services.

  • The webmap will not be shared within your organization or publicly by default. Use the sharing parameters to set appropriate sharing options for the feature service and webmap to be created.

  • Note:

    At the 10.4 release this tool has been enhanced with authentication parameters to supply a username and password. Previously this tool only worked within ArcGIS Desktop. Now, if you are signed into your Portal with ArcGIS Desktop, the tool will use that connection. If you are not signed in you can authenticate by using the username and password parameter. With these parameters you can also use the tool from Python scripts or command line.

Syntax

MXDToWebMap_server (Input_map_document, Web_map_name, Summary, Tags, {Layers_to_be_published}, {Basemap}, {Online_folder_name}, {Within_Organization}, {Everyone}, {Groups}, {Username}, {Password})
ParameterExplanationData Type
Input_map_document

The input map document of layers to convert to a web map in the portal.

ArcMap Document
Web_map_name

The name of the output web map to be created.

String
Summary

The summary for the web map. The summary will provide information about the web map itself when found through a search.

String
Tags

Identifying tags for the web map. The tags will help make your web map more discoverable through searches. Enter multiple tags by using a comma to separate terms.

String
Layers_to_be_published
[Layers_to_be_published,...]
(Optional)

The layers to be included in the output web map. By default, the tool tries to convert all layers found inside the map document. Invalid layer types (such as service layers, for example) will be excluded from the web map even if it was provided as input. An empty list will also attempt to create a web map with all layers from the map document.

String
Basemap
(Optional)

The Esri basemap to be used in the web map.

String
Online_folder_name
(Optional)

The portal folder in which to create the web map. If the folder does not already exist, it will be created.

String
Within_Organization
(Optional)

Specifies whether the webmap and associated services will be shared and available within your organization.

  • NOT_SHARED — Webmap will not be shared. This is the default.
  • MY_ORGANIZATION — Webmap will be shared within your organization.
Boolean
Everyone
(Optional)

Specifies whether the webmap will be shared and available to everyone.

  • EVERYBODY — Webmap will be shared with everybody including your organization.
  • MY_GROUPS — Webmap will only be available to the publisher and any selected group within your organization. This is the default.
Boolean
Groups
[Groups,...]
(Optional)

Select the groups to share the webmap and services with. You must be sure the user account publishing the webmap and services belongs to the group and the group is spelled correctly. The tool dialog will validate groups, you can use this as a reference before running the tool from a python script.

String
Username
(Optional)

The username to authenticate with ArcGIS.com or your local Portal for ArcGIS. The account must have publisher permissions.

String
Password
(Optional)

The password to authenticate with ArcGIS.com or your local Portal for ArcGIS. Note the password is passed as plain text but the tool will attempt to make an HTTPS connection.

String Hidden

Derived Output

NameExplanationData Type
Web_map_URL

String

Code sample

MXDToWebMap example (Python window)

The following Python window script demonstrates how to use the MXDToWebMap function in immediate mode.

mxd = arcpy.mapping.MapDocument("CURRENT")
arcpy.MXDToWebMap_server(mxd, "CoffeeShopLocations", "Location of coffee shops", "coffee,map")
MXDToWebMap example 2 (stand-alone script)

Create a web map from a map document from a stand alone script.

import arcpy

# Tool variables
mxd = r"c:\gisProjects\fastfood\fastfood.mxd"
title = "FastFoodSpots"
user = "PortalKing"
pass = "mySecret"
tags = "hamburger, pizza, tacos, salad" 
summary = "All the fast food places this side of the Mississippi."

arcpy.MXDToWebMap_server(mxd, title, summary, tags, Username=user, Password=pass)

Environments

This tool does not use any geoprocessing environments.

Licensing information

  • ArcGIS Desktop Basic: Yes
  • ArcGIS Desktop Standard: Yes
  • ArcGIS Desktop Advanced: Yes

Related topics

  • An overview of the Publishing toolset

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2019 Esri. | Privacy | Legal