Class LocalMapService

  • Direct Known Subclasses:
    LocalFeatureService

    public class LocalMapService
    extends LocalService
    Class representing a local map service. A local map service requires a map package file (.mpk) which will have been authored in ArcGIS Desktop.
    Since:
    100.0.0
    • Constructor Detail

      • LocalMapService

        public LocalMapService​(String packagePath)
        Creates a local map service from a package (.mpk) file.
        Throws:
        IllegalArgumentException - if the package path is null or empty
        Since:
        100.0.0
    • Method Detail

      • getMaxRecords

        public int getMaxRecords()
        Gets the maximum number of records the service will return. The default value is 10000.
        Returns:
        the maximum number of records the service will return
        Since:
        100.0.0
      • setMaxRecords

        public void setMaxRecords​(int maxRecords)
        Sets the maximum number of records returned by the service. Cannot be set on a running service.
        Parameters:
        maxRecords - the maximum number of records
        Throws:
        IllegalArgumentException - if the value is zero or less
        IllegalStateException - if the service is not in the STOPPED state
        Since:
        100.0.0
      • setDynamicWorkspaces

        public void setDynamicWorkspaces​(Iterable<DynamicWorkspace> dynamicWorkspaces)
        Sets the dynamic workspaces for this service. Can only be set when the service is in the LocalServerStatus.STOPPED state. Setting this property will replace any previously set values. Can be null or an empty list.
        Parameters:
        dynamicWorkspaces - the workspaces
        Throws:
        IllegalStateException - if the service is not in the STOPPED state
        Since:
        100.1.0
      • getDynamicWorkspaces

        public List<DynamicWorkspace> getDynamicWorkspaces()
        Gets an unmodifiable list of this service's dynamic workspaces.
        Returns:
        an unmodifiable list of dynamic workspaces
        Since:
        100.1.0
      • getUrl

        public String getUrl()
        Returns the URL of this map service. This is needed to access the service using an ArcGISMapImageLayer as show below:

         
            // create a map image layer from the local service and add it to the map
            ArcGISMapImageLayer mapImageLayer = new ArcGISMapImageLayer(localMapService.getUrl());
            map.getOperationalLayers().add(mapImageLayer);
         
         
        Specified by:
        getUrl in class LocalService
        Returns:
        the URL
        Since:
        100.0.0;