[mapguide-commits] r8496 - in trunk/Tools/Maestro/Maestro.Editors: . Fusion Fusion/MapEditors

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Sun Jan 11 04:17:26 PST 2015


Author: jng
Date: 2015-01-11 04:17:26 -0800 (Sun, 11 Jan 2015)
New Revision: 8496

Modified:
   trunk/Tools/Maestro/Maestro.Editors/Fusion/MapCtrl.cs
   trunk/Tools/Maestro/Maestro.Editors/Fusion/MapEditors/EditorFactory.cs
   trunk/Tools/Maestro/Maestro.Editors/Strings.Designer.cs
   trunk/Tools/Maestro/Maestro.Editors/Strings.resx
Log:
#2519: Add stamen tile layer support for Fusion editor

Modified: trunk/Tools/Maestro/Maestro.Editors/Fusion/MapCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Fusion/MapCtrl.cs	2015-01-09 14:26:09 UTC (rev 8495)
+++ trunk/Tools/Maestro/Maestro.Editors/Fusion/MapCtrl.cs	2015-01-11 12:17:26 UTC (rev 8496)
@@ -111,7 +111,7 @@
 
         private void LoadMapOptions()
         {
-            foreach (var option in EditorFactory.GetAvailableOptions(_group))
+            foreach (var option in EditorFactory.GetAvailableOptions(_edSvc.CurrentConnection.SiteVersion, _group))
             {
                 var ed = option;
                 btnNewMap.DropDown.Items.Add(ed.Name, null, (s, e) =>
@@ -133,6 +133,11 @@
                         _appDef.SetValue("OpenStreetMapScript", EditorFactory.OSM_URL);
                         bAddedCommercialLayer = true;
                     }
+                    else if (map.Type == EditorFactory.Type_Stamen)
+                    {
+                        _appDef.SetValue("StamenScript", EditorFactory.STAMEN_URL);
+                        bAddedCommercialLayer = true;
+                    }
                     _group.AddMap(map);
                     _models.Add(new MapModel(map));
                     if (bAddedCommercialLayer)

Modified: trunk/Tools/Maestro/Maestro.Editors/Fusion/MapEditors/EditorFactory.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Fusion/MapEditors/EditorFactory.cs	2015-01-09 14:26:09 UTC (rev 8495)
+++ trunk/Tools/Maestro/Maestro.Editors/Fusion/MapEditors/EditorFactory.cs	2015-01-11 12:17:26 UTC (rev 8496)
@@ -42,15 +42,21 @@
         internal const string Type_Bing = "VirtualEarth"; //NOXLATE
         internal const string Type_OSM = "OpenStreetMap"; //NOXLATE
         internal const string Type_MapGuide = "MapGuide"; //NOXLATE
+        internal const string Type_Stamen = "Stamen"; //NOXLATE
         private const string Type_Generic = "Generic"; //NOXLATE
 
         private const string OSM_MAP_MAPNIK = "Mapnik"; //NOXLATE
         private const string OSM_MAP_TRANSPORTMAP = "TransportMap"; //NOXLATE
         private const string OSM_MAP_CYCLEMAP = "CycleMap"; //NOXLATE
 
+        private const string STAMEN_TERRAIN = "terrain"; //NOXLATE
+        private const string STAMEN_TONER = "toner"; //NOXLATE
+        private const string STAMEN_WATERCOLOR = "watercolor"; //NOXLATE
+
         internal const string OSM_URL = "http://www.openstreetmap.org/openlayers/OpenStreetMap.js"; //NOXLATE
         internal const string GOOGLE_URL = "http://maps.google.com/maps/api/js?sensor=false"; //NOXLATE
         internal const string BING_URL = "http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2"; //NOXLATE
+        internal const string STAMEN_URL = "http://maps.stamen.com/js/tile.stamen.js?v1.3.0"; //NOXLATE
 
         internal static Control GetEditor(IEditorService edSvc, IMapGroup group, IMap map)
         {
@@ -65,6 +71,9 @@
                 case Type_OSM:
                     return new CommercialMapEditor(edSvc, map, new string[] { OSM_MAP_MAPNIK, OSM_MAP_CYCLEMAP, OSM_MAP_TRANSPORTMAP });
 
+                case Type_Stamen:
+                    return new CommercialMapEditor(edSvc, map, new string[] { STAMEN_TONER, STAMEN_TERRAIN, STAMEN_WATERCOLOR });
+
                 case Type_MapGuide:
                     return new MapGuideEditor(edSvc, group, map);
 
@@ -73,7 +82,7 @@
             }
         }
 
-        internal static IEnumerable<EditorInvoker> GetAvailableOptions(IMapGroup group)
+        internal static IEnumerable<EditorInvoker> GetAvailableOptions(Version version, IMapGroup group)
         {
             yield return new EditorInvoker()
             {
@@ -171,6 +180,33 @@
                     return group.CreateCmsMapEntry(Type_OSM, false, Strings.CmsOsmTransport, OSM_MAP_TRANSPORTMAP);
                 }
             };
+            if (version.Major >= 3) //MGOS 3.0 or higher
+            {
+                yield return new EditorInvoker()
+                {
+                    Name = Strings.CmsStamenToner,
+                    Action = () =>
+                    {
+                        return group.CreateCmsMapEntry(Type_Stamen, false, Strings.CmsStamenToner, STAMEN_TONER);
+                    }
+                };
+                yield return new EditorInvoker()
+                {
+                    Name = Strings.CmsStamenTerrain,
+                    Action = () =>
+                    {
+                        return group.CreateCmsMapEntry(Type_Stamen, false, Strings.CmsStamenTerrain, STAMEN_TERRAIN);
+                    }
+                };
+                yield return new EditorInvoker()
+                {
+                    Name = Strings.CmsStamenWaterColor,
+                    Action = () =>
+                    {
+                        return group.CreateCmsMapEntry(Type_Stamen, false, Strings.CmsStamenWaterColor, STAMEN_WATERCOLOR);
+                    }
+                };
+            }
         }
     }
 

