public SourceMapRegistrationView(SourceMap sourceMap, MapPosition lockedMapView)
		{
			this._sourceMap = sourceMap;
			this._locked = true;
			this.referenceMapView = new MapPosition(lockedMapView, null);
			this.sourceMapView = lockedMapView.llz;
		}
示例#2
0
 private void NodeSelectedHandler(object sender, TreeViewEventArgs e)
 {
     try
     {
         if (e.Node.Tag is SourceMap)
         {
             SourceMap sourceMap = (SourceMap)e.Node.Tag;
             layerControl.OpenSourceMap(sourceMap);
         }
         else
         {
             if (e.Node.Tag is Layer)
             {
                 Layer layer = (Layer)e.Node.Tag;
                 layerControl.OpenLayer(layer);
             }
             else
             {
                 if (e.Node.Tag is Legend)
                 {
                     Legend legend = (Legend)e.Node.Tag;
                     layerControl.OpenLegend(legend);
                 }
             }
         }
     }
     catch (UnknownImageTypeException)
     {
     }
 }
示例#3
0
 public SourceMapRegistrationView(SourceMap sourceMap, LatLonZoom sourceMapView, MapPosition referenceMapView)
 {
     this.sourceMap        = sourceMap;
     locked                = false;
     this.sourceMapView    = sourceMapView;
     this.referenceMapView = new MapPosition(referenceMapView, null);
 }
示例#4
0
        public Layer AddSourceMap(SourceMap sourceMap)
        {
            TreeNode selectedNode = layerTreeView.SelectedNode;
            Layer    layer;

            if (selectedNode != null)
            {
                if (selectedNode.Tag is Layer)
                {
                    layer = (Layer)selectedNode.Tag;
                }
                else
                {
                    layer = (Layer)selectedNode.Parent.Tag;
                }
            }
            else
            {
                if (_mashup.layerList.Count == 0)
                {
                    _mashup.layerList.AddNewLayer();
                }

                layer = _mashup.layerList.First;
            }

            layer.Add(sourceMap);
            Reload();
            return(layer);
        }
示例#5
0
 public SourceMapRegistrationView(SourceMap sourceMap, MapPosition lockedMapView)
 {
     this.sourceMap   = sourceMap;
     locked           = true;
     referenceMapView = new MapPosition(lockedMapView, null);
     sourceMapView    = lockedMapView.llz;
 }
示例#6
0
 public SourceMapViewManager(SourceMap sourceMap, MapTileSourceFactory mapTileSourceFactory, ViewControlIfc viewControl, DefaultReferenceView drv)
 {
     this.sourceMap            = sourceMap;
     this.mapTileSourceFactory = mapTileSourceFactory;
     this.viewControl          = viewControl;
     this.drv = drv;
 }
示例#7
0
        internal static LatLonZoom DefaultReferenceMapPosition(SourceMap sourceMap,
                                                               MapTileSourceFactory mapTileSourceFactory, ViewControlIfc viewControl, DefaultReferenceView drv)
        {
            if (sourceMap.ReadyToLock())
            {
                try
                {
                    ViewerControlIfc    sMViewerControl               = viewControl.GetSMViewerControl();
                    MapRectangle        bounds                        = sMViewerControl.GetBounds();
                    WarpedMapTileSource warpedMapTileSource           = mapTileSourceFactory.CreateWarpedSource(sourceMap);
                    IPointTransformer   sourceToDestLatLonTransformer =
                        warpedMapTileSource.GetSourceToDestLatLonTransformer();
                    MapRectangle mapRectangle = bounds.Transform(sourceToDestLatLonTransformer);
                    mapRectangle = mapRectangle.ClipTo(new MapRectangle(-180.0, -360.0, 180.0, 360.0));
                    return(viewControl.GetVEViewerControl().GetCoordinateSystem()
                           .GetBestViewContaining(mapRectangle, sMViewerControl.Size));
                }
                catch (CorrespondencesAreSingularException)
                {
                }
                catch (InsufficientCorrespondencesException)
                {
                }
            }

            if (drv != null && drv.present)
            {
                return(drv.llz);
            }

            return(viewControl.GetVEViewerControl().GetCoordinateSystem().GetDefaultView());
        }
示例#8
0
 public InsaneSourceMapRemover(SourceMap sourceMap, MapTileSourceFactory mapTileSourceFactory,
                               UndoAdddSourceMapDelegate removeSourceMapDelegate) : this(sourceMap,
                                                                                         mapTileSourceFactory,
                                                                                         removeSourceMapDelegate,
                                                                                         0)
 {
 }
示例#9
0
        private InsaneSourceMapRemover(SourceMap sourceMap, MapTileSourceFactory mapTileSourceFactory,
                                       UndoAdddSourceMapDelegate removeSourceMapDelegate, int tryCount)
        {
            this.sourceMap            = sourceMap;
            this.mapTileSourceFactory = mapTileSourceFactory;
            undoAddSourceMapDelegate  = removeSourceMapDelegate;
            this.tryCount             = tryCount;
            if (tryCount > 3)
            {
                return;
            }

            Present present = mapTileSourceFactory.CreateUnwarpedSource(sourceMap)
                              .GetImagePrototype(new ImageParameterFromTileAddress(ContinuousCoordinateSystem.theInstance),
                                                 (FutureFeatures)7)
                              .Curry(new ParamDict(new object[]
            {
                TermName.TileAddress,
                new TileAddress(0, 0, ContinuousCoordinateSystem.theInstance.GetDefaultView().zoom)
            })).Realize("SourceMap.CheckRendererSanity");
            AsyncRef asyncRef = (AsyncRef)present;

            asyncRef.AddCallback(RendererSanityCheckComplete);
            new PersistentInterest(asyncRef);
        }
