[mapguide-commits] r1150 - in trunk/MgDev: Common/MapGuideCommon/Controller Common/MapGuideCommon/Services Server/src/Services/Mapping Server/src/Services/Rendering Web/src/HttpHandler

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Mar 5 13:39:45 EST 2007


Author: brucedechant
Date: 2007-03-05 13:39:44 -0500 (Mon, 05 Mar 2007)
New Revision: 1150

Modified:
   trunk/MgDev/Common/MapGuideCommon/Controller/HtmlController.cpp
   trunk/MgDev/Common/MapGuideCommon/Controller/HtmlController.h
   trunk/MgDev/Common/MapGuideCommon/Services/ProxyRenderingService.cpp
   trunk/MgDev/Common/MapGuideCommon/Services/ProxyRenderingService.h
   trunk/MgDev/Common/MapGuideCommon/Services/RenderingService.h
   trunk/MgDev/Server/src/Services/Mapping/StylizationUtil.cpp
   trunk/MgDev/Server/src/Services/Mapping/StylizationUtil.h
   trunk/MgDev/Server/src/Services/Rendering/OpQueryFeatureProperties.cpp
   trunk/MgDev/Server/src/Services/Rendering/OpQueryFeatures.cpp
   trunk/MgDev/Server/src/Services/Rendering/OpRenderDynamicOverlay.cpp
   trunk/MgDev/Server/src/Services/Rendering/OpRenderMap.cpp
   trunk/MgDev/Server/src/Services/Rendering/ServerRenderingService.cpp
   trunk/MgDev/Server/src/Services/Rendering/ServerRenderingService.h
   trunk/MgDev/Web/src/HttpHandler/HttpGetDynamicMapOverlayImage.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpGetDynamicMapOverlayImage.h
   trunk/MgDev/Web/src/HttpHandler/HttpGetMapImage.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpGetMapImage.h
   trunk/MgDev/Web/src/HttpHandler/HttpQueryMapFeatures.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpQueryMapFeatures.h
   trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.h
Log:
Implement RFC 15.

Modified: trunk/MgDev/Common/MapGuideCommon/Controller/HtmlController.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Controller/HtmlController.cpp	2007-03-02 21:54:12 UTC (rev 1149)
+++ trunk/MgDev/Common/MapGuideCommon/Controller/HtmlController.cpp	2007-03-05 18:39:44 UTC (rev 1150)
@@ -28,7 +28,7 @@
 //////////////////////////////////////////////////////////////////
 // Processes a GetDynamicMapOverlayImage request from the Viewer and returns an image of the specified map.
 //
-MgByteReader* MgHtmlController::GetDynamicMapOverlayImage(CREFSTRING mapName, CREFSTRING format)
+MgByteReader* MgHtmlController::GetDynamicMapOverlayImage(CREFSTRING mapName, CREFSTRING format, bool bKeepSelection)
 {
     // Create a Resource Service instance
     Ptr<MgResourceService> resourceService = (MgResourceService*)GetService(MgServiceType::ResourceService);
@@ -53,14 +53,14 @@
     Ptr<MgRenderingService> service = (MgRenderingService*)(GetService(MgServiceType::RenderingService));
 
     // Call the C++ API
-    return service->RenderDynamicOverlay(map, selection, format);
+    return service->RenderDynamicOverlay(map, selection, format, bKeepSelection);
 }
 
 //////////////////////////////////////////////////////////////////
 // Processes a GetMapImage request from the Viewer and returns an image of the specified map.
 //
 MgByteReader* MgHtmlController::GetMapImage(MgMap* map, MgSelection* selection,
-    CREFSTRING format, MgPropertyCollection* mapViewCommands)
+    CREFSTRING format, MgPropertyCollection* mapViewCommands, bool bKeepSelection)
 {
     // Apply map view commands
     ApplyMapViewCommands(map, mapViewCommands);
@@ -73,7 +73,7 @@
     Ptr<MgRenderingService> service = (MgRenderingService*)(GetService(MgServiceType::RenderingService));
 
     // Call the C++ API
-    return service->RenderMap(map, selection, format);
+    return service->RenderMap(map, selection, format, bKeepSelection);
 }
 
 //////////////////////////////////////////////////////////////////
@@ -167,7 +167,8 @@
     MgGeometry* selectionGeometry,
     INT32 selectionVariant,
     INT32 maxFeatures,
-    bool persist)
+    bool persist,
+    bool bIgnoreScaleRange)
 {
     // Create a Resource Service instance
     Ptr<MgResourceService> resourceService = (MgResourceService*)GetService(MgServiceType::ResourceService);
@@ -189,7 +190,7 @@
 
     // Call the C++ API
     Ptr<MgFeatureInformation> featureInfo = service->QueryFeatures(map, layerNames, selectionGeometry,
-        selectionVariant, maxFeatures);
+        selectionVariant, maxFeatures, bIgnoreScaleRange);
 
     if(persist)
     {

Modified: trunk/MgDev/Common/MapGuideCommon/Controller/HtmlController.h
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Controller/HtmlController.h	2007-03-02 21:54:12 UTC (rev 1149)
+++ trunk/MgDev/Common/MapGuideCommon/Controller/HtmlController.h	2007-03-05 18:39:44 UTC (rev 1150)
@@ -54,13 +54,17 @@
     /// Name of the map
     /// \param format
     /// Image format, from MgImageFormats
+    /// \param bKeepSelection
+    /// Input
+    /// true if you want to keep the selection
     ///
     /// \return
     /// A byte reader containing the map image
     ///
     MgByteReader* GetDynamicMapOverlayImage(
         CREFSTRING mapName,
-        CREFSTRING format);
+        CREFSTRING format,
+        bool bKeepSelection);
 
     //////////////////////////////////////////////////////////////////
     /// \brief
@@ -74,6 +78,9 @@
     /// Image format, from MgImageFormats
     /// \param mapViewCommands
     /// Commands to be applied to the map before generation
+    /// \param bKeepSelection
+    /// Input
+    /// true if you want to keep the selection
     ///
     /// \return
     /// A byte reader containing the map image
@@ -82,7 +89,8 @@
         MgMap* map,
         MgSelection* selection,
         CREFSTRING format,
-        MgPropertyCollection* mapViewCommands);
+        MgPropertyCollection* mapViewCommands,
+        bool bKeepSelection);
 
     //////////////////////////////////////////////////////////////////
     /// \brief
@@ -126,7 +134,8 @@
         MgGeometry* selectionGeometry,
         INT32 selectionVariant,
         INT32 maxFeatures,
-        bool persist);
+        bool persist,
+        bool bIgnoreScaleRange);
 
     //////////////////////////////////////////////////////////////////
     /// \brief

Modified: trunk/MgDev/Common/MapGuideCommon/Services/ProxyRenderingService.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Services/ProxyRenderingService.cpp	2007-03-02 21:54:12 UTC (rev 1149)
+++ trunk/MgDev/Common/MapGuideCommon/Services/ProxyRenderingService.cpp	2007-03-05 18:39:44 UTC (rev 1150)
@@ -131,16 +131,50 @@
     MgSelection* selection,
     CREFSTRING format)
 {
+    // Call the updated RenderDynamicOverlay API
+    return RenderDynamicOverlay(map, selection, format, true);
+}
+
+
+/////////////////////////////////////////////////////////////////
+/// <summary>
+/// Renders all dynamic layers in the specified MgMap to a dynamic overlay image
+/// with a transparent background. The center, scale, size, and layers to be
+/// rendered are defined by the specified map instance.  The format parameter
+/// must be set to an image format that supports transparency.
+/// </summary>
+/// <param name="map">Input
+/// map object containing current state of map.
+/// </param>
+/// <param name="selection">Input
+/// map feature selection. Specifies the selected features on the map
+/// </param>
+/// <param name="format">Input
+/// image format. Defines the format of the resulting image
+/// </param>
+/// <param name="bKeepSelection">Input
+/// true if you want to keep the selection
+/// </param>
+/// <returns>
+/// A byte reader containing the rendered image
+/// </returns>
+MgByteReader* MgProxyRenderingService::RenderDynamicOverlay(
+    MgMap* map,
+    MgSelection* selection,
+    CREFSTRING format,
+    bool bKeepSelection)
+{
     MgCommand cmd;
     cmd.ExecuteCommand(m_connProp,                                      // Connection
                         MgCommand::knObject,                            // Return type expected
                         MgRenderingServiceOpId::RenderDynamicOverlay,   // Command Code
-                        3,                                              // No of arguments
+                        4,                                              // No of arguments
                         Rendering_Service,                              // Service Id
                         1,                                              // Operation version
                         MgCommand::knObject, map,                       // Argument#1
                         MgCommand::knObject, selection,                 // Argument#2
                         MgCommand::knString, &format,                   // Argument#3
+                        MgCommand::knInt32, bKeepSelection,             // Argument#4
                         MgCommand::knNone);                             // End of arguments
 
     SetWarning(cmd.GetWarningObject());
@@ -170,16 +204,47 @@
     MgSelection* selection,
     CREFSTRING format)
 {
+    // Call the updated RenderMap API
+    return RenderMap(map, selection, format, true);
+}
+
+
+/////////////////////////////////////////////////////////////////
+/// <summary>
+/// Renders the specified MgMap to the requested image format.
+/// </summary>
+/// <param name="map">Input
+/// map object containing current state of map.
+/// </param>
+/// <param name="selection">Input
+/// map feature selection. Specifies the selected features on the map
+/// </param>
+/// <param name="format">Input
+/// image format. Defines the format of the resulting image
+/// </param>
+/// <param name="bKeepSelection">Input
+/// true if you want to keep the selection
+/// </param>
+/// <returns>
+/// A byte reader containing the rendered image
+/// </returns>
+MgByteReader* MgProxyRenderingService::RenderMap(
+    MgMap* map,
+    MgSelection* selection,
+    CREFSTRING format,
+    bool bKeepSelection)
+{
     MgCommand cmd;
     cmd.ExecuteCommand(m_connProp,                          // Connection
                         MgCommand::knObject,                // Return type expected
                         MgRenderingServiceOpId::RenderMap1, // Command Code
-                        3,                                  // No of arguments
+                        4,                                  // No of arguments
                         Rendering_Service,                  // Service Id
                         1,                                  // Operation version
                         MgCommand::knObject, map,           // Argument#1
                         MgCommand::knObject, selection,     // Argument#2
                         MgCommand::knString, &format,       // Argument#3
+                        MgCommand::knInt32, bKeepSelection, // Argument#4
                         MgCommand::knNone);                 // End of arguments
 
     SetWarning(cmd.GetWarningObject());
@@ -225,11 +290,57 @@
     MgColor* backgroundColor,
     CREFSTRING format)
 {
+    // Call the updated RenderMap API
+    return RenderMap(map, selection, extents, width, height, backgroundColor, format, true);
+}
+
+
+/////////////////////////////////////////////////////////////////
+/// <summary>
+/// Renders the specified MgMap to the requested image format.
+/// </summary>
+/// <param name="map">Input
+/// map object containing current state of map.
+/// </param>
+/// <param name="selection">Input
+/// map feature selection. Specifies the selected features on the map
+/// </param>
+/// <param name="extents">Input
+/// map extents. Specifies the extents for the map
+/// </param>
+/// <param name="width">Input
+/// image width. Specifies the image width in pixels
+/// </param>
+/// <param name="height">Input
+/// image height. Specifies the image height in pixels
+/// </param>
+/// <param name="backgroundColor">Input
+/// background color. Specifies the map background color
+/// </param>
+/// <param name="format">Input
+/// image format. Defines the format of the resulting image
+/// </param>
+/// <param name="bKeepSelection">Input
+/// true if you want to keep the selection
+/// </param>
+/// <returns>
+/// A byte reader containing the rendered image
+/// </returns>
+MgByteReader* MgProxyRenderingService::RenderMap(
+    MgMap* map,
+    MgSelection* selection,
+    MgEnvelope* extents,
+    INT32 width,
+    INT32 height,
+    MgColor* backgroundColor,
+    CREFSTRING format,
+    bool bKeepSelection)
+{
     MgCommand cmd;
     cmd.ExecuteCommand(m_connProp,                              // Connection
                         MgCommand::knObject,                    // Return type expected
                         MgRenderingServiceOpId::RenderMap2,     // Command Code
-                        7,                                      // No of arguments
+                        8,                                      // No of arguments
                         Rendering_Service,                      // Service Id
                         1,                                      // Operation version
                         MgCommand::knObject, map,               // Argument#1
@@ -239,6 +350,7 @@
                         MgCommand::knInt32, height,             // Argument#5
                         MgCommand::knObject, backgroundColor,   // Argument#6
                         MgCommand::knString, &format,           // Argument#7
+                        MgCommand::knInt32, bKeepSelection,     // Argument#8
                         MgCommand::knNone);                     // End of arguments
 
     SetWarning(cmd.GetWarningObject());
@@ -246,7 +358,6 @@
     return (MgByteReader*)cmd.GetReturnValue().val.m_obj;
 }
 
