示例#1
0
		public MapPosition(MapPosition prototype, PositionUpdateIfc updateIfc)
		{
			this._llz = prototype._llz;
			this._style = prototype._style;
			this.valid = prototype.valid;
			this.updateIfc = updateIfc;
		}
示例#2
0
 public SourceMapRegistrationView(SourceMap sourceMap, LatLonZoom sourceMapView, MapPosition referenceMapView)
 {
     this.sourceMap        = sourceMap;
     locked                = false;
     this.sourceMapView    = sourceMapView;
     this.referenceMapView = new MapPosition(referenceMapView, null);
 }
示例#3
0
 public MapPosition(MapPosition prototype, PositionUpdateIfc updateIfc)
 {
     _llz           = prototype._llz;
     style          = prototype.style;
     valid          = prototype.valid;
     this.updateIfc = updateIfc;
 }
示例#4
0
 public LegendView(Legend legend, bool showingPreview, LatLonZoom sourceMapView, MapPosition referenceMapView)
 {
     this.legend           = legend;
     this.showingPreview   = showingPreview;
     this.sourceMapView    = sourceMapView;
     this.referenceMapView = referenceMapView;
 }
		public SourceMapRegistrationView(SourceMap sourceMap, LatLonZoom sourceMapView, MapPosition referenceMapView)
		{
			this._sourceMap = sourceMap;
			this._locked = false;
			this.sourceMapView = sourceMapView;
			this.referenceMapView = new MapPosition(referenceMapView, null);
		}
示例#6
0
        public MapPosition(MashupParseContext context, PositionUpdateIfc updateIfc, CoordinateSystemIfc coordSys)
        {
            this.updateIfc = updateIfc;
            if (context.version == MonolithicMapPositionsSchema.schema)
            {
                XMLTagReader xMLTagReader = context.NewTagReader("MapPosition");
                this._llz = new LatLonZoom(Convert.ToDouble(context.reader.GetAttribute("lat"), CultureInfo.InvariantCulture), Convert.ToDouble(context.reader.GetAttribute("lon"), CultureInfo.InvariantCulture), Convert.ToInt32(context.reader.GetAttribute("zoom"), CultureInfo.InvariantCulture));
                if (context.reader.GetAttribute("style") != null)
                {
                    this.setStyle(context.reader.GetAttribute("style"));
                }
                this.valid = true;
                while (xMLTagReader.FindNextStartTag())
                {
                }
                return;
            }
            XMLTagReader xMLTagReader2 = context.NewTagReader("MapPosition");

            if (context.reader.GetAttribute("style") != null)
            {
                this.setStyle(context.reader.GetAttribute("style"));
            }
            while (xMLTagReader2.FindNextStartTag())
            {
                if (xMLTagReader2.TagIs(LatLonZoom.GetXMLTag()))
                {
                    this._llz  = new LatLonZoom(context, coordSys);
                    this.valid = true;
                }
            }
            while (xMLTagReader2.FindNextStartTag())
            {
            }
        }
		public SourceMapRegistrationView(SourceMap sourceMap, MapPosition lockedMapView)
		{
			this._sourceMap = sourceMap;
			this._locked = true;
			this.referenceMapView = new MapPosition(lockedMapView, null);
			this.sourceMapView = lockedMapView.llz;
		}
示例#8
0
		public LegendView(Legend legend, bool showingPreview, LatLonZoom sourceMapView, MapPosition referenceMapView)
		{
			this._legend = legend;
			this._showingPreview = showingPreview;
			this.sourceMapView = sourceMapView;
			this.referenceMapView = referenceMapView;
		}
示例#9
0
		public MapPosition(LatLonZoom llz, string style, PositionUpdateIfc updateIfc)
		{
			this._llz = llz;
			this._style = style;
			this.valid = true;
			this.updateIfc = updateIfc;
		}
示例#10
0
 public SourceMapRegistrationView(SourceMap sourceMap, MapPosition lockedMapView)
 {
     this.sourceMap   = sourceMap;
     locked           = true;
     referenceMapView = new MapPosition(lockedMapView, null);
     sourceMapView    = lockedMapView.llz;
 }
示例#11
0
 public MapPosition(LatLonZoom llz, string style, PositionUpdateIfc updateIfc)
 {
     _llz           = llz;
     this.style     = style;
     valid          = true;
     this.updateIfc = updateIfc;
 }
示例#12
0
        public CrunchedLayer(MashupParseContext context)
        {
            displayName = context.reader.GetAttribute(Layer.GetLayerDisplayNameTag());
            XMLTagReader xMLTagReader = context.NewTagReader(Layer.GetXMLTag());

            while (xMLTagReader.FindNextStartTag())
            {
                if (xMLTagReader.TagIs("RangeDescriptors"))
                {
                    XMLTagReader xMLTagReader2 = context.NewTagReader("RangeDescriptors");
                    xMLTagReader2.SkipAllSubTags();
                }
                else
                {
                    if (xMLTagReader.TagIs("DefaultView"))
                    {
                        XMLTagReader xMLTagReader3 = context.NewTagReader("DefaultView");
                        defaultView = LatLonZoom.ReadFromAttributes(context, MercatorCoordinateSystem.theInstance);
                        xMLTagReader3.SkipAllSubTags();
                    }
                    else
                    {
                        if (xMLTagReader.TagIs("SourceMapInfoList"))
                        {
                            XMLTagReader xMLTagReader4 = context.NewTagReader("SourceMapInfoList");
                            while (xMLTagReader4.FindNextStartTag())
                            {
                                if (xMLTagReader4.TagIs(SourceMapInfo.GetXMLTag()))
                                {
                                    sourceMapRecords.Add(
                                        new SourceMapRecord(new SourceMapInfo(context, new DirtyEvent())));
                                }
                            }
                        }
                        else
                        {
                            if (xMLTagReader.TagIs("SourceMapRecordList"))
                            {
                                XMLTagReader xMLTagReader5 = context.NewTagReader("SourceMapRecordList");
                                while (xMLTagReader5.FindNextStartTag())
                                {
                                    if (xMLTagReader5.TagIs(SourceMapRecord.GetXMLTag()))
                                    {
                                        sourceMapRecords.Add(new SourceMapRecord(context));
                                    }
                                }
                            }
                            else
                            {
                                if (xMLTagReader.TagIs(RenderedTileNamingScheme.GetXMLTag()))
                                {
                                    namingScheme = RenderedTileNamingScheme.ReadXML(context);
                                }
                            }
                        }
                    }
                }
            }
        }
