#region Disclaimer / License
// Copyright (C) 2010, Jackie Ng
// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie@gmail.com
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//
#endregion
using System;
using System.Collections.Generic;
using System.Text;
using OSGeo.MapGuide.ObjectModels.MapDefinition;
using OSGeo.MapGuide.MaestroAPI.Mapping;
using System.Drawing;
using OSGeo.MapGuide.ObjectModels.LayerDefinition;
namespace OSGeo.MapGuide.MaestroAPI.Services
{
///
/// Provides services for interaction with the runtime map
///
///
/// This example shows how to obtain a mapping service instance. Note that you should check if this service type is
/// supported through its capabilities.
///
///
///
///
public interface IMappingService : IService
{
///
/// Creates the map group.
///
/// The parent runtime map. The runtime map must have been created or opened from this same service instance
/// The name.
///
RuntimeMapGroup CreateMapGroup(RuntimeMap parent, string name);
///
/// Creates a new runtime map group
///
/// The parent runtime map. The runtime map must have been created or opened from this same service instance
/// The group.
///
RuntimeMapGroup CreateMapGroup(RuntimeMap parent, IBaseMapGroup group);
///
/// Creates a new runtime map group
///
/// The parent runtime map. The runtime map must have been created or opened from this same service instance
/// The group.
///
RuntimeMapGroup CreateMapGroup(RuntimeMap parent, IMapLayerGroup group);
///
/// Creates a new runtime map layer from the specified Layer Definition
///
/// The parent runtime map. The runtime map must have been created or opened from this same service instance
/// The layer definition
///
RuntimeMapLayer CreateMapLayer(RuntimeMap parent, ILayerDefinition ldf);
///
/// Creates a new runtime map layer from the specified instance
///
/// The parent runtime map. The runtime map must have been created or opened from this same service instance
/// The map definition layer
///
RuntimeMapLayer CreateMapLayer(RuntimeMap parent, IBaseMapLayer source);
///
/// Creates a new runtime map layer from the specified instance
///
/// The parent runtime map. The runtime map must have been created or opened from this same service instance
/// The map definition layer
///
RuntimeMapLayer CreateMapLayer(RuntimeMap parent, IMapLayer source);
///
/// Creates a new runtime map instance from an existing map definition.
///
///
///
RuntimeMap CreateMap(IMapDefinition mapDef);
///
/// Creates a new runtime map instance from an existing map definition. Meters per unit
/// is calculated from the Coordinate System WKT of the map definition.
///
///
///
///
RuntimeMap CreateMap(IMapDefinition mapDef, double metersPerUnit);
///
/// Creates a new runtime map instance from an existing map definition. Meters per unit
/// is calculated from the Coordinate System WKT of the map definition.
///
///
/// Calculation of meters-per-unit may differ between implementations. This may have an adverse
/// effect on things such as rendering and measuring depending on the underlying implementation
///
/// If you are certain of the meters-per-unit value required, use the overloaded method that
/// accepts a metersPerUnit parameter.
///
///
///
///
RuntimeMap CreateMap(string runtimeMapResourceId, string baseMapDefinitionId);
///
/// Creates a new runtime map instance from an existing map definition
///
///
///
///
///
RuntimeMap CreateMap(string runtimeMapResourceId, string baseMapDefinitionId, double metersPerUnit);
///
/// Creates a new runtime map instance from an existing map definition. Meters per unit
/// is calculated from the Coordinate System WKT of the map definition.
///
///
/// Calculation of meters-per-unit may differ between implementations. This may have an adverse
/// effect on things such as rendering and measuring depending on the underlying implementation
///
/// If you are certain of the meters-per-unit value required, use the overloaded method that
/// accepts a metersPerUnit parameter.
///
///
///
///
RuntimeMap CreateMap(string runtimeMapResourceId, IMapDefinition mdf);
///
/// Creates a new runtime map instance from an existing map definition
///
///
///
///
///
RuntimeMap CreateMap(string runtimeMapResourceId, IMapDefinition mdf, double metersPerUnit);
///
/// Opens an existing runtime map instance
///
///
///
RuntimeMap OpenMap(string runtimeMapResourceId);
///
/// Renders a dynamic overlay image of the map
///
///
///
///
///
System.IO.Stream RenderDynamicOverlay(RuntimeMap map, MapSelection selection, string format);
///
/// Renders a dynamic overlay image of the map
///
///
///
///
///
///
System.IO.Stream RenderDynamicOverlay(RuntimeMap map, MapSelection selection, string format, bool keepSelection);
///
/// Renders the runtime map.
///
/// The resource id.
/// The x.
/// The y.
/// The scale.
/// The width.
/// The height.
/// The dpi.
///
System.IO.Stream RenderRuntimeMap(string resourceId, double x, double y, double scale, int width, int height, int dpi);
///
/// Renders the runtime map.
///
/// The resource id.
/// The x1.
/// The y1.
/// The x2.
/// The y2.
/// The width.
/// The height.
/// The dpi.
///
System.IO.Stream RenderRuntimeMap(string resourceId, double x1, double y1, double x2, double y2, int width, int height, int dpi);
///
/// Renders the runtime map.
///
/// The resource id.
/// The x.
/// The y.
/// The scale.
/// The width.
/// The height.
/// The dpi.
/// The format.
///
System.IO.Stream RenderRuntimeMap(string resourceId, double x, double y, double scale, int width, int height, int dpi, string format);
///
/// Renders the runtime map.
///
/// The resource id.
/// The x1.
/// The y1.
/// The x2.
/// The y2.
/// The width.
/// The height.
/// The dpi.
/// The format.
///
System.IO.Stream RenderRuntimeMap(string resourceId, double x1, double y1, double x2, double y2, int width, int height, int dpi, string format);
///
/// Renders the runtime map.
///
/// The resource id.
/// The x.
/// The y.
/// The scale.
/// The width.
/// The height.
/// The dpi.
/// The format.
/// if set to true [clip].
///
System.IO.Stream RenderRuntimeMap(string resourceId, double x, double y, double scale, int width, int height, int dpi, string format, bool clip);
///
/// Renders the runtime map.
///
/// The resource id.
/// The x1.
/// The y1.
/// The x2.
/// The y2.
/// The width.
/// The height.
/// The dpi.
/// The format.
/// if set to true [clip].
///
System.IO.Stream RenderRuntimeMap(string resourceId, double x1, double y1, double x2, double y2, int width, int height, int dpi, string format, bool clip);
///
/// Renders the legend for the specified to the requested size and format
///
///
///
///
///
///
///
System.IO.Stream RenderMapLegend(RuntimeMap map, int width, int height, Color backgroundColor, string format);
///
/// Renders a minature bitmap of the layers style
///
/// The scale for the bitmap to match
/// The layer definition resource id
/// If the layer is themed, this gives the theme index, otherwise set to 0
/// The geometry type, 1 for point, 2 for line, 3 for area, 4 for composite
/// The minature bitmap
System.Drawing.Image GetLegendImage(double scale, string layerdefinition, int themeIndex, int type);
///
///Renders a minature bitmap of the layers style
///
/// The scale for the bitmap to match
/// The layer definition resource id
/// If the layer is themed, this gives the theme index, otherwise set to 0
/// The geometry type, 1 for point, 2 for line, 3 for area, 4 for composite
/// The width of the image to request.
/// The height of the image to request.
/// The image format (PNG, JPG or GIF).
///
System.Drawing.Image GetLegendImage(double scale, string layerdefinition, int themeIndex, int type, int width, int height, string format);
///
/// Selects features from a runtime map, returning a selection Xml.
///
/// The map to query. NOT a resourceID, only the map name!
/// The WKT of the geometry to query with (always uses intersection)
/// True if the selection should be saved in the runtime map, false otherwise.
/// The type of layer to include in the query
/// True if the result should contain the tooltip and link info
/// The selection Xml, or an empty string if there were no data.
string QueryMapFeatures(string runtimeMapName, string wkt, bool persist, QueryMapFeaturesLayerAttributes attributes, bool raw);
///
/// Selects features from a runtime map, returning a selection Xml.
///
/// The map to query. NOT a resourceID, only the map name!
/// The WKT of the geometry to query with (always uses intersection)
/// True if the selection should be saved in the runtime map, false otherwise.
/// The selection Xml, or an empty string if there were no data.
string QueryMapFeatures(string runtimeMapName, string wkt, bool persist);
}
}