Beispiel #1
0
		public void SetLastView(ICurrentView lastView)
		{
			this._lastView = lastView;
		}
Beispiel #2
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;
					}
				}
			}
		}
Beispiel #3
0
 public void SetLastView(ICurrentView lastView)
 {
     _lastView = lastView;
 }
Beispiel #4
0
 public void SetLastView(ICurrentView lastView)
 {
     this.lastView = lastView;
 }
Beispiel #5
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()))
                {
                    _layerList = new LayerList(context,
                                               GetFilenameContext,
                                               dirtyEvent,
                                               readyToLockEvent);
                }
                else
                {
                    if (context.version == MonolithicMapPositionsSchema.schema &&
                        xMLTagReader.TagIs(SourceMap.GetXMLTag()))
                    {
                        if (_layerList != null && _layerList.Count > 0)
                        {
                            throw new InvalidMashupFile(context,
                                                        string.Format("Multiple SourceMaps in Version {0} file.",
                                                                      context.version.versionNumberString));
                        }

                        SourceMap sourceMap = new SourceMap(context,
                                                            GetFilenameContext,
                                                            dirtyEvent,
                                                            readyToLockEvent);
                        _layerList = new LayerList(dirtyEvent);
                        _layerList.AddNewLayer();
                        _layerList.First.Add(sourceMap);
                    }
                    else
                    {
                        if (xMLTagReader.TagIs(RenderOptions.GetXMLTag()))
                        {
                            renderOptions = new RenderOptions(context,
                                                              dirtyEvent,
                                                              ref singleMaxZoomForEntireMashupCompatibilityBlob);
                        }
                        else
                        {
                            if (xMLTagReader.TagIs(LastViewTag))
                            {
                                XMLTagReader xMLTagReader2 = context.NewTagReader(LastViewTag);
                                text = context.reader.GetAttribute(LastView_TargetIdAttr);
                                xMLTagReader2.SkipAllSubTags();
                            }
                        }
                    }
                }
            }

            _lastView = new NoView();
            if (text != null)
            {
                object obj = context.FetchObjectByIdentity(text);
                if (obj != null && obj is LastViewIfc)
                {
                    _lastView = ((LastViewIfc)obj).lastView;
                }
            }

            if (renderOptions == null)
            {
                if (context.version != MonolithicMapPositionsSchema.schema)
                {
                    context.warnings.Add(new MashupFileWarning("RenderOptions tag absent."));
                }

                renderOptions = new RenderOptions(dirtyEvent);
            }

            if (singleMaxZoomForEntireMashupCompatibilityBlob != null)
            {
                D.Assert(context.version == SingleMaxZoomForEntireMashupSchema.schema);
                foreach (Layer current in _layerList)
                {
                    foreach (SourceMap current2 in current)
                    {
                        current2.sourceMapRenderOptions.maxZoom = singleMaxZoomForEntireMashupCompatibilityBlob.maxZoom;
                    }
                }
            }
        }