-
 /////////////////////////////////////////////////////////////////
 /// <summary>
 /// Renders the specified MgMap to the requested image format.
@@ -288,11 +399,60 @@
     MgColor* backgroundColor,
     CREFSTRING format)
 {
+    // Call the updated RenderMap API
+    return RenderMap(map, selection, center, scale, width, height, backgroundColor, format, true);
+}
+
+/////////////////////////////////////////////////////////////////
+/// <summary>
+/// Renders the specified MgMap to the requested image format.
+/// </summary>
+/// <param name="map">Input
+/// map object containing current state of map.
+/// </param>
+/// <param name="selection">Input
+/// map feature selection. Specifies the selected features on the map
+/// </param>
+/// <param name="center">Input
+/// map center point. Specifies the center point for the map
+/// </param>
+/// <param name="scale">Input
+/// map scale. Specifies the scale for the map
+/// </param>
+/// <param name="width">Input
+/// image width. Specifies the image width in pixels
+/// </param>
+/// <param name="height">Input
+/// image height. Specifies the image height in pixels
+/// </param>
+/// <param name="backgroundColor">Input
+/// background color. Specifies the map background color
+/// </param>
+/// <param name="format">Input
+/// image format. Defines the format of the resulting image
+/// </param>
+/// <param name="bKeepSelection">Input
+/// true if you want to keep the selection
+/// </param>
+/// <returns>
+/// A byte reader containing the rendered image
+/// </returns>
+MgByteReader* MgProxyRenderingService::RenderMap(
+    MgMap* map,
+    MgSelection* selection,
+    MgCoordinate* center,
+    double scale,
+    INT32 width,
+    INT32 height,
+    MgColor* backgroundColor,
+    CREFSTRING format,
+    bool bKeepSelection)
+{
     MgCommand cmd;
     cmd.ExecuteCommand(m_connProp,                              // Connection
                         MgCommand::knObject,                    // Return type expected
                         MgRenderingServiceOpId::RenderMap3,     // Command Code
-                        8,                                      // No of arguments
+                        9,                                      // No of arguments
                         Rendering_Service,                      // Service Id
                         1,                                      // Operation version
                         MgCommand::knObject, map,               // Argument#1
@@ -303,6 +463,7 @@
                         MgCommand::knInt32, height,             // Argument#6
                         MgCommand::knObject, backgroundColor,   // Argument#7
                         MgCommand::knString, &format,           // Argument#8
+                        MgCommand::knInt32, bKeepSelection,     // Argument#9
                         MgCommand::knNone);                     // End of arguments
 
     SetWarning(cmd.GetWarningObject());
@@ -310,7 +471,6 @@
     return (MgByteReader*)cmd.GetReturnValue().val.m_obj;
 }
 
-
 /////////////////////////////////////////////////////////////////
 /// <summary>
 /// Renders the legend for the specified MgMap to the requested size and format