示例#13
0
 public static string GetXMLTag(MashupXMLSchemaVersion version)
 {
     if (version == MonolithicMapPositionsSchema.schema)
     {
         return(MapPosition.GetXMLTag(version));
     }
     return(LatLonZoom.GetXMLTag());
 }
示例#14
0
 public PositionAssociation(string associationName, LatLonZoom imagePosition, LatLonZoom sourcePosition, LatLonZoom globalPosition, DirtyEvent dirtyEvent)
 {
     this.dirtyEvent       = dirtyEvent;
     this._pinId           = -1;
     this._associationName = associationName;
     this._imagePosition   = new DisplayablePosition(imagePosition);
     this._sourcePosition  = new DisplayablePosition(sourcePosition);
     this._globalPosition  = new DisplayablePosition(globalPosition);
 }
		public PositionAssociation(string associationName, LatLonZoom imagePosition, LatLonZoom sourcePosition, LatLonZoom globalPosition, DirtyEvent dirtyEvent)
		{
			this.dirtyEvent = dirtyEvent;
			this._pinId = -1;
			this._associationName = associationName;
			this._imagePosition = new DisplayablePosition(imagePosition);
			this._sourcePosition = new DisplayablePosition(sourcePosition);
			this._globalPosition = new DisplayablePosition(globalPosition);
		}
示例#16
0
 internal void DragVertex(Point diff, int draggedVertexIndex)
 {
     LatLon point = this.GetUserRegion().GetPoint(draggedVertexIndex);
     LatLonZoom center = new LatLonZoom(point.lat, point.lon, this.svdp.MapCenter().zoom);
     diff = new Point(-diff.X, -diff.Y);
     LatLonZoom translationInLatLon = this.csi.GetTranslationInLatLon(center, diff);
     this.GetUserRegion().UpdatePoint(draggedVertexIndex, translationInLatLon.latlon);
     this.Invalidate();
 }
示例#17
0
		public CrunchedLayer(MashupParseContext context)
		{
			this.displayName = context.reader.GetAttribute(Layer.GetLayerDisplayNameTag());
			XMLTagReader xMLTagReader = context.NewTagReader(Layer.GetXMLTag());
			while (xMLTagReader.FindNextStartTag())
			{
				if (xMLTagReader.TagIs("RangeDescriptors"))
				{
					XMLTagReader xMLTagReader2 = context.NewTagReader("RangeDescriptors");
					xMLTagReader2.SkipAllSubTags();
				}
				else
				{
					if (xMLTagReader.TagIs("DefaultView"))
					{
						XMLTagReader xMLTagReader3 = context.NewTagReader("DefaultView");
						this.defaultView = LatLonZoom.ReadFromAttributes(context, MercatorCoordinateSystem.theInstance);
						xMLTagReader3.SkipAllSubTags();
					}
					else
					{
						if (xMLTagReader.TagIs("SourceMapInfoList"))
						{
							XMLTagReader xMLTagReader4 = context.NewTagReader("SourceMapInfoList");
							while (xMLTagReader4.FindNextStartTag())
							{
								if (xMLTagReader4.TagIs(SourceMapInfo.GetXMLTag()))
								{
									this.sourceMapRecords.Add(new SourceMapRecord(new SourceMapInfo(context, new DirtyEvent())));
								}
							}
						}
						else
						{
							if (xMLTagReader.TagIs("SourceMapRecordList"))
							{
								XMLTagReader xMLTagReader5 = context.NewTagReader("SourceMapRecordList");
								while (xMLTagReader5.FindNextStartTag())
								{
									if (xMLTagReader5.TagIs(SourceMapRecord.GetXMLTag()))
									{
										this.sourceMapRecords.Add(new SourceMapRecord(context));
									}
								}
							}
							else
							{
								if (xMLTagReader.TagIs(RenderedTileNamingScheme.GetXMLTag()))
								{
									this.namingScheme = RenderedTileNamingScheme.ReadXML(context);
								}
							}
						}
					}
				}
			}
		}
示例#18
0
 public void RecordSource(LatLonZoom llz)
 {
     if (this.mapsLocked)
     {
         this.RecordRef(llz);
         return;
     }
     this.sourceMap.sourceSnap = llz;
 }
示例#19
0
 public override bool Equals(object o)
 {
     if (o is LatLonZoom)
     {
         LatLonZoom llz = (LatLonZoom)o;
         return(this == llz);
     }
     return(false);
 }
示例#20
0
        public void RecordSource(LatLonZoom llz)
        {
            if (mapsLocked)
            {
                RecordRef(llz);
                return;
            }

            sourceMap.sourceSnap = llz;
        }