示例#10
0
文件: Legend.cs 项目: mikhp/greatmaps
		public Legend(SourceMap sourceMap, DirtyEvent parentEvent, DirtyEvent parentBoundsChangedEvent)
		{
			this._sourceMap = sourceMap;
			this.dirtyEvent = new DirtyEvent(parentEvent);
			this._latentRegionHolder = new LatentRegionHolder(this.dirtyEvent, parentBoundsChangedEvent);
			this._displayName = "legend";
		}
示例#11
0
文件: Legend.cs 项目: mikhp/greatmaps
		public Legend(SourceMap sourceMap, MashupParseContext context, DirtyEvent parentEvent, DirtyEvent parentBoundsChangedEvent)
		{
			this._sourceMap = sourceMap;
			this.dirtyEvent = new DirtyEvent(parentEvent);
			this._latentRegionHolder = new LatentRegionHolder(this.dirtyEvent, parentBoundsChangedEvent);
			this._displayName = context.GetRequiredAttribute("DisplayName");
			string attribute = context.reader.GetAttribute("RenderedSize");
			if (attribute != null)
			{
				Legend.renderedSizeRange.Parse(context, "RenderedSize", attribute);
			}
			XMLTagReader xMLTagReader = context.NewTagReader(Legend.GetXMLTag());
			context.ExpectIdentity(this);
			while (xMLTagReader.FindNextStartTag())
			{
				if (xMLTagReader.TagIs(RenderRegion.GetXMLTag()))
				{
					context.AssertUnique(this._latentRegionHolder.renderRegion);
					this._latentRegionHolder.renderRegion = new RenderRegion(context, this.dirtyEvent, ContinuousCoordinateSystem.theInstance);
				}
				else
				{
					if (xMLTagReader.TagIs(LegendView.GetXMLTag()))
					{
						this._lastView = new LegendView(this, context);
					}
				}
			}
		}
示例#12
0
文件: Legend.cs 项目: gabilic/Oplan
        public Legend(SourceMap sourceMap, MashupParseContext context, DirtyEvent parentEvent, DirtyEvent parentBoundsChangedEvent)
        {
            this._sourceMap          = sourceMap;
            this.dirtyEvent          = new DirtyEvent(parentEvent);
            this._latentRegionHolder = new LatentRegionHolder(this.dirtyEvent, parentBoundsChangedEvent);
            this._displayName        = context.GetRequiredAttribute("DisplayName");
            string attribute = context.reader.GetAttribute("RenderedSize");

            if (attribute != null)
            {
                Legend.renderedSizeRange.Parse(context, "RenderedSize", attribute);
            }
            XMLTagReader xMLTagReader = context.NewTagReader(Legend.GetXMLTag());

            context.ExpectIdentity(this);
            while (xMLTagReader.FindNextStartTag())
            {
                if (xMLTagReader.TagIs(RenderRegion.GetXMLTag()))
                {
                    context.AssertUnique(this._latentRegionHolder.renderRegion);
                    this._latentRegionHolder.renderRegion = new RenderRegion(context, this.dirtyEvent, ContinuousCoordinateSystem.theInstance);
                }
                else
                {
                    if (xMLTagReader.TagIs(LegendView.GetXMLTag()))
                    {
                        this._lastView = new LegendView(this, context);
                    }
                }
            }
        }
示例#13
0
文件: Legend.cs 项目: gabilic/Oplan
 public Legend(SourceMap sourceMap, DirtyEvent parentEvent, DirtyEvent parentBoundsChangedEvent)
 {
     this._sourceMap          = sourceMap;
     this.dirtyEvent          = new DirtyEvent(parentEvent);
     this._latentRegionHolder = new LatentRegionHolder(this.dirtyEvent, parentBoundsChangedEvent);
     this._displayName        = "legend";
 }
示例#14
0
        //[CompilerGenerated]
        //private static Comparison<ThumbnailRecord> <>9__CachedAnonymousMethodDelegate1;

        public SourceMapRecord(Layer layer, SourceMap sourceMap, MapTileSourceFactory mapTileSourceFactory)
        {
            displayName      = sourceMap.displayName;
            sourceMapInfo    = sourceMap.sourceMapInfo;
            userBoundingRect = sourceMap.GetUserBoundingBox(mapTileSourceFactory);
            maxZoom          = sourceMap.sourceMapRenderOptions.maxZoom;
            try
            {
                imageTransformer =
                    sourceMap.registration.warpStyle.getImageTransformer(sourceMap.registration,
                                                                         InterpolationMode.Invalid);
            }
            catch (Exception)
            {
            }

            foreach (Legend current in sourceMap.legendList)
            {
                legendRecords.Add(new LegendRecord("legends",
                                                   sourceMap.GetLegendFilename(current),
                                                   current.displayName,
                                                   current.GetOutputSizeSynchronously(mapTileSourceFactory.CreateDisplayableUnwarpedSource(sourceMap)
                                                                                      .GetUserBounds(current.latentRegionHolder, FutureFeatures.Cached))));
            }

            sourceMapLegendFrame = new SourceMapLegendFrame(layer,
                                                            sourceMap,
                                                            legendRecords,
                                                            thumbnailForLegendFrame);
        }