@@ -394,11 +554,53 @@
     INT32 selectionVariant, // Within, Touching, Topmost
     INT32 maxFeatures)
 {
+    // Call the updated QueryFeatures API
+    return QueryFeatures(map, layerNames, geometry, selectionVariant, maxFeatures, false);
+}
+
+/////////////////////////////////////////////////////////////////
+/// <summary>
+/// The QueryFeatures operation identifies those features that
+/// meet the specified spatial selection criteria. This operation
+/// is used to implement server-side selection. In addition to
+/// a selection set, this operation returns attribute information
+/// in case only one feature is selected
+/// </summary>
+/// <param name="map">Input
+/// map object containing current state of map.
+/// </param>
+/// <param name="layerName">Input
+/// Active layer name for which to query features
+/// </param>
+/// <param name="geometry">Input
+/// geometry object specifying the selection area
+/// </param>
+/// <param name="selectionVariant">Input
+/// selection criterion - 0=Within, 1=Touching, 2=Topmost
+/// </param>
+/// <param name="maxFeatures">Input
+/// the maximum number of features to return
+/// </param>
+/// <param name="bIgnoreScaleRange">Input
+/// true if you want to ignore scale ranges when querying features
+/// </param>
+/// <returns>
+/// An MgSelection instance identifying the features that meet the
+/// selection criteria. Returns null if no features are identified.
+/// </returns>
+MgFeatureInformation* MgProxyRenderingService::QueryFeatures(
+    MgMap* map,
+    MgStringCollection* layerNames,
+    MgGeometry* geometry,
+    INT32 selectionVariant, // Within, Touching, Topmost
+    INT32 maxFeatures,
+    bool bIgnoreScaleRange)
+{
     MgCommand cmd;
     cmd.ExecuteCommand(m_connProp,                              // Connection
                         MgCommand::knObject,                    // Return type expected
                         MgRenderingServiceOpId::QueryFeatures,  // Command Code
-                        5,                                      // No of arguments
+                        6,                                      // No of arguments
                         Rendering_Service,                      // Service Id
                         1,                                      // Operation version
                         MgCommand::knObject, map,               // Argument#1
@@ -406,6 +608,7 @@
                         MgCommand::knObject, geometry,          // Argument#3
                         MgCommand::knInt32, selectionVariant,   // Argument#4
                         MgCommand::knInt32, maxFeatures,        // Argument#5
+                        MgCommand::knInt32, bIgnoreScaleRange,  // Argument#6
                         MgCommand::knNone);                     // End of arguments
 
     SetWarning(cmd.GetWarningObject());
@@ -447,11 +650,54 @@
     INT32 selectionVariant, 
     INT32 maxFeatures)
 {
+    // Call the updated QueryFeatureProperties API
+    return QueryFeatureProperties(map, layerNames, geometry, selectionVariant, maxFeatures, false);
+}
+
+
+/////////////////////////////////////////////////////////////////
+/// <summary>
+/// The QueryFeatureProeprties operation identifies those features that
+/// meet the specified spatial selection criteria. This operation
+/// is used to implement WMS feature info and returns property values
+/// for all features which match the spatial query
+/// </summary>
+/// <param name="map">Input
+/// map object containing current state of map.
+/// </param>
+/// <param name="layerName">Input
+/// Active layer name for which to query features
+/// </param>
+/// <param name="geometry">Input
+/// geometry object specifying the selection area
+/// </param>
+/// <param name="selectionVariant">Input
+/// selection criterion - 0=Within, 1=Touching, 2=Topmost
+/// </param>
+/// <param name="maxFeatures">Input
+/// the maximum number of features to return
+/// </param>
+/// <param name="bIgnoreScaleRange">Input
+/// true if you want to ignore scale ranges when querying feature 
+/// properties
+/// </param>
+/// <returns>
+/// An MgSelection instance identifying the features that meet the
+/// selection criteria. Returns null if no features are identified.
+/// </returns>
+MgBatchPropertyCollection* MgProxyRenderingService::QueryFeatureProperties(
+    MgMap* map,
+    MgStringCollection* layerNames,
+    MgGeometry* geometry,
+    INT32 selectionVariant, 
+    INT32 maxFeatures,
+    bool bIgnoreScaleRange)
+{
     MgCommand cmd;
     cmd.ExecuteCommand(m_connProp,                              // Connection
                         MgCommand::knObject,                    // Return type expected
                         MgRenderingServiceOpId::QueryFeatureProperties,  // Command Code
-                        5,                                      // No of arguments
+                        6,                                      // No of arguments
                         Rendering_Service,                      // Service Id
                         1,                                      // Operation version
                         MgCommand::knObject, map,               // Argument#1
@@ -459,6 +705,7 @@
                         MgCommand::knObject, geometry,          // Argument#3
                         MgCommand::knInt32, selectionVariant,   // Argument#4
                         MgCommand::knInt32, maxFeatures,        // Argument#5
+                        MgCommand::knInt32, bIgnoreScaleRange,  // Argument#6
                         MgCommand::knNone);                     // End of arguments
 
     SetWarning(cmd.GetWarningObject());

Modified: trunk/MgDev/Common/MapGuideCommon/Services/ProxyRenderingService.h
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Services/ProxyRenderingService.h	2007-03-02 21:54:12 UTC (rev 1149)
+++ trunk/MgDev/Common/MapGuideCommon/Services/ProxyRenderingService.h	2007-03-05 18:39:44 UTC (rev 1150)
@@ -83,6 +83,35 @@
 
     /////////////////////////////////////////////////////////////////
     /// \brief
+    /// Renders all dynamic layers in the specified MgMap to a dynamic overlay image
+    /// with a transparent background. The center, scale, size, and layers to be
+    /// rendered are defined by the specified map instance.  The format parameter
+    /// must be set to an image format that supports transparency.
+    ///
+    /// \param map
+    /// Input
+    /// map object containing current state of map.
+    /// \param selection
+    /// Input
+    /// map feature selection. Specifies the selected features on the map
+    /// \param format
+    /// Input
+    /// image format. Defines the format of the resulting image
+    /// \param bKeepSelection
+    /// Input
+    /// true if you want to keep the selection
+    ///
+    /// \return
+    /// A byte reader containing the rendered image
+    ///
+    virtual MgByteReader* RenderDynamicOverlay(
+        MgMap* map,
+        MgSelection* selection,
+        CREFSTRING format,
+        bool bKeepSelection);
+
+    /////////////////////////////////////////////////////////////////
+    /// \brief
     /// Renders the specified MgMap to the requested image format.
     ///
     /// \param map
@@ -113,6 +142,32 @@
     /// \param selection
     /// Input
     /// map feature selection. Specifies the selected features on the map
+    /// \param format
+    /// Input
+    /// image format. Defines the format of the resulting image
+    /// \param bKeepSelection
+    /// Input
+    /// true if you want to keep the selection
+    ///
+    /// \return
+    /// A byte reader containing the rendered image
+    ///
+    virtual MgByteReader* RenderMap(
+        MgMap* map,
+        MgSelection* selection,
+        CREFSTRING format,
+        bool bKeepSelection);
+
+    /////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Renders the specified MgMap to the requested image format.
+    ///
+    /// \param map
+    /// Input
+    /// map object containing current state of map.
+    /// \param selection
+    /// Input
+    /// map feature selection. Specifies the selected features on the map
     /// \param extents
     /// Input
     /// map extents. Specifies the extents for the map
@@ -151,6 +206,48 @@
     /// \param selection
     /// Input
     /// map feature selection. Specifies the selected features on the map
+    /// \param extents
+    /// Input
+    /// map extents. Specifies the extents for the map
+    /// \param width
+    /// Input
+    /// image width. Specifies the image width in pixels
+    /// \param height
+    /// Input
+    /// image height. Specifies the image height in pixels
+    /// \param backgroundColor
+    /// Input
+    /// background color. Specifies the map background color
+    /// \param format
+    /// Input
+    /// image format. Defines the format of the resulting image
+    /// \param bKeepSelection
+    /// Input
+    /// true if you want to keep the selection
+    ///
+    /// \return
+    /// A byte reader containing the rendered image
+    ///
+    virtual MgByteReader* RenderMap(
+        MgMap* map,
+        MgSelection* selection,
+        MgEnvelope* extents,
+        INT32 width,
+        INT32 height,
+        MgColor* backgroundColor,
+        CREFSTRING format,
+        bool bKeepSelection);
+
+    /////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Renders the specified MgMap to the requested image format.
+    ///
+    /// \param map
+    /// Input
+    /// map object containing current state of map.
+    /// \param selection
+    /// Input
+    /// map feature selection. Specifies the selected features on the map
     /// \param center
     /// Input
     /// map center point. Specifies the center point for the map
@@ -185,6 +282,52 @@
 
     /////////////////////////////////////////////////////////////////
     /// \brief
+    /// Renders the specified MgMap to the requested image format.
+    ///
+    /// \param map
+    /// Input
+    /// map object containing current state of map.
+    /// \param selection
+    /// Input
+    /// map feature selection. Specifies the selected features on the map
+    /// \param center
+    /// Input
+    /// map center point. Specifies the center point for the map
+    /// \param scale
+    /// Input
+    /// map scale. Specifies the scale for the map
+    /// \param width
+    /// Input
+    /// image width. Specifies the image width in pixels
+    /// \param height
+    /// Input
+    /// image height. Specifies the image height in pixels
+    /// \param backgroundColor
+    /// Input
+    /// background color. Specifies the map background color
+    /// \param format
+    /// Input
+    /// image format. Defines the format of the resulting image
+    /// \param bKeepSelection
+    /// Input
+    /// true if you want to keep the selection
+    ///
+    /// \return
+    /// A byte reader containing the rendered image
+    ///
+    virtual MgByteReader* RenderMap(
+        MgMap* map,
+        MgSelection* selection,
+        MgCoordinate* center,
+        double scale,
+        INT32 width,
+        INT32 height,
+        MgColor* backgroundColor,
+        CREFSTRING format,
+        bool bKeepSelection);
+
+    /////////////////////////////////////////////////////////////////
+    /// \brief
     /// Renders the legend for the specified MgMap to the requested size and format
     ///
     /// \param map
@@ -251,6 +394,45 @@
 
     /////////////////////////////////////////////////////////////////
     /// \brief
+    /// The QueryFeatures operation identifies those features that
+    /// meet the specified spatial selection criteria. This operation
+    /// is used to implement server-side selection. In addition to
+    /// a selection set, this operation returns attribute information
+    /// in case only one feature is selected
+    ///
+    /// \param map
+    /// Input
+    /// map object containing current state of map.
+    /// \param layerName
+    /// Input
+    /// Active layer name for which to query features
+    /// \param geometry
+    /// Input
+    /// geometry object specifying the selection area
+    /// \param selectionVariant
+    /// Input
+    /// selection criterion - 0=Within, 1=Touching, 2=Topmost
+    /// \param maxFeatures
+    /// Input
+    /// the maximum number of features to return
+    /// \param bIgnoreScaleRange
+    /// Input
+    /// true if you want to ignore scale ranges when querying features
+    ///
+    /// \return
+    /// An MgSelection instance identifying the features that meet the
+    /// selection criteria. Returns null if no features are identified.
+    ///
+    virtual MgFeatureInformation* QueryFeatures(
+        MgMap* map,
+        MgStringCollection* layerNames,
+        MgGeometry* geometry,
+        INT32 selectionVariant, 
+        INT32 maxFeatures,
+        bool bIgnoreScaleRange);
+
+    /////////////////////////////////////////////////////////////////
+    /// \brief
     /// The QueryFeatureProeprties operation identifies those features that
     /// meet the specified spatial selection criteria. This operation
     /// is used to implement WMS feature info and returns property values
@@ -283,6 +465,44 @@
         INT32 selectionVariant, 
         INT32 maxFeatures);
 
+    /////////////////////////////////////////////////////////////////
+    /// \brief
+    /// The QueryFeatureProeprties operation identifies those features that
+    /// meet the specified spatial selection criteria. This operation
+    /// is used to implement WMS feature info and returns property values
+    /// for all features which match the spatial query
+    ///
+    /// \param map
+    /// Input
+    /// map object containing current state of map.
+    /// \param layerName
+    /// Input
+    /// Active layer name for which to query features
+    /// \param geometry
+    /// Input
+    /// geometry object specifying the selection area
+    /// \param selectionVariant
+    /// Input
+    /// selection criterion - 0=Within, 1=Touching, 2=Topmost
+    /// \param maxFeatures
+    /// Input
+    /// the maximum number of features to return
+    /// \param bIgnoreScaleRange
+    /// Input
+    /// true if you want to ignore scale ranges when querying feature 
+    /// properties
+    ///
+    /// \return
+    /// An MgSelection instance identifying the features that meet the
+    /// selection criteria. Returns null if no features are identified.
+    ///
+    virtual MgBatchPropertyCollection* QueryFeatureProperties(
+        MgMap* map,
+        MgStringCollection* layerNames,
+        MgGeometry* geometry,
+        INT32 selectionVariant, 
+        INT32 maxFeatures,
+        bool bIgnoreScaleRange);
 
 INTERNAL_API:
 

Modified: trunk/MgDev/Common/MapGuideCommon/Services/RenderingService.h
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Services/RenderingService.h	2007-03-02 21:54:12 UTC (rev 1149)
+++ trunk/MgDev/Common/MapGuideCommon/Services/RenderingService.h	2007-03-05 18:39:44 UTC (rev 1150)
@@ -86,6 +86,35 @@
 
     /////////////////////////////////////////////////////////////////
     /// \brief
+    /// Renders all dynamic layers in the specified MgMap to a dynamic overlay image
+    /// with a transparent background. The center, scale, size, and layers to be
+    /// rendered are defined by the specified map instance.  The format parameter
+    /// must be set to an image format that supports transparency.
+    ///
+    /// \param map
+    /// Input
+    /// map object containing current state of map.
+    /// \param selection
+    /// Input
+    /// map feature selection. Specifies the selected features on the map
+    /// \param format
+    /// Input
+    /// image format. Defines the format of the resulting image
+    /// \param bKeepSelection
+    /// Input
+    /// true if you want to keep the selection
+    ///
+    /// \return
+    /// A byte reader containing the rendered image
+    ///
+    virtual MgByteReader* RenderDynamicOverlay(
+        MgMap* map,
+        MgSelection* selection,
+        CREFSTRING format,
+        bool bKeepSelection) = 0;
+
+    /////////////////////////////////////////////////////////////////
+    /// \brief
     /// Renders the specified MgMap to the requested image format.
     ///
     /// \param map