示例#21
0
        internal void AddCorner(Point newCornerPoint, int originalVertexIndex)
        {
            LatLonZoom center              = this.svdp.MapCenter();
            Point      offsetInPixels      = new Point(this.svdp.ScreenCenter().X - newCornerPoint.X, this.svdp.ScreenCenter().Y - newCornerPoint.Y);
            LatLonZoom translationInLatLon = this.csi.GetTranslationInLatLon(center, offsetInPixels);

            D.Say(0, string.Format("newCornerPosition= {0}", translationInLatLon));
            this.GetUserRegion().InsertPoint(originalVertexIndex + 1, translationInLatLon.latlon);
            this.Invalidate();
        }
示例#22
0
 public DisplayablePosition(MashupParseContext context, CoordinateSystemIfc coordSys)
 {
     if (context.version == MonolithicMapPositionsSchema.schema)
     {
         MapPosition mapPosition = new MapPosition(context, null, coordSys);
         this._pinPosition = mapPosition.llz;
         return;
     }
     this._pinPosition = new LatLonZoom(context, coordSys);
 }
		public DisplayablePosition(MashupParseContext context, CoordinateSystemIfc coordSys)
		{
			if (context.version == MonolithicMapPositionsSchema.schema)
			{
				MapPosition mapPosition = new MapPosition(context, null, coordSys);
				this._pinPosition = mapPosition.llz;
				return;
			}
			this._pinPosition = new LatLonZoom(context, coordSys);
		}
示例#24
0
        internal void DragVertex(Point diff, int draggedVertexIndex)
        {
            LatLon     point  = GetUserRegion().GetPoint(draggedVertexIndex);
            LatLonZoom center = new LatLonZoom(point.lat, point.lon, svdp.MapCenter().zoom);

            diff = new Point(-diff.X, -diff.Y);
            LatLonZoom translationInLatLon = csi.GetTranslationInLatLon(center, diff);

            GetUserRegion().UpdatePoint(draggedVertexIndex, translationInLatLon.latlon);
            Invalidate();
        }
示例#25
0
		public CrunchedLayer(RenderOptions renderOptions, Layer layer, List<RangeDescriptor> rangeDescriptors, MapTileSourceFactory mapTileSourceFactory)
		{
			this.displayName = layer.GetDisplayName();
			this.namingScheme = new VENamingScheme(layer.GetFilesystemName(), renderOptions.GetOutputTileSuffix());
			this.rangeDescriptors = rangeDescriptors;
			bool flag;
			this.defaultView = this.GetDefaultView(layer, new Size(600, 600), mapTileSourceFactory, out flag);
			foreach (SourceMap current in layer)
			{
				this.sourceMapRecords.Add(new SourceMapRecord(layer, current, mapTileSourceFactory));
			}
		}
示例#26
0
 public void RestoreSnapView()
 {
     if (this.snapViewStore != null)
     {
         LatLonZoom latLonZoom = this.snapViewStore.Restore();
         if (latLonZoom != default(LatLonZoom))
         {
             this.center().setPosition(latLonZoom);
             this.center().ForceInteractiveUpdate();
         }
     }
 }
示例#27
0
        public CrunchedLayer(RenderOptions renderOptions, Layer layer, List <RangeDescriptor> rangeDescriptors, MapTileSourceFactory mapTileSourceFactory)
        {
            this.displayName      = layer.GetDisplayName();
            this.namingScheme     = new VENamingScheme(layer.GetFilesystemName(), renderOptions.GetOutputTileSuffix());
            this.rangeDescriptors = rangeDescriptors;
            bool flag;

            this.defaultView = this.GetDefaultView(layer, new Size(600, 600), mapTileSourceFactory, out flag);
            foreach (SourceMap current in layer)
            {
                this.sourceMapRecords.Add(new SourceMapRecord(layer, current, mapTileSourceFactory));
            }
        }
示例#28
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.");
            }
        }
示例#29
0
        public void UnlockMaps()
        {
            if (!this.mapsLocked)
            {
                throw new Exception("uh oh.  trying to unlock maps that are already unlocked!");
            }
            this.SetupUnlockedView();
            ViewerControlIfc    sMViewerControl               = this.viewControl.GetSMViewerControl();
            MapRectangle        bounds                        = this.viewControl.GetVEViewerControl().GetBounds();
            WarpedMapTileSource warpedMapTileSource           = this.mapTileSourceFactory.CreateWarpedSource(this.sourceMap);
            IPointTransformer   destLatLonToSourceTransformer = warpedMapTileSource.GetDestLatLonToSourceTransformer();
            MapRectangle        newBounds                     = bounds.Transform(destLatLonToSourceTransformer);
            LatLonZoom          latLonZoom                    = sMViewerControl.GetCoordinateSystem().GetBestViewContaining(newBounds, sMViewerControl.Size);

            latLonZoom = CoordinateSystemUtilities.ConstrainLLZ(ContinuousCoordinateSystem.theInstance, latLonZoom);
            this.viewControl.GetUIPositionManager().GetSMPos().setPosition(latLonZoom);
            this.viewControl.GetUIPositionManager().PositionUpdated();
        }
示例#30
0
 internal void Paint(PaintSpecification e, LatLonZoom center, Size size)
 {
     if (this.GetUserRegion() == null)
     {
         return;
     }
     UserRegionViewController.State state;
     state.center = center;
     state.size   = size;
     state.valid  = true;
     this.UpdateState(state);
     UserRegionViewController.ClickableThing[] array = this.clickableThings;
     for (int i = 0; i < array.Length; i++)
     {
         UserRegionViewController.ClickableThing clickableThing = array[i];
         e.Graphics.FillPath(this.segmentFillBrush, clickableThing.path);
     }
 }
		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.");
			}
		}