Modified: trunk/Tools/Maestro/Maestro.Editors/Strings.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Strings.Designer.cs	2015-01-09 14:26:09 UTC (rev 8495)
+++ trunk/Tools/Maestro/Maestro.Editors/Strings.Designer.cs	2015-01-11 12:17:26 UTC (rev 8496)
@@ -1,7 +1,7 @@
 //------------------------------------------------------------------------------
 // <auto-generated>
 //     This code was generated by a tool.
-//     Runtime Version:4.0.30319.34209
+//     Runtime Version:4.0.30319.18444
 //
 //     Changes to this file may cause incorrect behavior and will be lost if
 //     the code is regenerated.
@@ -250,6 +250,33 @@
         }
         
         /// <summary>
+        ///   Looks up a localized string similar to Stamen (Terrain).
+        /// </summary>
+        internal static string CmsStamenTerrain {
+            get {
+                return ResourceManager.GetString("CmsStamenTerrain", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to Stamen (Toner).
+        /// </summary>
+        internal static string CmsStamenToner {
+            get {
+                return ResourceManager.GetString("CmsStamenToner", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to Stamen (WaterColor).
+        /// </summary>
+        internal static string CmsStamenWaterColor {
+            get {
+                return ResourceManager.GetString("CmsStamenWaterColor", resourceCulture);
+            }
+        }
+        
+        /// <summary>
         ///   Looks up a localized string similar to Yahoo! Maps Hybrid.
         /// </summary>
         internal static string CmsYahooHybrid {

Modified: trunk/Tools/Maestro/Maestro.Editors/Strings.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Strings.resx	2015-01-09 14:26:09 UTC (rev 8495)
+++ trunk/Tools/Maestro/Maestro.Editors/Strings.resx	2015-01-11 12:17:26 UTC (rev 8496)
@@ -1610,4 +1610,13 @@
   <data name="DebugWatermarkMessageLayer" xml:space="preserve">
     <value>MapGuide Debugging Information\n==============================\n\nMap Extents Min: ({0}, {1})\nMap Extents Max: ({2}, {3})\nMap Coordinate System: \n{4}\nLayer Spatial Context: {5}</value>
   </data>
+  <data name="CmsStamenTerrain" xml:space="preserve">
+    <value>Stamen (Terrain)</value>
+  </data>
+  <data name="CmsStamenToner" xml:space="preserve">
+    <value>Stamen (Toner)</value>
+  </data>
+  <data name="CmsStamenWaterColor" xml:space="preserve">
+    <value>Stamen (WaterColor)</value>
+  </data>
 </root>
\ No newline at end of file



More information about the mapguide-commits mailing list