@@ -116,6 +145,32 @@
     /// \param selection
     /// Input
     /// map feature selection. Specifies the selected features on the map
+    /// \param format
+    /// Input
+    /// image format. Defines the format of the resulting image
+    /// \param bKeepSelection
+    /// Input
+    /// true if you want to keep the selection
+    ///
+    /// \return
+    /// A byte reader containing the rendered image
+    ///
+    virtual MgByteReader* RenderMap(
+        MgMap* map,
+        MgSelection* selection,
+        CREFSTRING format,
+        bool bKeepSelection) = 0;
+
+    /////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Renders the specified MgMap to the requested image format.
+    ///
+    /// \param map
+    /// Input
+    /// map object containing current state of map.
+    /// \param selection
+    /// Input
+    /// map feature selection. Specifies the selected features on the map
     /// \param extents
     /// Input
     /// map extents. Specifies the extents for the map
@@ -154,6 +209,48 @@
     /// \param selection
     /// Input
     /// map feature selection. Specifies the selected features on the map
+    /// \param extents
+    /// Input
+    /// map extents. Specifies the extents for the map
+    /// \param width
+    /// Input
+    /// image width. Specifies the image width in pixels
+    /// \param height
+    /// Input
+    /// image height. Specifies the image height in pixels
+    /// \param backgroundColor
+    /// Input
+    /// background color. Specifies the map background color
+    /// \param format
+    /// Input
+    /// image format. Defines the format of the resulting image
+    /// \param bKeepSelection
+    /// Input
+    /// true if you want to keep the selection
+    ///
+    /// \return
+    /// A byte reader containing the rendered image
+    ///
+    virtual MgByteReader* RenderMap(
+        MgMap* map,
+        MgSelection* selection,
+        MgEnvelope* extents,
+        INT32 width,
+        INT32 height,
+        MgColor* backgroundColor,
+        CREFSTRING format,
+        bool bKeepSelection) = 0;
+
+    /////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Renders the specified MgMap to the requested image format.
+    ///
+    /// \param map
+    /// Input
+    /// map object containing current state of map.
+    /// \param selection
+    /// Input
+    /// map feature selection. Specifies the selected features on the map
     /// \param center
     /// Input
     /// map center point. Specifies the center point for the map
@@ -188,6 +285,52 @@
 
     /////////////////////////////////////////////////////////////////
     /// \brief
+    /// Renders the specified MgMap to the requested image format.
+    ///
+    /// \param map
+    /// Input
+    /// map object containing current state of map.
+    /// \param selection
+    /// Input
+    /// map feature selection. Specifies the selected features on the map
+    /// \param center
+    /// Input
+    /// map center point. Specifies the center point for the map
+    /// \param scale
+    /// Input
+    /// map scale. Specifies the scale for the map
+    /// \param width
+    /// Input
+    /// image width. Specifies the image width in pixels
+    /// \param height
+    /// Input
+    /// image height. Specifies the image height in pixels
+    /// \param backgroundColor
+    /// Input
+    /// background color. Specifies the map background color
+    /// \param format
+    /// Input
+    /// image format. Defines the format of the resulting image
+    /// \param bKeepSelection
+    /// Input
+    /// true if you want to keep the selection
+    ///
+    /// \return
+    /// A byte reader containing the rendered image
+    ///
+    virtual MgByteReader* RenderMap(
+        MgMap* map,
+        MgSelection* selection,
+        MgCoordinate* center,
+        double scale,
+        INT32 width,
+        INT32 height,
+        MgColor* backgroundColor,
+        CREFSTRING format,
+        bool bKeepSelection) = 0;
+
+    /////////////////////////////////////////////////////////////////
+    /// \brief
     /// Renders the legend for the specified MgMap to the requested size and format
     ///
     /// \param map
@@ -254,6 +397,45 @@
 
     /////////////////////////////////////////////////////////////////
     /// \brief
+    /// The QueryFeatures operation identifies those features that
+    /// meet the specified spatial selection criteria. This operation
+    /// is used to implement server-side selection. In addition to
+    /// a selection set, this operation returns attribute information
+    /// in case only one feature is selected
+    ///
+    /// \param map
+    /// Input
+    /// map object containing current state of map.
+    /// \param layerNames
+    /// Input
+    /// Active layer names for which to query features
+    /// \param geometry
+    /// Input
+    /// geometry object specifying the selection area
+    /// \param selectionVariant
+    /// Input
+    /// selection criterion - 0=Within, 1=Touching, 2=Topmost
+    /// \param maxFeatures
+    /// Input
+    /// the maximum number of features to return
+    /// \param bIgnoreScaleRange
+    /// Input
+    /// true if you want to ignore scale ranges when querying features
+    ///
+    /// \return
+    /// An MgSelection instance identifying the features that meet the
+    /// selection criteria. Returns null if no features are identified.
+    ///
+    virtual MgFeatureInformation* QueryFeatures(
+        MgMap* map,
+        MgStringCollection* layerNames,
+        MgGeometry* geometry,
+        INT32 selectionVariant, 
+        INT32 maxFeatures,
+        bool bIgnoreScaleRange) = 0;
+
+    /////////////////////////////////////////////////////////////////
+    /// \brief
     /// The QueryFeatureProeprties operation identifies those features that
     /// meet the specified spatial selection criteria. This operation
     /// is used to implement WMS feature info and returns property values
@@ -286,6 +468,44 @@
         INT32 selectionVariant, 
         INT32 maxFeatures) = 0;
 
+    /////////////////////////////////////////////////////////////////
+    /// \brief
+    /// The QueryFeatureProeprties operation identifies those features that
+    /// meet the specified spatial selection criteria. This operation
+    /// is used to implement WMS feature info and returns property values
+    /// for all features which match the spatial query
+    ///
+    /// \param map
+    /// Input
+    /// map object containing current state of map.
+    /// \param layerName
+    /// Input
+    /// Active layer name for which to query features
+    /// \param geometry
+    /// Input
+    /// geometry object specifying the selection area
+    /// \param selectionVariant
+    /// Input
+    /// selection criterion - 0=Within, 1=Touching, 2=Topmost
+    /// \param maxFeatures
+    /// Input
+    /// the maximum number of features to return
+    /// \param bIgnoreScaleRange
+    /// Input
+    /// true if you want to ignore scale ranges when querying feature 
+    /// properties
+    ///
+    /// \return
+    /// An MgSelection instance identifying the features that meet the
+    /// selection criteria. Returns null if no features are identified.
+    ///
+    virtual MgBatchPropertyCollection* QueryFeatureProperties(
+        MgMap* map,
+        MgStringCollection* layerNames,
+        MgGeometry* geometry,
+        INT32 selectionVariant, 
+        INT32 maxFeatures,
+        bool bIgnoreScaleRange) = 0;
 
 INTERNAL_API:
 

Modified: trunk/MgDev/Server/src/Services/Mapping/StylizationUtil.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Mapping/StylizationUtil.cpp	2007-03-02 21:54:12 UTC (rev 1149)
+++ trunk/MgDev/Server/src/Services/Mapping/StylizationUtil.cpp	2007-03-05 18:39:44 UTC (rev 1150)
@@ -442,11 +442,12 @@
                                       MgCoordinateSystem* dstCs,
                                       bool expandExtents,
                                       bool checkRefreshFlag,
-                                      double scale)
+                                      double scale,
+                                      bool selection)
 {
     #ifdef _DEBUG
     long dwStart = GetTickCount();
-    printf("\nStylizeLayers() **MAPSTART** Layers: %d\n", layers->GetCount());
+    printf("\nStylizeLayers() **MAPSTART** Layers:%d  Scale:%f\n", layers->GetCount(), scale);
     #endif
 
     // Cache coordinate system transforms for the life of the
@@ -462,11 +463,11 @@
         Ptr<MgLayerBase> mapLayer = layers->GetItem(i);
 
         #ifdef _DEBUG
-        printf("  StylizeLayers() **LAYERSTART** Layer: %d - %S\n", i, (mapLayer->GetName()).c_str());
+        printf("  StylizeLayers() **LAYERSTART** Name:%S  VAS:%S\n", (mapLayer->GetName()).c_str(), mapLayer->IsVisibleAtScale(scale) ? L"True" : L"False");
         #endif
 
         //don't send data if layer is not currently visible
-        if (!mapLayer->IsVisibleAtScale(scale))
+        if ((!selection) && (!mapLayer->IsVisible()))
             continue;
 
         //don't send data if the refresh flag is not set
@@ -520,11 +521,31 @@
                 long dwLayerStart = GetTickCount();
                 #endif
 
+                // Modify the layer scale range to also support infinite
+                // Need to apply default style as one will not be defined
+                if(selection)
+                {
+                    MdfModel::VectorScaleRangeCollection* scaleRanges = vl->GetScaleRanges();
+                    if(scaleRanges)
+                    {
+                        MdfModel::VectorScaleRange* scaleRange = scaleRanges->GetAt(0);
+                        if(scaleRange)
+                        {
+                            scaleRange->SetMinScale(0.0);
+                            scaleRange->SetMaxScale(MdfModel::VectorScaleRange::MAX_MAP_SCALE);
+                        }
+                    }
+                }
+
                 // make sure we have a valid scale range
                 MdfModel::VectorScaleRange* scaleRange = Stylizer::FindScaleRange(*vl->GetScaleRanges(), scale);
 
                 if (scaleRange)
                 {
+                    #ifdef _DEBUG
+                    printf("  StylizeLayers() **Stylizing** Name:%S\n", (mapLayer->GetName()).c_str());
+                    #endif
+
                     // get feature source id
                     STRING sfeatResId = vl->GetResourceID();
                     Ptr<MgResourceIdentifier> featResId = new MgResourceIdentifier(sfeatResId);
@@ -820,10 +841,15 @@
                         }
                     }
                 }