示例#15
0
 public SourceMapViewManager(SourceMap sourceMap, MapTileSourceFactory mapTileSourceFactory, ViewControlIfc viewControl, DefaultReferenceView drv)
 {
     this.sourceMap = sourceMap;
     this.mapTileSourceFactory = mapTileSourceFactory;
     this.viewControl = viewControl;
     this.drv = drv;
 }
		public SourceMapRegistrationView(SourceMap sourceMap, LatLonZoom sourceMapView, MapPosition referenceMapView)
		{
			this._sourceMap = sourceMap;
			this._locked = false;
			this.sourceMapView = sourceMapView;
			this.referenceMapView = new MapPosition(referenceMapView, null);
		}
示例#17
0
        private void RemoveHandler(object sender, EventArgs e)
        {
            object tag = layerTreeView.SelectedNode.Tag;

            if (tag is Layer)
            {
                _mashup.layerList.Remove((Layer)tag);
            }
            else
            {
                if (tag is SourceMap)
                {
                    SourceMap    sourceMap    = (SourceMap)tag;
                    DialogResult dialogResult =
                        MessageBox.Show(
                            string.Format("Are you sure you want to remove source map {0}?", sourceMap.displayName),
                            "Remove source map?",
                            MessageBoxButtons.OKCancel,
                            MessageBoxIcon.Question);
                    if (dialogResult != DialogResult.OK)
                    {
                        return;
                    }

                    layerControl.RemoveSourceMap(sourceMap);
                }
                else
                {
                    if (tag is Legend)
                    {
                        Legend legend = (Legend)tag;
                        legend.sourceMap.legendList.RemoveLegend(legend);
                    }
                    else
                    {
                        D.Assert(false);
                    }
                }
            }

            object obj = null;

            if (layerTreeView.SelectedNode.Parent != null)
            {
                obj = layerTreeView.SelectedNode.Parent.Tag;
            }

            Reload();
            if (obj != null)
            {
                layerTreeView.SelectedNode = tagToTreeNodeDict[obj];
                return;
            }

            if (_mashup.layerList.Count > 0)
            {
                layerTreeView.SelectedNode = tagToTreeNodeDict[_mashup.layerList.First];
            }
        }
示例#18
0
		public IDisplayableSource CreateDisplayableWarpedSource(SourceMap sourceMap)
		{
			if (!sourceMap.ReadyToLock())
			{
				return null;
			}
			return this.CreateWarpedSource(sourceMap);
		}
示例#19
0
 public SourceMapLegendFrame(Layer layer, SourceMap sourceMap, List <LegendRecord> legendRecords, SourceMapLegendFrame.ThumbnailDelegate thumbnailDelegate)
 {
     this.filename          = RenderState.ForceValidFilename(string.Format("SourceMap_{0}_{1}.html", layer.displayName, sourceMap.displayName));
     this.displayName       = sourceMap.displayName;
     this.sourceMapInfo     = sourceMap.sourceMapInfo;
     this.legendRecords     = legendRecords;
     this.thumbnailDelegate = thumbnailDelegate;
 }
示例#20
0
        private void AddLegendHandler(object sender, EventArgs e)
        {
            SourceMap sourceMap = (SourceMap)layerTreeView.SelectedNode.Tag;
            Legend    key       = sourceMap.legendList.AddNewLegend();

            Reload();
            layerTreeView.SelectedNode = tagToTreeNodeDict[key];
        }
示例#21
0
 public UndoAddSourceMap(string filename, SourceMap newSourceMap, Layer addedToLayer, LayerControls layerControls, MainAppForm mainAppForm)
 {
     this.filename = filename;
     this.newSourceMap = newSourceMap;
     this.addedToLayer = addedToLayer;
     this.layerControls = layerControls;
     this.mainAppForm = mainAppForm;
 }
		public SourceMapLegendFrame(Layer layer, SourceMap sourceMap, List<LegendRecord> legendRecords, SourceMapLegendFrame.ThumbnailDelegate thumbnailDelegate)
		{
			this.filename = RenderState.ForceValidFilename(string.Format("SourceMap_{0}_{1}.html", layer.displayName, sourceMap.displayName));
			this.displayName = sourceMap.displayName;
			this.sourceMapInfo = sourceMap.sourceMapInfo;
			this.legendRecords = legendRecords;
			this.thumbnailDelegate = thumbnailDelegate;
		}
示例#23
0
 public IDisplayableSource CreateDisplayableWarpedSource(SourceMap sourceMap)
 {
     if (!sourceMap.ReadyToLock())
     {
         return(null);
     }
     return(this.CreateWarpedSource(sourceMap));
 }