示例#32
0
        public LegendView(Legend legend, MashupParseContext context)
        {
            this.legend = legend;
            object       obj          = null;
            XMLTagReader xMLTagReader = context.NewTagReader(GetXMLTag());

            showingPreview = context.GetRequiredAttributeBoolean(previewAttr);
            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);
                            context.AssertUnique(obj);
                            obj = new object();
                        }
                    }
                }
                else
                {
                    if (xMLTagReader.TagIs(referenceMapViewTag))
                    {
                        context.AssertUnique(referenceMapView);
                        XMLTagReader xMLTagReader3 = context.NewTagReader(referenceMapViewTag);
                        while (xMLTagReader3.FindNextStartTag())
                        {
                            if (xMLTagReader3.TagIs(MapPosition.GetXMLTag(context.version)))
                            {
                                referenceMapView =
                                    new MapPosition(context, null, MercatorCoordinateSystem.theInstance);
                            }
                        }
                    }
                }
            }

            context.AssertPresent(obj, sourceMapViewTag);
            context.AssertPresent(referenceMapView, referenceMapViewTag);
        }
示例#33
0
		public LegendView(Legend legend, MashupParseContext context)
		{
			this._legend = legend;
			object obj = null;
			XMLTagReader xMLTagReader = context.NewTagReader(LegendView.GetXMLTag());
			this._showingPreview = context.GetRequiredAttributeBoolean(LegendView.previewAttr);
			while (xMLTagReader.FindNextStartTag())
			{
				if (xMLTagReader.TagIs(LegendView.sourceMapViewTag))
				{
					XMLTagReader xMLTagReader2 = context.NewTagReader(LegendView.sourceMapViewTag);
					while (xMLTagReader2.FindNextStartTag())
					{
						if (xMLTagReader2.TagIs(LatLonZoom.GetXMLTag()))
						{
							this.sourceMapView = new LatLonZoom(context, ContinuousCoordinateSystem.theInstance);
							context.AssertUnique(obj);
							obj = new object();
						}
					}
				}
				else
				{
					if (xMLTagReader.TagIs(LegendView.referenceMapViewTag))
					{
						context.AssertUnique(this.referenceMapView);
						XMLTagReader xMLTagReader3 = context.NewTagReader(LegendView.referenceMapViewTag);
						while (xMLTagReader3.FindNextStartTag())
						{
							if (xMLTagReader3.TagIs(MapPosition.GetXMLTag(context.version)))
							{
								this.referenceMapView = new MapPosition(context, null, MercatorCoordinateSystem.theInstance);
							}
						}
					}
				}
			}
			context.AssertPresent(obj, LegendView.sourceMapViewTag);
			context.AssertPresent(this.referenceMapView, LegendView.referenceMapViewTag);
		}
示例#34
0
 public void RecordSource(LatLonZoom llz)
 {
     if (this.mapsLocked)
     {
         this.RecordRef(llz);
         return;
     }
     this.sourceMap.sourceSnap = llz;
 }
示例#35
0
 public void RecordRef(LatLonZoom llz)
 {
     this.sourceMap.referenceSnap = llz;
 }
