ArcGIS Server publishing service failure solution and ArcGIS Server for Javascript image layer loading transparency setting (2021.2.12)

The solution to the ArcGIS Server publishing service failure caused by Windows update or installation of the application and the transparency setting of the WCS image layer after loading into the web map

1. Prerequisite environment

        The 10.2.2 version of ArcGIS Desktop and ArcGIS Server are installed on the computer (accessible at http://localhost:6080/arcgis/manager/ service manager)
Insert picture description here
Insert picture description here
Insert picture description here

2. Reasons and solutions for the failure of publishing services to ArcGIS Server in ArcGIS

        Generally speaking, vector feature classes can be published as WFS services in ArcGIS Desktop , raster images can be published as WCS services , and single geoprocessing GP tools or custom models (including multiple GP tools) can be published as WPS services . You can also publish map documents as WMS map services , but you may encounter publishing failures when publishing services, or the service manager in ArcGIS Server will freeze and respond slowly, and the ArcGIS Server service port will be occupied after other applications are installed on the computer. And other problems, this is usually caused by the installation of Windows updates on the computer .
Insert picture description here
        In the above figure, the status of the geoprocessing service in ArcGIS Server Manager is Stopping..., which indicates that the server is abnormal and definitely cannot publish the service (Of course, you can also directly publish the service in ArcMap to test whether ArcGIS Server is running normally).
         Solution : At this time, you can consider installing the patch ArcGIS Server Geoprocessing Service Startup Patch to
Insert picture description here
        ensure that the computer has installed ArcGIS Server, select the patch package of the corresponding version, here select ArcGIS-1022-S-GSS-Patch.msp , and save it after downloading ArcGIS Server installation directory.
Insert picture description here
Insert picture description here
        Double-click the patch to install it. After the installation is complete, you need to restart the service corresponding to ArcGIS Server according to the next steps.
Insert picture description here
        Open the task manager, click on the service in it, right-click after finding ArcGIS Server, select restart,
Insert picture description here
        and then access ArcGIS Server Manager in the browser , enter the user name and password (here user name: arcgis password: 123456) to log in, you can see System The geoprocessing service status under is Started. It means that the ArcGIS Server server is running normally and the service can be published normally.
Insert picture description here

Insert picture description here

3. Use ArcMap to publish tif images as WCS image services on ArcGIS Server

        The first step is to open the tif image with ArcMap, right-click in the Catalog and select Share as an image service, the
Insert picture description here
        Share as Service window pops up, select Publish a service and click Next.
Insert picture description here
        In the Publish a Service window, select the local server and enter the service name Click Next,
Insert picture description here
        in the publish a Service window, you can use the existing root root directory, or you can create a new directory, click Continue,
Insert picture description here
Insert picture description here
Insert picture description here
        select WCS
Insert picture description here
        in the Capabilities of the Service Editor window , enter Summary, Tags and Desciption in the Item Description,
Insert picture description here
        click analyze , View the analysis results below,
Insert picture description here
        click preview to preview,
Insert picture description here
        click Publish to publish, Copying Data to Server pops up, select the tif image file, and click OK.
Insert picture description here
        Finally, the service is published successfully.
Insert picture description here
        At this point, the image service is published successfully, open ArcGIS Server Manager in the browser to view the published image service,
Insert picture description here
        and obtain the REST URL address of the image service in the image configuration of the function: http://localhost:6080/arcgis/rest/services/MLClassification /ImageServer
Insert picture description here

4. Load the WCS image layer in the ArcGIS web map and set the transparency

Insert picture description here
        For ArcGIS web map is published on the WCS image services ArcGIS Server can be displayed by adding ImageryLayer url on the base map layers, specifically in the ArcGIS API for JavaScript reference ImageryLayer - Client Side Rendering rules ,
Insert picture description here
        in particular ImageryLayer of The Opacity property is found in the property settings to set the transparency of ImageryLayer, and the value is between 0 and 1. The attribute settings of the layer can be directly assigned when the layer's constructor is initialized.
Insert picture description here

Insert picture description here
Insert picture description here
The effect of loading the image layer in the ArcGIS web map is as follows:

Insert picture description here

opacity = 1

Insert picture description here

opacity = 0.9

Insert picture description here

opacity = 0.6

Insert picture description here

opacity = 0.3

        The servermap.jsp file used by the web map:

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>MapLayer</title>
<link rel="stylesheet" href="https://js.arcgis.com/4.16/esri/themes/light/main.css">
  <script src="https://js.arcgis.com/4.16/"></script>
   <style>
    html,
    body,
    #viewDiv {
    
    
      padding: 0;
      margin: 0;
      height: 100%;
      width: 100%;
    }
  </style>
</head>
<body>
    <%
		String url = request.getParameter("url");
	%>
<div id="viewDiv"></div>
</body>
  <script>
    require([
        "esri/Map",
        "esri/views/MapView",
        "esri/layers/ImageryLayer",
        "dojo/domReady!"
      ],
      function(
        Map, MapView,
        ImageryLayer
      ) {
    
    
        /********************
         * Create image layer
         ********************/
         var layer = new ImageryLayer({
    
    
             url: "http://localhost:6080/arcgis/rest/services/MLClassification/ImageServer",
             format: "jpgpng", // server exports in either jpg or png format
             opacity: 0.5 //影像图层透明度设置          
           });
           /**************************
            * Add image layer to map
            *************************/
           var map = new Map({
    
    
             basemap: "streets-navigation-vector",
             layers: [layer]
           });
   		  //map.add(maplayer);
           var view = new MapView({
    
    
             container: "viewDiv",
             map: map,
             center: [118.536450, 36.684521],
             zoom: 15
           });
    });
  </script>
</html>

Guess you like

Origin blog.csdn.net/jing_zhong/article/details/113215371