示例#24
0
		public LayerList(MashupParseContext context, SourceMap.GetFilenameContext filenameContextDelegate, DirtyEvent parentDirty, DirtyEvent parentReadyToLockEvent)
		{
			this.dirtyEvent = parentDirty;
			XMLTagReader xMLTagReader = context.NewTagReader("LayerList");
			while (xMLTagReader.FindNextStartTag())
			{
				if (xMLTagReader.TagIs(Layer.GetXMLTag()))
				{
					this.Add(new Layer(context, filenameContextDelegate, this.dirtyEvent, parentReadyToLockEvent));
				}
			}
		}
示例#25
0
		public SourceMapRecord this[SourceMap sourceMap]
		{
			get
			{
				int num = this.sourceMapRecords.FindIndex((SourceMapRecord smr) => smr.displayName == sourceMap.displayName);
				if (num == -1)
				{
					throw new IndexOutOfRangeException();
				}
				return this.sourceMapRecords[num];
			}
		}
示例#26
0
 public SourceMapRecord this[SourceMap sourceMap]
 {
     get
     {
         int num = this.sourceMapRecords.FindIndex((SourceMapRecord smr) => smr.displayName == sourceMap.displayName);
         if (num == -1)
         {
             throw new IndexOutOfRangeException();
         }
         return(this.sourceMapRecords[num]);
     }
 }
示例#27
0
 public void Configure(SourceMap sourceMap)
 {
     if (this.sourceMap != null)
     {
         this.sourceMap.sourceMapRenderOptions.dirtyEvent.Remove(new DirtyListener(this.ZoomChangedHandler));
     }
     this.sourceMap = sourceMap;
     if (this.sourceMap != null)
     {
         this.sourceMap.sourceMapRenderOptions.dirtyEvent.Add(new DirtyListener(this.ZoomChangedHandler));
     }
     this.update();
 }
示例#28
0
 public void Configure(SourceMap sourceMap)
 {
     if (this.sourceMap != null)
     {
         this.sourceMap.sourceMapRenderOptions.dirtyEvent.Remove(new DirtyListener(this.ZoomChangedHandler));
     }
     this.sourceMap = sourceMap;
     if (this.sourceMap != null)
     {
         this.sourceMap.sourceMapRenderOptions.dirtyEvent.Add(new DirtyListener(this.ZoomChangedHandler));
     }
     this.update();
 }
示例#29
0
 public void Configure(SourceMap sourceMap, TransparencyIfc transparencyIfc)
 {
     this.transparencyIfc = transparencyIfc;
     if (this.sourceMap != null)
     {
         this.sourceMap.transparencyOptions.transparencyOptionsChangedEvent -= new TransparencyOptionsChangedDelegate(this.TransparencyChangedHandler);
     }
     this.sourceMap = sourceMap;
     if (this.sourceMap != null)
     {
         this.sourceMap.transparencyOptions.transparencyOptionsChangedEvent += new TransparencyOptionsChangedDelegate(this.TransparencyChangedHandler);
     }
     this.update();
 }
示例#30
0
 public void Configure(SourceMap sourceMap, TransparencyIfc transparencyIfc)
 {
     this.transparencyIfc = transparencyIfc;
     if (this.sourceMap != null)
     {
         this.sourceMap.transparencyOptions.transparencyOptionsChangedEvent -= new TransparencyOptionsChangedDelegate(this.TransparencyChangedHandler);
     }
     this.sourceMap = sourceMap;
     if (this.sourceMap != null)
     {
         this.sourceMap.transparencyOptions.transparencyOptionsChangedEvent += new TransparencyOptionsChangedDelegate(this.TransparencyChangedHandler);
     }
     this.update();
 }
示例#31
0
		public LegendList(SourceMap sourceMap, MashupParseContext context, DirtyEvent parentEvent)
		{
			this._sourceMap = sourceMap;
			this.dirtyEvent = new DirtyEvent(parentEvent);
			this.parentBoundsChangedEvent = parentEvent;
			XMLTagReader xMLTagReader = context.NewTagReader(LegendList.GetXMLTag());
			while (xMLTagReader.FindNextStartTag())
			{
				if (xMLTagReader.TagIs(Legend.GetXMLTag()))
				{
					this.list.Add(new Legend(this._sourceMap, context, this.dirtyEvent, this.parentBoundsChangedEvent));
				}
			}
		}
示例#32
0
        public SourceMapRegistrationView(SourceMap sourceMap, MashupParseContext context)
        {
            this.sourceMap = sourceMap;
            XMLTagReader xMLTagReader = context.NewTagReader(GetXMLTag());

            locked = context.GetRequiredAttributeBoolean(lockedAttribute);
            bool flag = false;

            while (xMLTagReader.FindNextStartTag())
            {
                if (xMLTagReader.TagIs(sourceMapViewTag))
                {
                    XMLTagReader xMLTagReader2 = context.NewTagReader(sourceMapViewTag);
                    while (xMLTagReader2.FindNextStartTag())
                    {
                        if (xMLTagReader2.TagIs(LatLonZoom.GetXMLTag()))
                        {
                            sourceMapView = new LatLonZoom(context, ContinuousCoordinateSystem.theInstance);
                            flag          = true;
                        }
                    }
                }
                else
                {
                    if (xMLTagReader.TagIs(referenceMapViewTag))
                    {
                        XMLTagReader xMLTagReader3 = context.NewTagReader(referenceMapViewTag);
                        while (xMLTagReader3.FindNextStartTag())
                        {
                            if (xMLTagReader3.TagIs(MapPosition.GetXMLTag(context.version)))
                            {
                                referenceMapView =
                                    new MapPosition(context, null, MercatorCoordinateSystem.theInstance);
                            }
                        }
                    }
                }
            }

            if (referenceMapView == null)
            {
                throw new InvalidMashupFile(context, "No " + referenceMapViewTag + " tag in LayerView.");
            }

            if (flag == locked)
            {
                throw new InvalidMashupFile(context, "locked flag disagrees with " + sourceMapViewTag + " element.");
            }
        }
