コード例 #1
0
        private static RenderedLayerDisplayInfo BuildLayerSelector(ViewerControl viewer, CachePackage cachePackage,
                                                                   string basePath, CrunchedFile crunchedFile)
        {
            RenderedLayerDisplayInfo renderedLayerDisplayInfo = new RenderedLayerDisplayInfo();

            renderedLayerDisplayInfo.tsmiList = new List <ToolStripMenuItem>();
            foreach (CrunchedLayer current in crunchedFile.crunchedLayers)
            {
                RenderedLayerSelector renderedLayerSelector = new RenderedLayerSelector(current);
                renderedLayerSelector.viewer     = viewer;
                renderedLayerSelector.menuItem   = new ToolStripMenuItem(current.displayName);
                renderedLayerSelector.tileSource = new RenderedTileSource(cachePackage,
                                                                          new VENamingScheme(Path.Combine(basePath, current.namingScheme.GetFilePrefix()),
                                                                                             current.namingScheme.GetFileSuffix()));
                renderedLayerSelector.menuItem.Tag    = renderedLayerSelector;
                renderedLayerSelector.menuItem.Click += MenuItem_Click;
                renderedLayerDisplayInfo.tsmiList.Add(renderedLayerSelector.menuItem);
            }

            for (int i = 0; i < renderedLayerDisplayInfo.tsmiList.Count; i++)
            {
                ((RenderedLayerSelector)renderedLayerDisplayInfo
                 .tsmiList[renderedLayerDisplayInfo.tsmiList.Count - 1 - i].Tag).ToggleLayer();
            }

            renderedLayerDisplayInfo.defaultView = crunchedFile.crunchedLayers[0].defaultView;
            return(renderedLayerDisplayInfo);
        }
コード例 #2
0
		private void addLayers(RenderedLayerDisplayInfo displayInfo)
		{
			if (displayInfo != null)
			{
				foreach (ToolStripMenuItem current in displayInfo.tsmiList)
				{
					this.mashupLayersMenuItem.DropDownItems.Add(current);
				}
				this.mapPos.setPosition(displayInfo.defaultView);
			}
		}
コード例 #3
0
 private void addLayers(RenderedLayerDisplayInfo displayInfo)
 {
     if (displayInfo != null)
     {
         foreach (ToolStripMenuItem current in displayInfo.tsmiList)
         {
             this.mashupLayersMenuItem.DropDownItems.Add(current);
         }
         this.mapPos.setPosition(displayInfo.defaultView);
     }
 }
コード例 #4
0
		private static RenderedLayerDisplayInfo BuildLayerSelector(ViewerControl viewer, CachePackage cachePackage, string basePath, CrunchedFile crunchedFile)
		{
			RenderedLayerDisplayInfo renderedLayerDisplayInfo = new RenderedLayerDisplayInfo();
			renderedLayerDisplayInfo.tsmiList = new List<ToolStripMenuItem>();
			foreach (CrunchedLayer current in crunchedFile.crunchedLayers)
			{
				RenderedLayerSelector renderedLayerSelector = new RenderedLayerSelector(current);
				renderedLayerSelector.viewer = viewer;
				renderedLayerSelector.menuItem = new ToolStripMenuItem(current.displayName);
				renderedLayerSelector.tileSource = new RenderedTileSource(cachePackage, new VENamingScheme(Path.Combine(basePath, current.namingScheme.GetFilePrefix()), current.namingScheme.GetFileSuffix()));
				renderedLayerSelector.menuItem.Tag = renderedLayerSelector;
				renderedLayerSelector.menuItem.Click += new EventHandler(RenderedLayerSelector.MenuItem_Click);
				renderedLayerDisplayInfo.tsmiList.Add(renderedLayerSelector.menuItem);
			}
			for (int i = 0; i < renderedLayerDisplayInfo.tsmiList.Count; i++)
			{
				((RenderedLayerSelector)renderedLayerDisplayInfo.tsmiList[renderedLayerDisplayInfo.tsmiList.Count - 1 - i].Tag).ToggleLayer();
			}
			renderedLayerDisplayInfo.defaultView = crunchedFile.crunchedLayers[0].defaultView;
			return renderedLayerDisplayInfo;
		}