示例#36
0
        private List <ViewerControl.PaintKit> AssembleLayer(PaintSpecification e, LatLonZoom llz, IDisplayableSource tileSource, int stackOrder)
        {
            List <ViewerControl.PaintKit> list = new List <ViewerControl.PaintKit>();
            CoordinateSystemIfc           defaultCoordinateSystem = tileSource.GetDefaultCoordinateSystem();
            TileDisplayDescriptorArray    tileArrayDescriptor     = defaultCoordinateSystem.GetTileArrayDescriptor(llz, e.Size);
            AsyncRef asyncRef;

            try
            {
                asyncRef = (AsyncRef)tileSource.GetUserBounds(null, (FutureFeatures)7).Realize("ViewerControl.PaintLayer boundsRef");
            }
            catch (Exception ex)
            {
                ViewerControl.MessagePainter item = new ViewerControl.MessagePainter(stackOrder * 12, BigDebugKnob.theKnob.debugFeaturesEnabled ? ex.ToString() : "X", stackOrder == 0);
                foreach (TileDisplayDescriptor current in tileArrayDescriptor)
                {
                    list.Add(new ViewerControl.PaintKit(current.paintLocation)
                    {
                        annotations =
                        {
                            item
                        }
                    });
                }
                return(list);
            }
            Region clipRegion = null;

            if (asyncRef.present == null)
            {
                asyncRef.AddCallback(new AsyncRecord.CompleteCallback(this.BoundsRefAvailable));
                asyncRef.SetInterest(524290);
            }
            if ((this.ShowSourceCrop == null || this.ShowSourceCrop.Enabled) && asyncRef.present is IBoundsProvider)
            {
                clipRegion = ((IBoundsProvider)asyncRef.present).GetRenderRegion().GetClipRegion(defaultCoordinateSystem.GetUnclippedMapWindow(this.center().llz, e.Size), this.center().llz.zoom, defaultCoordinateSystem);
                this.UpdateUserRegion();
            }
            new PersistentInterest(asyncRef);
            int num = 0;

            foreach (TileDisplayDescriptor current2 in tileArrayDescriptor)
            {
                ViewerControl.PaintKit paintKit = new ViewerControl.PaintKit(current2.paintLocation);
                D.Sayf(10, "count {0} tdd {1}", new object[]
                {
                    num,
                    current2.tileAddress
                });
                num++;
                if (e.SynchronousTiles)
                {
                    D.Sayf(0, "PaintLayer({0}, tdd.ta={1})", new object[]
                    {
                        tileSource.GetHashCode(),
                        current2.tileAddress
                    });
                }
                bool    arg_1F5_0 = e.SynchronousTiles;
                Present present   = tileSource.GetImagePrototype(null, (FutureFeatures)15).Curry(new ParamDict(new object[]
                {
                    TermName.TileAddress,
                    current2.tileAddress
                })).Realize("ViewerControl.PaintLayer imageAsyncRef");
                AsyncRef  asyncRef2 = (AsyncRef)present;
                Rectangle rectangle = Rectangle.Intersect(e.ClipRectangle, current2.paintLocation);
                int       interest  = rectangle.Height * rectangle.Width + 524296;
                asyncRef2.SetInterest(interest);
                if (asyncRef2.present == null)
                {
                    ViewerControl.AsyncNotifier @object = new ViewerControl.AsyncNotifier(this);
                    asyncRef2.AddCallback(new AsyncRecord.CompleteCallback(@object.AsyncRecordComplete));
                }
                this.activeTiles.Add(asyncRef2);
                asyncRef2 = (AsyncRef)asyncRef2.Duplicate("ViewerControl.PaintLayer");
                if (e.SynchronousTiles)
                {
                    D.Assert(false, "unimpl");
                }
                if (asyncRef2.present == null)
                {
                    D.Assert(!e.SynchronousTiles);
                }
                bool flag;
                if (asyncRef2.present != null && asyncRef2.present is ImageRef)
                {
                    flag = false;
                    ImageRef imageRef = (ImageRef)asyncRef2.present.Duplicate("tpc");
                    paintKit.meatyParts.Add(new ViewerControl.ImagePainter(imageRef, clipRegion));
                }
                else
                {
                    if (asyncRef2.present != null && asyncRef2.present is BeyondImageBounds)
                    {
                        flag = false;
                    }
                    else
                    {
                        if (asyncRef2.present != null && asyncRef2.present is PresentFailureCode)
                        {
                            flag = false;
                            PresentFailureCode           presentFailureCode = (PresentFailureCode)asyncRef2.present;
                            ViewerControl.MessagePainter item2 = new ViewerControl.MessagePainter(stackOrder * 12, BigDebugKnob.theKnob.debugFeaturesEnabled ? StringUtils.breakLines(presentFailureCode.ToString()) : "X", stackOrder == 0);
                            paintKit.annotations.Add(item2);
                        }
                        else
                        {
                            flag = true;
                            ViewerControl.MessagePainter item3 = new ViewerControl.MessagePainter(stackOrder * 12, stackOrder.ToString(), stackOrder == 0);
                            if (stackOrder == 0)
                            {
                                paintKit.meatyParts.Add(item3);
                            }
                            else
                            {
                                paintKit.annotations.Add(item3);
                            }
                        }
                    }
                }
                this.tilesRequired++;
                if (!flag)
                {
                    this.tilesAvailable++;
                }
                if ((flag && stackOrder == 0) || MapDrawingOption.IsEnabled(this.ShowTileBoundaries))
                {
                    paintKit.annotations.Add(new ViewerControl.TileBoundaryPainter());
                }
                if (MapDrawingOption.IsEnabled(this.ShowTileNames))
                {
                    paintKit.annotations.Add(new ViewerControl.TileNamePainter(current2.tileAddress.ToString()));
                }
                asyncRef2.Dispose();
                list.Add(paintKit);
            }
            return(list);
        }
示例#37
0
        private void PaintGraphics(PaintSpecification e, LatLonZoom llz)
        {
            this.tilesRequired  = 0;
            this.tilesAvailable = 0;
            this.asyncRequestGeneration++;
            if (this.baseLayer == null)
            {
                return;
            }
            InterestList interestList = this.activeTiles;

            this.activeTiles = new InterestList();
            e.ResetClip();
            e.Graphics.FillRectangle(new SolidBrush(Color.LightPink), new Rectangle(new Point(0, 0), e.Size));
            List <ViewerControl.PaintKit> list = new List <ViewerControl.PaintKit>();

            list.AddRange(this.AssembleLayer(e, llz, this.baseLayer, 0));
            int num = 1;

            foreach (IDisplayableSource current in this.alphaLayers)
            {
                list.AddRange(this.AssembleLayer(e, llz, current, num));
                num++;
            }
            this.activeTiles.Activate();
            this.PaintKits(e.Graphics, list);
            e.ResetClip();
            if (this.userRegionViewController != null)
            {
                e.ResetClip();
                this.userRegionViewController.Paint(e, llz, base.Size);
            }
            if (MapDrawingOption.IsEnabled(this.ShowCrosshairs))
            {
                Pen   pen   = new Pen(Color.Yellow);
                Pen[] array = new Pen[]
                {
                    pen,
                    new Pen(Color.Black)
                    {
                        DashStyle = DashStyle.Dash
                    }
                };
                for (int i = 0; i < array.Length; i++)
                {
                    Pen pen2 = array[i];
                    e.Graphics.DrawLine(pen2, 0, base.Size.Height / 2, base.Size.Width, base.Size.Height / 2);
                    e.Graphics.DrawLine(pen2, base.Size.Width / 2, 0, base.Size.Width / 2, base.Size.Height);
                }
            }
            if (MapDrawingOption.IsEnabled(this.ShowPushPins) && this.pinList != null)
            {
                List <PositionAssociationView> list2 = new List <PositionAssociationView>();
                list2.AddRange(this.pinList);
                list2.Sort(delegate(PositionAssociationView p0, PositionAssociationView p1)
                {
                    double num2 = p1.position.pinPosition.lat - p0.position.pinPosition.lat;
                    if (num2 != 0.0)
                    {
                        if (num2 <= 0.0)
                        {
                            return(-1);
                        }
                        return(1);
                    }
                    else
                    {
                        double num3 = p1.position.pinPosition.lon - p0.position.pinPosition.lon;
                        if (num3 == 0.0)
                        {
                            return(0);
                        }
                        if (num3 <= 0.0)
                        {
                            return(-1);
                        }
                        return(1);
                    }
                });
                foreach (PositionAssociationView current2 in list2)
                {
                    this.DrawMarker(current2, e);
                }
            }
            if (interestList != null)
            {
                interestList.Dispose();
            }
            if (this.tilesRequired == 0 || this.tilesAvailable == this.tilesRequired)
            {
                this.displayProgressBar.Visible = false;
                return;
            }
            this.displayProgressBar.Visible = true;
            this.displayProgressBar.Minimum = 0;
            this.displayProgressBar.Maximum = this.tilesRequired;
            this.displayProgressBar.Value   = this.tilesAvailable;
        }