示例#33
0
        public LegendList(SourceMap sourceMap, MashupParseContext context, DirtyEvent parentEvent)
        {
            this._sourceMap = sourceMap;
            this.dirtyEvent = new DirtyEvent(parentEvent);
            this.parentBoundsChangedEvent = parentEvent;
            XMLTagReader xMLTagReader = context.NewTagReader(LegendList.GetXMLTag());

            while (xMLTagReader.FindNextStartTag())
            {
                if (xMLTagReader.TagIs(Legend.GetXMLTag()))
                {
                    this.list.Add(new Legend(this._sourceMap, context, this.dirtyEvent, this.parentBoundsChangedEvent));
                }
            }
        }
示例#34
0
 public SourceMap(IDocumentFuture documentDescriptor, SourceMap.GetFilenameContext filenameContextDelegate, DirtyEvent parentDirty, DirtyEvent parentReadyToLockEvent)
 {
     this.dirtyEvent = new DirtyEvent(parentDirty);
     this.readyToLockChangedEvent = new DirtyEvent(parentReadyToLockEvent);
     this._documentFuture = new GeneralDocumentFuture(documentDescriptor);
     this._displayName = documentDescriptor.GetDefaultDisplayName();
     this.filenameContextDelegate = filenameContextDelegate;
     this._sourceMapInfo = new SourceMapInfo(this.dirtyEvent);
     this._sourceMapRenderOptions = new SourceMapRenderOptions(this.dirtyEvent);
     this._transparencyOptions = new TransparencyOptions(this.dirtyEvent);
     this.registration = new RegistrationDefinition(this.dirtyEvent);
     this.registration.dirtyEvent.Add(this.readyToLockChangedEvent);
     this.latentRegionHolder = new LatentRegionHolder(this.dirtyEvent, this.readyToLockChangedEvent);
     this.legendList = new LegendList(this, this.dirtyEvent, this.readyToLockChangedEvent);
     this.renderRegion = null;
 }
示例#35
0
        internal bool AccumulateBoundingBox(SourceMap sourceMap, MapTileSourceFactory mapTileSourceFactory, ref MapRectangle boundingBox)
        {
            bool result;

            try
            {
                WarpedMapTileSource warpedMapTileSource = mapTileSourceFactory.CreateWarpedSource(sourceMap);
                BoundsPresent       boundsPresent       = (BoundsPresent)warpedMapTileSource.GetUserBounds(null, FutureFeatures.Cached).Realize("CrunchedFile.AccumulateBoundingBox");
                boundsPresent.GetRenderRegion().AccumulateBoundingBox(ref boundingBox);
                result = true;
            }
            catch (InsufficientCorrespondencesException)
            {
                result = false;
            }
            return(result);
        }
		public SourceMapRegistrationView(SourceMap sourceMap, MashupParseContext context)
		{
			this._sourceMap = sourceMap;
			XMLTagReader xMLTagReader = context.NewTagReader(SourceMapRegistrationView.GetXMLTag());
			this._locked = context.GetRequiredAttributeBoolean(SourceMapRegistrationView.lockedAttribute);
			bool flag = false;
			while (xMLTagReader.FindNextStartTag())
			{
				if (xMLTagReader.TagIs(SourceMapRegistrationView.sourceMapViewTag))
				{
					XMLTagReader xMLTagReader2 = context.NewTagReader(SourceMapRegistrationView.sourceMapViewTag);
					while (xMLTagReader2.FindNextStartTag())
					{
						if (xMLTagReader2.TagIs(LatLonZoom.GetXMLTag()))
						{
							this.sourceMapView = new LatLonZoom(context, ContinuousCoordinateSystem.theInstance);
							flag = true;
						}
					}
				}
				else
				{
					if (xMLTagReader.TagIs(SourceMapRegistrationView.referenceMapViewTag))
					{
						XMLTagReader xMLTagReader3 = context.NewTagReader(SourceMapRegistrationView.referenceMapViewTag);
						while (xMLTagReader3.FindNextStartTag())
						{
							if (xMLTagReader3.TagIs(MapPosition.GetXMLTag(context.version)))
							{
								this.referenceMapView = new MapPosition(context, null, MercatorCoordinateSystem.theInstance);
							}
						}
					}
				}
			}
			if (this.referenceMapView == null)
			{
				throw new InvalidMashupFile(context, "No " + SourceMapRegistrationView.referenceMapViewTag + " tag in LayerView.");
			}
			if (flag == this._locked)
			{
				throw new InvalidMashupFile(context, "locked flag disagrees with " + SourceMapRegistrationView.sourceMapViewTag + " element.");
			}
		}