+                else
+                {
+                    #ifdef _DEBUG
+                    printf("  StylizeLayers() **NOT Stylizing - NO SCALE RANGE** Name:%S\n", (mapLayer->GetName()).c_str());
+                    #endif
+                }
 
-
                 #ifdef _DEBUG
-                printf("  StylizeLayers() **LAYEREND** Vector layer time = %6.4f (s)\n\n", (GetTickCount()-dwLayerStart)/1000.0);
+                printf("  StylizeLayers() **LAYEREND** -Vector- Name:%S  Time:%6.4f (s)\n\n", (mapLayer->GetName()).c_str(), (GetTickCount()-dwLayerStart)/1000.0);
                 #endif
             }
             else if (gl)
@@ -1012,7 +1038,7 @@
                 }
 
                 #ifdef _DEBUG
-                printf("  StylizeLayers() **LAYEREND** Grid layer time = %6.4f (s)\n\n", (GetTickCount()-dwLayerStart)/1000.0);
+                printf("  StylizeLayers() **LAYEREND** -Grid- Name:%S  Time:%6.4f (s)\n\n", (mapLayer->GetName()).c_str(), (GetTickCount()-dwLayerStart)/1000.0);
                 #endif
             }
             else if (dl) //drawing layer
@@ -1071,7 +1097,7 @@
                 }
 
                 #ifdef _DEBUG
-                printf("  StylizeLayers() **LAYEREND** Drawing layer time = %6.4f (s)\n\n", (GetTickCount()-dwLayerStart)/1000.0);
+                printf("  StylizeLayers() **LAYEREND** -Drawing- Name:%S  Time = %6.4f (s)\n\n", (mapLayer->GetName()).c_str(), (GetTickCount()-dwLayerStart)/1000.0);
                 #endif
             }
 
@@ -1120,7 +1146,7 @@
     }
 
     #ifdef _DEBUG
-    printf("StylizeLayers() **MAPDONE** Layers: %d  Total Time = %6.4f (s)\n\n", layers->GetCount(), (GetTickCount()-dwStart)/1000.0);
+    printf("StylizeLayers() **MAPDONE** Layers:%d  Total Time:%6.4f (s)\n\n", layers->GetCount(), (GetTickCount()-dwStart)/1000.0);
     #endif
 
     TransformCacheMap::iterator iter = transformCache.begin();

Modified: trunk/MgDev/Server/src/Services/Mapping/StylizationUtil.h
===================================================================
--- trunk/MgDev/Server/src/Services/Mapping/StylizationUtil.h	2007-03-02 21:54:12 UTC (rev 1149)
+++ trunk/MgDev/Server/src/Services/Mapping/StylizationUtil.h	2007-03-05 18:39:44 UTC (rev 1150)
@@ -74,7 +74,8 @@
                               MgCoordinateSystem* dstCs,
                               bool expandExtents,
                               bool checkRefreshFlag,
