#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. /// /// /// 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. /// /// /// This example shows how to create a new runtime map instance /// /// /// /// /// /// 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. /// /// /// This example shows how to create a new runtime map instance /// /// /// /// /// /// /// 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. /// /// /// This example shows how to create a new runtime map instance /// /// /// /// /// /// /// RuntimeMap CreateMap(string runtimeMapResourceId, string baseMapDefinitionId); /// /// Creates a new runtime map instance from an existing map definition /// /// /// This example shows how to create a new runtime map instance /// /// /// /// /// /// /// /// 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. /// /// /// This example shows how to create a new runtime map instance /// /// /// /// /// /// /// RuntimeMap CreateMap(string runtimeMapResourceId, IMapDefinition mdf); /// /// Creates a new runtime map instance from an existing map definition /// /// /// This example shows how to create a new runtime map instance /// /// /// /// /// /// /// /// RuntimeMap CreateMap(string runtimeMapResourceId, IMapDefinition mdf, double metersPerUnit); /// /// Opens an existing runtime map instance /// /// /// This example shows how to open a RuntimeMap instance from a resource id /// /// /// /// /// /// RuntimeMap OpenMap(string runtimeMapResourceId); /// /// Renders a dynamic overlay image of the map /// /// /// /// /// [Obsolete("Use the version of RenderDynamicOverlay that is not marked Obsolete")] //NOXLATE System.IO.Stream RenderDynamicOverlay(RuntimeMap map, MapSelection selection, string format); /// /// Renders a dynamic overlay image of the map /// /// /// /// /// /// [Obsolete("Use the version of RenderDynamicOverlay that is not marked Obsolete")] //NOXLATE System.IO.Stream RenderDynamicOverlay(RuntimeMap map, MapSelection selection, string format, bool keepSelection); /// /// Renders a dynamic overlay image of the map /// /// /// The render base layers bitmask behaviour (8) is only supported from MapGuide Open Source 2.5 onwards /// /// /// This example shows how to create a render a dynamic overlay image from a map and load it into a System.Drawing.Image /// /// /// /// /// The runtime map instance /// The map selection /// The image format /// The color of the selection /// A bitmask for the rendering behaviour (1 = Render Selection, 2 = Render Layers, 4 = Keep Selection, 8 = Render Base Layers) /// /// Thrown if the service is too old to be able to support this API System.IO.Stream RenderDynamicOverlay(RuntimeMap map, MapSelection selection, string format, Color selectionColor, int behaviour); /// /// Renders the runtime map. /// /// The runtime map instance /// The x. /// The y. /// The scale. /// The width. /// The height. /// The dpi. /// System.IO.Stream RenderRuntimeMap(RuntimeMap map, double x, double y, double scale, int width, int height, int dpi); /// /// Renders the runtime map. /// /// The runtime map instance. /// The x1. /// The y1. /// The x2. /// The y2. /// The width. /// The height. /// The dpi. /// System.IO.Stream RenderRuntimeMap(RuntimeMap map, double x1, double y1, double x2, double y2, int width, int height, int dpi); /// /// Renders the runtime map. /// /// The runtime map instance. /// The x. /// The y. /// The scale. /// The width. /// The height. /// The dpi. /// The format. /// System.IO.Stream RenderRuntimeMap(RuntimeMap map, double x, double y, double scale, int width, int height, int dpi, string format); /// /// Renders the runtime map. /// /// The runtime map instance. /// The x1. /// The y1. /// The x2. /// The y2. /// The width. /// The height. /// The dpi. /// The format. /// System.IO.Stream RenderRuntimeMap(RuntimeMap map, double x1, double y1, double x2, double y2, int width, int height, int dpi, string format); /// /// Renders the runtime map. /// /// The runtime map instance. /// The x. /// The y. /// The scale. /// The width. /// The height. /// The dpi. /// The format. /// if set to true [clip]. /// System.IO.Stream RenderRuntimeMap(RuntimeMap map, double x, double y, double scale, int width, int height, int dpi, string format, bool clip); /// /// Renders the runtime map. /// /// The runtime map /// 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(RuntimeMap map, 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); /// /// Identifies features that meet the specified spatial selection criteria. These features can be persisted as selected features in a map. /// This operation is generally used to implement selection/tooltip functionality for a client-side map viewer. /// QueryMapFeatures returns an XML document describing the set of selected features. /// If a single feature is selected, the XML contains the tooltip, hyperlink, and properties of the feature. /// /// The RuntimeMap instance /// The maximum number of features to return /// The WKT of the filter geometry, specifying the selection area /// Indicates whether the selection should be persisted as part of the map /// The spatial operator to use against the selection geometry /// Extra options for controlling selection criteria /// string QueryMapFeatures(RuntimeMap map, int maxFeatures, string wkt, bool persist, string selectionVariant, QueryMapOptions extraOptions); } }