示例#37
0
        //[CompilerGenerated]
        //private static Comparison<ThumbnailRecord> <>9__CachedAnonymousMethodDelegate1;
		
        public SourceMapRecord(Layer layer, SourceMap sourceMap, MapTileSourceFactory mapTileSourceFactory)
		{
			this.displayName = sourceMap.displayName;
			this.sourceMapInfo = sourceMap.sourceMapInfo;
			this.userBoundingRect = sourceMap.GetUserBoundingBox(mapTileSourceFactory);
			this.maxZoom = sourceMap.sourceMapRenderOptions.maxZoom;
			try
			{
				this.imageTransformer = sourceMap.registration.warpStyle.getImageTransformer(sourceMap.registration, InterpolationMode.Invalid);
			}
			catch (Exception)
			{
			}
			foreach (Legend current in sourceMap.legendList)
			{
				this.legendRecords.Add(new LegendRecord("legends", sourceMap.GetLegendFilename(current), current.displayName, current.GetOutputSizeSynchronously(mapTileSourceFactory.CreateDisplayableUnwarpedSource(sourceMap).GetUserBounds(current.latentRegionHolder, FutureFeatures.Cached))));
			}
			this.sourceMapLegendFrame = new SourceMapLegendFrame(layer, sourceMap, this.legendRecords, new SourceMapLegendFrame.ThumbnailDelegate(this.thumbnailForLegendFrame));
		}
		private InsaneSourceMapRemover(SourceMap sourceMap, MapTileSourceFactory mapTileSourceFactory, InsaneSourceMapRemover.UndoAdddSourceMapDelegate removeSourceMapDelegate, int tryCount)
		{
			this.sourceMap = sourceMap;
			this.mapTileSourceFactory = mapTileSourceFactory;
			this.undoAddSourceMapDelegate = removeSourceMapDelegate;
			this.tryCount = tryCount;
			if (tryCount > 3)
			{
				return;
			}
			Present present = mapTileSourceFactory.CreateUnwarpedSource(sourceMap).GetImagePrototype(new ImageParameterFromTileAddress(ContinuousCoordinateSystem.theInstance), (FutureFeatures)7).Curry(new ParamDict(new object[]
			{
				TermName.TileAddress,
				new TileAddress(0, 0, ContinuousCoordinateSystem.theInstance.GetDefaultView().zoom)
			})).Realize("SourceMap.CheckRendererSanity");
			AsyncRef asyncRef = (AsyncRef)present;
			asyncRef.AddCallback(new AsyncRecord.CompleteCallback(this.RendererSanityCheckComplete));
			new PersistentInterest(asyncRef);
		}
示例#39
0
        public void Dispose()
        {
            viewControl.GetCachePackage().ClearSchedulers();
            UIPositionManager uIPositionManager = viewControl.GetUIPositionManager();

            uIPositionManager.SetPositionMemory(null);
            uIPositionManager.GetSMPos().setPosition(new LatLonZoom(0.0, 0.0, 0));
            uIPositionManager.switchFree();
            viewControl.GetSMViewerControl().ClearLayers();
            viewControl.GetSMViewerControl().SetSnapViewStore(null);
            viewControl.GetVEViewerControl().SetSnapViewStore(null);
            viewControl.SetOptionsPanelVisibility(OptionsPanelVisibility.Nothing);
            viewControl.GetSourceMapInfoPanel().Configure(null);
            viewControl.GetSourceMapInfoPanel().Enabled = false;
            viewControl.GetTransparencyPanel().Configure(null, null);
            viewControl.GetTransparencyPanel().Enabled = false;
            viewControl.setDisplayedRegistration(null);
            sourceMap = null;
        }
示例#40
0
		public Layer(MashupParseContext context, SourceMap.GetFilenameContext filenameContextDelegate, DirtyEvent parentDirty, DirtyEvent parentReadyToLockEvent)
		{
			this.dirtyEvent = new DirtyEvent(parentDirty);
			XMLTagReader xMLTagReader = context.NewTagReader("Layer");
			context.ExpectIdentity(this);
			string attribute = context.reader.GetAttribute("DisplayName");
			if (attribute != null)
			{
				this._displayName = attribute;
				context.GetAttributeBoolean("Expanded", ref this._expanded);
				string attribute2 = context.reader.GetAttribute("SimulateTransparencyWithVEBackingLayer");
				if (attribute2 != null)
				{
					this._simulateTransparencyWithVEBackingLayer = attribute2;
				}
				while (xMLTagReader.FindNextStartTag())
				{
					if (xMLTagReader.TagIs(SourceMap.GetXMLTag()))
					{
						this.Add(new SourceMap(context, filenameContextDelegate, this.dirtyEvent, parentReadyToLockEvent));
					}
					else
					{
						if (xMLTagReader.TagIs(LayerView.GetXMLTag()))
						{
							this._lastView = new LayerView(this, context);
						}
						else
						{
							if (xMLTagReader.TagIs("LastLayerViewPosition"))
							{
								XMLTagReader xMLTagReader2 = context.NewTagReader("LastLayerViewPosition");
								MapPosition mapPosition = null;
								while (xMLTagReader2.FindNextStartTag())
								{
									if (xMLTagReader2.TagIs(MapPosition.GetXMLTag(context.version)))
									{
										mapPosition = new MapPosition(context, null, MercatorCoordinateSystem.theInstance);
									}
								}
								if (mapPosition != null)
								{
									this._lastView = new LayerView(this, mapPosition);
								}
							}
							else
							{
								if (xMLTagReader.TagIs(RenderClip.GetXMLTag()))
								{
									this._renderClip = new RenderClip(context);
								}
							}
						}
					}
				}
				return;
			}
			throw new InvalidMashupFile(context, "Expected displayName attribute");
		}