-                              double scale);
+                              double scale,
+                              bool selection = false);
 
     static MgFeatureReader * ExecuteFeatureQuery(MgFeatureService* svcFeature,
                                                  RS_Bounds& extent,

Modified: trunk/MgDev/Server/src/Services/Rendering/OpQueryFeatureProperties.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Rendering/OpQueryFeatureProperties.cpp	2007-03-02 21:54:12 UTC (rev 1149)
+++ trunk/MgDev/Server/src/Services/Rendering/OpQueryFeatureProperties.cpp	2007-03-05 18:39:44 UTC (rev 1150)
@@ -32,12 +32,7 @@
 void MgOpQueryFeatureProperties::Execute()
 {
     ACE_DEBUG((LM_DEBUG, ACE_TEXT("  (%t) MgOpQueryFeatureProperties::Execute()\n")));
-    
 
-
-
-
-
     MG_LOG_OPERATION_MESSAGE(L"QueryFeatures");
 
     MG_TRY()
@@ -46,7 +41,7 @@
 
     ACE_ASSERT(m_stream != NULL);
 
-    if (5 == m_packet.m_NumArguments)
+    if (6 == m_packet.m_NumArguments)
     {
         Ptr<MgMap> map = (MgMap*)m_stream->GetObject();
         map->SetDelayedLoadResourceService(m_resourceService);
@@ -60,6 +55,9 @@
         INT32 maxFeatures = 0;
         m_stream->GetInt32(maxFeatures);
 
+        INT32 bIgnoreScale = 0;
+        m_stream->GetInt32(bIgnoreScale);
+
         BeginExecution();
 
         MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
@@ -69,17 +67,18 @@
         MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
         MG_LOG_OPERATION_MESSAGE_ADD_STRING(L"MgGeometry");
         MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
-        MG_LOG_OPERATION_MESSAGE_ADD_STRING(L"selectionVariant");
+        MG_LOG_OPERATION_MESSAGE_ADD_INT32(selectionVariant);
         MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
-        MG_LOG_OPERATION_MESSAGE_ADD_STRING(L"maxFeatures");
+        MG_LOG_OPERATION_MESSAGE_ADD_INT32(maxFeatures);
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_BOOL(bIgnoreScale);
         MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
 
         Validate();
 
         Ptr<MgBatchPropertyCollection> info =
-            m_service->QueryFeatureProperties(map, layerNames, geom, selectionVariant, maxFeatures);
+            m_service->QueryFeatureProperties(map, layerNames, geom, selectionVariant, maxFeatures, bIgnoreScale);
 
-        
         EndExecution(info);
     }
     else
@@ -101,8 +100,6 @@
 
     if (mgException != NULL)
     {
-
-
         // Failed operation
         MG_LOG_OPERATION_MESSAGE_ADD_STRING(MgResources::Failure.c_str());
     }

Modified: trunk/MgDev/Server/src/Services/Rendering/OpQueryFeatures.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Rendering/OpQueryFeatures.cpp	2007-03-02 21:54:12 UTC (rev 1149)
+++ trunk/MgDev/Server/src/Services/Rendering/OpQueryFeatures.cpp	2007-03-05 18:39:44 UTC (rev 1150)
@@ -32,12 +32,7 @@
 void MgOpQueryFeatures::Execute()
 {
     ACE_DEBUG((LM_DEBUG, ACE_TEXT("  (%t) MgOpQueryFeatures::Execute()\n")));
-    
 
-
-
-
-
     MG_LOG_OPERATION_MESSAGE(L"QueryFeatures");
 
     MG_TRY()
@@ -46,7 +41,7 @@
 
     ACE_ASSERT(m_stream != NULL);
 
-    if (5 == m_packet.m_NumArguments)
+    if (6 == m_packet.m_NumArguments)
     {
         Ptr<MgMap> map = (MgMap*)m_stream->GetObject();
         map->SetDelayedLoadResourceService(m_resourceService);
@@ -60,6 +55,9 @@
         INT32 maxFeatures = 0;
         m_stream->GetInt32(maxFeatures);
 
+        INT32 bIgnoreScale = 0;
+        m_stream->GetInt32(bIgnoreScale);
+
         BeginExecution();
 
         MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
@@ -69,17 +67,18 @@
         MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
         MG_LOG_OPERATION_MESSAGE_ADD_STRING(L"MgGeometry");
         MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
-        MG_LOG_OPERATION_MESSAGE_ADD_STRING(L"selectionVariant");
+        MG_LOG_OPERATION_MESSAGE_ADD_INT32(selectionVariant);
         MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
-        MG_LOG_OPERATION_MESSAGE_ADD_STRING(L"maxFeatures");
+        MG_LOG_OPERATION_MESSAGE_ADD_INT32(maxFeatures);
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_BOOL(bIgnoreScale);
         MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
 
         Validate();
 
         Ptr<MgFeatureInformation> info =
-            m_service->QueryFeatures(map, layerNames, geom, selectionVariant, maxFeatures);
+            m_service->QueryFeatures(map, layerNames, geom, selectionVariant, maxFeatures, bIgnoreScale);
 
-        
         EndExecution(info);
     }
     else
@@ -101,8 +100,6 @@
 
     if (mgException != NULL)
     {
-
-
         // Failed operation
         MG_LOG_OPERATION_MESSAGE_ADD_STRING(MgResources::Failure.c_str());
     }

Modified: trunk/MgDev/Server/src/Services/Rendering/OpRenderDynamicOverlay.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Rendering/OpRenderDynamicOverlay.cpp	2007-03-02 21:54:12 UTC (rev 1149)
+++ trunk/MgDev/Server/src/Services/Rendering/OpRenderDynamicOverlay.cpp	2007-03-05 18:39:44 UTC (rev 1150)
@@ -33,11 +33,6 @@
 {
     ACE_DEBUG((LM_DEBUG, ACE_TEXT("  (%t) MgOpRenderDynamicOverlay::Execute()\n")));
     
-
-
-
-
-
     MG_LOG_OPERATION_MESSAGE(L"RenderDynamicOverlay");
 
     MG_TRY()
@@ -46,7 +41,7 @@
 
     ACE_ASSERT(m_stream != NULL);
 
-    if (3 == m_packet.m_NumArguments)
+    if (4 == m_packet.m_NumArguments)
     {
         Ptr<MgMap> map = (MgMap*)m_stream->GetObject();
         map->SetDelayedLoadResourceService(m_resourceService);
@@ -58,6 +53,9 @@
         STRING format;
         m_stream->GetString(format);
 
+        INT32 bKeepSelection = 0;
+        m_stream->GetInt32(bKeepSelection);
+
         BeginExecution();
 
         MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
@@ -66,14 +64,15 @@
         MG_LOG_OPERATION_MESSAGE_ADD_STRING(L"MgSelection");
         MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
         MG_LOG_OPERATION_MESSAGE_ADD_STRING(format.c_str());
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_BOOL(bKeepSelection);
         MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
 
         Validate();
 
         Ptr<MgByteReader> byteReader =
-            m_service->RenderDynamicOverlay(map, selection, format);
+            m_service->RenderDynamicOverlay(map, selection, format, bKeepSelection);
 
-        
         EndExecution(byteReader);
     }
     else
@@ -95,8 +94,6 @@
 
     if (mgException != NULL)
     {
-
-
         // Failed operation
         MG_LOG_OPERATION_MESSAGE_ADD_STRING(MgResources::Failure.c_str());
     }

Modified: trunk/MgDev/Server/src/Services/Rendering/OpRenderMap.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Rendering/OpRenderMap.cpp	2007-03-02 21:54:12 UTC (rev 1149)
+++ trunk/MgDev/Server/src/Services/Rendering/OpRenderMap.cpp	2007-03-05 18:39:44 UTC (rev 1150)
@@ -33,11 +33,6 @@
 {
     ACE_DEBUG((LM_DEBUG, ACE_TEXT("  (%t) MgOpRenderMap::Execute()\n")));
     
-
-
-
-
-
     MG_LOG_OPERATION_MESSAGE(L"RenderMap");
 
     MG_TRY()
@@ -46,7 +41,7 @@
 
     ACE_ASSERT(m_stream != NULL);
 
-    if (3 == m_packet.m_NumArguments)
+    if (4 == m_packet.m_NumArguments)
     {
         Ptr<MgMap> map = (MgMap*)m_stream->GetObject();
         map->SetDelayedLoadResourceService(m_resourceService);
@@ -58,6 +53,9 @@
         STRING format;
         m_stream->GetString(format);
 
+        INT32 bKeepSelection = 0;
+        m_stream->GetInt32(bKeepSelection);
+
         BeginExecution();
 
         MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
@@ -66,17 +64,18 @@
         MG_LOG_OPERATION_MESSAGE_ADD_STRING(L"MgSelection");
         MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
         MG_LOG_OPERATION_MESSAGE_ADD_STRING(format.c_str());
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_BOOL(bKeepSelection);
         MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
 
         Validate();
 
         Ptr<MgByteReader> byteReader =
-            m_service->RenderMap(map, selection, format);
+            m_service->RenderMap(map, selection, format, bKeepSelection);
 
-        
         EndExecution(byteReader);
     }
-    else if (7 == m_packet.m_NumArguments)
+    else if (8 == m_packet.m_NumArguments)
     {
         Ptr<MgMap> map = (MgMap*)m_stream->GetObject();
         map->SetDelayedLoadResourceService(m_resourceService);
@@ -98,6 +97,9 @@
         STRING format;
         m_stream->GetString(format);
 
+        INT32 bKeepSelection = 0;
+        m_stream->GetInt32(bKeepSelection);
+
         BeginExecution();
 
         MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
@@ -107,24 +109,25 @@
         MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
         MG_LOG_OPERATION_MESSAGE_ADD_STRING(L"MgEnvelope");
         MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
-        MG_LOG_OPERATION_MESSAGE_ADD_STRING(L"width");
+        MG_LOG_OPERATION_MESSAGE_ADD_INT32(width);
         MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
-        MG_LOG_OPERATION_MESSAGE_ADD_STRING(L"height");
+        MG_LOG_OPERATION_MESSAGE_ADD_INT32(height);
         MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
         MG_LOG_OPERATION_MESSAGE_ADD_STRING(L"MgColor");
         MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
         MG_LOG_OPERATION_MESSAGE_ADD_STRING(format.c_str());
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_BOOL(bKeepSelection);
         MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
 
         Validate();
 
         Ptr<MgByteReader> byteReader =
-            m_service->RenderMap(map, selection, extents, width, height, color, format);
+            m_service->RenderMap(map, selection, extents, width, height, color, format, bKeepSelection);
 
-        
         EndExecution(byteReader);
     }
-    else if (8 == m_packet.m_NumArguments)
+    else if (9 == m_packet.m_NumArguments)
     {
         Ptr<MgMap> map = (MgMap*)m_stream->GetObject();
         map->SetDelayedLoadResourceService(m_resourceService);
@@ -149,6 +152,9 @@
         STRING format;
         m_stream->GetString(format);
 
+        INT32 bKeepSelection = 0;
+        m_stream->GetInt32(bKeepSelection);
+
         BeginExecution();
 
         MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
@@ -158,23 +164,24 @@
         MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
         MG_LOG_OPERATION_MESSAGE_ADD_STRING(L"MgCoordinate");
         MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
-        MG_LOG_OPERATION_MESSAGE_ADD_STRING(L"scale");
+        MG_LOG_OPERATION_MESSAGE_ADD_DOUBLE(scale);
         MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
-        MG_LOG_OPERATION_MESSAGE_ADD_STRING(L"width");
+        MG_LOG_OPERATION_MESSAGE_ADD_INT32(width);
         MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
-        MG_LOG_OPERATION_MESSAGE_ADD_STRING(L"height");
+        MG_LOG_OPERATION_MESSAGE_ADD_INT32(height);
         MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
         MG_LOG_OPERATION_MESSAGE_ADD_STRING(L"MgColor");
         MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
         MG_LOG_OPERATION_MESSAGE_ADD_STRING(format.c_str());
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_BOOL(bKeepSelection);
         MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
 
         Validate();
 
         Ptr<MgByteReader> byteReader =
-            m_service->RenderMap(map, selection, center, scale, width, height, color, format);
+            m_service->RenderMap(map, selection, center, scale, width, height, color, format, bKeepSelection);
 
-        
         EndExecution(byteReader);
     }
     else
@@ -196,8 +203,6 @@
 
     if (mgException != NULL)
     {
-
-
         // Failed operation
         MG_LOG_OPERATION_MESSAGE_ADD_STRING(MgResources::Failure.c_str());
     }

Modified: trunk/MgDev/Server/src/Services/Rendering/ServerRenderingService.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Rendering/ServerRenderingService.cpp	2007-03-02 21:54:12 UTC (rev 1149)
+++ trunk/MgDev/Server/src/Services/Rendering/ServerRenderingService.cpp	2007-03-05 18:39:44 UTC (rev 1150)
@@ -201,7 +201,7 @@
     baseGroup->SetVisible(true);
 
     // call the internal helper API to do all the stylization overhead work
-    ret = RenderMapInternal(map, NULL, roLayers, &dr, width, height, format, scale, extent, true);
+    ret = RenderMapInternal(map, NULL, roLayers, &dr, width, height, format, scale, extent, true, true);
 
     // restore the base group's visibility
     baseGroup->SetVisible(groupVisible);
@@ -216,6 +216,15 @@
                                                              MgSelection* selection,
                                                              CREFSTRING format)
 {
+    // Call updated RenderDynamicOverlay API
+    return RenderDynamicOverlay(map, selection, format, true);
+}
+
+MgByteReader* MgServerRenderingService::RenderDynamicOverlay(MgMap* map,
+                                                             MgSelection* selection,
+                                                             CREFSTRING format,
+                                                             bool bKeepSelection)
+{
     Ptr<MgByteReader> ret;
 
     MG_TRY()
@@ -268,7 +277,7 @@
     }
 
     // call the internal helper API to do all the stylization overhead work
-    ret = RenderMapInternal(map, selection, roLayers, &dr, width, height, format, scale, extent, false);
+    ret = RenderMapInternal(map, selection, roLayers, &dr, width, height, format, scale, extent, false, bKeepSelection);
 
     MG_CATCH_AND_THROW(L"MgServerRenderingService.RenderDynamicOverlay")
 
@@ -280,6 +289,15 @@
                                                   MgSelection* selection,
                                                   CREFSTRING format)
 {
+    // Call updated RenderMap API
+    return RenderMap(map, selection, format, true);
+}
+
+MgByteReader* MgServerRenderingService::RenderMap(MgMap* map,
+                                                  MgSelection* selection,
+                                                  CREFSTRING format,
+                                                  bool bKeepSelection)
+{
     Ptr<MgByteReader> ret;
 
     MG_TRY()
@@ -297,7 +315,7 @@
     Ptr<MgColor> bgColor = new MgColor(col.red(), col.green(), col.blue(), col.alpha());
 
     // punt to more specific RenderMap API
-    ret = RenderMap(map, selection, center, scale, map->GetDisplayWidth(), map->GetDisplayHeight(), bgColor, format);
+    ret = RenderMap(map, selection, center, scale, map->GetDisplayWidth(), map->GetDisplayHeight(), bgColor, format, bKeepSelection);
 
     MG_CATCH_AND_THROW(L"MgServerRenderingService.RenderMap")
 
@@ -313,6 +331,19 @@
                                                   MgColor* backgroundColor,
                                                   CREFSTRING format)
 {
+    // Call updated RenderMap API
+    return RenderMap(map, selection, extents, width, height, backgroundColor, format, true);
+}
+
+MgByteReader* MgServerRenderingService::RenderMap(MgMap* map,
+                                                  MgSelection* selection,
+                                                  MgEnvelope* extents,
+                                                  INT32 width,
+                                                  INT32 height,
+                                                  MgColor* backgroundColor,
+                                                  CREFSTRING format,
+                                                  bool bKeepSelection)
+{
     Ptr<MgByteReader> ret;
 
     MG_TRY()
@@ -390,7 +421,7 @@
     GDRenderer dr(drawWidth, drawHeight, bgcolor, false);
 
     // call the internal helper API to do all the stylization overhead work
-    ret = RenderMapInternal(map, selection, NULL, &dr, width, height, format, scale, b, false);
+    ret = RenderMapInternal(map, selection, NULL, &dr, width, height, format, scale, b, false, bKeepSelection);
 
     MG_CATCH_AND_THROW(L"MgServerRenderingService.RenderMap")
 
@@ -407,6 +438,20 @@
                                                   MgColor* backgroundColor,
                                                   CREFSTRING format)
 {
+    // Call updated RenderMap API
+    return RenderMap(map, selection, center, scale, width, height, backgroundColor, format, true);
+}
+
+MgByteReader* MgServerRenderingService::RenderMap(MgMap* map,
+                                                  MgSelection* selection,
+                                                  MgCoordinate* center,
+                                                  double scale,
+                                                  INT32 width,
+                                                  INT32 height,
+                                                  MgColor* backgroundColor,
+                                                  CREFSTRING format,
+                                                  bool bKeepSelection)
+{
     Ptr<MgByteReader> ret;
 
     MG_TRY()
@@ -444,7 +489,7 @@
     GDRenderer dr(width, height, bgcolor, false);
 
     // call the internal helper API to do all the stylization overhead work
-    ret = RenderMapInternal(map, selection, NULL, &dr, width, height, format, scale, b, false);
+    ret = RenderMapInternal(map, selection, NULL, &dr, width, height, format, scale, b, false, bKeepSelection);
 
     MG_CATCH_AND_THROW(L"MgServerRenderingService.RenderMap")
 
@@ -459,6 +504,18 @@
                                                               INT32       selectionVariant, // Within, Touching, Topmost
                                                               INT32       maxFeatures)
 {
+    // Call updated QueryFeatures API
+    return QueryFeatures(map, layerNames, geometry, selectionVariant, maxFeatures, false);
+}
+
+
+MgFeatureInformation* MgServerRenderingService::QueryFeatures(MgMap*      map,
+                                                              MgStringCollection* layerNames,
+                                                              MgGeometry* geometry,
+                                                              INT32       selectionVariant, // Within, Touching, Topmost
+                                                              INT32       maxFeatures,
+                                                              bool bIgnoreScaleRange)
+{
     Ptr<MgFeatureInformation> ret;
 
     MG_TRY()
@@ -472,7 +529,7 @@
     Ptr<MgSelection> sel = new MgSelection(map);
     FeatureInfoRenderer fir(sel, maxFeatures, map->GetViewScale());
 
-    RenderForSelection(map, layerNames, geometry, selectionVariant, maxFeatures, &fir);
+    RenderForSelection(map, layerNames, geometry, selectionVariant, maxFeatures, &fir, bIgnoreScaleRange);
 
     //fill out the output object with the info we collected
     //in the FeatureInfoRenderer for the first feature we hit
@@ -486,6 +543,11 @@
 
     ret->SetSelection(sel);
 
+    #ifdef _DEBUG
+    Ptr<MgReadOnlyLayerCollection> selLayers = sel->GetLayers();
+    ACE_DEBUG((LM_ERROR, ACE_TEXT("MgServerRenderingService::QueryFeatures() Selection Size:%d\n"), selLayers.p ? selLayers->GetCount() : 0));
+    #endif
+
     MG_CATCH_AND_THROW(L"MgServerRenderingService.QueryFeatures")
 
     return ret.Detach();
@@ -498,6 +560,18 @@
                                     INT32 selectionVariant, // Within, Touching, Topmost
                                     INT32 maxFeatures)
 {
+    // Call updated QueryFeatureProperties API
+    return QueryFeatureProperties(map, layerNames, geometry, selectionVariant, maxFeatures, false);
+}
+
+
+MgBatchPropertyCollection* MgServerRenderingService::QueryFeatureProperties( MgMap* map,
+                                    MgStringCollection* layerNames,
+                                    MgGeometry* geometry,
+                                    INT32 selectionVariant, // Within, Touching, Topmost
+                                    INT32 maxFeatures,
+                                    bool bIgnoreScaleRange)
+{
     Ptr<MgBatchPropertyCollection> ret;
 
     MG_TRY()
@@ -509,7 +583,7 @@
     Ptr<MgSelection> sel = NULL;//TODO: do we need this for this API? new MgSelection(map);
     FeaturePropRenderer fpr(sel, maxFeatures, map->GetViewScale());
 
-    RenderForSelection(map, layerNames, geometry, selectionVariant, maxFeatures, &fpr);
+    RenderForSelection(map, layerNames, geometry, selectionVariant, maxFeatures, &fpr, bIgnoreScaleRange);
 
     ret = fpr.GetProperties();
     //ret->SetSelection(sel);
@@ -530,7 +604,8 @@
                                                           CREFSTRING format,
                                                           double scale,
                                                           RS_Bounds& b,
-                                                          bool expandExtents)
+                                                          bool expandExtents,
+                                                          bool bKeepSelection)
 {
     // convert the map coordinate system from srs wkt to a mentor cs structure
     STRING srs = map->GetMapSRS();
@@ -591,6 +666,11 @@
         if (selection)
         {
             Ptr<MgReadOnlyLayerCollection> selLayers = selection->GetLayers();
+
+            #ifdef _DEBUG
+            printf("MgServerRenderingService::RenderMapInternal() - Layers:%d  Selection Layers:%d\n", tempLayers.p ? tempLayers->GetCount() : 0, selLayers.p ? selLayers->GetCount() : 0);
+            #endif
+
             if (selLayers.p && selLayers->GetCount() > 0)
             {
                 // tell the renderer to override draw styles with the ones
@@ -612,7 +692,7 @@
                 }
 
                 MgStylizationUtil::StylizeLayers(m_svcResource, m_svcFeature, m_svcDrawing, m_pCSFactory, map,
-                                                 modLayers, overrideFilters, &ds, dr, dstCs, false, false, scale);
+                                                 modLayers, overrideFilters, &ds, dr, dstCs, false, false, scale, bKeepSelection);
             }
         }
 
@@ -756,8 +836,10 @@
                          MgGeometry* geometry,
                          INT32 selectionVariant,
                          INT32 maxFeatures,
-                         FeatureInfoRenderer* selRenderer)
+                         FeatureInfoRenderer* selRenderer,
+                         bool bIgnoreScaleRange)
 {
+    ACE_DEBUG ((LM_DEBUG, ACE_TEXT("RenderForSelection(): ** START **\n")));
     if (NULL == map || NULL == geometry)
         throw new MgNullArgumentException(L"MgServerRenderingService.RenderForSelection", __LINE__, __WFILE__, NULL, L"", NULL);
 
@@ -804,14 +886,24 @@
         //find the layer we need to select features from
         Ptr<MgLayerBase> layer = layers->GetItem(p);
 
+        ACE_DEBUG ((LM_DEBUG, ACE_TEXT("RenderForSelection(): Layer: %W  Selectable:%W  Visible: %W\n"), layer->GetName().c_str(), layer->GetSelectable() ? L"True" : L"False", layer->IsVisibleAtScale(map->GetViewScale()) ? L"True" : L"False"));
+    
         //do we want to select on this layer -- if caller
         //gave us a layer name collection, check if the layer
         //is in there
         if (layerNames && layerNames->GetCount() > 0 && layerNames->IndexOf(layer->GetName()) == -1)
             continue;
 
-        if (!layer->GetSelectable() || !layer->IsVisibleAtScale(map->GetViewScale()))
-            continue;
+        if(bIgnoreScaleRange)
+        {
+            if (!layer->GetSelectable())
+                continue;
+        }
+        else
+        {
+            if (!layer->GetSelectable() || !layer->IsVisibleAtScale(map->GetViewScale()))
+                continue;
+        }
 
         //have we processed enough features already?
         if (maxFeatures <= 0)
@@ -822,9 +914,26 @@
         auto_ptr<MdfModel::LayerDefinition> ldf(MgStylizationUtil::GetLayerDefinition(m_svcResource, layerResId));
         MdfModel::VectorLayerDefinition* vl = dynamic_cast<MdfModel::VectorLayerDefinition*>(ldf.get());
 
-        //we can only do geometric query selectionb for vector layers
+        //we can only do geometric query selection for vector layers
         if (vl)
         {
+            ACE_DEBUG ((LM_DEBUG, ACE_TEXT("RenderForSelection(): Layer: %W  Vector Layer\n"), layer->GetName().c_str()));
+
+            if(bIgnoreScaleRange)
+            {
+                // Modify the layer scale range only for layers that are passed in
+                MdfModel::VectorScaleRangeCollection* scaleRanges = vl->GetScaleRanges();
+                if(scaleRanges)
+                {
+                    MdfModel::VectorScaleRange* scaleRange = scaleRanges->GetAt(0);
+                    if(scaleRange)
+                    {
+                        scaleRange->SetMinScale(0.0);
+                        scaleRange->SetMaxScale(MdfModel::VectorScaleRange::MAX_MAP_SCALE);
+                    }
+                }
+            }
+
             Ptr<MgResourceIdentifier> featResId = new MgResourceIdentifier(layer->GetFeatureSourceId());
 
             //get the coordinate system of the layer --> we need this
@@ -1009,6 +1118,7 @@
     }
 
     selRenderer->EndMap();
+    ACE_DEBUG ((LM_DEBUG, ACE_TEXT("RenderForSelection(): ** END **\n")));
 }
 
 void MgServerRenderingService::SetConnectionProperties(MgConnectionProperties*)

