[mapguide-commits] r6595 - in trunk/MgDev/Desktop: MapViewer
MapViewer/Properties MapViewer/Resources MapViewer.Desktop
MapViewerTest MgDesktop/Services
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Fri Apr 27 11:17:59 EDT 2012
Author: jng
Date: 2012-04-27 08:17:59 -0700 (Fri, 27 Apr 2012)
New Revision: 6595
Added:
trunk/MgDev/Desktop/MapViewer/MgBufferControl.Designer.cs
trunk/MgDev/Desktop/MapViewer/MgBufferControl.cs
trunk/MgDev/Desktop/MapViewer/MgBufferControl.resx
trunk/MgDev/Desktop/MapViewer/MgLineMeasureControl.Designer.cs
trunk/MgDev/Desktop/MapViewer/MgLineMeasureControl.cs
trunk/MgDev/Desktop/MapViewer/MgLineMeasureControl.resx
trunk/MgDev/Desktop/MapViewer/Resources/AreaLayerDef.txt
Modified:
trunk/MgDev/Desktop/MapViewer.Desktop/MgDesktopMapViewerProvider.cs
trunk/MgDev/Desktop/MapViewer/IMapViewer.cs
trunk/MgDev/Desktop/MapViewer/MapViewer.Net40.csproj
trunk/MgDev/Desktop/MapViewer/MapViewer.csproj
trunk/MgDev/Desktop/MapViewer/MgMapViewer.cs
trunk/MgDev/Desktop/MapViewer/MgMapViewerProvider.cs
trunk/MgDev/Desktop/MapViewer/Properties/Resources.Designer.cs
trunk/MgDev/Desktop/MapViewer/Properties/Resources.resx
trunk/MgDev/Desktop/MapViewerTest/Form1.Designer.cs
trunk/MgDev/Desktop/MapViewerTest/Form1.cs
trunk/MgDev/Desktop/MapViewerTest/Form1.resx
trunk/MgDev/Desktop/MgDesktop/Services/FeatureService.cpp
Log:
mg-desktop updates:
- Add new controls to the map viewer library:
- Generic Measure control
- Buffer control
- Fix defects in MgdFeatureService::UpdateFeatures
Modified: trunk/MgDev/Desktop/MapViewer/IMapViewer.cs
===================================================================
--- trunk/MgDev/Desktop/MapViewer/IMapViewer.cs 2012-04-26 15:45:54 UTC (rev 6594)
+++ trunk/MgDev/Desktop/MapViewer/IMapViewer.cs 2012-04-27 15:17:59 UTC (rev 6595)
@@ -93,6 +93,13 @@
void DigitizeLineString(LineStringDigitizationCallback callback);
/// <summary>
+ /// Starts the digitization process for a line string (polyline)
+ /// </summary>
+ /// <param name="callback">The callback to be invoked when the digitization process completes</param>
+ /// <param name="segmentDigitized">The callback to be invoked when a new segment of the current line string is digitized</param>
+ void DigitizeLineString(LineStringDigitizationCallback callback, LineDigitizationCallback segmentDigitized);
+
+ /// <summary>
/// Starts the digitization process for a rectangle
/// </summary>
/// <param name="callback">The callback to be invoked when the digitization process completes</param>
Modified: trunk/MgDev/Desktop/MapViewer/MapViewer.Net40.csproj
===================================================================
--- trunk/MgDev/Desktop/MapViewer/MapViewer.Net40.csproj 2012-04-26 15:45:54 UTC (rev 6594)
+++ trunk/MgDev/Desktop/MapViewer/MapViewer.Net40.csproj 2012-04-27 15:17:59 UTC (rev 6595)
@@ -90,6 +90,12 @@
<Compile Include="IMapViewerComponent.cs" />
<Compile Include="IMapStatusBar.cs" />
<Compile Include="IPropertyPane.cs" />
+ <Compile Include="MgBufferControl.cs">
+ <SubType>UserControl</SubType>
+ </Compile>
+ <Compile Include="MgBufferControl.Designer.cs">
+ <DependentUpon>MgBufferControl.cs</DependentUpon>
+ </Compile>
<Compile Include="MgDefaultToolbar.cs">
<SubType>Component</SubType>
</Compile>
@@ -104,6 +110,12 @@
<DependentUpon>MgLegend.cs</DependentUpon>
</Compile>
<Compile Include="MgMapViewerProvider.cs" />
+ <Compile Include="MgLineMeasureControl.cs">
+ <SubType>UserControl</SubType>
+ </Compile>
+ <Compile Include="MgLineMeasureControl.Designer.cs">
+ <DependentUpon>MgLineMeasureControl.cs</DependentUpon>
+ </Compile>
<Compile Include="MgPropertyPane.cs">
<SubType>UserControl</SubType>
</Compile>
@@ -124,9 +136,15 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Debug.Designer.cs</LastGenOutput>
</EmbeddedResource>
+ <EmbeddedResource Include="MgBufferControl.resx">
+ <DependentUpon>MgBufferControl.cs</DependentUpon>
+ </EmbeddedResource>
<EmbeddedResource Include="MgLegend.resx">
<DependentUpon>MgLegend.cs</DependentUpon>
</EmbeddedResource>
+ <EmbeddedResource Include="MgLineMeasureControl.resx">
+ <DependentUpon>MgLineMeasureControl.cs</DependentUpon>
+ </EmbeddedResource>
<EmbeddedResource Include="MgPropertyPane.resx">
<DependentUpon>MgPropertyPane.cs</DependentUpon>
</EmbeddedResource>
@@ -338,6 +356,9 @@
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
+ <ItemGroup>
+ <None Include="Resources\AreaLayerDef.txt" />
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Modified: trunk/MgDev/Desktop/MapViewer/MapViewer.csproj
===================================================================
--- trunk/MgDev/Desktop/MapViewer/MapViewer.csproj 2012-04-26 15:45:54 UTC (rev 6594)
+++ trunk/MgDev/Desktop/MapViewer/MapViewer.csproj 2012-04-27 15:17:59 UTC (rev 6595)
@@ -69,9 +69,21 @@
<Compile Include="IMapViewerComponent.cs" />
<Compile Include="IMapStatusBar.cs" />
<Compile Include="IPropertyPane.cs" />
+ <Compile Include="MgBufferControl.cs">
+ <SubType>UserControl</SubType>
+ </Compile>
+ <Compile Include="MgBufferControl.Designer.cs">
+ <DependentUpon>MgBufferControl.cs</DependentUpon>
+ </Compile>
<Compile Include="MgDefaultToolbar.cs">
<SubType>Component</SubType>
</Compile>
+ <Compile Include="MgLineMeasureControl.cs">
+ <SubType>UserControl</SubType>
+ </Compile>
+ <Compile Include="MgLineMeasureControl.Designer.cs">
+ <DependentUpon>MgLineMeasureControl.cs</DependentUpon>
+ </Compile>
<Compile Include="MgMapViewer.cs">
<SubType>Component</SubType>
</Compile>
@@ -103,9 +115,15 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Debug.Designer.cs</LastGenOutput>
</EmbeddedResource>
+ <EmbeddedResource Include="MgBufferControl.resx">
+ <DependentUpon>MgBufferControl.cs</DependentUpon>
+ </EmbeddedResource>
<EmbeddedResource Include="MgLegend.resx">
<DependentUpon>MgLegend.cs</DependentUpon>
</EmbeddedResource>
+ <EmbeddedResource Include="MgLineMeasureControl.resx">
+ <DependentUpon>MgLineMeasureControl.cs</DependentUpon>
+ </EmbeddedResource>
<EmbeddedResource Include="MgPropertyPane.resx">
<DependentUpon>MgPropertyPane.cs</DependentUpon>
</EmbeddedResource>
@@ -300,6 +318,9 @@
<ItemGroup>
<None Include="Resources\icon_etc.png" />
</ItemGroup>
+ <ItemGroup>
+ <Content Include="Resources\AreaLayerDef.txt" />
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Added: trunk/MgDev/Desktop/MapViewer/MgBufferControl.Designer.cs
===================================================================
--- trunk/MgDev/Desktop/MapViewer/MgBufferControl.Designer.cs (rev 0)
+++ trunk/MgDev/Desktop/MapViewer/MgBufferControl.Designer.cs 2012-04-27 15:17:59 UTC (rev 6595)
@@ -0,0 +1,457 @@
+namespace OSGeo.MapGuide.Viewer
+{
+ partial class MgBufferControl
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.groupBox1 = new System.Windows.Forms.GroupBox();
+ this.lstLayers = new System.Windows.Forms.ListBox();
+ this.label2 = new System.Windows.Forms.Label();
+ this.cmbUnits = new System.Windows.Forms.ComboBox();
+ this.numBufferDistance = new System.Windows.Forms.NumericUpDown();
+ this.label1 = new System.Windows.Forms.Label();
+ this.lblSelectFeatures = new System.Windows.Forms.Label();
+ this.groupBox2 = new System.Windows.Forms.GroupBox();
+ this.btnFillBackColor = new System.Windows.Forms.Button();
+ this.pnlFillBackColor = new System.Windows.Forms.Panel();
+ this.label10 = new System.Windows.Forms.Label();
+ this.numFillTransparency = new System.Windows.Forms.NumericUpDown();
+ this.label5 = new System.Windows.Forms.Label();
+ this.btnFillColor = new System.Windows.Forms.Button();
+ this.pnlFillColor = new System.Windows.Forms.Panel();
+ this.label4 = new System.Windows.Forms.Label();
+ this.cmbFillPattern = new System.Windows.Forms.ComboBox();
+ this.label3 = new System.Windows.Forms.Label();
+ this.groupBox3 = new System.Windows.Forms.GroupBox();
+ this.numLineThickness = new System.Windows.Forms.NumericUpDown();
+ this.cmbBorderPattern = new System.Windows.Forms.ComboBox();
+ this.label6 = new System.Windows.Forms.Label();
+ this.label8 = new System.Windows.Forms.Label();
+ this.btnBorderColor = new System.Windows.Forms.Button();
+ this.label7 = new System.Windows.Forms.Label();
+ this.pnlBorderColor = new System.Windows.Forms.Panel();
+ this.btnCreate = new System.Windows.Forms.Button();
+ this.groupBox4 = new System.Windows.Forms.GroupBox();
+ this.chkMergeBuffers = new System.Windows.Forms.CheckBox();
+ this.txtBufferLayer = new System.Windows.Forms.TextBox();
+ this.label9 = new System.Windows.Forms.Label();
+ this.colorPicker = new System.Windows.Forms.ColorDialog();
+ this.groupBox1.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.numBufferDistance)).BeginInit();
+ this.groupBox2.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.numFillTransparency)).BeginInit();
+ this.groupBox3.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.numLineThickness)).BeginInit();
+ this.groupBox4.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // groupBox1
+ //
+ this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.groupBox1.Controls.Add(this.lstLayers);
+ this.groupBox1.Controls.Add(this.label2);
+ this.groupBox1.Controls.Add(this.cmbUnits);
+ this.groupBox1.Controls.Add(this.numBufferDistance);
+ this.groupBox1.Controls.Add(this.label1);
+ this.groupBox1.Controls.Add(this.lblSelectFeatures);
+ this.groupBox1.Location = new System.Drawing.Point(0, 0);
+ this.groupBox1.Name = "groupBox1";
+ this.groupBox1.Size = new System.Drawing.Size(232, 220);
+ this.groupBox1.TabIndex = 0;
+ this.groupBox1.TabStop = false;
+ this.groupBox1.Text = "Buffer Settings";
+ //
+ // lstLayers
+ //
+ this.lstLayers.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.lstLayers.FormattingEnabled = true;
+ this.lstLayers.Location = new System.Drawing.Point(9, 126);
+ this.lstLayers.Name = "lstLayers";
+ this.lstLayers.Size = new System.Drawing.Size(206, 82);
+ this.lstLayers.TabIndex = 5;
+ //
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Location = new System.Drawing.Point(6, 101);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(180, 13);
+ this.label2.TabIndex = 4;
+ this.label2.Text = "Includes the following layers in buffer";
+ //
+ // cmbUnits
+ //
+ this.cmbUnits.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.cmbUnits.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.cmbUnits.FormattingEnabled = true;
+ this.cmbUnits.Location = new System.Drawing.Point(105, 66);
+ this.cmbUnits.Name = "cmbUnits";
+ this.cmbUnits.Size = new System.Drawing.Size(110, 21);
+ this.cmbUnits.TabIndex = 3;
+ //
+ // numBufferDistance
+ //
+ this.numBufferDistance.Location = new System.Drawing.Point(9, 67);
+ this.numBufferDistance.Maximum = new decimal(new int[] {
+ 100000,
+ 0,
+ 0,
+ 0});
+ this.numBufferDistance.Minimum = new decimal(new int[] {
+ 100000,
+ 0,
+ 0,
+ -2147483648});
+ this.numBufferDistance.Name = "numBufferDistance";
+ this.numBufferDistance.Size = new System.Drawing.Size(92, 20);
+ this.numBufferDistance.TabIndex = 2;
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(6, 50);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(126, 13);
+ this.label1.TabIndex = 1;
+ this.label1.Text = "Distance around features";
+ //
+ // lblSelectFeatures
+ //
+ this.lblSelectFeatures.BackColor = System.Drawing.Color.White;
+ this.lblSelectFeatures.ForeColor = System.Drawing.Color.Blue;
+ this.lblSelectFeatures.Location = new System.Drawing.Point(6, 16);
+ this.lblSelectFeatures.Name = "lblSelectFeatures";
+ this.lblSelectFeatures.Size = new System.Drawing.Size(209, 23);
+ this.lblSelectFeatures.TabIndex = 0;
+ this.lblSelectFeatures.Text = "Select Features on the Map first";
+ this.lblSelectFeatures.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // groupBox2
+ //
+ this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.groupBox2.Controls.Add(this.btnFillBackColor);
+ this.groupBox2.Controls.Add(this.pnlFillBackColor);
+ this.groupBox2.Controls.Add(this.label10);
+ this.groupBox2.Controls.Add(this.numFillTransparency);
+ this.groupBox2.Controls.Add(this.label5);
+ this.groupBox2.Controls.Add(this.btnFillColor);
+ this.groupBox2.Controls.Add(this.pnlFillColor);
+ this.groupBox2.Controls.Add(this.label4);
+ this.groupBox2.Controls.Add(this.cmbFillPattern);
+ this.groupBox2.Controls.Add(this.label3);
+ this.groupBox2.Location = new System.Drawing.Point(0, 220);
+ this.groupBox2.Name = "groupBox2";
+ this.groupBox2.Size = new System.Drawing.Size(232, 144);
+ this.groupBox2.TabIndex = 1;
+ this.groupBox2.TabStop = false;
+ this.groupBox2.Text = "Fill Style";
+ //
+ // btnFillBackColor
+ //
+ this.btnFillBackColor.Location = new System.Drawing.Point(183, 102);
+ this.btnFillBackColor.Name = "btnFillBackColor";
+ this.btnFillBackColor.Size = new System.Drawing.Size(32, 23);
+ this.btnFillBackColor.TabIndex = 9;
+ this.btnFillBackColor.Text = "...";
+ this.btnFillBackColor.UseVisualStyleBackColor = true;
+ this.btnFillBackColor.Click += new System.EventHandler(this.btnFillBackColor_Click);
+ //
+ // pnlFillBackColor
+ //
+ this.pnlFillBackColor.Location = new System.Drawing.Point(95, 103);
+ this.pnlFillBackColor.Name = "pnlFillBackColor";
+ this.pnlFillBackColor.Size = new System.Drawing.Size(82, 22);
+ this.pnlFillBackColor.TabIndex = 8;
+ //
+ // label10
+ //
+ this.label10.AutoSize = true;
+ this.label10.Location = new System.Drawing.Point(30, 107);
+ this.label10.Name = "label10";
+ this.label10.Size = new System.Drawing.Size(59, 13);
+ this.label10.TabIndex = 7;
+ this.label10.Text = "Back Color";
+ //
+ // numFillTransparency
+ //
+ this.numFillTransparency.Location = new System.Drawing.Point(95, 77);
+ this.numFillTransparency.Name = "numFillTransparency";
+ this.numFillTransparency.Size = new System.Drawing.Size(120, 20);
+ this.numFillTransparency.TabIndex = 6;
+ //
+ // label5
+ //
+ this.label5.AutoSize = true;
+ this.label5.Location = new System.Drawing.Point(17, 79);
+ this.label5.Name = "label5";
+ this.label5.Size = new System.Drawing.Size(72, 13);
+ this.label5.TabIndex = 5;
+ this.label5.Text = "Transparency";
+ //
+ // btnFillColor
+ //
+ this.btnFillColor.Location = new System.Drawing.Point(183, 48);
+ this.btnFillColor.Name = "btnFillColor";
+ this.btnFillColor.Size = new System.Drawing.Size(32, 23);
+ this.btnFillColor.TabIndex = 4;
+ this.btnFillColor.Text = "...";
+ this.btnFillColor.UseVisualStyleBackColor = true;
+ this.btnFillColor.Click += new System.EventHandler(this.btnFillColor_Click);
+ //
+ // pnlFillColor
+ //
+ this.pnlFillColor.Location = new System.Drawing.Point(95, 49);
+ this.pnlFillColor.Name = "pnlFillColor";
+ this.pnlFillColor.Size = new System.Drawing.Size(82, 22);
+ this.pnlFillColor.TabIndex = 3;
+ //
+ // label4
+ //
+ this.label4.AutoSize = true;
+ this.label4.Location = new System.Drawing.Point(34, 53);
+ this.label4.Name = "label4";
+ this.label4.Size = new System.Drawing.Size(55, 13);
+ this.label4.TabIndex = 2;
+ this.label4.Text = "Fore Color";
+ //
+ // cmbFillPattern
+ //
+ this.cmbFillPattern.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.cmbFillPattern.FormattingEnabled = true;
+ this.cmbFillPattern.Location = new System.Drawing.Point(95, 23);
+ this.cmbFillPattern.Name = "cmbFillPattern";
+ this.cmbFillPattern.Size = new System.Drawing.Size(120, 21);
+ this.cmbFillPattern.TabIndex = 1;
+ //
+ // label3
+ //
+ this.label3.AutoSize = true;
+ this.label3.Location = new System.Drawing.Point(48, 26);
+ this.label3.Name = "label3";
+ this.label3.Size = new System.Drawing.Size(41, 13);
+ this.label3.TabIndex = 0;
+ this.label3.Text = "Pattern";
+ //
+ // groupBox3
+ //
+ this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.groupBox3.Controls.Add(this.numLineThickness);
+ this.groupBox3.Controls.Add(this.cmbBorderPattern);
+ this.groupBox3.Controls.Add(this.label6);
+ this.groupBox3.Controls.Add(this.label8);
+ this.groupBox3.Controls.Add(this.btnBorderColor);
+ this.groupBox3.Controls.Add(this.label7);
+ this.groupBox3.Controls.Add(this.pnlBorderColor);
+ this.groupBox3.Location = new System.Drawing.Point(0, 364);
+ this.groupBox3.Name = "groupBox3";
+ this.groupBox3.Size = new System.Drawing.Size(232, 100);
+ this.groupBox3.TabIndex = 2;
+ this.groupBox3.TabStop = false;
+ this.groupBox3.Text = "Border Style";
+ //
+ // numLineThickness
+ //
+ this.numLineThickness.Location = new System.Drawing.Point(95, 73);
+ this.numLineThickness.Name = "numLineThickness";
+ this.numLineThickness.Size = new System.Drawing.Size(120, 20);
+ this.numLineThickness.TabIndex = 13;
+ //
+ // cmbBorderPattern
+ //
+ this.cmbBorderPattern.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.cmbBorderPattern.FormattingEnabled = true;
+ this.cmbBorderPattern.Location = new System.Drawing.Point(95, 19);
+ this.cmbBorderPattern.Name = "cmbBorderPattern";
+ this.cmbBorderPattern.Size = new System.Drawing.Size(120, 21);
+ this.cmbBorderPattern.TabIndex = 8;
+ //
+ // label6
+ //
+ this.label6.AutoSize = true;
+ this.label6.Location = new System.Drawing.Point(17, 75);
+ this.label6.Name = "label6";
+ this.label6.Size = new System.Drawing.Size(72, 13);
+ this.label6.TabIndex = 12;
+ this.label6.Text = "Transparency";
+ //
+ // label8
+ //
+ this.label8.AutoSize = true;
+ this.label8.Location = new System.Drawing.Point(48, 22);
+ this.label8.Name = "label8";
+ this.label8.Size = new System.Drawing.Size(41, 13);
+ this.label8.TabIndex = 7;
+ this.label8.Text = "Pattern";
+ //
+ // btnBorderColor
+ //
+ this.btnBorderColor.Location = new System.Drawing.Point(183, 44);
+ this.btnBorderColor.Name = "btnBorderColor";
+ this.btnBorderColor.Size = new System.Drawing.Size(32, 23);
+ this.btnBorderColor.TabIndex = 11;
+ this.btnBorderColor.Text = "...";
+ this.btnBorderColor.UseVisualStyleBackColor = true;
+ this.btnBorderColor.Click += new System.EventHandler(this.btnBorderColor_Click);
+ //
+ // label7
+ //
+ this.label7.AutoSize = true;
+ this.label7.Location = new System.Drawing.Point(58, 49);
+ this.label7.Name = "label7";
+ this.label7.Size = new System.Drawing.Size(31, 13);
+ this.label7.TabIndex = 9;
+ this.label7.Text = "Color";
+ //
+ // pnlBorderColor
+ //
+ this.pnlBorderColor.Location = new System.Drawing.Point(95, 45);
+ this.pnlBorderColor.Name = "pnlBorderColor";
+ this.pnlBorderColor.Size = new System.Drawing.Size(82, 22);
+ this.pnlBorderColor.TabIndex = 10;
+ //
+ // btnCreate
+ //
+ this.btnCreate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+ this.btnCreate.Location = new System.Drawing.Point(9, 567);
+ this.btnCreate.Name = "btnCreate";
+ this.btnCreate.Size = new System.Drawing.Size(98, 23);
+ this.btnCreate.TabIndex = 3;
+ this.btnCreate.Text = "Create Buffer";
+ this.btnCreate.UseVisualStyleBackColor = true;
+ this.btnCreate.Click += new System.EventHandler(this.btnCreate_Click);
+ //
+ // groupBox4
+ //
+ this.groupBox4.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.groupBox4.Controls.Add(this.chkMergeBuffers);
+ this.groupBox4.Controls.Add(this.txtBufferLayer);
+ this.groupBox4.Controls.Add(this.label9);
+ this.groupBox4.Location = new System.Drawing.Point(0, 464);
+ this.groupBox4.Name = "groupBox4";
+ this.groupBox4.Size = new System.Drawing.Size(232, 97);
+ this.groupBox4.TabIndex = 4;
+ this.groupBox4.TabStop = false;
+ this.groupBox4.Text = "Other";
+ //
+ // chkMergeBuffers
+ //
+ this.chkMergeBuffers.AutoSize = true;
+ this.chkMergeBuffers.Checked = true;
+ this.chkMergeBuffers.CheckState = System.Windows.Forms.CheckState.Checked;
+ this.chkMergeBuffers.Location = new System.Drawing.Point(12, 69);
+ this.chkMergeBuffers.Name = "chkMergeBuffers";
+ this.chkMergeBuffers.Size = new System.Drawing.Size(117, 17);
+ this.chkMergeBuffers.TabIndex = 2;
+ this.chkMergeBuffers.Text = "Merge Buffer Areas";
+ this.chkMergeBuffers.UseVisualStyleBackColor = true;
+ //
+ // txtBufferLayer
+ //
+ this.txtBufferLayer.Location = new System.Drawing.Point(12, 43);
+ this.txtBufferLayer.Name = "txtBufferLayer";
+ this.txtBufferLayer.Size = new System.Drawing.Size(203, 20);
+ this.txtBufferLayer.TabIndex = 1;
+ //
+ // label9
+ //
+ this.label9.AutoSize = true;
+ this.label9.Location = new System.Drawing.Point(9, 26);
+ this.label9.Name = "label9";
+ this.label9.Size = new System.Drawing.Size(98, 13);
+ this.label9.TabIndex = 0;
+ this.label9.Text = "Buffer Layer Name:";
+ //
+ // MgBufferControl
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this.groupBox4);
+ this.Controls.Add(this.btnCreate);
+ this.Controls.Add(this.groupBox3);
+ this.Controls.Add(this.groupBox2);
+ this.Controls.Add(this.groupBox1);
+ this.Name = "MgBufferControl";
+ this.Size = new System.Drawing.Size(232, 601);
+ this.groupBox1.ResumeLayout(false);
+ this.groupBox1.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.numBufferDistance)).EndInit();
+ this.groupBox2.ResumeLayout(false);
+ this.groupBox2.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.numFillTransparency)).EndInit();
+ this.groupBox3.ResumeLayout(false);
+ this.groupBox3.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.numLineThickness)).EndInit();
+ this.groupBox4.ResumeLayout(false);
+ this.groupBox4.PerformLayout();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.GroupBox groupBox1;
+ private System.Windows.Forms.Label lblSelectFeatures;
+ private System.Windows.Forms.ListBox lstLayers;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.ComboBox cmbUnits;
+ private System.Windows.Forms.NumericUpDown numBufferDistance;
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.GroupBox groupBox2;
+ private System.Windows.Forms.NumericUpDown numFillTransparency;
+ private System.Windows.Forms.Label label5;
+ private System.Windows.Forms.Button btnFillColor;
+ private System.Windows.Forms.Panel pnlFillColor;
+ private System.Windows.Forms.Label label4;
+ private System.Windows.Forms.ComboBox cmbFillPattern;
+ private System.Windows.Forms.Label label3;
+ private System.Windows.Forms.GroupBox groupBox3;
+ private System.Windows.Forms.NumericUpDown numLineThickness;
+ private System.Windows.Forms.ComboBox cmbBorderPattern;
+ private System.Windows.Forms.Label label6;
+ private System.Windows.Forms.Label label8;
+ private System.Windows.Forms.Button btnBorderColor;
+ private System.Windows.Forms.Label label7;
+ private System.Windows.Forms.Panel pnlBorderColor;
+ private System.Windows.Forms.Button btnCreate;
+ private System.Windows.Forms.GroupBox groupBox4;
+ private System.Windows.Forms.CheckBox chkMergeBuffers;
+ private System.Windows.Forms.TextBox txtBufferLayer;
+ private System.Windows.Forms.Label label9;
+ private System.Windows.Forms.ColorDialog colorPicker;
+ private System.Windows.Forms.Button btnFillBackColor;
+ private System.Windows.Forms.Panel pnlFillBackColor;
+ private System.Windows.Forms.Label label10;
+ }
+}
Added: trunk/MgDev/Desktop/MapViewer/MgBufferControl.cs
===================================================================
--- trunk/MgDev/Desktop/MapViewer/MgBufferControl.cs (rev 0)
+++ trunk/MgDev/Desktop/MapViewer/MgBufferControl.cs 2012-04-27 15:17:59 UTC (rev 6595)
@@ -0,0 +1,482 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using System.Globalization;
+
+namespace OSGeo.MapGuide.Viewer
+{
+ public partial class MgBufferControl : UserControl
+ {
+ private IMapViewer _viewer;
+ private MgResourceService _resSvc;
+ private MgFeatureService _featSvc;
+ private string _sessionId;
+
+ public MgBufferControl(IMapViewer viewer)
+ {
+ InitializeComponent();
+ _viewer = viewer;
+ _sessionId = Guid.NewGuid().ToString();
+ var provider = viewer.GetProvider();
+ _resSvc = (MgResourceService)provider.CreateService(MgServiceType.ResourceService);
+ _featSvc = (MgFeatureService)provider.CreateService(MgServiceType.FeatureService);
+
+ cmbUnits.DataSource = Enum.GetValues(typeof(MeasurementUnit));
+ cmbUnits.SelectedItem = MeasurementUnit.Kilometers;
+ cmbBorderPattern.DataSource = Enum.GetValues(typeof(StockPattern));
+ cmbFillPattern.DataSource = Enum.GetValues(typeof(StockPattern));
+
+ cmbBorderPattern.SelectedItem = StockPattern.Solid;
+ cmbFillPattern.SelectedItem = StockPattern.Solid;
+
+ pnlFillColor.BackColor = Color.Red;
+ pnlBorderColor.BackColor = Color.Black;
+
+ numBufferDistance.Value = 1;
+ numFillTransparency.Value = 50;
+ numLineThickness.Value = 1;
+
+ _viewer.SelectionChanged += new EventHandler(OnViewerSelectedChanged);
+ }
+
+ void OnViewerSelectedChanged(object sender, EventArgs e)
+ {
+ lstLayers.Items.Clear();
+ var sel = _viewer.GetSelection();
+ var layers = sel.GetLayers();
+ if (layers != null)
+ {
+ for (var i = 0; i < layers.GetCount(); i++)
+ {
+ var layer = layers.GetItem(i);
+ var name = layer.GetName();
+
+ lstLayers.Items.Add(name);
+ }
+ }
+
+ lblSelectFeatures.Visible = (lstLayers.Items.Count == 0);
+ }
+
+ private void btnFillColor_Click(object sender, EventArgs e)
+ {
+ if (colorPicker.ShowDialog() == DialogResult.OK)
+ {
+ pnlFillColor.BackColor = colorPicker.Color;
+ }
+ }
+
+ private void btnBorderColor_Click(object sender, EventArgs e)
+ {
+ if (colorPicker.ShowDialog() == DialogResult.OK)
+ {
+ pnlBorderColor.BackColor = colorPicker.Color;
+ }
+ }
+
+ private void btnFillBackColor_Click(object sender, EventArgs e)
+ {
+ if (colorPicker.ShowDialog() == DialogResult.OK)
+ {
+ pnlFillBackColor.BackColor = colorPicker.Color;
+ }
+ }
+
+ private void btnCreate_Click(object sender, EventArgs e)
+ {
+ var layerName = txtBufferLayer.Text.Trim();
+ if (string.IsNullOrEmpty(layerName))
+ {
+ MessageBox.Show("Please enter a name for this layer");
+ return;
+ }
+
+ if (lstLayers.SelectedItems.Count == 0)
+ {
+ MessageBox.Show("Please include one or more layers to create a buffer from");
+ return;
+ }
+
+ var map = _viewer.GetMap();
+ var layers = map.GetLayers();
+ var provider = _viewer.GetProvider();
+
+ //From here, it's the same logic as buffer.aspx in .net MapGuide AJAX viewer
+ MgResourceIdentifier fsId = new MgResourceIdentifier("Session:" + _sessionId + "//" + txtBufferLayer.Text + "_Buffer.FeatureSource");
+ MgResourceIdentifier ldfId = new MgResourceIdentifier("Session:" + _sessionId + "//" + txtBufferLayer.Text + "_Buffer.LayerDefinition");
+
+ MgLayerBase layer = FindLayer(layers, txtBufferLayer.Text);
+ string[] layerNames = lstLayers.Items.OfType<string>().ToArray();
+
+ double distance = Convert.ToDouble(numBufferDistance.Value);
+ MeasurementUnit bUnits = (MeasurementUnit)cmbUnits.SelectedItem;
+ switch (bUnits)
+ {
+ case MeasurementUnit.Feet:
+ distance *= 0.30480;
+ break;
+ case MeasurementUnit.Kilometers:
+ distance *= 1000;
+ break;
+ case MeasurementUnit.Miles:
+ distance *= 1609.35;
+ break;
+ }
+
+ String srsDefMap = GetMapSrs(map);
+ MgCoordinateSystem srsMap = provider.GetMapCoordinateSystem();
+ string mapSrsUnits = "";
+ bool arbitraryMapSrs = (srsMap.GetType() == MgCoordinateSystemType.Arbitrary);
+ if (arbitraryMapSrs)
+ mapSrsUnits = srsMap.GetUnits();
+
+ String xtrans = String.Format("{0:x2}", ((int)(255 * Convert.ToInt32(numFillTransparency.Value) / 100)));
+ var lineColor = ToHtmlColor(pnlBorderColor.BackColor);
+ var foreColor = ToHtmlColor(pnlFillColor.BackColor);
+ var backColor = ToHtmlColor(pnlFillBackColor.BackColor);
+ String layerTempl = string.Format(Properties.Resources.AreaLayerDef,
+ fsId.ToString(),
+ "BufferSchema:Buffer",
+ "GEOM",
+ cmbFillPattern.SelectedItem,
+ xtrans + foreColor,
+ ((0 != 1/*transparent*/) ? "ff" : "00") + backColor,
+ cmbBorderPattern.SelectedItem,
+ numLineThickness.Value.ToString(NumberFormatInfo.InvariantInfo),
+ lineColor
+ );
+ byte[] bytes = Encoding.UTF8.GetBytes(layerTempl);
+ MgByteSource src = new MgByteSource(bytes, bytes.Length);
+ MgByteReader layerDefContent = src.GetReader();
+ _resSvc.SetResource(ldfId, layerDefContent, null);
+
+ bool newBuffer = false;
+ if (layer == null)
+ {
+ newBuffer = true;
+
+ //Targetting a new layer. create a data source for it
+ //
+ MgClassDefinition classDef = new MgClassDefinition();
+
+ classDef.SetName("Buffer");
+ classDef.SetDescription("Feature class for buffer layer");
+ classDef.SetDefaultGeometryPropertyName("GEOM");
+
+ //Set KEY property
+ MgDataPropertyDefinition prop = new MgDataPropertyDefinition("KEY");
+ prop.SetDataType(MgPropertyType.Int32);
+ prop.SetAutoGeneration(true);
+ prop.SetReadOnly(true);
+ classDef.GetIdentityProperties().Add(prop);
+ classDef.GetProperties().Add(prop);
+
+ //Set ID property. Hold this segment ID
+ prop = new MgDataPropertyDefinition("ID");
+ prop.SetDataType(MgPropertyType.Int32);
+ classDef.GetProperties().Add(prop);
+
+ //Set geometry property
+ MgGeometricPropertyDefinition geomProp = new MgGeometricPropertyDefinition("GEOM");
+ //prop.SetGeometryTypes(MgFeatureGeometricType.mfgtSurface); //TODO use the constant when exposed
+ geomProp.SetGeometryTypes(4);
+ classDef.GetProperties().Add(geomProp);
+
+ //Create the schema
+ MgFeatureSchema schema = new MgFeatureSchema("BufferSchema", "Temporary buffer schema");
+ schema.GetClasses().Add(classDef);
+
+ //finally, creation of the feature source
+ MgCreateSdfParams sdfParams = new MgCreateSdfParams("LatLong", map.GetMapSRS(), schema);
+ _featSvc.CreateFeatureSource(fsId, sdfParams);
+
+ //Add layer to map
+ layer = provider.CreateLayer(ldfId);
+ layer.SetName(txtBufferLayer.Text);
+ layer.SetLegendLabel(txtBufferLayer.Text);
+ layer.SetDisplayInLegend(true);
+ layer.SetSelectable(true);
+ layers.Insert(0, layer);
+ }
+ else
+ {
+ //data source already exist. clear its content
+ //
+ ClearDataSource(_featSvc, fsId, "BufferSchema:Buffer");
+ }
+
+ var sel = _viewer.GetSelection();
+ var selLayers = sel.GetLayers();
+
+ MgAgfReaderWriter agfRW = new MgAgfReaderWriter();
+ MgGeometryCollection bufferGeometries = new MgGeometryCollection();
+ MgGeometry geomBuffer;
+
+ MgFeatureCommandCollection commands = new MgFeatureCommandCollection();
+ int featId = 0;
+
+ MgBatchPropertyCollection propCollection = new MgBatchPropertyCollection();
+
+ int excludedLayers = 0;
+ MgCoordinateSystem srsDs = null;
+ MgGeometryCollection inputGeometries = new MgGeometryCollection();
+
+ int bufferFeatures = 0;
+ for (int li = 0; li < selLayers.GetCount(); li++)
+ {
+ MgLayerBase selLayer = selLayers.GetItem(li);
+ bool inputLayer = false;
+ String selLayerName = selLayer.GetName();
+ for (int il = 0; il < layerNames.Length; il++)
+ {
+ if (layerNames[il].Equals(selLayerName))
+ {
+ inputLayer = true;
+ break;
+ }
+ }
+ if (inputLayer == false)
+ {
+ continue;
+ }
+
+ // get the data source SRS
+ //
+ MgResourceIdentifier featSourceId = new MgResourceIdentifier(selLayer.GetFeatureSourceId());
+ MgSpatialContextReader ctxs = _featSvc.GetSpatialContexts(featSourceId, false);
+ String srsDefDs = "";
+ if (ctxs != null && ctxs.ReadNext())
+ srsDefDs = ctxs.GetCoordinateSystemWkt();
+
+ if (srsDefDs == null || srsDefDs.Length == 0)
+ {
+ excludedLayers++;
+ continue;
+ }
+
+ var srsFactory = new MgCoordinateSystemFactory();
+ srsDs = srsFactory.Create(srsDefDs);
+ bool arbitraryDsSrs = (srsDs.GetType() == MgCoordinateSystemType.Arbitrary);
+ String dsSrsUnits = "";
+
+ if (arbitraryDsSrs)
+ dsSrsUnits = srsDs.GetUnits();
+
+ // exclude layer if:
+ // the map is non-arbitrary and the layer is arbitrary or vice-versa
+ // or
+ // layer and map are both arbitrary but have different units
+ //
+ if ((arbitraryDsSrs != arbitraryMapSrs) || (arbitraryDsSrs && (dsSrsUnits != mapSrsUnits)))
+ {
+ excludedLayers++;
+ continue;
+ }
+
+ // calculate distance in the data source SRS units
+ //
+ double dist = srsDs.ConvertMetersToCoordinateSystemUnits(distance);
+
+ // calculate great circle unless data source srs is arbitrary
+ MgCoordinateSystemMeasure measure;
+ if (!arbitraryDsSrs)
+ measure = srsDs.GetMeasure();
+ else
+ measure = null;
+
+ // create a SRS transformer if necessary
+ MgCoordinateSystemTransform srsXform;
+ if (!srsDefDs.Equals(srsDefMap))
+ srsXform = srsFactory.GetTransform(srsDs, srsMap);
+ else
+ srsXform = null;
+
+ String featureClassName = selLayer.GetFeatureClassName();
+ String filter = sel.GenerateFilter(selLayer, featureClassName);
+ if (filter == null || filter.Length == 0)
+ continue;
+
+ MgFeatureQueryOptions query = new MgFeatureQueryOptions();
+ query.SetFilter(filter);
+
+ MgResourceIdentifier featureSource = new MgResourceIdentifier(selLayer.GetFeatureSourceId());
+
+ MgFeatureReader features = _featSvc.SelectFeatures(featureSource, featureClassName, query);
+
+ if (features.ReadNext())
+ {
+ MgClassDefinition classDef = features.GetClassDefinition();
+ String geomPropName = classDef.GetDefaultGeometryPropertyName();
+
+ do
+ {
+ MgByteReader geomReader = features.GetGeometry(geomPropName);
+ MgGeometry geom = agfRW.Read(geomReader);
+
+ if (!chkMergeBuffers.Checked)
+ {
+ geomBuffer = geom.Buffer(dist, measure);
+ if (geomBuffer != null)
+ {
+ if (srsXform != null)
+ geomBuffer = (MgGeometry)geomBuffer.Transform(srsXform);
+ AddFeatureToCollection(propCollection, agfRW, featId++, geomBuffer);
+ bufferFeatures++;
+ }
+ }
+ else
+ {
+ if (srsXform != null)
+ geom = (MgGeometry)geom.Transform(srsXform);
+ inputGeometries.Add(geom);
+ }
+ }
+ while (features.ReadNext());
+
+ features.Close();
+ }
+ }
+
+ if (chkMergeBuffers.Checked)
+ {
+ if (inputGeometries.GetCount() > 0)
+ {
+ double dist = srsMap.ConvertMetersToCoordinateSystemUnits(distance);
+ MgCoordinateSystemMeasure measure;
+ if (!arbitraryMapSrs)
+ measure = srsMap.GetMeasure();
+ else
+ measure = null;
+
+ MgGeometryFactory geomFactory = new MgGeometryFactory();
+ geomBuffer = geomFactory.CreateMultiGeometry(inputGeometries).Buffer(dist, measure);
+ if (geomBuffer != null)
+ {
+ AddFeatureToCollection(propCollection, agfRW, featId, geomBuffer);
+ bufferFeatures = 1;
+ }
+ }
+ }
+
+ if (propCollection.GetCount() > 0)
+ {
+ commands.Add(new MgInsertFeatures("BufferSchema:Buffer", propCollection));
+
+ //Insert the features in the temporary data source
+ //
+ ReleaseReader(_featSvc.UpdateFeatures(fsId, commands, false), commands);
+ }
+
+ // Save the new map state
+ //
+ layer.ForceRefresh();
+ _viewer.RefreshMap();
+
+ //build report message
+ MessageBox.Show("Buffer layer (" + txtBufferLayer.Text + ") " + (newBuffer ? "created" : "updated"));
+ }
+
+ static string ToHtmlColor(Color color)
+ {
+ return String.Format("{0:X2}{1:X2}{2:X2}", color.R, color.G, color.B);
+ }
+
+ static MgLayerBase FindLayer(MgLayerCollection layers, String layerName)
+ {
+ MgLayerBase layer = null;
+ int i = 0;
+ for (i = 0; i < layers.GetCount(); i++)
+ {
+ MgLayerBase layer1 = layers.GetItem(i);
+
+ if (layer1.GetName() == layerName)
+ {
+ layer = layer1;
+ break;
+ }
+ }
+ return layer;
+ }
+
+ static string GetMapSrs(MgMapBase map)
+ {
+ try
+ {
+ String srs = map.GetMapSRS();
+ if (srs != "")
+ return srs;
+ }
+ catch (MgException e)
+ {
+ }
+
+ //No SRS, set to ArbitrayXY meters
+ //
+ return "LOCALCS[\"Non-Earth (Meter)\",LOCAL_DATUM[\"Local Datum\",0],UNIT[\"Meter\", 1],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]";
+ }
+
+ static void ClearDataSource(MgFeatureService featSvc, MgResourceIdentifier fsId, String featureName)
+ {
+ MgDeleteFeatures deleteCmd = new MgDeleteFeatures(featureName, "ID >= 0");
+ MgFeatureCommandCollection commands = new MgFeatureCommandCollection();
+ commands.Add(deleteCmd);
+ featSvc.UpdateFeatures(fsId, commands, false);
+ }
+
+ static void ReleaseReader(MgPropertyCollection res, MgFeatureCommandCollection commands)
+ {
+ if (res == null)
+ return;
+
+ for (int i = 0; i < res.GetCount(); i++)
+ {
+ MgFeatureCommand cmd = commands.GetItem(i);
+ if (cmd is MgInsertFeatures)
+ {
+ MgFeatureProperty resProp = res.GetItem(i) as MgFeatureProperty;
+ if (resProp != null)
+ {
+ MgFeatureReader reader = resProp.GetValue() as MgFeatureReader;
+ if (reader == null)
+ return;
+ reader.Close();
+ }
+ }
+ }
+ }
+
+ static void AddFeatureToCollection(MgBatchPropertyCollection propCollection, MgAgfReaderWriter agfRW, int featureId, MgGeometry featureGeom)
+ {
+ MgPropertyCollection bufferProps = new MgPropertyCollection();
+ MgInt32Property idProp = new MgInt32Property("ID", featureId);
+ bufferProps.Add(idProp);
+ MgByteReader geomReader = agfRW.Write(featureGeom);
+ MgGeometryProperty geomProp = new MgGeometryProperty("GEOM", geomReader);
+ bufferProps.Add(geomProp);
+ propCollection.Add(bufferProps);
+ }
+ }
+
+ public enum StockPattern
+ {
+ Solid,
+ Net,
+ Line,
+ Line_45,
+ Line_90,
+ Line_135,
+ Square,
+ Box,
+ Cross,
+ Dash,
+ Dolmit,
+ Hex,
+ Sacncr,
+ Steel
+ }
+}
Added: trunk/MgDev/Desktop/MapViewer/MgBufferControl.resx
===================================================================
--- trunk/MgDev/Desktop/MapViewer/MgBufferControl.resx (rev 0)
+++ trunk/MgDev/Desktop/MapViewer/MgBufferControl.resx 2012-04-27 15:17:59 UTC (rev 6595)
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <metadata name="colorPicker.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>17, 17</value>
+ </metadata>
+</root>
Added: trunk/MgDev/Desktop/MapViewer/MgLineMeasureControl.Designer.cs
===================================================================
--- trunk/MgDev/Desktop/MapViewer/MgLineMeasureControl.Designer.cs (rev 0)
+++ trunk/MgDev/Desktop/MapViewer/MgLineMeasureControl.Designer.cs 2012-04-27 15:17:59 UTC (rev 6595)
@@ -0,0 +1,155 @@
+namespace OSGeo.MapGuide.Viewer
+{
+ partial class MgLineMeasureControl
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.label1 = new System.Windows.Forms.Label();
+ this.lstSegments = new System.Windows.Forms.ListBox();
+ this.label2 = new System.Windows.Forms.Label();
+ this.lblUnits = new System.Windows.Forms.Label();
+ this.label3 = new System.Windows.Forms.Label();
+ this.cmbUnits = new System.Windows.Forms.ComboBox();
+ this.btnStart = new System.Windows.Forms.Button();
+ this.groupBox1 = new System.Windows.Forms.GroupBox();
+ this.groupBox1.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // label1
+ //
+ this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(15, 297);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(157, 13);
+ this.label1.TabIndex = 0;
+ this.label1.Text = "Click \"Start\" to begin measuring";
+ //
+ // lstSegments
+ //
+ this.lstSegments.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.lstSegments.FormattingEnabled = true;
+ this.lstSegments.Location = new System.Drawing.Point(3, 16);
+ this.lstSegments.Name = "lstSegments";
+ this.lstSegments.Size = new System.Drawing.Size(206, 192);
+ this.lstSegments.TabIndex = 1;
+ //
+ // label2
+ //
+ this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+ this.label2.AutoSize = true;
+ this.label2.Location = new System.Drawing.Point(15, 270);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(79, 13);
+ this.label2.TabIndex = 2;
+ this.label2.Text = "Total Distance:";
+ //
+ // lblUnits
+ //
+ this.lblUnits.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+ this.lblUnits.AutoSize = true;
+ this.lblUnits.Location = new System.Drawing.Point(100, 270);
+ this.lblUnits.Name = "lblUnits";
+ this.lblUnits.Size = new System.Drawing.Size(0, 13);
+ this.lblUnits.TabIndex = 3;
+ //
+ // label3
+ //
+ this.label3.AutoSize = true;
+ this.label3.Location = new System.Drawing.Point(15, 17);
+ this.label3.Name = "label3";
+ this.label3.Size = new System.Drawing.Size(34, 13);
+ this.label3.TabIndex = 4;
+ this.label3.Text = "Units:";
+ //
+ // cmbUnits
+ //
+ this.cmbUnits.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.cmbUnits.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.cmbUnits.FormattingEnabled = true;
+ this.cmbUnits.Location = new System.Drawing.Point(97, 14);
+ this.cmbUnits.Name = "cmbUnits";
+ this.cmbUnits.Size = new System.Drawing.Size(127, 21);
+ this.cmbUnits.TabIndex = 5;
+ this.cmbUnits.SelectedIndexChanged += new System.EventHandler(this.cmbUnits_SelectedIndexChanged);
+ //
+ // btnStart
+ //
+ this.btnStart.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+ this.btnStart.Location = new System.Drawing.Point(18, 325);
+ this.btnStart.Name = "btnStart";
+ this.btnStart.Size = new System.Drawing.Size(82, 23);
+ this.btnStart.TabIndex = 6;
+ this.btnStart.Text = "Start";
+ this.btnStart.UseVisualStyleBackColor = true;
+ this.btnStart.Click += new System.EventHandler(this.btnStart_Click);
+ //
+ // groupBox1
+ //
+ this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.groupBox1.Controls.Add(this.lstSegments);
+ this.groupBox1.Location = new System.Drawing.Point(15, 41);
+ this.groupBox1.Name = "groupBox1";
+ this.groupBox1.Size = new System.Drawing.Size(212, 211);
+ this.groupBox1.TabIndex = 7;
+ this.groupBox1.TabStop = false;
+ this.groupBox1.Text = "Segments";
+ //
+ // MgLineMeasureControl
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this.groupBox1);
+ this.Controls.Add(this.btnStart);
+ this.Controls.Add(this.cmbUnits);
+ this.Controls.Add(this.label3);
+ this.Controls.Add(this.lblUnits);
+ this.Controls.Add(this.label2);
+ this.Controls.Add(this.label1);
+ this.Name = "MgLineMeasureControl";
+ this.Size = new System.Drawing.Size(247, 360);
+ this.groupBox1.ResumeLayout(false);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.ListBox lstSegments;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.Label lblUnits;
+ private System.Windows.Forms.Label label3;
+ private System.Windows.Forms.ComboBox cmbUnits;
+ private System.Windows.Forms.Button btnStart;
+ private System.Windows.Forms.GroupBox groupBox1;
+ }
+}
Added: trunk/MgDev/Desktop/MapViewer/MgLineMeasureControl.cs
===================================================================
--- trunk/MgDev/Desktop/MapViewer/MgLineMeasureControl.cs (rev 0)
+++ trunk/MgDev/Desktop/MapViewer/MgLineMeasureControl.cs 2012-04-27 15:17:59 UTC (rev 6595)
@@ -0,0 +1,124 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+
+namespace OSGeo.MapGuide.Viewer
+{
+ public partial class MgLineMeasureControl : UserControl
+ {
+ private IMapViewer _viewer;
+ private MgCoordinateSystem _mapCs;
+ private BindingList<MeasuredLineSegment> _segments;
+
+ public MgLineMeasureControl(IMapViewer viewer, MeasurementUnit preferredUnit)
+ {
+ InitializeComponent();
+ _viewer = viewer;
+ _segments = new BindingList<MeasuredLineSegment>();
+ cmbUnits.DataSource = Enum.GetValues(typeof(MeasurementUnit));
+ cmbUnits.SelectedItem = preferredUnit;
+ lstSegments.DataSource = _segments;
+ _mapCs = _viewer.GetProvider().GetMapCoordinateSystem();
+ }
+
+ private void btnStart_Click(object sender, EventArgs e)
+ {
+ btnStart.Enabled = false;
+ _segments.Clear();
+ _viewer.DigitizeLineString((coordinates) => //Completed
+ {
+ btnStart.Enabled = true;
+ }, (x1, y1, x2, y2) => //Segment completed
+ {
+ double dist = 0.0;
+ if (_mapCs.GetType() == MgCoordinateSystemType.Geographic)
+ dist = _mapCs.MeasureGreatCircleDistance(x1, y1, x2, y2);
+ else
+ dist = _mapCs.MeasureEuclideanDistance(x1, y1, x2, y2);
+
+ //Convert this distance to meters
+ dist = _mapCs.ConvertCoordinateSystemUnitsToMeters(dist);
+ //Add to list of line segments
+ _segments.Add(new MeasuredLineSegment() { MapDistanceMeters = dist, Units = (MeasurementUnit)cmbUnits.SelectedItem });
+
+ lblUnits.Text = _segments.Sum(x => x.DisplayUnits).ToString();
+ });
+ }
+
+ private void cmbUnits_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ //Update segments units, then total
+ foreach (var seg in _segments)
+ {
+ seg.Units = (MeasurementUnit)cmbUnits.SelectedItem;
+ }
+ lblUnits.Text = _segments.Sum(x => x.DisplayUnits).ToString();
+ }
+ }
+
+ public enum MeasurementUnit
+ {
+ Feet,
+ Meters,
+ Kilometers,
+ Miles
+ }
+
+ public class MeasuredLineSegment : INotifyPropertyChanged
+ {
+ public double MapDistanceMeters { get; set; }
+
+ private MeasurementUnit _units;
+
+ public MeasurementUnit Units
+ {
+ get { return _units; }
+ set
+ {
+ if (!value.Equals(_units))
+ {
+ _units = value;
+ var h = this.PropertyChanged;
+ if (h != null)
+ {
+ h(this, new PropertyChangedEventArgs("Units"));
+ h(this, new PropertyChangedEventArgs("DisplayUnits"));
+ }
+ }
+ }
+ }
+
+ const double M_TO_KM = 0.001;
+ const double M_TO_MI = 0.000621371192;
+
+ public double DisplayUnits
+ {
+ get
+ {
+ var dist = this.MapDistanceMeters;
+ switch (this.Units)
+ {
+ case MeasurementUnit.Kilometers:
+ dist *= M_TO_KM;
+ break;
+ case MeasurementUnit.Miles:
+ dist *= M_TO_MI;
+ break;
+ }
+ return dist;
+ }
+ }
+
+ public override string ToString()
+ {
+ return string.Format("{0} {1}", this.DisplayUnits, this.Units);
+ }
+
+ public event PropertyChangedEventHandler PropertyChanged;
+ }
+}
Added: trunk/MgDev/Desktop/MapViewer/MgLineMeasureControl.resx
===================================================================
--- trunk/MgDev/Desktop/MapViewer/MgLineMeasureControl.resx (rev 0)
+++ trunk/MgDev/Desktop/MapViewer/MgLineMeasureControl.resx 2012-04-27 15:17:59 UTC (rev 6595)
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
Modified: trunk/MgDev/Desktop/MapViewer/MgMapViewer.cs
===================================================================
--- trunk/MgDev/Desktop/MapViewer/MgMapViewer.cs 2012-04-26 15:45:54 UTC (rev 6594)
+++ trunk/MgDev/Desktop/MapViewer/MgMapViewer.cs 2012-04-27 15:17:59 UTC (rev 6595)
@@ -835,7 +835,22 @@
_digitizationYetToStart = true;
}
+ private LineDigitizationCallback _segmentCallback;
+
/// <summary>
+ /// Starts the digitization process for a line string (polyline)
+ /// </summary>
+ /// <param name="callback">The callback to be invoked when the digitization process completes</param>
+ /// <param name="segmentCallback">The callback to be invoked when a new segment of the current line string is digitized</param>
+ public void DigitizeLineString(LineStringDigitizationCallback callback, LineDigitizationCallback segmentCallback)
+ {
+ this.DigitizingType = MapDigitizationType.LineString;
+ _digitzationCallback = callback;
+ _segmentCallback = segmentCallback;
+ _digitizationYetToStart = true;
+ }
+
+ /// <summary>
/// Starts the digitization process for a rectangle
/// </summary>
/// <param name="callback">The callback to be invoked when the digitization process completes</param>
@@ -849,6 +864,7 @@
private void ResetDigitzationState()
{
_digitzationCallback = null;
+ _segmentCallback = null;
dPath.Clear();
dPtEnd.X = dPtStart.Y = 0;
dPtStart.X = dPtStart.Y = 0;
@@ -883,6 +899,16 @@
cb(coords);
}
+ private void OnLineStringSegmentDigitized(Point p1, Point p2)
+ {
+ if (_segmentCallback != null)
+ {
+ var ptx1 = ScreenToMapUnits(p1.X, p1.Y);
+ var ptx2 = ScreenToMapUnits(p2.X, p2.Y);
+ _segmentCallback.Invoke(ptx1.X, ptx1.Y, ptx2.X, ptx2.Y);
+ }
+ }
+
private void OnLineStringDigitized(List<Point> path)
{
double[,] coords = new double[path.Count, 2];
@@ -2037,6 +2063,7 @@
pt.X = e.X;
pt.Y = e.Y;
dPath.Add(new Point(e.X, e.Y)); //This is a transient one
+ OnLineStringSegmentDigitized(dPath[dPath.Count - 3], dPath[dPath.Count - 2]);
}
else
{
Modified: trunk/MgDev/Desktop/MapViewer/MgMapViewerProvider.cs
===================================================================
--- trunk/MgDev/Desktop/MapViewer/MgMapViewerProvider.cs 2012-04-26 15:45:54 UTC (rev 6594)
+++ trunk/MgDev/Desktop/MapViewer/MgMapViewerProvider.cs 2012-04-27 15:17:59 UTC (rev 6595)
@@ -181,6 +181,7 @@
public abstract void SetViewScale(double scale);
public abstract void MakeGroupNormal(MgLayerGroup group);
+ public abstract MgLayerBase CreateLayer(MgResourceIdentifier layerDefId);
public abstract MgService CreateService(int serviceType);
public abstract MgByteReader GenerateLegendImage(MgResourceIdentifier layerDefinition, double viewScale, int width, int height, string format, int geomType, int themeCategory);
Modified: trunk/MgDev/Desktop/MapViewer/Properties/Resources.Designer.cs
===================================================================
--- trunk/MgDev/Desktop/MapViewer/Properties/Resources.Designer.cs 2012-04-26 15:45:54 UTC (rev 6594)
+++ trunk/MgDev/Desktop/MapViewer/Properties/Resources.Designer.cs 2012-04-27 15:17:59 UTC (rev 6595)
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
-// Runtime Version:4.0.30319.239
+// Runtime Version:4.0.30319.225
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -67,6 +67,28 @@
}
}
+ /// <summary>
+ /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8"?>
+ ///<LayerDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="LayerDefinition-2.4.0.xsd" version="2.4.0">
+ /// <VectorLayerDefinition>
+ /// <ResourceId>{0}</ResourceId>
+ /// <FeatureName>{1}</FeatureName>
+ /// <FeatureNameType>FeatureClass</FeatureNameType>
+ /// <Geometry>{2}</Geometry>
+ /// <VectorScaleRange>
+ /// <AreaTypeStyle>
+ /// <AreaRule>
+ /// <LegendLabel/>
+ /// <AreaSymbolization2D>
+ /// <Fill>
+ /// [rest of string was truncated]";.
+ /// </summary>
+ internal static string AreaLayerDef {
+ get {
+ return ResourceManager.GetString("AreaLayerDef", resourceCulture);
+ }
+ }
+
internal static System.Drawing.Bitmap buffer {
get {
object obj = ResourceManager.GetObject("buffer", resourceCulture);
Modified: trunk/MgDev/Desktop/MapViewer/Properties/Resources.resx
===================================================================
--- trunk/MgDev/Desktop/MapViewer/Properties/Resources.resx 2012-04-26 15:45:54 UTC (rev 6594)
+++ trunk/MgDev/Desktop/MapViewer/Properties/Resources.resx 2012-04-27 15:17:59 UTC (rev 6595)
@@ -112,15 +112,15 @@
<value>2.0</value>
</resheader>
<resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="TextDigitizePolygon" xml:space="preserve">
<value>Digitize Polygon</value>
</data>
- <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="layer_shape_polyline" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\layer-shape-polyline.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@@ -364,4 +364,7 @@
<data name="icon_etc" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icon_etc.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
+ <data name="AreaLayerDef" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>..\Resources\AreaLayerDef.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
+ </data>
</root>
\ No newline at end of file
Added: trunk/MgDev/Desktop/MapViewer/Resources/AreaLayerDef.txt
===================================================================
--- trunk/MgDev/Desktop/MapViewer/Resources/AreaLayerDef.txt (rev 0)
+++ trunk/MgDev/Desktop/MapViewer/Resources/AreaLayerDef.txt 2012-04-27 15:17:59 UTC (rev 6595)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LayerDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="LayerDefinition-2.4.0.xsd" version="2.4.0">
+ <VectorLayerDefinition>
+ <ResourceId>{0}</ResourceId>
+ <FeatureName>{1}</FeatureName>
+ <FeatureNameType>FeatureClass</FeatureNameType>
+ <Geometry>{2}</Geometry>
+ <VectorScaleRange>
+ <AreaTypeStyle>
+ <AreaRule>
+ <LegendLabel/>
+ <AreaSymbolization2D>
+ <Fill>
+ <FillPattern>{3}</FillPattern>
+ <ForegroundColor>{4}</ForegroundColor>
+ <BackgroundColor>{5}</BackgroundColor>
+ </Fill>
+ <Stroke>
+ <LineStyle>{6}</LineStyle>
+ <Thickness>{7}</Thickness>
+ <Color>{8}</Color>
+ <Unit>Points</Unit>
+ <SizeContext>DeviceUnits</SizeContext>
+ </Stroke>
+ </AreaSymbolization2D>
+ </AreaRule>
+ </AreaTypeStyle>
+ </VectorScaleRange>
+ </VectorLayerDefinition>
+</LayerDefinition>
Modified: trunk/MgDev/Desktop/MapViewer.Desktop/MgDesktopMapViewerProvider.cs
===================================================================
--- trunk/MgDev/Desktop/MapViewer.Desktop/MgDesktopMapViewerProvider.cs 2012-04-26 15:45:54 UTC (rev 6594)
+++ trunk/MgDev/Desktop/MapViewer.Desktop/MgDesktopMapViewerProvider.cs 2012-04-27 15:17:59 UTC (rev 6595)
@@ -11,12 +11,14 @@
private MgdMap _implMap;
private MgRenderingService _renderSvc;
private MgServiceFactory _fact;
+ private MgResourceService _resSvc;
public MgDesktopMapViewerProvider(MgdMap map, MgdResourceService resSvc, MgRenderingService renderingService) : base(map, resSvc)
{
_implMap = map;
_fact = new MgServiceFactory();
_renderSvc = renderingService;
+ _resSvc = (MgResourceService)_fact.CreateService(MgServiceType.ResourceService);
}
@@ -123,5 +125,10 @@
throw new InvalidOperationException("The given layer is not of the expected implementation (" + typeof(MgdLayer).FullName + ")");
}
+
+ public override MgLayerBase CreateLayer(MgResourceIdentifier layerDefId)
+ {
+ return new MgdLayer(layerDefId, _resSvc);
+ }
}
}
Modified: trunk/MgDev/Desktop/MapViewerTest/Form1.Designer.cs
===================================================================
--- trunk/MgDev/Desktop/MapViewerTest/Form1.Designer.cs 2012-04-26 15:45:54 UTC (rev 6594)
+++ trunk/MgDev/Desktop/MapViewerTest/Form1.Designer.cs 2012-04-27 15:17:59 UTC (rev 6595)
@@ -29,6 +29,7 @@
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.lblCoords = new System.Windows.Forms.ToolStripStatusLabel();
this.lblScale = new System.Windows.Forms.ToolStripStatusLabel();
@@ -54,6 +55,8 @@
this.btnDigitizePolygon = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.btnPlotToDwf = new System.Windows.Forms.ToolStripButton();
+ this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
+ this.toolStripButton2 = new System.Windows.Forms.ToolStripButton();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.legend = new OSGeo.MapGuide.Viewer.MgLegend();
@@ -63,26 +66,28 @@
this.thisIsALayerContextMenuToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.propertyPane = new OSGeo.MapGuide.Viewer.MgPropertyPane();
this.viewer = new OSGeo.MapGuide.Viewer.MgMapViewer();
- this.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer();
- this.toolbar = new OSGeo.MapGuide.Viewer.MgDefaultToolbar();
this.ctxViewer = new System.Windows.Forms.ContextMenuStrip(this.components);
this.refreshMapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.initialViewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer();
+ this.toolbar = new OSGeo.MapGuide.Viewer.MgDefaultToolbar();
this.statusStrip1.SuspendLayout();
this.menuStrip1.SuspendLayout();
this.toolStrip1.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
this.splitContainer2.Panel1.SuspendLayout();
this.splitContainer2.Panel2.SuspendLayout();
this.splitContainer2.SuspendLayout();
this.ctxGroup.SuspendLayout();
this.ctxLayer.SuspendLayout();
+ this.ctxViewer.SuspendLayout();
this.toolStripContainer1.ContentPanel.SuspendLayout();
this.toolStripContainer1.TopToolStripPanel.SuspendLayout();
this.toolStripContainer1.SuspendLayout();
- this.ctxViewer.SuspendLayout();
this.SuspendLayout();
//
// statusStrip1
@@ -220,7 +225,9 @@
this.btnDigitizeRectangle,
this.btnDigitizePolygon,
this.toolStripSeparator1,
- this.btnPlotToDwf});
+ this.btnPlotToDwf,
+ this.toolStripButton1,
+ this.toolStripButton2});
this.toolStrip1.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow;
this.toolStrip1.Location = new System.Drawing.Point(0, 25);
this.toolStrip1.Name = "toolStrip1";
@@ -304,6 +311,24 @@
this.btnPlotToDwf.Text = "Plot current view to DWF";
this.btnPlotToDwf.Click += new System.EventHandler(this.btnPlotToDwf_Click);
//
+ // toolStripButton1
+ //
+ this.toolStripButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image")));
+ this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.toolStripButton1.Name = "toolStripButton1";
+ this.toolStripButton1.Size = new System.Drawing.Size(72, 22);
+ this.toolStripButton1.Text = "Measure";
+ this.toolStripButton1.Click += new System.EventHandler(this.toolStripButton1_Click);
+ //
+ // toolStripButton2
+ //
+ this.toolStripButton2.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton2.Image")));
+ this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.toolStripButton2.Name = "toolStripButton2";
+ this.toolStripButton2.Size = new System.Drawing.Size(59, 22);
+ this.toolStripButton2.Text = "Buffer";
+ this.toolStripButton2.Click += new System.EventHandler(this.toolStripButton2_Click);
+ //
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
@@ -399,9 +424,31 @@
this.viewer.SelectionColor = System.Drawing.Color.OrangeRed;
this.viewer.Size = new System.Drawing.Size(572, 465);
this.viewer.TabIndex = 1;
- this.viewer.ZoomInFactor = 0.75;
- this.viewer.ZoomOutFactor = 1.35;
+ this.viewer.ZoomInFactor = 0.75D;
+ this.viewer.ZoomOutFactor = 1.35D;
//
+ // ctxViewer
+ //
+ this.ctxViewer.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.refreshMapToolStripMenuItem,
+ this.initialViewToolStripMenuItem});
+ this.ctxViewer.Name = "ctxViewer";
+ this.ctxViewer.Size = new System.Drawing.Size(141, 48);
+ //
+ // refreshMapToolStripMenuItem
+ //
+ this.refreshMapToolStripMenuItem.Name = "refreshMapToolStripMenuItem";
+ this.refreshMapToolStripMenuItem.Size = new System.Drawing.Size(140, 22);
+ this.refreshMapToolStripMenuItem.Text = "Refresh Map";
+ this.refreshMapToolStripMenuItem.Click += new System.EventHandler(this.refreshMapToolStripMenuItem_Click);
+ //
+ // initialViewToolStripMenuItem
+ //
+ this.initialViewToolStripMenuItem.Name = "initialViewToolStripMenuItem";
+ this.initialViewToolStripMenuItem.Size = new System.Drawing.Size(140, 22);
+ this.initialViewToolStripMenuItem.Text = "Initial View";
+ this.initialViewToolStripMenuItem.Click += new System.EventHandler(this.initialViewToolStripMenuItem_Click);
+ //
// toolStripContainer1
//
//
@@ -434,28 +481,6 @@
this.toolbar.Viewer = null;
this.toolbar.ZoomOutMode = OSGeo.MapGuide.Viewer.ZoomOutMode.AutoZoom;
//
- // ctxViewer
- //
- this.ctxViewer.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.refreshMapToolStripMenuItem,
- this.initialViewToolStripMenuItem});
- this.ctxViewer.Name = "ctxViewer";
- this.ctxViewer.Size = new System.Drawing.Size(153, 70);
- //
- // refreshMapToolStripMenuItem
- //
- this.refreshMapToolStripMenuItem.Name = "refreshMapToolStripMenuItem";
- this.refreshMapToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
- this.refreshMapToolStripMenuItem.Text = "Refresh Map";
- this.refreshMapToolStripMenuItem.Click += new System.EventHandler(this.refreshMapToolStripMenuItem_Click);
- //
- // initialViewToolStripMenuItem
- //
- this.initialViewToolStripMenuItem.Name = "initialViewToolStripMenuItem";
- this.initialViewToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
- this.initialViewToolStripMenuItem.Text = "Initial View";
- this.initialViewToolStripMenuItem.Click += new System.EventHandler(this.initialViewToolStripMenuItem_Click);
- //
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -475,18 +500,20 @@
this.toolStrip1.PerformLayout();
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.splitContainer2.Panel1.ResumeLayout(false);
this.splitContainer2.Panel2.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
this.splitContainer2.ResumeLayout(false);
this.ctxGroup.ResumeLayout(false);
this.ctxLayer.ResumeLayout(false);
+ this.ctxViewer.ResumeLayout(false);
this.toolStripContainer1.ContentPanel.ResumeLayout(false);
this.toolStripContainer1.TopToolStripPanel.ResumeLayout(false);
this.toolStripContainer1.TopToolStripPanel.PerformLayout();
this.toolStripContainer1.ResumeLayout(false);
this.toolStripContainer1.PerformLayout();
- this.ctxViewer.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
@@ -533,6 +560,8 @@
private System.Windows.Forms.ContextMenuStrip ctxViewer;
private System.Windows.Forms.ToolStripMenuItem refreshMapToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem initialViewToolStripMenuItem;
+ private System.Windows.Forms.ToolStripButton toolStripButton1;
+ private System.Windows.Forms.ToolStripButton toolStripButton2;
}
}
Modified: trunk/MgDev/Desktop/MapViewerTest/Form1.cs
===================================================================
--- trunk/MgDev/Desktop/MapViewerTest/Form1.cs 2012-04-26 15:45:54 UTC (rev 6594)
+++ trunk/MgDev/Desktop/MapViewerTest/Form1.cs 2012-04-27 15:17:59 UTC (rev 6595)
@@ -443,5 +443,26 @@
{
viewer.InitialMapView();
}
+
+ private void toolStripButton1_Click(object sender, EventArgs e)
+ {
+ var ctrl = new MgLineMeasureControl(viewer, MeasurementUnit.Kilometers);
+ var frm = new Form();
+ frm.Text = "Measure";
+ ctrl.Dock = DockStyle.Fill;
+ frm.Controls.Add(ctrl);
+ frm.Show();
+ }
+
+ private void toolStripButton2_Click(object sender, EventArgs e)
+ {
+ var ctrl = new MgBufferControl(viewer);
+ var frm = new Form();
+ frm.Text = "Buffer";
+ frm.Size = ctrl.PreferredSize;
+ ctrl.Dock = DockStyle.Fill;
+ frm.Controls.Add(ctrl);
+ frm.Show();
+ }
}
}
Modified: trunk/MgDev/Desktop/MapViewerTest/Form1.resx
===================================================================
--- trunk/MgDev/Desktop/MapViewerTest/Form1.resx 2012-04-26 15:45:54 UTC (rev 6594)
+++ trunk/MgDev/Desktop/MapViewerTest/Form1.resx 2012-04-27 15:17:59 UTC (rev 6595)
@@ -112,30 +112,61 @@
<value>2.0</value>
</resheader>
<resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
- <metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
- <metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>133, 17</value>
</metadata>
- <metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>248, 17</value>
</metadata>
- <metadata name="ctxGroup.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <data name="toolStripButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIISURBVDhPpZP7S1NxGMbPPxKaXVUkMEq8IpKUCoY/hGgI
+ ymqkDYYXcCjDZOANURSjCNGFQUTsl4GXVMxKk62YU4fXQpaIlygHQxBRH8/zwvyaIAYe+HLgnPN8nue9
+ HA3nvDTq63oW/jm13XOwvPTB3DYFY5MH+bXfcN8ygfTSMSSXfESicQDxBqdYHwH29g9w2tnZ3UcguIvN
+ rR3417exuBJE5N1n/wfwLgXEOc38Bc6xNRHb+/y4nm49G0Bnit2zf9H6bkliE/jKuYxrd6oVgDWfjB+K
+ TWeKMyrGEVfowITvD9re/9ABVQrAhh0HHK+ZselMMaN/mvwtDb+aVqkA7HYIwIj3ysfluPTorJnP6Ezx
+ oHsD1s5ZXEktUwCOioB5f1CEPR9+wTG6iuiserTo8dkwng7HT/R+XUPF8xlcTjErAOdMcW6NW8STiwG8
+ 7vej8oUPN/PsEv3t8Ao0TZP3T1u8uJRkUgAuSYHtO97oLxmXd5t9Ho8aPTK+GzntqNfrLm2fFoihwYOI
+ xGIF4KjoGBLzY1OrF9k6OOFxnwDC4wxIMX1G0pMhgVyMNyoA13PAtS7OrJk1PrC69LUdQWxuF6IybHrX
+ LRI7JrtZdoDAo1XmbjMyD+tjSXxGcXRmnYg5ttD9QuxDhN0uUgDOmbvNTpPOJaGAo2K36cyaGZvOFIfd
+ KlSA8/zRh9ABIDUG+1JpAAAAAElFTkSuQmCC
+</value>
+ </data>
+ <data name="toolStripButton2.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIISURBVDhPpZP7S1NxGMbPPxKaXVUkMEq8IpKUCoY/hGgI
+ ymqkDYYXcCjDZOANURSjCNGFQUTsl4GXVMxKk62YU4fXQpaIlygHQxBRH8/zwvyaIAYe+HLgnPN8nue9
+ HA3nvDTq63oW/jm13XOwvPTB3DYFY5MH+bXfcN8ygfTSMSSXfESicQDxBqdYHwH29g9w2tnZ3UcguIvN
+ rR3417exuBJE5N1n/wfwLgXEOc38Bc6xNRHb+/y4nm49G0Bnit2zf9H6bkliE/jKuYxrd6oVgDWfjB+K
+ TWeKMyrGEVfowITvD9re/9ABVQrAhh0HHK+ZselMMaN/mvwtDb+aVqkA7HYIwIj3ysfluPTorJnP6Ezx
+ oHsD1s5ZXEktUwCOioB5f1CEPR9+wTG6iuiserTo8dkwng7HT/R+XUPF8xlcTjErAOdMcW6NW8STiwG8
+ 7vej8oUPN/PsEv3t8Ao0TZP3T1u8uJRkUgAuSYHtO97oLxmXd5t9Ho8aPTK+GzntqNfrLm2fFoihwYOI
+ xGIF4KjoGBLzY1OrF9k6OOFxnwDC4wxIMX1G0pMhgVyMNyoA13PAtS7OrJk1PrC69LUdQWxuF6IybHrX
+ LRI7JrtZdoDAo1XmbjMyD+tjSXxGcXRmnYg5ttD9QuxDhN0uUgDOmbvNTpPOJaGAo2K36cyaGZvOFIfd
+ KlSA8/zRh9ABIDUG+1JpAAAAAElFTkSuQmCC
+</value>
+ </data>
+ <metadata name="ctxGroup.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>444, 17</value>
</metadata>
- <metadata name="ctxLayer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <metadata name="ctxLayer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>545, 17</value>
</metadata>
- <metadata name="ctxViewer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <metadata name="ctxViewer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>641, 17</value>
</metadata>
- <metadata name="toolbar.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <metadata name="toolbar.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>353, 17</value>
</metadata>
</root>
\ No newline at end of file
Modified: trunk/MgDev/Desktop/MgDesktop/Services/FeatureService.cpp
===================================================================
--- trunk/MgDev/Desktop/MgDesktop/Services/FeatureService.cpp 2012-04-26 15:45:54 UTC (rev 6594)
+++ trunk/MgDev/Desktop/MgDesktop/Services/FeatureService.cpp 2012-04-27 15:17:59 UTC (rev 6595)
@@ -3381,8 +3381,7 @@
{
CHECK_FEATURE_SOURCE_ARGUMENT(resource, L"MgdFeatureService::UpdateFeatures");
CHECKARGUMENTNULL(commands, L"MgdFeatureService::UpdateFeatures");
- CHECKARGUMENTNULL(transaction, L"MgdFeatureService::UpdateFeatures");
-
+
Ptr<MgPropertyCollection> ret;
MG_FEATURE_SERVICE_TRY()
@@ -3437,7 +3436,7 @@
bool supports = false;
for (FdoInt32 j = 0; j < sCmdCount; j++)
{
- if (supportedCmds[i] == FdoCommandType_Insert)
+ if (supportedCmds[j] == FdoCommandType_Insert)
{
supports = true;
break;
@@ -3466,7 +3465,7 @@
bool supports = false;
for (FdoInt32 j = 0; j < sCmdCount; j++)
{
- if (supportedCmds[i] == FdoCommandType_Delete)
+ if (supportedCmds[j] == FdoCommandType_Delete)
{
supports = true;
break;
@@ -3494,7 +3493,7 @@
bool supports = false;
for (FdoInt32 j = 0; j < sCmdCount; j++)
{
- if (supportedCmds[i] == FdoCommandType_Update)
+ if (supportedCmds[j] == FdoCommandType_Update)
{
supports = true;
break;
More information about the mapguide-commits
mailing list