示例#41
0
		internal int GetIndexOfSourceMap(SourceMap targetSourceMap)
		{
			return this.sourceMaps.FindIndex((SourceMap item) => item == targetSourceMap);
		}
示例#42
0
		internal void AddAt(SourceMap sourceMap, int index)
		{
			this.sourceMaps.Insert(index, sourceMap);
		}
示例#43
0
		internal void Remove(SourceMap sourceMap)
		{
			this.sourceMaps.Remove(sourceMap);
			this.dirtyEvent.SetDirty();
		}
示例#44
0
		internal bool Contains(SourceMap sourceMap)
		{
			return this.sourceMaps.Contains(sourceMap);
		}
示例#45
0
		public IRenderableSource CreateRenderableWarpedSource(SourceMap sourceMap)
		{
			D.Assert(sourceMap.ReadyToLock());
			return this.CreateWarpedSource(sourceMap);
		}
示例#46
0
		public UnwarpedMapTileSource CreateUnwarpedSource(SourceMap sourceMap)
		{
			return new UnwarpedMapTileSource(this.cachePackage, sourceMap.documentFuture.GetSynchronousFuture(this.cachePackage), sourceMap);
		}
示例#47
0
		internal void RemoveSourceMap(SourceMap sourceMap)
		{
			Layer layer2 = this.layers.Find((Layer layer) => layer.Contains(sourceMap));
			layer2.Remove(sourceMap);
		}
示例#48
0
 internal bool Contains(SourceMap sourceMap)
 {
     return(sourceMaps.Contains(sourceMap));
 }
示例#49
0
 internal void Remove(SourceMap sourceMap)
 {
     sourceMaps.Remove(sourceMap);
     dirtyEvent.SetDirty();
 }
示例#50
0
 internal void AddAt(SourceMap sourceMap, int index)
 {
     sourceMaps.Insert(index, sourceMap);
 }
示例#51
0
 private void PreviewSourceMapZoom(SourceMap sourceMap)
 {
     if (this.currentView is SourceMapViewManager && ((SourceMapViewManager)this.currentView).GetSourceMap() == sourceMap)
     {
         ((SourceMapViewManager)this.currentView).PreviewSourceMapZoom();
     }
 }
示例#52
0
 internal int GetIndexOfSourceMap(SourceMap targetSourceMap)
 {
     return(sourceMaps.FindIndex((SourceMap item) => item == targetSourceMap));
 }
示例#53
0
		public IDisplayableSource CreateDisplayableUnwarpedSource(SourceMap sourceMap)
		{
			return this.CreateUnwarpedSource(sourceMap);
		}
示例#54
0
		public void ReadXML(MashupParseContext context)
		{
			XMLTagReader xMLTagReader = context.NewTagReader("MapGrinderMashupFile");
			context.version = MashupXMLSchemaVersion.ReadXMLAttribute(context.reader);
			SingleMaxZoomForEntireMashupCompatibilityBlob singleMaxZoomForEntireMashupCompatibilityBlob = null;
			string text = null;
			while (xMLTagReader.FindNextStartTag())
			{
				if (context.version != MonolithicMapPositionsSchema.schema && xMLTagReader.TagIs(LayerList.GetXMLTag()))
				{
					this._layerList = new LayerList(context, new SourceMap.GetFilenameContext(this.GetFilenameContext), this.dirtyEvent, this.readyToLockEvent);
				}
				else
				{
					if (context.version == MonolithicMapPositionsSchema.schema && xMLTagReader.TagIs(SourceMap.GetXMLTag()))
					{
						if (this._layerList != null && this._layerList.Count > 0)
						{
							throw new InvalidMashupFile(context, string.Format("Multiple SourceMaps in Version {0} file.", context.version.versionNumberString));
						}
						SourceMap sourceMap = new SourceMap(context, new SourceMap.GetFilenameContext(this.GetFilenameContext), this.dirtyEvent, this.readyToLockEvent);
						this._layerList = new LayerList(this.dirtyEvent);
						this._layerList.AddNewLayer();
						this._layerList.First.Add(sourceMap);
					}
					else
					{
						if (xMLTagReader.TagIs(RenderOptions.GetXMLTag()))
						{
							this.renderOptions = new RenderOptions(context, this.dirtyEvent, ref singleMaxZoomForEntireMashupCompatibilityBlob);
						}
						else
						{
							if (xMLTagReader.TagIs(Mashup.LastViewTag))
							{
								XMLTagReader xMLTagReader2 = context.NewTagReader(Mashup.LastViewTag);
								text = context.reader.GetAttribute(Mashup.LastView_TargetIdAttr);
								xMLTagReader2.SkipAllSubTags();
							}
						}
					}
				}
			}
			this._lastView = new NoView();
			if (text != null)
			{
				object obj = context.FetchObjectByIdentity(text);
				if (obj != null && obj is LastViewIfc)
				{
					this._lastView = ((LastViewIfc)obj).lastView;
				}
			}
			if (this.renderOptions == null)
			{
				if (context.version != MonolithicMapPositionsSchema.schema)
				{
					context.warnings.Add(new MashupFileWarning("RenderOptions tag absent."));
				}
				this.renderOptions = new RenderOptions(this.dirtyEvent);
			}
			if (singleMaxZoomForEntireMashupCompatibilityBlob != null)
			{
				D.Assert(context.version == SingleMaxZoomForEntireMashupSchema.schema);
				foreach (Layer current in this._layerList)
				{
					foreach (SourceMap current2 in current)
					{
						current2.sourceMapRenderOptions.maxZoom = singleMaxZoomForEntireMashupCompatibilityBlob.maxZoom;
					}
				}
			}
		}
