Sample code description

Feedback


SuperMap provides sample programs to help you to understand how to use SuperMap iServer API to develop. The sample programs are located in directory [SuperMap iServer_HOME%]\samples\code. Please run LibReplace.bat in this directory before running the programs. The contents of the sample programs are described in the table below:

  Directory Eclipse project/RESTAPI directory Description
Using iServer API UseJavaAPI HelloiServer This project implements the function of retrieving the service name of the WMS service published locally. This example can help beginners learn how to develop an application program in Eclipse using Java API provided in SuperMap iServer. Please refer to Getting started with Java API.
MapComponentSample Creates a map service component by using the MapImpl implementing class of the map service component interface, and implements functions including query, exporting images, and measurement. Please refer to Using Map Component.
MapComponentSampleUseRMP Creates a map service component through calling the implementation class of the map service component interface--MapImpl based on RestMapProvider and realizes SQL query, output map with bounds. Please refer to Map Component Example - Using RestMapProvider.
WMSClientSample Retrieves the meta data, map images, and map feature information of a WMS service in iServer using the WMS interface. Please refer to WMS Service Interface.
UseRESTAPI HelloREST Generates the map list on a server. This program can help you understand the processes of using SuperMap iServer REST API. Please refer to Getting started with Getting Started with REST API.
RESTDataOperation Implements data operations using RESTAPI. Three example html pages are included: AddFeature.html (for adding features), FieldStatistic.html (for calculating field statistics), and QueryFeatureByBuffer.html (for buffer query on data features). Please refer to Data operations.
RESTLayerOperation Implements layer operations using RESTAPI. Four example html pages are included: createThemeLayer.html for creating and displaying a temporary layer set; getLayersList.html for retrieving the layer list of the World map; getSubLayers.html for retrieving the sub-layer list of the World layer; and layersList.html for retrieving the layer list of "World Map".
RESTMapOperation Implements map operations using RESTAPI. Four example html pages are included: getMap.html for retrieving map parameters including the map name, the display extent, the extent of the viewing window, and the scale information; getMapImage.html for retrieving a map image; getMapsList.html for retrieving a map list; and mapImageApp.html for shifting and zooming in/out on a map. Please refer to Map operations.
RESTQueryOperation Implements query operations using RESTAPI. Four example html pages are included: queryByDistance.html for distance query; queryByDistanceDirect for distance query and displaying the detailed information on the query result; queryBySQL.html for SQL query; and getQueryResult.html for parsing a distance query result. Please refer to Query operations.
RESTRealspaceOperation Implements realspace operations using RESTAPI. Pages getImageCache.html and getRLayers.html are included. The former retrieves cached image data. The latter retrieves a 3D layer list. Please refer to Realspace operations.
Extending iServer DSSE BingMapsInterfaceSample This example illustrates how to retrieve an image through the Bing Maps REST interface. Please see the readme.txt file in the project directory for its detailed description.
BingMapsMapProviderSample How to output maps through the inheritance of TiledMapProviderBase. For the detailed description, see readme.txt.
GoogleMapsProviderSample How to get map services from GoogleMaps. Please refer to Extension of Service Provider Layer.
DSSE_Cluster Build a domain spatial service cluster with weather information inquiry as an example. Please see the readme.txt file in the project directory for its detailed description.
PushpinComponentSample Implements the map labeling function through an extension on the service component level. Please see the readme.txt file in the project directory for its detailed description.
Temperature_SC Creates a service component and implements the weather information function. Please refer to Creating a service component for details.
Temperature_SPSC Implements a service provider on the basis of a service component. Please refer to Creating a service provider for details.
Temperature_SPSCSI Creates another service interface on the basis of a service provider, and builds a complete domain service extension. Please refer to Creating a service interface for details.
DSSE_JSR DSSE_JSR Creates a domain service resource extension based on JAX-RS. Please see the readme.txt file in the project directory for its detailed description. For detailed description, please refer to Defining REST Resource Based on JAX-RS.
Extend_MapProvider SimpleCacheMapProvider Introduces how to implement SimpleCacheMapProvider by extending UGCMapProvider in SuperMap iServer in order to make simple map caches (SimpleCache) of SuperMap iServer 2008 compatible. Please see the description in the readme.txt file in the project directory.
ExtendExist_JSR ExtendExist_JSR Creates resource extensions for existing modules, including a parameter decoder extension and a new resource extension. Please refer to JAX-RS-based Extension.
ExtendREST ExtendREST Extends REST based on RESTlet. It includes extending a simple algorithm resource, a parameter decoder, a representation encoder, and an HTTP request handler. Please refer to Extending REST based on RESTlet for details.
Temprature_JSR Temprature_JSR Implements a weather information service extension based on the JAX-RS mechanism. For the specific usage, please refer to the description in the readme.txt file in this project directory.
ExtendTileSourceprovider ExtendTileSourceprovider Based on distributed cache generating, extend a new cache storage format. It follows the Chinese standard CH/Z 9011——2011. For the specific usage, please refer to the description in the readme.txt file in this project directory.
Extend_SecurityInfo Extend_SecurityInfo Based on the iServer security module, extend a new security information storage. It can store security information of user, role, user groups, authorization information in the json file. Please refer to Security Information Storage Extension for details.