Modified: trunk/MgDev/Server/src/Services/Rendering/ServerRenderingService.h
===================================================================
--- trunk/MgDev/Server/src/Services/Rendering/ServerRenderingService.h	2007-03-02 21:54:12 UTC (rev 1149)
+++ trunk/MgDev/Server/src/Services/Rendering/ServerRenderingService.h	2007-03-05 18:39:44 UTC (rev 1150)
@@ -45,12 +45,22 @@
                                                MgSelection* selection,
                                                CREFSTRING format);
 
+    virtual MgByteReader* RenderDynamicOverlay(MgMap* map,
+                                               MgSelection* selection,
+                                               CREFSTRING format,
+                                               bool bKeepSelection);
+
     virtual MgByteReader* RenderMap(MgMap* map,
                                     MgSelection* selection,
                                     CREFSTRING format);
 
     virtual MgByteReader* RenderMap(MgMap* map,
                                     MgSelection* selection,
+                                    CREFSTRING format,
+                                    bool bKeepSelection);
+
+    virtual MgByteReader* RenderMap(MgMap* map,
+                                    MgSelection* selection,
                                     MgEnvelope* extents,
                                     INT32 width,
                                     INT32 height,
@@ -59,6 +69,15 @@
 
     virtual MgByteReader* RenderMap(MgMap* map,
                                     MgSelection* selection,
+                                    MgEnvelope* extents,
+                                    INT32 width,
+                                    INT32 height,
+                                    MgColor* backgroundColor,
+                                    CREFSTRING format,
+                                    bool bKeepSelection);
+
+    virtual MgByteReader* RenderMap(MgMap* map,
+                                    MgSelection* selection,
                                     MgCoordinate* center,
                                     double scale,
                                     INT32 width,
@@ -66,6 +85,16 @@
                                     MgColor* backgroundColor,
                                     CREFSTRING format);
 
+    virtual MgByteReader* RenderMap(MgMap* map,
+                                    MgSelection* selection,
+                                    MgCoordinate* center,
+                                    double scale,
+                                    INT32 width,
+                                    INT32 height,
+                                    MgColor* backgroundColor,
+                                    CREFSTRING format,
+                                    bool bKeepSelection);
+
     virtual MgByteReader* RenderMapLegend(MgMap* map,
                                           INT32 width,
                                           INT32 height,
@@ -78,12 +107,26 @@
                                         INT32 selectionVariant, // Within, Touching, Topmost
                                         INT32 maxFeatures);
 
+    virtual MgFeatureInformation* QueryFeatures( MgMap* map,
+                                        MgStringCollection* layerNames,
+                                        MgGeometry* geometry,
+                                        INT32 selectionVariant, // Within, Touching, Topmost
+                                        INT32 maxFeatures,
+                                        bool bIgnoreScaleRange);
+
     virtual MgBatchPropertyCollection* QueryFeatureProperties( MgMap* map,
                                         MgStringCollection* layerNames,
                                         MgGeometry* geometry,
                                         INT32 selectionVariant, // Within, Touching, Topmost
                                         INT32 maxFeatures);
 
+    virtual MgBatchPropertyCollection* QueryFeatureProperties( MgMap* map,
+                                        MgStringCollection* layerNames,
+                                        MgGeometry* geometry,
+                                        INT32 selectionVariant, // Within, Touching, Topmost
+                                        INT32 maxFeatures,
+                                        bool bIgnoreScaleRange);
+
 private:
 
     // used for tile generation
@@ -109,14 +152,16 @@
                                     CREFSTRING format,
                                     double scale,
                                     RS_Bounds& b,
-                                    bool expandExtents);
+                                    bool expandExtents,
+                                    bool bKeepSelection);
 
     void RenderForSelection(MgMap* map,
                          MgStringCollection* layerNames,
                          MgGeometry* geometry,
                          INT32 selectionVariant, 
                          INT32 maxFeatures,
-                         FeatureInfoRenderer* selRenderer);
+                         FeatureInfoRenderer* selRenderer,
+                         bool bIgnoreScaleRange);
 
     // member data
     Ptr<MgFeatureService> m_svcFeature;