示例#55
0
        public void CancelSourceMap(Layer layer, SourceMap sourceMap)
        {
            ReloadDelegate method = Reload;

            Invoke(method);
        }
示例#56
0
		public void Add(SourceMap sourceMap)
		{
			this.sourceMaps.Add(sourceMap);
			this.dirtyEvent.SetDirty();
		}
示例#57
0
		public WarpedMapTileSource CreateWarpedSource(SourceMap sourceMap)
		{
			return new WarpedMapTileSource(this.CreateUnwarpedSource(sourceMap), this.cachePackage, sourceMap);
		}
示例#58
0
        //[CompilerGenerated]
        //private static Converter<Legend, string> <>9__CachedAnonymousMethodDelegate1;

        public LegendList(SourceMap sourceMap, DirtyEvent parentEvent, DirtyEvent parentBoundsChangedEvent)
        {
            this._sourceMap = sourceMap;
            this.dirtyEvent = new DirtyEvent(parentEvent);
            this.parentBoundsChangedEvent = parentBoundsChangedEvent;
        }
示例#59
0
        internal void RemoveSourceMap(SourceMap sourceMap)
        {
            Layer layer2 = this.layers.Find((Layer layer) => layer.Contains(sourceMap));

            layer2.Remove(sourceMap);
        }
示例#60
0
        private void layerTreeView_DragDrop(object sender, DragEventArgs e)
        {
            TreeView treeView = (TreeView)sender;

            try
            {
                if (e.Data.GetDataPresent(dataTypeName, true))
                {
                    TreeNode treeNode  = (TreeNode)e.Data.GetData(dataTypeName);
                    TreeNode treeNode2 = ((LayerControls)treeView.Tag).currentDropHighlight;
                    if (treeNode2 != null)
                    {
                        D.Assert(treeView.Tag == this,
                                 "Not currently designed to support drags from one layer control to another.");
                        if (treeNode2.Tag == treeNode.Tag)
                        {
                            D.Sayf(0, "Ignoring drop onto self", new object[0]);
                        }
                        else
                        {
                            if (treeNode.Tag is SourceMap)
                            {
                                SourceMap sourceMap = (SourceMap)treeNode.Tag;
                                Layer     layer     = (Layer)treeNode.Parent.Tag;
                                if (treeNode2.Tag is Layer)
                                {
                                    Layer layer2 = (Layer)treeNode2.Tag;
                                    layer.Remove(sourceMap);
                                    layer2.AddAt(sourceMap, 0);
                                }
                                else
                                {
                                    if (treeNode2.Tag is SourceMap)
                                    {
                                        SourceMap targetSourceMap = (SourceMap)treeNode2.Tag;
                                        Layer     layer3          = (Layer)treeNode2.Parent.Tag;
                                        layer.Remove(sourceMap);
                                        int index = layer3.GetIndexOfSourceMap(targetSourceMap) + 1;
                                        layer3.AddAt(sourceMap, index);
                                    }
                                    else
                                    {
                                        D.Assert(false, "unknown case");
                                    }
                                }

                                object tag = layerTreeView.SelectedNode.Tag;
                                Reload();
                                IEnumerator enumerator = layerTreeView.Nodes.GetEnumerator();
                                try
                                {
                                    while (enumerator.MoveNext())
                                    {
                                        TreeNode treeNode3 = (TreeNode)enumerator.Current;
                                        if (treeNode3.Tag == tag)
                                        {
                                            layerTreeView.SelectedNode = treeNode3;
                                            break;
                                        }
                                    }

                                    goto IL_226;
                                }
                                finally
                                {
                                    IDisposable disposable = enumerator as IDisposable;
                                    if (disposable != null)
                                    {
                                        disposable.Dispose();
                                    }
                                }
                            }

                            if (treeNode.Tag is Layer)
                            {
                                Layer layer4 = (Layer)treeNode.Tag;
                                if (!(treeNode2.Tag is Layer))
                                {
                                    return;
                                }

                                Layer layer5 = (Layer)treeNode2.Tag;
                                if (layer5 == layer4)
                                {
                                    return;
                                }

                                _mashup.layerList.Remove(layer4);
                                _mashup.layerList.AddAfter(layer4, layer5);
                                Reload();
                            }
                            else
                            {
                                D.Assert(false, "didn't think tree could contain anything else");
                            }
                        }

IL_226:
                        treeNode2.EnsureVisible();
                    }
                }
            }
            finally
            {
                ((LayerControls)treeView.Tag).SetDropHighlight(null);
            }
        }