#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; namespace OSGeo.MapGuide.MaestroAPI.Services { /// /// Provides services for interaction with the runtime map /// public interface IMappingService : IService { /// /// 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); /* /// /// Creates a runtime map on the server. /// The map name will be the name of the resource, without path information. /// This is equivalent to the way the AJAX viewer creates the runtime map. /// /// The mapDefinition resource id void CreateRuntimeMap(string resourceID); /// /// Creates a runtime map on the server /// /// The target resource id for the runtime map /// The mapdefinition to base the map on void CreateRuntimeMap(string resourceID, string mapdefinition); /// /// Creates a runtime map on the server /// /// The target resource id for the runtime map /// The mapdefinition to base the map on void CreateRuntimeMap(string resourceID, IMapDefinition map); /// /// Creates a runtime map on the server /// /// The target resource id for the runtime map /// The mapdefinition to base the map on void CreateRuntimeMap(string resourceID, RuntimeMapBase map); /// /// Updates an existing runtime map /// /// The target resource id for the runtime map /// The runtime map to update with void SaveRuntimeMap(string resourceID, RuntimeMapBase map); /// /// Gets the runtime map. /// /// The resource ID. /// RuntimeMapBase GetRuntimeMap(string resourceID); /// /// 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); /// /// Sets the selection of a map /// /// The resourceID of the runtime map /// The selection xml void SetSelectionXml(string runtimeMap, string selectionXml); /// /// Gets the selection from a map /// /// The resourceID of the runtime map /// The selection xml string GetSelectionXml(string runtimeMap); /// /// 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 runtimemap, 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 runtimemap, string wkt, bool persist); /// /// Renders a minature bitmap of the layers style /// /// The scale for the bitmap to match /// The layer the image should represent /// 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); */ } }