[mapguide-commits] r7076 - in trunk/Tools/Maestro: Maestro.Editors/MapDefinition Maestro.LiveMapEditor Maestro.LiveMapEditor/Properties Maestro.MapViewer OSGeo.MapGuide.MaestroAPI/Mapping
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Thu Oct 4 06:56:37 PDT 2012
Author: jng
Date: 2012-10-04 06:56:36 -0700 (Thu, 04 Oct 2012)
New Revision: 7076
Added:
trunk/Tools/Maestro/Maestro.LiveMapEditor/Strings.Designer.cs
trunk/Tools/Maestro/Maestro.LiveMapEditor/Strings.resx
Modified:
trunk/Tools/Maestro/Maestro.Editors/MapDefinition/LiveMapDefinitionEditorCtrl.cs
trunk/Tools/Maestro/Maestro.LiveMapEditor/Maestro.LiveMapEditor.csproj
trunk/Tools/Maestro/Maestro.LiveMapEditor/MainForm.cs
trunk/Tools/Maestro/Maestro.LiveMapEditor/MapSettingsDialog.cs
trunk/Tools/Maestro/Maestro.LiveMapEditor/MapSettingsDialog.resx
trunk/Tools/Maestro/Maestro.LiveMapEditor/Properties/Resources.Designer.cs
trunk/Tools/Maestro/Maestro.LiveMapEditor/Properties/Resources.resx
trunk/Tools/Maestro/Maestro.MapViewer/Interfaces.cs
trunk/Tools/Maestro/Maestro.MapViewer/Legend.cs
trunk/Tools/Maestro/Maestro.MapViewer/LegendPresenter.cs
trunk/Tools/Maestro/Maestro.MapViewer/MapViewer.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMap.cs
Log:
#2018: This submission includes the following changes:
- Port over tiled map "support" from mg-desktop viewer
- Add missing APIs to RuntimeMap to allow finite scale range interrogation
- Remove ConvertTiledGroupsToNonTiled option and warning in Live Map Editor, instead a new message will be displayed indicating that the RenderMap API will be used instead of the RenderDynamicOverlay API. The only side-effects of using RenderMap over RenderDynamicOverlay are larger image sizes and RenderMap images cannot be under-laid as the map background color is pre-filled in.
- Fix anchor layout issues in the Map Settings Dialog
- Move localizable strings into Strings.resx
Modified: trunk/Tools/Maestro/Maestro.Editors/MapDefinition/LiveMapDefinitionEditorCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/MapDefinition/LiveMapDefinitionEditorCtrl.cs 2012-10-04 12:47:09 UTC (rev 7075)
+++ trunk/Tools/Maestro/Maestro.Editors/MapDefinition/LiveMapDefinitionEditorCtrl.cs 2012-10-04 13:56:36 UTC (rev 7076)
@@ -79,20 +79,6 @@
}
/// <summary>
- /// Gets or sets whether to convert tiled groups to untiled groups
- /// </summary>
- /// <remarks>
- /// This property is a workaround for the fact that the map viewer currently does not support rendering of tiled
- /// layers. It is recommended to set this property to true, otherwise such layers and groups are not visible on
- /// the live preview
- /// </remarks>
- public bool ConvertTiledGroupsToNonTiled
- {
- get { return viewer.ConvertTiledGroupsToNonTiled; }
- set { viewer.ConvertTiledGroupsToNonTiled = value; }
- }
-
- /// <summary>
/// Refreshes the viewer
/// </summary>
public void RefreshMap()
Modified: trunk/Tools/Maestro/Maestro.LiveMapEditor/Maestro.LiveMapEditor.csproj
===================================================================
--- trunk/Tools/Maestro/Maestro.LiveMapEditor/Maestro.LiveMapEditor.csproj 2012-10-04 12:47:09 UTC (rev 7075)
+++ trunk/Tools/Maestro/Maestro.LiveMapEditor/Maestro.LiveMapEditor.csproj 2012-10-04 13:56:36 UTC (rev 7076)
@@ -79,6 +79,11 @@
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ResourceEditorService.cs" />
+ <Compile Include="Strings.Designer.cs">
+ <AutoGen>True</AutoGen>
+ <DesignTime>True</DesignTime>
+ <DependentUpon>Strings.resx</DependentUpon>
+ </Compile>
<EmbeddedResource Include="AboutDialog.resx">
<DependentUpon>AboutDialog.cs</DependentUpon>
</EmbeddedResource>
@@ -98,6 +103,10 @@
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
+ <EmbeddedResource Include="Strings.resx">
+ <Generator>ResXFileCodeGenerator</Generator>
+ <LastGenOutput>Strings.Designer.cs</LastGenOutput>
+ </EmbeddedResource>
<None Include="app.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
Modified: trunk/Tools/Maestro/Maestro.LiveMapEditor/MainForm.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.LiveMapEditor/MainForm.cs 2012-10-04 12:47:09 UTC (rev 7075)
+++ trunk/Tools/Maestro/Maestro.LiveMapEditor/MainForm.cs 2012-10-04 13:56:36 UTC (rev 7076)
@@ -82,7 +82,7 @@
{
ClearExistingEditor();
- var mdf = ObjectFactory.CreateMapDefinition(_conn, Properties.Resources.NewMap);
+ var mdf = ObjectFactory.CreateMapDefinition(_conn, Strings.NewMap);
var diag = new MapSettingsDialog(_conn, mdf);
if (diag.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
@@ -97,8 +97,7 @@
{
if (mdf.BaseMap.GroupCount > 0)
{
- if (MessageBox.Show(Properties.Resources.ConfirmTiledGroupConversion, Properties.Resources.ConfirmTiledMap, MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.No)
- return;
+ MessageBox.Show(Strings.TiledMapNote, Strings.TitleTiledMap);
}
}
@@ -153,7 +152,7 @@
{
if (_mapEditor != null)
{
- if (MessageBox.Show(Properties.Resources.ConfirmNewMap, Properties.Resources.CaptionNewMap, MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
+ if (MessageBox.Show(Strings.ConfirmNewMap, Strings.CaptionNewMap, MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
{
DoSave();
}
@@ -167,7 +166,7 @@
if (_mapEditor == null)
this.Text = _origTitle;
else
- this.Text = _origTitle + " - " + (_mapEditor.EditorService.IsNew ? Properties.Resources.CaptionNewMap : _mapEditor.EditorService.ResourceID);
+ this.Text = _origTitle + " - " + (_mapEditor.EditorService.IsNew ? Strings.CaptionNewMap : _mapEditor.EditorService.ResourceID);
}
private void btnMapProperties_Click(object sender, EventArgs e)
Modified: trunk/Tools/Maestro/Maestro.LiveMapEditor/MapSettingsDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.LiveMapEditor/MapSettingsDialog.cs 2012-10-04 12:47:09 UTC (rev 7075)
+++ trunk/Tools/Maestro/Maestro.LiveMapEditor/MapSettingsDialog.cs 2012-10-04 13:56:36 UTC (rev 7076)
@@ -69,7 +69,7 @@
{
if (string.IsNullOrEmpty(txtCoordinateSystem.Text))
{
- MessageBox.Show(Properties.Resources.ErrCoordSysRequired);
+ MessageBox.Show(Strings.ErrCoordSysRequired);
return false;
}
else
@@ -86,7 +86,7 @@
!double.TryParse(txtUpperX.Text, out urx) ||
!double.TryParse(txtUpperY.Text, out ury))
{
- MessageBox.Show(Properties.Resources.ErrInvalidExtents);
+ MessageBox.Show(Strings.ErrInvalidExtents);
return false;
}
else
Modified: trunk/Tools/Maestro/Maestro.LiveMapEditor/MapSettingsDialog.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.LiveMapEditor/MapSettingsDialog.resx 2012-10-04 12:47:09 UTC (rev 7075)
+++ trunk/Tools/Maestro/Maestro.LiveMapEditor/MapSettingsDialog.resx 2012-10-04 13:56:36 UTC (rev 7076)
@@ -528,6 +528,9 @@
<data name=">>label2.ZOrder" xml:space="preserve">
<value>7</value>
</data>
+ <data name="btnCancel.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
+ <value>Bottom, Right</value>
+ </data>
<data name="btnCancel.Location" type="System.Drawing.Point, System.Drawing">
<value>346, 182</value>
</data>
@@ -552,6 +555,9 @@
<data name=">>btnCancel.ZOrder" xml:space="preserve">
<value>1</value>
</data>
+ <data name="btnOK.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
+ <value>Bottom, Right</value>
+ </data>
<data name="btnOK.Location" type="System.Drawing.Point, System.Drawing">
<value>265, 182</value>
</data>
Modified: trunk/Tools/Maestro/Maestro.LiveMapEditor/Properties/Resources.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.LiveMapEditor/Properties/Resources.Designer.cs 2012-10-04 12:47:09 UTC (rev 7075)
+++ trunk/Tools/Maestro/Maestro.LiveMapEditor/Properties/Resources.Designer.cs 2012-10-04 13:56:36 UTC (rev 7076)
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
-// Runtime Version:4.0.30319.225
+// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -60,6 +60,9 @@
}
}
+ /// <summary>
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ /// </summary>
internal static System.Drawing.Bitmap application_task {
get {
object obj = ResourceManager.GetObject("application-task", resourceCulture);
@@ -67,6 +70,9 @@
}
}
+ /// <summary>
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ /// </summary>
internal static System.Drawing.Bitmap arrow_circle_double {
get {
object obj = ResourceManager.GetObject("arrow-circle-double", resourceCulture);
@@ -75,41 +81,8 @@
}
/// <summary>
- /// Looks up a localized string similar to New Map.
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
- internal static string CaptionNewMap {
- get {
- return ResourceManager.GetString("CaptionNewMap", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to You have an existing open map. Save that map first?.
- /// </summary>
- internal static string ConfirmNewMap {
- get {
- return ResourceManager.GetString("ConfirmNewMap", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to The Map Editor currently does not support the display of tiled layers and groups. As a workaround, these groups are converted to regular groups. Proceed with Group Conversion?.
- /// </summary>
- internal static string ConfirmTiledGroupConversion {
- get {
- return ResourceManager.GetString("ConfirmTiledGroupConversion", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Tiled Map Support.
- /// </summary>
- internal static string ConfirmTiledMap {
- get {
- return ResourceManager.GetString("ConfirmTiledMap", resourceCulture);
- }
- }
-
internal static System.Drawing.Bitmap disk {
get {
object obj = ResourceManager.GetObject("disk", resourceCulture);
@@ -117,6 +90,9 @@
}
}
+ /// <summary>
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ /// </summary>
internal static System.Drawing.Bitmap disk__arrow {
get {
object obj = ResourceManager.GetObject("disk--arrow", resourceCulture);
@@ -125,23 +101,8 @@
}
/// <summary>
- /// Looks up a localized string similar to Coordinate System Required.
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
- internal static string ErrCoordSysRequired {
- get {
- return ResourceManager.GetString("ErrCoordSysRequired", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Extents are invalid or empty.
- /// </summary>
- internal static string ErrInvalidExtents {
- get {
- return ResourceManager.GetString("ErrInvalidExtents", resourceCulture);
- }
- }
-
internal static System.Drawing.Bitmap folder_horizontal_open {
get {
object obj = ResourceManager.GetObject("folder-horizontal-open", resourceCulture);
@@ -149,6 +110,9 @@
}
}
+ /// <summary>
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ /// </summary>
internal static System.Drawing.Bitmap MaestroAbout {
get {
object obj = ResourceManager.GetObject("MaestroAbout", resourceCulture);
@@ -156,6 +120,9 @@
}
}
+ /// <summary>
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ /// </summary>
internal static System.Drawing.Bitmap map__plus {
get {
object obj = ResourceManager.GetObject("map--plus", resourceCulture);
@@ -164,14 +131,8 @@
}
/// <summary>
- /// Looks up a localized string similar to New Map.
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
- internal static string NewMap {
- get {
- return ResourceManager.GetString("NewMap", resourceCulture);
- }
- }
-
internal static System.Drawing.Bitmap property {
get {
object obj = ResourceManager.GetObject("property", resourceCulture);
Modified: trunk/Tools/Maestro/Maestro.LiveMapEditor/Properties/Resources.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.LiveMapEditor/Properties/Resources.resx 2012-10-04 12:47:09 UTC (rev 7075)
+++ trunk/Tools/Maestro/Maestro.LiveMapEditor/Properties/Resources.resx 2012-10-04 13:56:36 UTC (rev 7076)
@@ -117,9 +117,6 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
- <data name="ConfirmNewMap" xml:space="preserve">
- <value>You have an existing open map. Save that map first?</value>
- </data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="arrow-circle-double" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\arrow-circle-double.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
@@ -130,36 +127,18 @@
<data name="disk" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\disk.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
- <data name="ErrCoordSysRequired" xml:space="preserve">
- <value>Coordinate System Required</value>
- </data>
<data name="disk--arrow" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\disk--arrow.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="map--plus" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\map--plus.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
- <data name="CaptionNewMap" xml:space="preserve">
- <value>New Map</value>
- </data>
- <data name="NewMap" xml:space="preserve">
- <value>New Map</value>
- </data>
- <data name="ErrInvalidExtents" xml:space="preserve">
- <value>Extents are invalid or empty</value>
- </data>
<data name="application-task" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\application-task.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="property" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\property.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
- <data name="ConfirmTiledGroupConversion" xml:space="preserve">
- <value>The Map Editor currently does not support the display of tiled layers and groups. As a workaround, these groups are converted to regular groups. Proceed with Group Conversion?</value>
- </data>
- <data name="ConfirmTiledMap" xml:space="preserve">
- <value>Tiled Map Support</value>
- </data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="MaestroAbout" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
Added: trunk/Tools/Maestro/Maestro.LiveMapEditor/Strings.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.LiveMapEditor/Strings.Designer.cs (rev 0)
+++ trunk/Tools/Maestro/Maestro.LiveMapEditor/Strings.Designer.cs 2012-10-04 13:56:36 UTC (rev 7076)
@@ -0,0 +1,126 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.17929
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace Maestro.LiveMapEditor {
+ using System;
+
+
+ /// <summary>
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ /// </summary>
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Strings {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Strings() {
+ }
+
+ /// <summary>
+ /// Returns the cached ResourceManager instance used by this class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Maestro.LiveMapEditor.Strings", typeof(Strings).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ /// <summary>
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to New Map.
+ /// </summary>
+ internal static string CaptionNewMap {
+ get {
+ return ResourceManager.GetString("CaptionNewMap", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to You have an existing open map. Save that map first?.
+ /// </summary>
+ internal static string ConfirmNewMap {
+ get {
+ return ResourceManager.GetString("ConfirmNewMap", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Coordinate System Required.
+ /// </summary>
+ internal static string ErrCoordSysRequired {
+ get {
+ return ResourceManager.GetString("ErrCoordSysRequired", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Extents are invalid or empty.
+ /// </summary>
+ internal static string ErrInvalidExtents {
+ get {
+ return ResourceManager.GetString("ErrInvalidExtents", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to New Map.
+ /// </summary>
+ internal static string NewMap {
+ get {
+ return ResourceManager.GetString("NewMap", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Because this map has tiled layers, the RenderMap API will be used instead of the normal RenderDynamicOverlay API for map images.
+ /// </summary>
+ internal static string TiledMapNote {
+ get {
+ return ResourceManager.GetString("TiledMapNote", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Tiled Map Support.
+ /// </summary>
+ internal static string TitleTiledMap {
+ get {
+ return ResourceManager.GetString("TitleTiledMap", resourceCulture);
+ }
+ }
+ }
+}
Added: trunk/Tools/Maestro/Maestro.LiveMapEditor/Strings.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.LiveMapEditor/Strings.resx (rev 0)
+++ trunk/Tools/Maestro/Maestro.LiveMapEditor/Strings.resx 2012-10-04 13:56:36 UTC (rev 7076)
@@ -0,0 +1,141 @@
+<?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>
+ <data name="CaptionNewMap" xml:space="preserve">
+ <value>New Map</value>
+ </data>
+ <data name="ConfirmNewMap" xml:space="preserve">
+ <value>You have an existing open map. Save that map first?</value>
+ </data>
+ <data name="ErrCoordSysRequired" xml:space="preserve">
+ <value>Coordinate System Required</value>
+ </data>
+ <data name="ErrInvalidExtents" xml:space="preserve">
+ <value>Extents are invalid or empty</value>
+ </data>
+ <data name="NewMap" xml:space="preserve">
+ <value>New Map</value>
+ </data>
+ <data name="TiledMapNote" xml:space="preserve">
+ <value>Because this map has tiled layers, the RenderMap API will be used instead of the normal RenderDynamicOverlay API for map images</value>
+ </data>
+ <data name="TitleTiledMap" xml:space="preserve">
+ <value>Tiled Map Support</value>
+ </data>
+</root>
\ No newline at end of file
Modified: trunk/Tools/Maestro/Maestro.MapViewer/Interfaces.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.MapViewer/Interfaces.cs 2012-10-04 12:47:09 UTC (rev 7075)
+++ trunk/Tools/Maestro/Maestro.MapViewer/Interfaces.cs 2012-10-04 13:56:36 UTC (rev 7076)
@@ -318,7 +318,22 @@
/// </summary>
bool ConvertTiledGroupsToNonTiled { get; set; }
+
/// <summary>
+ /// Gets whether to use the RenderMap API instead of RenderDynamicOverlay if the map has tiled
+ /// layers. RenderMap includes tiled layers as part of the output image, but will not take advantage
+ /// of any tile caching mechanisms. Setting this property to true nullifies any effect of the
+ /// <see cref="P:Maestro.MapViewer.IMapViewer.ConvertTiledGroupsToNonTiled"/> property
+ /// </summary>
+ bool UseRenderMapIfTiledLayersExist { get; set; }
+
+ /// <summary>
+ /// Gets whether to respect the list of finite display scales in a map being viewed if there are any defined.
+ /// If true, all zooms will "snap" to the nearest finite display scale
+ /// </summary>
+ bool RespectFiniteDisplayScales { get; set; }
+
+ /// <summary>
/// Gets whether this viewer has a map loaded into it
/// </summary>
bool HasLoadedMap { get; }
Modified: trunk/Tools/Maestro/Maestro.MapViewer/Legend.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.MapViewer/Legend.cs 2012-10-04 12:47:09 UTC (rev 7075)
+++ trunk/Tools/Maestro/Maestro.MapViewer/Legend.cs 2012-10-04 13:56:36 UTC (rev 7076)
@@ -289,6 +289,9 @@
return;
var meta = ((LegendNodeMetadata)e.Node.Tag);
+ if (!meta.Checkable)
+ return;
+
if (meta.IsGroup) //Group
{
_presenter.SetGroupVisible(meta.ObjectId, e.Node.Checked);
@@ -305,6 +308,9 @@
return;
var meta = ((LegendNodeMetadata)e.Node.Tag);
+ if (!meta.Checkable) //Shouldn't happen, but just in case
+ return;
+
if (meta.IsGroup) //Group
{
_presenter.SetGroupExpandInLegend(meta.ObjectId, true);
@@ -420,12 +426,19 @@
{
trvLegend.SelectedNode = e.Node;
var meta = e.Node.Tag as LayerNodeMetadata;
+
+
if (meta != null && meta.DrawSelectabilityIcon)
{
//Toggle layer's selectability if it's within the bounds of the selectability icon
var box = new Rectangle(
new Point((e.Node.Bounds.Location.X - 36) + 16, e.Node.Bounds.Location.Y),
new Size(16, e.Node.Bounds.Height));
+
+ //Uncheckable items need to move 16px to the left
+ if (!meta.Checkable)
+ box.Offset(-16, 0);
+
if (box.Contains(e.X, e.Y))
{
var layer = meta.Layer;
Modified: trunk/Tools/Maestro/Maestro.MapViewer/LegendPresenter.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.MapViewer/LegendPresenter.cs 2012-10-04 12:47:09 UTC (rev 7075)
+++ trunk/Tools/Maestro/Maestro.MapViewer/LegendPresenter.cs 2012-10-04 13:56:36 UTC (rev 7076)
@@ -77,7 +77,10 @@
for (int i = 0; i < layers.Count; i++)
{
var layer = layers[i];
- _layers[layer.ObjectId] = new LayerNodeMetadata(layer, layer.Selectable);
+ RuntimeMapGroup group = null;
+ if (!string.IsNullOrEmpty(layer.Group))
+ group = _map.Groups[layer.Group];
+ _layers[layer.ObjectId] = new LayerNodeMetadata(layer, layer.Selectable, (group != null && group.Type == RuntimeMapGroup.kBaseMap));
}
}
}
@@ -132,7 +135,10 @@
}
else //If not in the dictionary, assume it is a dynamically added layer
{
- layerMeta = new LayerNodeMetadata(layer, bInitiallySelectable);
+ RuntimeMapGroup group = null;
+ if (!string.IsNullOrEmpty(layer.Group))
+ group = _map.Groups[layer.Group];
+ layerMeta = new LayerNodeMetadata(layer, bInitiallySelectable, (group != null && group.Type == RuntimeMapGroup.kBaseMap));
_layers[layer.ObjectId] = layerMeta;
}
node.Tag = layerMeta;
@@ -147,7 +153,10 @@
}
else
{
- layerMeta = new LayerNodeMetadata(layer, layer.Selectable);
+ RuntimeMapGroup group = null;
+ if (!string.IsNullOrEmpty(layer.Group))
+ group = _map.Groups[layer.Group];
+ layerMeta = new LayerNodeMetadata(layer, layer.Selectable, (group != null && group.Type == RuntimeMapGroup.kBaseMap));
_layers[layer.ObjectId] = layerMeta;
}
if (string.IsNullOrEmpty(layerMeta.LayerDefinitionContent))
@@ -465,7 +474,10 @@
}
else
{
- meta = new LayerNodeMetadata(lyr, lyr.Selectable);
+ RuntimeMapGroup group = null;
+ if (!string.IsNullOrEmpty(lyr.Group))
+ group = _map.Groups[lyr.Group];
+ meta = new LayerNodeMetadata(lyr, lyr.Selectable, (group != null && group.Type == RuntimeMapGroup.kBaseMap));
_layers[objId] = meta;
added++;
}
@@ -630,7 +642,7 @@
var checkBoxOffset = xoffset;
var selectabilityOffset = xoffset + 16;
var iconOffsetNoSelect = xoffset + 16;
- if (themeMeta != null) //No checkbox for theme rule nodes
+ if (layerMeta != null && !layerMeta.Checkable) //No checkbox for theme rule nodes
{
selectabilityOffset = xoffset;
iconOffsetNoSelect = xoffset;
@@ -642,7 +654,7 @@
//Uncomment if you need to "see" the bounds of the node
//e.Graphics.DrawRectangle(Pens.Black, e.Node.Bounds);
- if (layerMeta != null) //No checkbox for theme rule nodes
+ if (layerMeta != null && layerMeta.Checkable) //No checkbox for theme rule nodes
{
if (Application.RenderWithVisualStyles)
{
@@ -814,6 +826,8 @@
public bool IsGroup { get; protected set; }
public abstract string ObjectId { get; }
+
+ public bool Checkable { get; protected set; }
}
[DebuggerDisplay("Name = {GroupName}, Label = {LegendLabel}")]
@@ -827,6 +841,7 @@
{
base.IsGroup = true;
this.Group = group;
+ this.Checkable = true;
}
public string LegendLabel { get { return this.Group.LegendLabel; } }
@@ -847,6 +862,7 @@
this.IsPlaceholder = bPlaceholder;
this.ThemeIcon = themeIcon;
this.Label = labelText;
+ this.Checkable = false;
}
public bool IsPlaceholder { get; private set; }
@@ -899,7 +915,7 @@
[DebuggerDisplay("Name = {Layer.Name}, Label = {Layer.LegendLabel}")]
public class LayerNodeMetadata : LegendNodeMetadata
{
- public LayerNodeMetadata(RuntimeMapLayer layer, bool bInitiallySelectable)
+ public LayerNodeMetadata(RuntimeMapLayer layer, bool bInitiallySelectable, bool bTiled)
{
base.IsGroup = false;
this.Layer = layer;
@@ -907,6 +923,7 @@
this.DrawSelectabilityIcon = (layer != null && bInitiallySelectable);
this.WasInitiallySelectable = bInitiallySelectable;
this.LayerDefinitionContent = null;
+ this.Checkable = !bTiled;
_themeNodes = new Dictionary<ThemeCategory, List<LayerThemeNodeMetadata>>();
_defaultIcons = new Dictionary<ThemeCategory, Image>();
}
Modified: trunk/Tools/Maestro/Maestro.MapViewer/MapViewer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.MapViewer/MapViewer.cs 2012-10-04 12:47:09 UTC (rev 7075)
+++ trunk/Tools/Maestro/Maestro.MapViewer/MapViewer.cs 2012-10-04 13:56:36 UTC (rev 7076)
@@ -189,6 +189,9 @@
this.MinScale = 10;
this.MaxScale = 1000000000;
+ this.UseRenderMapIfTiledLayersExist = true;
+ this.RespectFiniteDisplayScales = true;
+
this.DigitizingFillTransparency = 100;
this.DigitizingOutline = Brushes.Red;
this.DigitzingFillColor = Color.White;
@@ -1189,6 +1192,27 @@
}
/// <summary>
+ /// Gets whether to use the RenderMap API instead of RenderDynamicOverlay if the map has tiled
+ /// layers. RenderMap includes tiled layers as part of the output image, but will not take advantage
+ /// of any tile caching mechanisms. Setting this property to true nullifies any effect of the
+ /// <see cref="P:Maestro.MapViewer.MapViewer.ConvertTiledGroupsToNonTiled"/> property
+ /// </summary>
+ [Category("MapGuide Viewer")] //NOXLATE
+ [Description("If true, the viewer will use the RenderMap API instead of RenderDynamicOverlay allowing tiled layers to be rendered to the final image. Setting this property to true nullifies the ConvertTiledGroupsToNonTiled property")] //NOXLATE
+ [DefaultValue(true)]
+ public bool UseRenderMapIfTiledLayersExist { get; set; }
+
+ /// <summary>
+ /// Gets whether to respect the list of finite display scales in a map being viewed if there are any defined.
+ /// If true, all zooms will "snap" to the nearest finite display scale. Otherwise, the viewer will disregard
+ /// this list when zooming in or out.
+ /// </summary>
+ [Category("MapGuide Viewer")] //NOXLATE
+ [Description("If true, all zooms will snap to the nearest finite display scale defined in the map being viewed")] //NOXLATE
+ [DefaultValue(true)]
+ public bool RespectFiniteDisplayScales { get; set; }
+
+ /// <summary>
/// Raised when the viewer has been initialized
/// </summary>
[Category("MapGuide Viewer")]
@@ -1317,6 +1341,10 @@
class RenderWorkArgs
{
+ public RenderWorkArgs() { this.UseRenderMap = false; }
+
+ public bool UseRenderMap { get; set; }
+
public ViewerRenderingOptions SelectionRenderingOptions { get; set; }
public ViewerRenderingOptions MapRenderingOptions { get; set; }
@@ -1427,6 +1455,7 @@
{
var args = new RenderWorkArgs()
{
+ UseRenderMap = this.UseRenderMapIfTiledLayersExist && this.HasTiledLayers,
MapRenderingOptions = _overlayRenderOpts,
RaiseEvents = raiseEvents
};
@@ -1679,13 +1708,16 @@
internal void ZoomToView(double x, double y, double scale, bool refresh, bool raiseEvents, bool addToHistoryStack)
{
+ var newScale = NormalizeScale(scale);
+ if (_map.FiniteDisplayScaleCount > 0 && this.RespectFiniteDisplayScales)
+ newScale = GetNearestFiniteScale(scale);
if (addToHistoryStack)
{
//If not current view, then any entries from the current view index are no longer needed
if (ViewHistoryIndex < _viewHistory.Count - 1)
PruneHistoryEntriesFromCurrentView();
- _viewHistory.Add(new MapViewHistoryEntry(x, y, scale));
+ _viewHistory.Add(new MapViewHistoryEntry(x, y, newScale));
OnPropertyChanged("ViewHistory");
_viewHistoryIndex = _viewHistory.Count - 1;
OnPropertyChanged("ViewHistoryIndex");
@@ -1702,7 +1734,7 @@
Trace.TraceInformation("Center is (" + x + ", " + y + ")");
#endif
var oldScale = _map.ViewScale;
- _map.ViewScale = Math.Max(scale, MINIMUM_ZOOM_SCALE);
+ _map.ViewScale = newScale;
if (oldScale != _map.ViewScale)
{
@@ -1722,6 +1754,36 @@
RefreshMap(raiseEvents);
}
+ private double GetNearestFiniteScale(double scale)
+ {
+ return _map.GetFiniteDisplayScaleAt(GetFiniteScaleIndex(scale));
+ }
+
+ private int GetFiniteScaleIndex(double reqScale)
+ {
+ var index = 0;
+ var scaleCount = _map.FiniteDisplayScaleCount;
+ if (scaleCount > 0)
+ {
+ var bestDiff = Math.Abs(_map.GetFiniteDisplayScaleAt(0) - reqScale);
+ for (var i = 1; i < scaleCount; i++)
+ {
+ var scaleDiff = Math.Abs(_map.GetFiniteDisplayScaleAt(i) - reqScale);
+ if (scaleDiff < bestDiff)
+ {
+ index = i;
+ bestDiff = scaleDiff;
+ if (bestDiff == 0)
+ {
+ //perfect match
+ break;
+ }
+ }
+ }
+ }
+ return index;
+ }
+
/// <summary>
/// Raised when the scale of the current runtime map has changed
/// </summary>
@@ -1745,7 +1807,10 @@
var res = new RenderResult() { RaiseEvents = args.RaiseEvents, InvalidateRegardless = args.InvalidateRegardless };
if (args.MapRenderingOptions != null)
{
- res.Image = Image.FromStream(_map.RenderDynamicOverlay(null, args.MapRenderingOptions.Format, args.MapRenderingOptions.Color, args.MapRenderingOptions.Behavior));
+ if (args.UseRenderMap)
+ res.Image = Image.FromStream(_map.Render(args.MapRenderingOptions.Format));
+ else
+ res.Image = Image.FromStream(_map.RenderDynamicOverlay(null, args.MapRenderingOptions.Format, args.MapRenderingOptions.Color, args.MapRenderingOptions.Behavior));
}
if (args.SelectionRenderingOptions != null)
{
@@ -2746,5 +2811,36 @@
}
public bool HasLoadedMap { get { return _map != null; } }
+
+ private bool? _hasTiledLayers;
+
+ internal bool HasTiledLayers
+ {
+ get
+ {
+ if (!_hasTiledLayers.HasValue)
+ {
+ if (_map != null)
+ {
+ var groups = _map.Groups;
+ for (int i = 0; i < groups.Count; i++)
+ {
+ if (groups[i].Type == RuntimeMapGroup.kBaseMap)
+ {
+ _hasTiledLayers = true;
+ break;
+ }
+ }
+ if (!_hasTiledLayers.HasValue)
+ _hasTiledLayers = false;
+ }
+ else
+ {
+ _hasTiledLayers = false;
+ }
+ }
+ return _hasTiledLayers.Value;
+ }
+ }
}
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMap.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMap.cs 2012-10-04 12:47:09 UTC (rev 7075)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMap.cs 2012-10-04 13:56:36 UTC (rev 7076)
@@ -332,6 +332,18 @@
}
/// <summary>
+ /// Gets the number of finite display scales
+ /// </summary>
+ public int FiniteDisplayScaleCount { get { return _finiteDisplayScales.Length; } }
+
+ /// <summary>
+ /// Gets the finite display scale at the specified index
+ /// </summary>
+ /// <param name="index"></param>
+ /// <returns></returns>
+ public double GetFiniteDisplayScaleAt(int index) { return _finiteDisplayScales[index]; }
+
+ /// <summary>
/// Gets or sets the map extents.
/// </summary>
/// <value>The map extents.</value>
More information about the mapguide-commits
mailing list