[mapguide-commits] r4809 -
trunk/Tools/Maestro/Maestro/ResourceEditors
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Wed Apr 21 21:17:14 EDT 2010
Author: jng
Date: 2010-04-21 21:17:13 -0400 (Wed, 21 Apr 2010)
New Revision: 4809
Modified:
trunk/Tools/Maestro/Maestro/ResourceEditors/FeatureSourceEditorBase.cs
trunk/Tools/Maestro/Maestro/ResourceEditors/MapEditor.cs
Log:
Fix a null reference on base layer drag/drop and disable local feature source preview for known raster providers.
Modified: trunk/Tools/Maestro/Maestro/ResourceEditors/FeatureSourceEditorBase.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/ResourceEditors/FeatureSourceEditorBase.cs 2010-04-21 00:29:51 UTC (rev 4808)
+++ trunk/Tools/Maestro/Maestro/ResourceEditors/FeatureSourceEditorBase.cs 2010-04-22 01:17:13 UTC (rev 4809)
@@ -103,18 +103,28 @@
CoordinateSystemOverride.SetItem(m_editor, feature);
}
- FeatureSourcePreviewCtrl ctl = new FeatureSourcePreviewCtrl(m_editor, ProviderName.Text, m_editor.ResourceId);
- ctl.Dock = DockStyle.Fill;
+ //This stuff is not applicable to raster providers
+ string provider = feature.Provider.ToUpper();
+ if (!provider.StartsWith("OSGEO.GDAL") &&
+ !provider.StartsWith("OSGEO.WMS") &&
+ !provider.StartsWith("AUTODESK.RASTER"))
+ {
+ FeatureSourcePreviewCtrl ctl = new FeatureSourcePreviewCtrl(m_editor, ProviderName.Text, m_editor.ResourceId);
+ ctl.Dock = DockStyle.Fill;
- LocalPreviewPage.Controls.Clear();
- LocalPreviewPage.Controls.Add(ctl);
+ LocalPreviewPage.Controls.Clear();
+ LocalPreviewPage.Controls.Add(ctl);
- //This feature is broken for any MG release < 2.2 so disable it.
- Version ver = editor.CurrentConnection.SiteVersion;
- Version supported = new Version(2, 2);
- if (ver < supported)
+ //This feature is broken for any MG release < 2.2 so disable it.
+ Version ver = editor.CurrentConnection.SiteVersion;
+ Version supported = new Version(2, 2);
+ if (ver < supported)
+ EditorTab.Controls.Remove(LocalPreviewPage);
+ }
+ else
+ {
EditorTab.Controls.Remove(LocalPreviewPage);
-
+ }
}
public FeatureSourceEditorBase(EditorInterface editor)
Modified: trunk/Tools/Maestro/Maestro/ResourceEditors/MapEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/ResourceEditors/MapEditor.cs 2010-04-21 00:29:51 UTC (rev 4808)
+++ trunk/Tools/Maestro/Maestro/ResourceEditors/MapEditor.cs 2010-04-22 01:17:13 UTC (rev 4809)
@@ -1598,6 +1598,9 @@
group.ShowInLegend = true;
group.Visible = true;
+ if (m_map.BaseMapDefinition == null)
+ m_map.BaseMapDefinition = new OSGeo.MapGuide.MaestroAPI.MapDefinitionTypeBaseMapDefinition();
+
if (m_map.BaseMapDefinition.BaseMapLayerGroup == null)
m_map.BaseMapDefinition.BaseMapLayerGroup = new OSGeo.MapGuide.MaestroAPI.BaseMapLayerGroupCommonTypeCollection();
More information about the mapguide-commits
mailing list