示例#38
0
		public MapPosition(MashupParseContext context, PositionUpdateIfc updateIfc, CoordinateSystemIfc coordSys)
		{
			this.updateIfc = updateIfc;
			if (context.version == MonolithicMapPositionsSchema.schema)
			{
				XMLTagReader xMLTagReader = context.NewTagReader("MapPosition");
				this._llz = new LatLonZoom(Convert.ToDouble(context.reader.GetAttribute("lat"), CultureInfo.InvariantCulture), Convert.ToDouble(context.reader.GetAttribute("lon"), CultureInfo.InvariantCulture), Convert.ToInt32(context.reader.GetAttribute("zoom"), CultureInfo.InvariantCulture));
				if (context.reader.GetAttribute("style") != null)
				{
					this.setStyle(context.reader.GetAttribute("style"));
				}
				this.valid = true;
				while (xMLTagReader.FindNextStartTag())
				{
				}
				return;
			}
			XMLTagReader xMLTagReader2 = context.NewTagReader("MapPosition");
			if (context.reader.GetAttribute("style") != null)
			{
				this.setStyle(context.reader.GetAttribute("style"));
			}
			while (xMLTagReader2.FindNextStartTag())
			{
				if (xMLTagReader2.TagIs(LatLonZoom.GetXMLTag()))
				{
					this._llz = new LatLonZoom(context, coordSys);
					this.valid = true;
				}
			}
			while (xMLTagReader2.FindNextStartTag())
			{
			}
		}
示例#39
0
文件: LLZBox.cs 项目: mikhp/greatmaps
		public void PositionChanged(LatLonZoom llz)
		{
			this.lastValue = llz;
			this.InvalidateView();
		}
示例#40
0
		public void setZoom(int zoom)
		{
			this._llz = new LatLonZoom(this.llz.lat, this.llz.lon, zoom);
			this.setBase();
		}
示例#41
0
文件: Legend.cs 项目: mikhp/greatmaps
		public void NotePositionUnlocked(LatLonZoom sourceMapPosition, MapPosition referenceMapPosition)
		{
			bool showingPreview = false;
			this._lastView = new LegendView(this, showingPreview, sourceMapPosition, referenceMapPosition);
		}
示例#42
0
		public DefaultReferenceView(LatLonZoom llz)
		{
			this.present = true;
			this.llz = llz;
		}
示例#43
0
 public void NotePositionUnlocked(LatLonZoom sourceMapPosition, MapPosition referenceMapPosition)
 {
     this._lastView = new SourceMapRegistrationView(this, sourceMapPosition, referenceMapPosition);
 }
		public DisplayablePosition(LatLonZoom position)
		{
			this._pinPosition = position;
		}
示例#45
0
 public State(UserRegionViewController.State state)
 {
     this.center = state.center;
     this.size = new Size(state.size.Width, state.size.Height);
     this.valid = state.valid;
 }
示例#46
0
 public void NotePositionUnlocked(LatLonZoom sourceMapPosition, MapPosition referenceMapPosition)
 {
     D.Assert(false, "Layers are never unlocked.");
 }
示例#47
0
 public DisplayablePosition(LatLonZoom position)
 {
     _pinPosition = position;
 }
示例#48
0
 internal void Paint(PaintSpecification e, LatLonZoom center, Size size)
 {
     if (this.GetUserRegion() == null)
     {
         return;
     }
     UserRegionViewController.State state;
     state.center = center;
     state.size = size;
     state.valid = true;
     this.UpdateState(state);
     UserRegionViewController.ClickableThing[] array = this.clickableThings;
     for (int i = 0; i < array.Length; i++)
     {
         UserRegionViewController.ClickableThing clickableThing = array[i];
         e.Graphics.FillPath(this.segmentFillBrush, clickableThing.path);
     }
 }
