com.supermap.services.providers

Class RemoteTileProviderBase

    • Field Detail

      • SEND_REQUEST_COUNT

        protected static final int SEND_REQUEST_COUNT
        
        When the network is not good, the failures times for accessing url.
    • Constructor Detail

      • RemoteTileProviderBase

        public RemoteTileProviderBase()
        
    • Method Detail

      • init

        protected void init(MapProviderSetting setting)
        
        Description copied from class: TiledMapProviderBase

        Initialization function. This function does not carry on null judgment on parameter, but it may judge the correction of the contents.

        Overrides:
        init in class TiledMapProviderBase
        Parameters:
        setting - The configuration object of service provider.
      • viewEntire

        public MapImage viewEntire(java.lang.String layerName,
                          MapParameter mapParameter,
                          ImageOutputOption outputOption)
        
        Description copied from interface: MapProvider

        Displays a map in the Full Extent mode according to map layer name, map parameters and image output settings.

        The full geographic map extent to display is the minimum circumscribed rectangle of the specified layer.

        Specified by:
        viewEntire in interface MapProvider
        Overrides:
        viewEntire in class TiledMapProviderBase
        Parameters:
        layerName - Layer name, used to determine the full map extent.
        mapParameter - Map parameters.
        outputOption - Image output settings.
        Returns:
        The Map object.
      • getImageBySendURL

        protected byte[] getImageBySendURL(java.lang.String tileImageUrl,
                               RemoteTileProviderBase.GetDefaultImageWhenException exceptionOpertor)
        
        Gets a picture based on url
        Parameters:
        tileImageUrl -
        exceptionOpertor - When there is an exception to the operation
        Returns:
        the corresponding image for url
      • getContent

        protected java.lang.String getContent(java.lang.String url,
                                  java.lang.String method,
                                  int number,
                                  java.io.InputStream entityStream)
        
      • getContent

        protected java.lang.String getContent(java.lang.String url,
                                  java.lang.String method,
                                  int number,
                                  java.io.InputStream entityStream,
                                  java.util.Map<java.lang.String,java.lang.String> headers)
        

        For the specified URL HTTP request, get the response content.

        Parameters:
        url - The specified URL .
        method - An HTTP method that executes a URI, such as "GET".
        number - The number of requests.
        entityStream - The request body for POST request.
        Returns:
        The HTTP response content converted to the text format.
      • getContent

        protected java.lang.String getContent(java.lang.String url,
                                  java.lang.String method,
                                  int number)
        

        For the specified URL HTTP request, get the response content.

        Parameters:
        url - The specified URL .
        method - An HTTP method that executes a URI, such as "GET".
        number - The number of requests
        Returns:
        The HTTP response content converted to the text format.
      • sendRequestByHttpURLConnection

        protected java.util.Map<java.lang.String,java.lang.Object> sendRequestByHttpURLConnection(java.lang.String urlStr,
                                                                                      java.lang.String method,
                                                                                      java.io.InputStream requestStream,
                                                                                      java.util.Map<java.lang.String,java.lang.String> headers,
                                                                                      int number)
        
      • sendRequestByHttpURLConnection

        protected java.util.Map<java.lang.String,java.lang.Object> sendRequestByHttpURLConnection(java.lang.String urlStr,
                                                                                      java.lang.String method,
                                                                                      java.io.InputStream requestStream,
                                                                                      int number)
        

        Send an HTTP request via HttpURLConnection.

        Parameters:
        urlStr - Request URI.
        method - HTTP methods such as "GET".
        requestStream - Request stream.
        Returns:
        Response to the result mapping, the key for the project name, such as status, entity, value for the project value.
      • getImageBySendURL

        protected byte[] getImageBySendURL(java.lang.String tileImageUrl)
        
        Gets a picture based on url
        Parameters:
        tileImageUrl -
        Returns:
        the corresponding image for url