Modified: trunk/MgDev/Web/src/HttpHandler/HttpGetDynamicMapOverlayImage.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpGetDynamicMapOverlayImage.cpp	2007-03-02 21:54:12 UTC (rev 1149)
+++ trunk/MgDev/Web/src/HttpHandler/HttpGetDynamicMapOverlayImage.cpp	2007-03-05 18:39:44 UTC (rev 1150)
@@ -41,6 +41,14 @@
 
     // Get the requested image format
     m_mapFormat = params->GetParameterValue(MgHttpResourceStrings::reqRenderingFormat);
+
+    // Get the keep selection flag
+    m_bKeepSelection = true; // default
+    STRING keepSelection = params->GetParameterValue(MgHttpResourceStrings::reqRenderingKeepSelection);
+    if(!keepSelection.empty())
+    {
+        m_bKeepSelection = (keepSelection.c_str() == L"1");
+    }
 }
 
 /// <summary>
@@ -61,7 +69,7 @@
 
     // Call the HTML controller to render the map image
     MgHtmlController controller(m_siteConn);
-    Ptr<MgByteReader> map = controller.GetDynamicMapOverlayImage(m_mapName, m_mapFormat);
+    Ptr<MgByteReader> map = controller.GetDynamicMapOverlayImage(m_mapName, m_mapFormat, m_bKeepSelection);
 
     // Set the result
     hResult->SetResultObject(map, map->GetMimeType());

Modified: trunk/MgDev/Web/src/HttpHandler/HttpGetDynamicMapOverlayImage.h
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpGetDynamicMapOverlayImage.h	2007-03-02 21:54:12 UTC (rev 1149)
+++ trunk/MgDev/Web/src/HttpHandler/HttpGetDynamicMapOverlayImage.h	2007-03-05 18:39:44 UTC (rev 1150)
@@ -54,6 +54,7 @@
 private:
     STRING  m_mapName;
     STRING  m_mapFormat;
+    bool    m_bKeepSelection;
 };
 
 #endif  // _FS_GET_DYNAMIC_MAP_OVERLAY_IMAGE_H

Modified: trunk/MgDev/Web/src/HttpHandler/HttpGetMapImage.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpGetMapImage.cpp	2007-03-02 21:54:12 UTC (rev 1149)
+++ trunk/MgDev/Web/src/HttpHandler/HttpGetMapImage.cpp	2007-03-05 18:39:44 UTC (rev 1150)
@@ -44,6 +44,14 @@
 
     // Get the requested image format
     m_mapFormat = params->GetParameterValue(MgHttpResourceStrings::reqRenderingFormat);
+
+    // Get the keep selection flag
+    m_bKeepSelection = true; // default
+    STRING keepSelection = params->GetParameterValue(MgHttpResourceStrings::reqRenderingKeepSelection);
+    if(!keepSelection.empty())
+    {
+        m_bKeepSelection = (keepSelection.c_str() == L"1");
+    }
 }
 
 /// <summary>
@@ -95,7 +103,7 @@
 
     // Call the HTML controller to render the map image
     MgHtmlController controller(m_siteConn);
-    Ptr<MgByteReader> reader = controller.GetMapImage(map, selection, m_mapFormat, commands);
+    Ptr<MgByteReader> reader = controller.GetMapImage(map, selection, m_mapFormat, commands, m_bKeepSelection);
 
     // If we opened the map from the repository then save it back to ensure
     // any track changes are removed from the persisted version, since these

Modified: trunk/MgDev/Web/src/HttpHandler/HttpGetMapImage.h
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpGetMapImage.h	2007-03-02 21:54:12 UTC (rev 1149)
+++ trunk/MgDev/Web/src/HttpHandler/HttpGetMapImage.h	2007-03-05 18:39:44 UTC (rev 1150)
@@ -55,6 +55,7 @@
     STRING m_mapName;
     STRING m_mapDefinition;
     STRING m_mapFormat;
+    bool   m_bKeepSelection;
 };
 
 #endif  // _FS_GET_MAP_IMAGE_H

Modified: trunk/MgDev/Web/src/HttpHandler/HttpQueryMapFeatures.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpQueryMapFeatures.cpp	2007-03-02 21:54:12 UTC (rev 1149)
+++ trunk/MgDev/Web/src/HttpHandler/HttpQueryMapFeatures.cpp	2007-03-05 18:39:44 UTC (rev 1150)
@@ -57,6 +57,9 @@
 
     // Flag indicated if the selection should be stored in the session repository
     m_persist = params->GetParameterValue(MgHttpResourceStrings::reqRenderingPersist) == L"1";
+
+    // Get the ignore scale flag
+    m_bIgnoreScale = params->GetParameterValue(MgHttpResourceStrings::reqRenderingIgnoreScale) == L"1";
 }
 
 /// <summary>
@@ -106,7 +109,7 @@
     // Call the HTML controller to process the request
     MgHtmlController controller(m_siteConn);
     Ptr<MgByteReader> featureDescriptionInfo = controller.QueryMapFeatures(
-        m_mapName, layerNames, geometry, selectionVariant, m_maxFeatures, m_persist);
+        m_mapName, layerNames, geometry, selectionVariant, m_maxFeatures, m_persist, m_bIgnoreScale);
 
     // Set the result
     hResult->SetResultObject(featureDescriptionInfo, featureDescriptionInfo->GetMimeType());

Modified: trunk/MgDev/Web/src/HttpHandler/HttpQueryMapFeatures.h
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpQueryMapFeatures.h	2007-03-02 21:54:12 UTC (rev 1149)
+++ trunk/MgDev/Web/src/HttpHandler/HttpQueryMapFeatures.h	2007-03-05 18:39:44 UTC (rev 1150)
@@ -58,6 +58,7 @@
     STRING  m_selectionVariant;
     INT32   m_maxFeatures;
     bool    m_persist;
+    bool    m_bIgnoreScale;
 };
 
 #endif  // _FS_DESCRIBE_MAP_FEATURES_H

Modified: trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.cpp	2007-03-02 21:54:12 UTC (rev 1149)
+++ trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.cpp	2007-03-05 18:39:44 UTC (rev 1150)
@@ -228,6 +228,8 @@
 const STRING MgHttpResourceStrings::reqRenderingTileRow = L"TILEROW";
 const STRING MgHttpResourceStrings::reqRenderingPersist = L"PERSIST";
 const STRING MgHttpResourceStrings::reqRenderingScaleIndex = L"SCALEINDEX";
+const STRING MgHttpResourceStrings::reqRenderingIgnoreScale = L"IGNORESCALE";
+const STRING MgHttpResourceStrings::reqRenderingKeepSelection = L"KEEPSELECTION";
 
 // Rendering Service Operation Requests
 const STRING MgHttpResourceStrings::opGetDynamicMapOverlayImage = L"GETDYNAMICMAPOVERLAYIMAGE";

Modified: trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.h
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.h	2007-03-02 21:54:12 UTC (rev 1149)
+++ trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.h	2007-03-05 18:39:44 UTC (rev 1150)
@@ -167,6 +167,8 @@
     static const STRING reqRenderingTileRow;
     static const STRING reqRenderingPersist;
     static const STRING reqRenderingScaleIndex;
+    static const STRING reqRenderingIgnoreScale;
+    static const STRING reqRenderingKeepSelection;
 
     // PREDEFINED TILE REQUEST PARAMETERS
     static const STRING reqTileMapDefinition;



More information about the mapguide-commits mailing list