示例#49
0
 public SourceMap(MashupParseContext context, SourceMap.GetFilenameContext filenameContextDelegate, DirtyEvent parentDirty, DirtyEvent parentReadyToLockEvent)
 {
     this.dirtyEvent = new DirtyEvent(parentDirty);
     this.readyToLockChangedEvent = new DirtyEvent(parentReadyToLockEvent);
     this.filenameContextDelegate = filenameContextDelegate;
     this.latentRegionHolder = new LatentRegionHolder(this.dirtyEvent, this.readyToLockChangedEvent);
     XMLTagReader xMLTagReader = context.NewTagReader("SourceMap");
     context.ExpectIdentity(this);
     string attribute = context.reader.GetAttribute("SourceMapFilename");
     if (attribute != null)
     {
         string path = Path.Combine(filenameContextDelegate(), attribute);
         int pageNumber = 0;
         context.GetAttributeInt("PageNumber", ref pageNumber);
         this._documentFuture = new GeneralDocumentFuture(new FutureDocumentFromFilesystem(path, pageNumber));
     }
     context.GetAttributeBoolean("Expanded", ref this._expanded);
     string attribute2 = context.reader.GetAttribute("DisplayName");
     MapPosition mapPosition = null;
     MapPosition mapPosition2 = null;
     while (xMLTagReader.FindNextStartTag())
     {
         if (xMLTagReader.TagIs(RegistrationDefinition.GetXMLTag()))
         {
             context.AssertUnique(this.registration);
             this.registration = new RegistrationDefinition(context, this.dirtyEvent);
         }
         else
         {
             if (xMLTagReader.TagIs(GeneralDocumentFuture.GetXMLTag()))
             {
                 context.AssertUnique(this._documentFuture);
                 this._documentFuture = new GeneralDocumentFuture(context, filenameContextDelegate());
             }
             else
             {
                 if (xMLTagReader.TagIs(LocalDocumentDescriptor.GetXMLTag()))
                 {
                     context.AssertUnique(this._documentFuture);
                     LocalDocumentDescriptor localDocumentDescriptor = new LocalDocumentDescriptor(context, filenameContextDelegate());
                     this._documentFuture = new GeneralDocumentFuture(new FutureDocumentFromFilesystem(localDocumentDescriptor.GetFilesystemAbsolutePath(), localDocumentDescriptor.GetPageNumber()));
                 }
                 else
                 {
                     if (xMLTagReader.TagIs("LastSourceMapPosition"))
                     {
                         XMLTagReader xMLTagReader2 = context.NewTagReader("LastSourceMapPosition");
                         while (xMLTagReader2.FindNextStartTag())
                         {
                             if (xMLTagReader2.TagIs(MapPosition.GetXMLTag(context.version)))
                             {
                                 mapPosition = new MapPosition(context, null, ContinuousCoordinateSystem.theInstance);
                             }
                         }
                     }
                     else
                     {
                         if (xMLTagReader.TagIs("LastVEPosition"))
                         {
                             XMLTagReader xMLTagReader3 = context.NewTagReader("LastVEPosition");
                             while (xMLTagReader3.FindNextStartTag())
                             {
                                 if (xMLTagReader3.TagIs(MapPosition.GetXMLTag(context.version)))
                                 {
                                     mapPosition2 = new MapPosition(context, null, MercatorCoordinateSystem.theInstance);
                                 }
                             }
                         }
                         else
                         {
                             if (xMLTagReader.TagIs(RenderRegion.GetXMLTag()))
                             {
                                 context.AssertUnique(this.renderRegion);
                                 this.renderRegion = new RenderRegion(context, this.dirtyEvent, ContinuousCoordinateSystem.theInstance);
                             }
                             else
                             {
                                 if (xMLTagReader.TagIs(SourceMapInfo.GetXMLTag()))
                                 {
                                     context.AssertUnique(this._sourceMapInfo);
                                     this._sourceMapInfo = new SourceMapInfo(context, this.dirtyEvent);
                                 }
                                 else
                                 {
                                     if (xMLTagReader.TagIs(SourceMapRenderOptions.GetXMLTag()))
                                     {
                                         context.AssertUnique(this._sourceMapRenderOptions);
                                         this._sourceMapRenderOptions = new SourceMapRenderOptions(context, this.dirtyEvent);
                                     }
                                     else
                                     {
                                         if (xMLTagReader.TagIs(TransparencyOptions.GetXMLTag()))
                                         {
                                             this._transparencyOptions = new TransparencyOptions(context, this.dirtyEvent);
                                         }
                                         else
                                         {
                                             if (xMLTagReader.TagIs(SourceMapRegistrationView.GetXMLTag()))
                                             {
                                                 context.AssertUnique(this._lastView);
                                                 this._lastView = new SourceMapRegistrationView(this, context);
                                             }
                                             else
                                             {
                                                 if (xMLTagReader.TagIs(LegendList.GetXMLTag()))
                                                 {
                                                     context.AssertUnique(this.legendList);
                                                     this.legendList = new LegendList(this, context, this.dirtyEvent);
                                                 }
                                                 else
                                                 {
                                                     if (xMLTagReader.TagIs("SnapView"))
                                                     {
                                                         XMLTagReader xMLTagReader4 = context.NewTagReader("SnapView");
                                                         string requiredAttribute = context.GetRequiredAttribute("Context");
                                                         LatLonZoom latLonZoom = default(LatLonZoom);
                                                         bool flag = false;
                                                         bool flag2 = true;
                                                         CoordinateSystemIfc coordSys = null;
                                                         if (requiredAttribute == "Source")
                                                         {
                                                             coordSys = ContinuousCoordinateSystem.theInstance;
                                                         }
                                                         else
                                                         {
                                                             if (!(requiredAttribute == "Reference"))
                                                             {
                                                                 throw new InvalidMashupFile(context, string.Format("Invalid {0} value {1}", "Context", requiredAttribute));
                                                             }
                                                             coordSys = MercatorCoordinateSystem.theInstance;
                                                         }
                                                         while (xMLTagReader4.FindNextStartTag())
                                                         {
                                                             if (xMLTagReader4.TagIs(LatLonZoom.GetXMLTag()))
                                                             {
                                                                 if (flag)
                                                                 {
                                                                     context.ThrowUnique();
                                                                 }
                                                                 try
                                                                 {
                                                                     latLonZoom = new LatLonZoom(context, coordSys);
                                                                 }
                                                                 catch (InvalidLLZ)
                                                                 {
                                                                     flag2 = false;
                                                                 }
                                                                 flag = true;
                                                             }
                                                         }
                                                         if (flag2)
                                                         {
                                                             if (!flag)
                                                             {
                                                                 context.AssertPresent(null, LatLonZoom.GetXMLTag());
                                                             }
                                                             if (requiredAttribute == "Source")
                                                             {
                                                                 this.sourceSnap = latLonZoom;
                                                             }
                                                             else
                                                             {
                                                                 if (requiredAttribute == "Reference")
                                                                 {
                                                                     this.referenceSnap = latLonZoom;
                                                                 }
                                                                 else
                                                                 {
                                                                     D.Assert(false, "handled above.");
                                                                 }
                                                             }
                                                         }
                                                     }
                                                     else
                                                     {
                                                         if (xMLTagReader.TagIs("SnapZoom"))
                                                         {
                                                             context.NewTagReader("SnapZoom");
                                                             string requiredAttribute2 = context.GetRequiredAttribute("Context");
                                                             bool flag3 = false;
                                                             CoordinateSystemIfc theInstance;
                                                             if (requiredAttribute2 == "Source")
                                                             {
                                                                 theInstance = ContinuousCoordinateSystem.theInstance;
                                                             }
                                                             else
                                                             {
                                                                 if (!(requiredAttribute2 == "Reference"))
                                                                 {
                                                                     throw new InvalidMashupFile(context, string.Format("Invalid {0} value {1}", "Context", requiredAttribute2));
                                                                 }
                                                                 theInstance = MercatorCoordinateSystem.theInstance;
                                                             }
                                                             int num = 0;
                                                             try
                                                             {
                                                                 theInstance.GetZoomRange().Parse(context, "Zoom");
                                                                 flag3 = true;
                                                             }
                                                             catch (InvalidMashupFile)
                                                             {
                                                             }
                                                             if (flag3)
                                                             {
                                                                 if (requiredAttribute2 == "Source")
                                                                 {
                                                                     this.sourceSnapZoom = num;
                                                                 }
                                                                 else
                                                                 {
                                                                     if (requiredAttribute2 == "Reference")
                                                                     {
                                                                         this.referenceSnapZoom = num;
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
         if (context.version == InlineSourceMapInfoSchema.schema)
         {
             if (xMLTagReader.TagIs("MapFileURL"))
             {
                 this._sourceMapInfo.mapFileURL = XMLUtils.ReadStringXml(context, "MapFileURL");
             }
             else
             {
                 if (xMLTagReader.TagIs("MapHomePage"))
                 {
                     this._sourceMapInfo.mapHomePage = XMLUtils.ReadStringXml(context, "MapHomePage");
                 }
                 else
                 {
                     if (xMLTagReader.TagIs("MapDescription"))
                     {
                         this._sourceMapInfo.mapDescription = XMLUtils.ReadStringXml(context, "MapDescription");
                     }
                 }
             }
         }
     }
     if (attribute2 != null)
     {
         this._displayName = attribute2;
     }
     else
     {
         this._displayName = this._documentFuture.documentFuture.GetDefaultDisplayName();
     }
     if (this._lastView == null && mapPosition != null && mapPosition2 != null)
     {
         this._lastView = new SourceMapRegistrationView(this, mapPosition.llz, mapPosition2);
     }
     if (this._documentFuture == null)
     {
         throw new Exception("Source Map element missing document descriptor tag");
     }
     if (this.registration == null)
     {
         this.registration = new RegistrationDefinition(this.dirtyEvent);
     }
     this.registration.dirtyEvent.Add(this.readyToLockChangedEvent);
     if (this.legendList == null)
     {
         this.legendList = new LegendList(this, this.dirtyEvent, this.readyToLockChangedEvent);
     }
     if (this._sourceMapInfo == null)
     {
         this._sourceMapInfo = new SourceMapInfo(this.dirtyEvent);
     }
     if (this._sourceMapRenderOptions == null)
     {
         this._sourceMapRenderOptions = new SourceMapRenderOptions(this.dirtyEvent);
     }
     if (this._transparencyOptions == null)
     {
         this._transparencyOptions = new TransparencyOptions(this.dirtyEvent);
     }
 }
		public void PositionUpdated(LatLonZoom llz)
		{
			this.PositionUpdated();
		}
示例#51
0
文件: Legend.cs 项目: gabilic/Oplan
        public void NotePositionUnlocked(LatLonZoom sourceMapPosition, MapPosition referenceMapPosition)
        {
            bool showingPreview = false;

            this._lastView = new LegendView(this, showingPreview, sourceMapPosition, referenceMapPosition);
        }
示例#52
0
		public void Record(LatLonZoom llz)
		{
			this.smvm.RecordRef(llz);
		}
示例#53
0
 public void RecordRef(LatLonZoom llz)
 {
     sourceMap.referenceSnap = llz;
 }
示例#54
0
 public void Record(LatLonZoom llz)
 {
     this.smvm.RecordSource(llz);
 }
示例#55
0
 public void PositionUpdated(LatLonZoom llz)
 {
     this.llzBox.PositionChanged(llz);
     base.Invalidate();
 }
示例#56
0
 public void Record(LatLonZoom llz)
 {
     this.smvm.RecordRef(llz);
 }
示例#57
0
		public void NotePositionUnlocked(LatLonZoom sourceMapPosition, MapPosition referenceMapPosition)
		{
			D.Assert(false, "Layers are never unlocked.");
		}
示例#58
0
		public void setPosition(LatLonZoom llz, string style)
		{
			this._llz = llz;
			this._style = style;
			this.setBase();
		}
示例#59
0
 public State(State state)
 {
     center = state.center;
     size   = new Size(state.size.Width, state.size.Height);
     valid  = state.valid;
 }
示例#60
0
		public void setPosition(LatLonZoom llz)
		{
			this._llz = llz;
			this.setBase();
		}