Class MapImpl
- java.lang.Object
-
- com.supermap.services.components.impl.MapImpl
-
- All Implemented Interfaces:
- ComponentContextAware, Map, Disposable, Tileable
public class MapImpl extends java.lang.Object implements Map, Tileable, Disposable, ComponentContextAware
The implementation class of the map service component interface.
Map service component is a type of GIS service component encapsulating GIS functions associated with the map. This class implements the interface.
The service providers in a map service component must be map service providers (
MapProvider).Below is an example to show how to construct map service component using SuperMap data.
public MapImpl getMapComponent() { // Initialize the settings of SuperMap map service provider. UGCMapProviderSetting ugcPSetting = new UGCMapProviderSetting(); // SuperMap workspace path. ugcPSetting.setWorkspacePath("C:\\SuperMap\\World\\World.sxwu"); // The output path of the map image of the map service provider. ugcPSetting.setOutputPath(".\\output1"); // The publish site of the map image of the map service provider.. ugcPSetting.setOutputSite("http://localhost"); ugcPSetting.setName("default"); // The map service provider set, used to initialize the map service component context. List<MapProviderSetting> ugcPSettings = new ArrayList<MapProviderSetting>(); ugcPSettings.add(ugcPSetting); // Configuration information of the map service component, used to initialize the map service component context. MapConfig config = new MapConfig(); // The output path of the map image of the map service component. config.setOutputPath(".\\output"); // The publish site of the map image of the map service component. config.setOutputSite("http://localhost/output"); // Initialize the context of the map service component. MapContext mapContext = new MapContext(); mapContext.setMapProviderSettings(ugcPSettings); mapContext.setConfig(config); // Create the map service component MapImpl mapc = new MapImpl(mapContext); return mapc; }- See Also:
Component
-
-
Field Summary
Fields Modifier and Type Field and Description protected static java.lang.StringPROVIDER_FACTORYThe factory object keyword of the provider.
-
Constructor Summary
Constructors Constructor and Description MapImpl()The default constructor.MapImpl(MapContext mapContext)Constructs a MapImpl object with context information of the specified map service component.
-
Method Summary
Methods Modifier and Type Method and Description voidclearCache(Rectangle2D bounds)Removing caches within the specified map extent.voidclearCache(Rectangle2D bounds, MapParameter mapParameter, ImageOutputOption outputOption)Clears the cache within specified map extent.voiddispose()Releases the resources used by this map service component.voiddispose(boolean disposeProvidersInContext)QueryResultfindNearest(Geometry geometry, double maxDistance, QueryParameterSet queryParameterSet, java.lang.String mapName)Queries the geometric objects on a specified map whose distances to a specified geometry are within a certain value.java.util.List<ChartFeatureInfoSpec>getChartFeatureInfoSpecs(java.lang.String mapName)Chart feature.MapParametergetDefaultMapParameter(java.lang.String mapName)${services_components_impl_MapImpl_method_getDefaultMapParameter_Title}MapParametergetDefaultMapParameterNoCache(MapProvider mapProvider, java.lang.String mapName)java.util.List<PrjCoordSys>getDynamicPrjCoordsyses(java.lang.String mapName)MapImagegetMapImage(MapParameter mapParameter, ImageOutputOption outputOption)Gets map images according to map parameters and image output settings.java.util.List<java.lang.String>getMapNames()Gets map names list.MapParametergetMapParameter(java.lang.String mapName)Gets parameters of the specified map.byte[]getMVTFonts(java.lang.String mapName, java.lang.String fontstack, java.lang.String range)Gets the font of sdf format.java.lang.StringgetMVTSpriteJson(java.lang.String mapName, java.lang.String spriteName)Gets the json of the MVT Sprite.byte[]getMVTSpriteResource(java.lang.String mapName, java.lang.String spriteName)Gets the resource of the MVT Sprite.byte[]getMVTTile(VectorTileParameter vectorTileParameter)Gets MVT tile of the map.OverviewgetOverview(MapParameter mapParameter, ImageOutputOption outputOption)Gets eagle-eye map according to map parameters and image output settings.protected MapProvidergetProvider(java.lang.String name)Gets the map service provider of the specified map.protected MapProvidergetQueryProvider(java.lang.String name)Gets the map service provider required by the query function.java.lang.StringgetResource(ResourceParameter resourceParameter)Gets resource image according to resource image parameter.byte[]getResource(ResourceParameter resourceParameter, Point2D[] points)Gets resource image according to resource image parameter.byte[]getResource(java.lang.String mapName, java.lang.String symbolId, OutputFormat format)Gets resource image according to resource image parameter.TilesetInfo[]getTilesetInfos(java.lang.String mapName)Returns all the tiles set of the specified map.MapImagegetTrackingLayerImage(MapParameter mapParameter, ImageOutputOption outputOption)Gets images of TrackingLayer according to map parameters and image output settings.UTFGridResultgetUTFGrid(UTFGridParameter gridParameter)Extracts the UTFGrid object from a specified layer according to the map extent.VectorStylegetVectorStyle(java.lang.String mapName, java.lang.String[] layerNames, VectorStyleType type)Gets the specified vector layer style in the specified map.VectorTileDatagetVectorTile(VectorTileParameter vectorTileParameter)Gets vector tile of the map.java.lang.String[]listMVTSprites(java.lang.String mapName)Lists all the Sprites names of the MVT.MeasureResultmeasureArea(java.lang.String mapName, Point2D[] points, MeasureParameter measureParameter)${services_components_impl_MapImpl_method_measureArea_Title}MeasureResultmeasureDistance(java.lang.String mapName, Point2D[] points, MeasureParameter measureParameter)${services_components_impl_MapImpl_method_measureDistance_Title}MapImagepan(double offsetX, double offsetY, MapParameter mapParameter, ImageOutputOption outputOption)Map panning.QueryResultqueryByBounds(java.lang.String mapName, Rectangle2D bounds, QueryParameterSet queryParameterSet)Queries the geometries within a specified range on the map.QueryResultqueryByDistance(java.lang.String mapName, Geometry geometry, double distance, QueryParameterSet queryParameterSet)Queries all the geometric objects on a specified map whose distances to a specified geometry are within a certain value.QueryResultqueryByGeometry(java.lang.String mapName, Geometry geometry, SpatialQueryMode spatialQueryMode, QueryParameterSet queryParameterSet)${services_components_impl_MapImpl_method_queryByGeometry_Title}QueryResultqueryByKeywords(java.lang.String mapName, KeywordsQueryParameterSet queryParameterSet)Queries the map features based on the keyword.QueryResultqueryBySQL(java.lang.String mapName, QueryParameterSet queryParameterSet)${services_components_impl_MapImpl_method_queryBySQL_Title}QueryResultqueryChart(java.lang.String mapName, java.lang.String[] chartLayerNames, ChartQueryParameterSet chartQueryParams)Chart feature.QueryResultqueryChart(java.lang.String mapName, java.lang.String[] chartLayerNames, ChartQueryParameterSet chartQueryParams, Rectangle2D bounds)Chart feature.voidsetComponentContext(ComponentContext context)Sets the context of map service component.protected voidsetComponentContext(ComponentContext context, ImageTileCache<TileSourceInfo> tileCache, UTFGridTileCache<TileSourceInfo> utfGridTileCache, VectorTileCache<TileSourceInfo> vectorTileCache)MapParametersetDefaultMapParameter(MapParameter mapParameter)${services_components_impl_MapImpl_method_setDefaultMapParameter_Title}booleansupport(java.lang.String mapName, MapCapability capability)Determines whether the map supports the specified function.booleanupdateMap(MapParameter mapParameter)Updates the map status permanently, which will do a persistence in the disk.voidupdateVectorStyle(java.lang.String mapName, java.lang.String layerName, VectorStyleType type, java.lang.String style)Updates the specified vector layer style in the specified map.voiduseCachedDefaultMapParams(boolean use)MapImageviewByBounds(Rectangle2D bounds, MapParameter mapParameter, ImageOutputOption outputOption)Displays map according to the bounds of geographic coordinates.MapImageviewByScale(Point2D center, double scale, MapParameter mapParameter, ImageOutputOption outputOption)Displays a map according to the specified center point and scale.MapImageviewEntire(MapParameter mapParameter, ImageOutputOption outputOption)Displays a map in the Full Extent mode according to map parameters and image output settings.MapImageviewEntire(java.lang.String layerName, MapParameter mapParameter, ImageOutputOption outputOption)Displays a map in the Full Extent mode according to map layer name, map parameters and image output settings.MapImagezoom(Point2D center, double ratio, MapParameter mapParameter, ImageOutputOption outputOption)Performs map scaling according to the specified center point, zoom scale, map parameter and image output settings.
-
-
-
Field Detail
-
PROVIDER_FACTORY
protected static final java.lang.String PROVIDER_FACTORY
The factory object keyword of the provider. Default is "MapProviderFactory".
-
-
Constructor Detail
-
MapImpl
public MapImpl(MapContext mapContext)
Constructs a MapImpl object with context information of the specified map service component.
- Parameters:
mapContext- Context information of the map service component. This parameter cannot be null.
-
MapImpl
public MapImpl()
The default constructor.
-
-
Method Detail
-
useCachedDefaultMapParams
public void useCachedDefaultMapParams(boolean use)
-
clearCache
public void clearCache(Rectangle2D bounds) throws MapException
Removing caches within the specified map extent.
- Specified by:
clearCachein interfaceMap- Parameters:
bounds- The specified map extent.- Throws:
MapException- A map service component exception.
-
clearCache
public void clearCache(Rectangle2D bounds, MapParameter mapParameter, ImageOutputOption outputOption) throws MapException
Clears the cache within specified map extent.
- Specified by:
clearCachein interfaceMap- Parameters:
bounds- The specified map extent.mapParameter- Map parameters.outputOption- Image output settings.- Throws:
MapException- Displays a map according to the specified center point and scale.
-
getMapNames
public java.util.List<java.lang.String> getMapNames()
Gets map names list.
- Specified by:
getMapNamesin interfaceMap- Specified by:
getMapNamesin interfaceTileable- Returns:
- The list of map names.
-
getMapParameter
public MapParameter getMapParameter(java.lang.String mapName) throws MapException
Gets parameters of the specified map.
- Specified by:
getMapParameterin interfaceMap- Parameters:
mapName- The map name.- Returns:
- Map parameters.
- Throws:
MapException- A map service component exception, which is thrown if the map named by mapName parameter doesn't exist.
-
getMapImage
public MapImage getMapImage(MapParameter mapParameter, ImageOutputOption outputOption) throws MapException
Gets map images according to map parameters and image output settings.
- Specified by:
getMapImagein interfaceMap- Parameters:
mapParameter- Map parameters.outputOption- Image output settings.- Returns:
- The map image object.
- Throws:
MapException- A map service component exception, which is thrown if the map named bymapParameter.nameparameter doesn't exist.
-
getResource
public byte[] getResource(java.lang.String mapName, java.lang.String symbolId, OutputFormat format) throws MapExceptionDescription copied from interface:MapGets resource image according to resource image parameter.- Specified by:
getResourcein interfaceMapsymbolId- Symbol id.format- Symbol Format.- Returns:
- Binary stream of the image.
- Throws:
MapException- Displays a map according to the specified center point and scale.
-
getResource
public java.lang.String getResource(ResourceParameter resourceParameter) throws MapException
Gets resource image according to resource image parameter.
- Specified by:
getResourcein interfaceMap- Parameters:
resourceParameter- The resource image parameter.- Returns:
- The resource image address.
- Throws:
MapException- A map service component exception, which is thrown when the size of the current map names list is less than 0.java.lang.IllegalArgumentException- When resourceParameter is null, this exception will be thrown.
-
getResource
public byte[] getResource(ResourceParameter resourceParameter, Point2D[] points) throws MapException
Description copied from interface:MapGets resource image according to resource image parameter.- Specified by:
getResourcein interfaceMap- Parameters:
resourceParameter- The resource image parameter, including the image height, width, type, resource type, style, etcpoints- The points used to draw resource images.- Returns:
- Binary stream of the image.
- Throws:
MapException- Displays a map according to the specified center point and scale.
-
measureDistance
public MeasureResult measureDistance(java.lang.String mapName, Point2D[] points, MeasureParameter measureParameter) throws MapException
${services_components_impl_MapImpl_method_measureDistance_Title}
${services_components_impl_MapImpl_method_measureDistance_Description}
- Specified by:
measureDistancein interfaceMap- Parameters:
mapName- ${services_components_impl_MapImpl_method_measureDistance_param_mapName}points- ${services_components_impl_MapImpl_method_measureDistance_param_points}measureParameter- ${services_components_impl_MapImpl_method_measureDistance_param_measureParameter}- Returns:
- ${services_components_impl_MapImpl_method_measureDistance_return}
- Throws:
MapException- ${services_components_impl_MapImpl_method_measureDistance_throws_MapException}java.lang.IllegalArgumentException- ${services_components_impl_MapImpl_method_measureDistance_throw_IllegalArgumentException}
-
measureArea
public MeasureResult measureArea(java.lang.String mapName, Point2D[] points, MeasureParameter measureParameter) throws MapException
${services_components_impl_MapImpl_method_measureArea_Title}
${services_components_impl_MapImpl_method_measureArea_Description}
- Specified by:
measureAreain interfaceMap- Parameters:
mapName- ${services_components_impl_MapImpl_method_measureArea_param_mapName}points- ${services_components_impl_MapImpl_method_measureArea_param_points}measureParameter- ${services_components_impl_MapImpl_method_measureArea_param_measureParameter}- Returns:
- ${services_components_impl_MapImpl_method_measureArea_return}
- Throws:
MapException- ${services_components_impl_MapImpl_method_measureArea_throws_MapException}java.lang.IllegalArgumentException- ${services_components_impl_MapImpl_method_measureArea_throw_IllegalArgumentException}
-
queryByDistance
public QueryResult queryByDistance(java.lang.String mapName, Geometry geometry, double distance, QueryParameterSet queryParameterSet) throws MapException
Queries all the geometric objects on a specified map whose distances to a specified geometry are within a certain value. When you limit the number of the returned geometries (specified by
QueryParameterSet.expectCount), the query result is the expectCount object extracting randomly from the total query records.Which means to query all the geometries within a circle whose center is the specified geometry.
The sample of this query is as follows. About the map service component initialization, please seemap component initialization sample.
public QueryResult queryByDistanceSample() throws MapException { //Initialize the map service component MapImpl mapc = getMapComponent(); // The attribute query parameter set. QueryParameterSet queryParameters = new QueryParameterSet(); QueryParameter[] queryLayerParams = new QueryParameter[1]; queryLayerParams[0] = new QueryParameter(); queryLayerParams[0].name = "Countries@World"; // Attribute filter condition. Here is set to null. queryLayerParams[0].attributeFilter = ""; // The field name to be returned (Not case sensitive). queryLayerParams[0].fields = new String[] { "Country", "Capital" }; queryParameters.queryParams = queryLayerParams; // The query result which is set to only contain attribute information queryParameters.queryOption = QueryOption.ATTRIBUTE; // Create the reference geometry object for buffer query. Here is a triangular planar object. Point2D p1 = new Point2D(101.0, 26.0); Point2D p2 = new Point2D(97.0, 21.0); Point2D p3 = new Point2D(103.0, 16.0); Point2D[] point2ds = { p1, p2, p3 }; Geometry geometry = Geometry.fromPoint2Ds(point2ds, GeometryType.REGION); // Query all features within 0.5 of the specified objects on the layer of "Countries@World" of the map of "WorldMap" QueryResult queryResult = mapc.queryByDistance("WorldMap", geometry, 0.5, queryParameters); mapc.dispose(); return queryResult; }- Specified by:
queryByDistancein interfaceMap- Parameters:
mapName- The map name.geometry- The geometric object.distance- The unit of the distance extent is identical to that of dataset coordinates corresponding to the current map.queryParameterSet- Query parameters can query multiple layers of a map. The query parameters in a single layer can be set inqueryParameterSet.queryParams[i].- Returns:
- Query result object.
- Throws:
MapException- A map service component exception, which is thrown if the map named by mapName parameter doesn't exist.java.lang.IllegalArgumentException- An IllegalArgumentException will be thrown if the following situations occur:
- The parameter geometry is null.
- The parameter distance is less than or equal to 0.
- The parameter queryParameterSet is null.
- The parameter
queryParameterSet.queryParamsis null, or the length of the array is 0.
-
queryByGeometry
public QueryResult queryByGeometry(java.lang.String mapName, Geometry geometry, SpatialQueryMode spatialQueryMode, QueryParameterSet queryParameterSet) throws MapException
${services_components_impl_MapImpl_method_queryByGeometry_Title}
${services_components_impl_MapImpl_method_queryByGeometry_Description}
- Specified by:
queryByGeometryin interfaceMap- Parameters:
mapName- ${services_components_impl_MapImpl_method_queryByGeometry_param_mapName}geometry- ${services_components_impl_MapImpl_method_queryByGeometry_param_geometry}spatialQueryMode- ${services_components_impl_MapImpl_method_queryByGeometry_param_spatialQueryMode}queryParameterSet- ${services_components_impl_MapImpl_method_queryByGeometry_param_queryParameterSet}- Returns:
- ${services_components_impl_MapImpl_method_queryByGeometry_return}
- Throws:
MapException- ${services_components_impl_MapImpl_method_queryByGeometry_throws_MapException}java.lang.IllegalArgumentException- ${services_components_impl_MapImpl_method_queryByGeometry_throw_IllegalArgumentException}
-
queryBySQL
public QueryResult queryBySQL(java.lang.String mapName, QueryParameterSet queryParameterSet) throws MapException
${services_components_impl_MapImpl_method_queryBySQL_Title}
${services_components_impl_MapImpl_method_queryBySQL_Description}
- Specified by:
queryBySQLin interfaceMap- Parameters:
mapName- ${services_components_impl_MapImpl_method_queryBySQL_param_mapName}queryParameterSet- ${services_components_impl_MapImpl_method_queryBySQL_param_queryParameterSet}- Returns:
- ${services_components_impl_MapImpl_method_queryBySQL_return}
- Throws:
MapException- ${services_components_impl_MapImpl_method_queryBySQL_throws_MapException}java.lang.IllegalArgumentException- ${services_components_impl_MapImpl_method_queryBySQL_throw_IllegalArgumentException}
-
queryByBounds
public QueryResult queryByBounds(java.lang.String mapName, Rectangle2D bounds, QueryParameterSet queryParameterSet) throws MapException
Queries the geometries within a specified range on the map.
- Specified by:
queryByBoundsin interfaceMap- Parameters:
mapName- The map name.bounds- The specified query bounds.queryParameterSet- Query parameters can query multiple layers of a map. The query parameters in a single layer can be set inqueryParameters.queryParams[i].- Returns:
- Query result object.
- Throws:
MapException- A map service component exception, which is thrown if the map named by mapName parameter doesn't exist.java.lang.IllegalArgumentException- An IllegalArgumentException will be thrown if the following situations occur:
- The parameter bounds is null.
- The parameter queryParameterSet is null.
- The parameter
queryParameterSet.queryParamsis null, or the length of the array is 0.
-
setDefaultMapParameter
public MapParameter setDefaultMapParameter(MapParameter mapParameter) throws MapException
${services_components_impl_MapImpl_method_setDefaultMapParameter_Title}
${services_components_impl_MapImpl_method_setDefaultMapParameter_Description}
- Specified by:
setDefaultMapParameterin interfaceMap- Parameters:
mapParameter- ${services_components_impl_MapImpl_method_setDefaultMapParameter_param_mapParameter}- Returns:
- ${services_components_impl_MapImpl_method_setDefaultMapParameter_return}
- Throws:
MapException- ${services_components_impl_MapImpl_method_setDefaultMapParameter_throws_MapException}java.lang.IllegalArgumentException- ${services_components_impl_MapImpl_method_setDefaultMapParameter_throw_IllegalArgumentException}
-
getDefaultMapParameter
public MapParameter getDefaultMapParameter(java.lang.String mapName) throws MapException
${services_components_impl_MapImpl_method_getDefaultMapParameter_Title}
${services_components_impl_MapImpl_method_getDefaultMapParameter_Description}
- Specified by:
getDefaultMapParameterin interfaceMap- Parameters:
mapName- ${services_components_impl_MapImpl_method_getDefaultMapParameter_param_mapName}- Returns:
- ${services_components_impl_MapImpl_method_getDefaultMapParameter_return}
- Throws:
MapException- ${services_components_impl_MapImpl_method_getDefaultMapParameter_throws_MapException}
-
pan
public MapImage pan(double offsetX, double offsetY, MapParameter mapParameter, ImageOutputOption outputOption) throws MapException
Map panning.
- Specified by:
panin interfaceMap- Parameters:
offsetX- Geographic coordinates offset in the horizontal axis.offsetY- Geographic coordinates offset in the vertical axis.mapParameter- Map parameters.outputOption- Image output settings.- Returns:
- The map image object.
- Throws:
MapException- Displays a map according to the specified center point and scale.
-
viewByBounds
public MapImage viewByBounds(Rectangle2D bounds, MapParameter mapParameter, ImageOutputOption outputOption) throws MapException
Displays map according to the bounds of geographic coordinates.
- Specified by:
viewByBoundsin interfaceMap- Parameters:
bounds- The bounds of geographic coordinates.mapParameter- Map parameters.outputOption- Image output settings.- Returns:
- The map image object.
- Throws:
MapException- Displays a map according to the specified center point and scale.java.lang.IllegalArgumentException- If the following situations occur, an IllegalArgumentException will be thrown.
- The parameter bounds is null.
- The parameter mapParameter is null.
- The parameter outputOption is null.
-
viewByScale
public MapImage viewByScale(Point2D center, double scale, MapParameter mapParameter, ImageOutputOption outputOption) throws MapException
Displays a map according to the specified center point and scale.
The sample is as follows. About the map service component initialization, please seemap component initialization sample.
public MapImage viewByScaleSample() throws MapException { //Initialize the map service component MapImpl mapc = getMapComponent(); // The coordinates of the center point. Point2D center = new Point2D(101.0, 26.0); // The scale for outputting map. double scale = 0.00000003; // The map parameters. Here the default parameters of "WorldMap" is used. MapParameter mapParameter = mapc.getDefaultMapParameter("WorldMap"); // Image output settings. Here the output format is set to PNG. ImageOutputOption outputOption = new ImageOutputOption(); outputOption.format = OutputFormat.PNG; MapImage mapImage = mapc.viewByScale(center, scale, mapParameter, outputOption); // Dispose the resources occupied by the map component mapc.dispose(); return mapImage; }- Specified by:
viewByScalein interfaceMap- Parameters:
center- Center point.scale- The specified scale.mapParameter- Map parameters.outputOption- Image output settings.- Returns:
- The map image object.
- Throws:
MapException- A map service component exception, which is thrown if the map named bymapParameter.nameparameter doesn't exist.java.lang.IllegalArgumentException- An IllegalArgumentException will be thrown if the following situations occur:
- The parameter center is null.
- The parameter scale is less than or equal to 0.
- The parameter mapParameter is null.
- The parameter outputOption is null.
-
zoom
public MapImage zoom(Point2D center, double ratio, MapParameter mapParameter, ImageOutputOption outputOption) throws MapException
Performs map scaling according to the specified center point, zoom scale, map parameter and image output settings.
- Specified by:
zoomin interfaceMap- Parameters:
center- Center point.ratio- The zoom scale.mapParameter- Map parameters.outputOption- Image output settings.- Returns:
- The map image object.
- Throws:
MapException- A map service component exception, which is thrown if the map named bymapParameter.nameparameter doesn't exist.java.lang.IllegalArgumentException- An IllegalArgumentException will be thrown if the following situations occur:
- The parameter center is null.
- The parameter mapParameter is null.
- The parameter outputOption is null.
- The parameter ration is equal to 0.
-
viewEntire
public MapImage viewEntire(MapParameter mapParameter, ImageOutputOption outputOption) throws MapException
Displays a map in the Full Extent mode according to map parameters and image output settings.
- Specified by:
viewEntirein interfaceMap- Parameters:
mapParameter- Map parameters.outputOption- Image output settings.- Returns:
- The map image object.
- Throws:
MapException- A map service component exception, which is thrown if the map named bymapParameter.mapNameparameter doesn't exist.java.lang.IllegalArgumentException- An IllegalArgumentException will be thrown if the following situations occur:
- The parameter mapParameter is null.
- The parameter outputOption is null.
-
getTrackingLayerImage
public MapImage getTrackingLayerImage(MapParameter mapParameter, ImageOutputOption outputOption) throws MapException
Gets images of TrackingLayer according to map parameters and image output settings.
- Specified by:
getTrackingLayerImagein interfaceMap- Parameters:
mapParameter- Map parameters.outputOption- Image output settings.- Returns:
- The map image object.
- Throws:
MapException- A map service component exception, which is thrown if the map named bymapParameter.nameparameter doesn't exist.java.lang.IllegalArgumentException- An IllegalArgumentException will be thrown if the following situations occur:
- The parameter mapParameter is null.
- The parameter outputOption is null.
- No highlight geometries exist.
-
findNearest
public QueryResult findNearest(Geometry geometry, double maxDistance, QueryParameterSet queryParameterSet, java.lang.String mapName) throws MapException
Queries the geometric objects on a specified map whose distances to a specified geometry are within a certain value. When limit the number of returned geometric objects (specified by
QueryParameterSet.expectCount), the query result is the expectCount features nearest to the center in the records. There is no orders of expectCount.- Specified by:
findNearestin interfaceMap- Parameters:
geometry- ${services_components_impl_MapImpl_method_findNearest_param_geometry}maxDistance- The unit of the distance extent is identical to that of dataset coordinates corresponding to the current map.queryParameterSet- ${services_components_impl_MapImpl_method_findNearest_param_queryParameterSet}mapName- ${services_components_impl_MapImpl_method_findNearest_param_mapName}- Returns:
- ${services_components_impl_MapImpl_method_findNearest_return}
- Throws:
MapException- ${services_components_impl_MapImpl_method_findNearest_throws_MapException}java.lang.IllegalArgumentException- ${services_components_impl_MapImpl_method_findNearest_throw_IllegalArgumentException}
-
viewEntire
public MapImage viewEntire(java.lang.String layerName, MapParameter mapParameter, ImageOutputOption outputOption) throws MapException
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:
viewEntirein interfaceMap- Parameters:
layerName- Layer name, used to determine the full map extent.mapParameter- Map parameters.outputOption- Image output settings.- Returns:
- The Map object.
- Throws:
MapException- A map service component exception, which is thrown if the map named bymapParameter.nameparameter doesn't exist.java.lang.IllegalArgumentException- An IllegalArgumentException will be thrown if the following situations occur:
- The parameter mapParameter is null.
- The parameter outputOption is null.
-
getOverview
public Overview getOverview(MapParameter mapParameter, ImageOutputOption outputOption) throws MapException
Gets eagle-eye map according to map parameters and image output settings.
- Specified by:
getOverviewin interfaceMap- Parameters:
mapParameter- Map parameters.outputOption- Image output settings.- Returns:
- The map image object.
- Throws:
MapException- A map service component exception, which is thrown if the map named bymapParameter.nameparameter doesn't exist.java.lang.IllegalArgumentException- If the following situations occur, an IllegalArgumentException will be thrown.
- The parameter mapParameter is null.
- The parameter outputOption is null.
-
getDynamicPrjCoordsyses
public java.util.List<PrjCoordSys> getDynamicPrjCoordsyses(java.lang.String mapName) throws MapException
- Specified by:
getDynamicPrjCoordsysesin interfaceMap- Throws:
MapException
-
getChartFeatureInfoSpecs
public java.util.List<ChartFeatureInfoSpec> getChartFeatureInfoSpecs(java.lang.String mapName) throws MapException
Chart feature. Gets all the feature types of charts.- Specified by:
getChartFeatureInfoSpecsin interfaceMap- Throws:
MapException
-
queryChart
public QueryResult queryChart(java.lang.String mapName, java.lang.String[] chartLayerNames, ChartQueryParameterSet chartQueryParams) throws MapException
Chart feature. Feature attribute query.- Specified by:
queryChartin interfaceMap- Throws:
MapException
-
queryChart
public QueryResult queryChart(java.lang.String mapName, java.lang.String[] chartLayerNames, ChartQueryParameterSet chartQueryParams, Rectangle2D bounds) throws MapException
Chart feature. Feature bounds query.- Specified by:
queryChartin interfaceMap- Throws:
MapException
-
getUTFGrid
public UTFGridResult getUTFGrid(UTFGridParameter gridParameter) throws MapException
Extracts the UTFGrid object from a specified layer according to the map extent.- Specified by:
getUTFGridin interfaceMap- Parameters:
gridParameter- UTFGrid request parameters object.- Returns:
- The corresponding JSONObject of the UTFGrid.
- Throws:
MapException- The exception.
-
getDefaultMapParameterNoCache
public MapParameter getDefaultMapParameterNoCache(MapProvider mapProvider, java.lang.String mapName) throws MapException
- Throws:
MapException
-
dispose
public void dispose()
Releases the resources used by this map service component.
- Specified by:
disposein interfaceDisposable
-
dispose
public void dispose(boolean disposeProvidersInContext)
-
setComponentContext
public void setComponentContext(ComponentContext context)
Sets the context of map service component.
- Specified by:
setComponentContextin interfaceComponentContextAware- Parameters:
context- The context of map service component.
-
setComponentContext
protected void setComponentContext(ComponentContext context, ImageTileCache<TileSourceInfo> tileCache, UTFGridTileCache<TileSourceInfo> utfGridTileCache, VectorTileCache<TileSourceInfo> vectorTileCache)
-
getTilesetInfos
public TilesetInfo[] getTilesetInfos(java.lang.String mapName)
Returns all the tiles set of the specified map.
- Specified by:
getTilesetInfosin interfaceTileable- Parameters:
mapName-- Returns:
- Since:
- 8.0.0
-
getProvider
protected MapProvider getProvider(java.lang.String name)
Gets the map service provider of the specified map.
- Parameters:
name- Map name, can not be null.- Returns:
- A MapProvider object.
-
getQueryProvider
protected MapProvider getQueryProvider(java.lang.String name)
Gets the map service provider required by the query function.
- Parameters:
name- The map name.- Returns:
- A MapProvider object.
-
getMVTTile
public byte[] getMVTTile(VectorTileParameter vectorTileParameter) throws MapException
Description copied from interface:MapGets MVT tile of the map.
- Specified by:
getMVTTilein interfaceMap- Parameters:
vectorTileParameter- The parameters of the vector tile.- Returns:
- The MVT map tile data.
- Throws:
MapException
-
getVectorTile
public VectorTileData getVectorTile(VectorTileParameter vectorTileParameter) throws MapException
Description copied from interface:MapGets vector tile of the map.
- Specified by:
getVectorTilein interfaceMap- Parameters:
vectorTileParameter- The parameters of the vector tile.- Returns:
- The vector tile data.
- Throws:
MapException
-
support
public boolean support(java.lang.String mapName, MapCapability capability)Description copied from interface:MapDetermines whether the map supports the specified function.
-
queryByKeywords
public QueryResult queryByKeywords(java.lang.String mapName, KeywordsQueryParameterSet queryParameterSet) throws MapException
Description copied from interface:MapQueries the map features based on the keyword.- Specified by:
queryByKeywordsin interfaceMap- Parameters:
mapName- The map name.queryParameterSet- Query parameter set.- Returns:
- Throws:
MapException
-
getVectorStyle
public VectorStyle getVectorStyle(java.lang.String mapName, java.lang.String[] layerNames, VectorStyleType type) throws MapException
Description copied from interface:MapGets the specified vector layer style in the specified map.- Specified by:
getVectorStylein interfaceMap- Parameters:
mapName- The map name.layerNames- The layer name.type- The vector style type.- Returns:
- The string of the vector style.
- Throws:
MapException
-
updateVectorStyle
public void updateVectorStyle(java.lang.String mapName, java.lang.String layerName, VectorStyleType type, java.lang.String style)Description copied from interface:MapUpdates the specified vector layer style in the specified map.- Specified by:
updateVectorStylein interfaceMap- Parameters:
mapName- The map name.type- The vector style type.
-
listMVTSprites
public java.lang.String[] listMVTSprites(java.lang.String mapName)
Description copied from interface:MapLists all the Sprites names of the MVT.- Specified by:
listMVTSpritesin interfaceMap- Parameters:
mapName- The map name.- Returns:
- Sprites names list.
-
getMVTSpriteJson
public java.lang.String getMVTSpriteJson(java.lang.String mapName, java.lang.String spriteName)Description copied from interface:MapGets the json of the MVT Sprite.- Specified by:
getMVTSpriteJsonin interfaceMap- Parameters:
mapName- The map name.spriteName- Sprite name.- Returns:
- The json of the MVT Sprite.
-
getMVTSpriteResource
public byte[] getMVTSpriteResource(java.lang.String mapName, java.lang.String spriteName)Description copied from interface:MapGets the resource of the MVT Sprite.- Specified by:
getMVTSpriteResourcein interfaceMap- Parameters:
mapName- The map name.spriteName- Sprite name.- Returns:
- The Sprite resource data.
-
getMVTFonts
public byte[] getMVTFonts(java.lang.String mapName, java.lang.String fontstack, java.lang.String range)Description copied from interface:MapGets the font of sdf format.- Specified by:
getMVTFontsin interfaceMap- Parameters:
mapName- The map name.fontstack- The fontstack name.range- rang.- Returns:
- Font data.
-
updateMap
public boolean updateMap(MapParameter mapParameter) throws MapException
Description copied from interface:MapUpdates the map status permanently, which will do a persistence in the disk.- Specified by:
updateMapin interfaceMap- Parameters:
mapParameter- The map status to update to.- Returns:
- Whether the update is successful.
- Throws:
MapException
-
-