public static string GetXMLTag(MashupXMLSchemaVersion version)
		{
			if (version == MonolithicMapPositionsSchema.schema)
			{
				return MapPosition.GetXMLTag(version);
			}
			return LatLonZoom.GetXMLTag();
		}
Exemple #2
0
 public static string GetXMLTag(MashupXMLSchemaVersion version)
 {
     if (version == MonolithicMapPositionsSchema.schema)
     {
         return("MapPosition");
     }
     return("MapPosition");
 }
Exemple #3
0
 public static string GetXMLTag(MashupXMLSchemaVersion version)
 {
     if (version == MonolithicMapPositionsSchema.schema)
     {
         return(MapPosition.GetXMLTag(version));
     }
     return(LatLonZoom.GetXMLTag());
 }
        public static MashupXMLSchemaVersion ReadXMLAttribute(XmlTextReader reader)
        {
            string versionString = reader.GetAttribute("Version");
            MashupXMLSchemaVersion mashupXMLSchemaVersion = MashupXMLSchemaVersion.AcceptedVersions.Find((MashupXMLSchemaVersion vi) => vi._versionNumberString == versionString);

            if (mashupXMLSchemaVersion == null)
            {
                throw new InvalidMashupFile(reader, string.Format("Unknown mashup file version {0}", versionString));
            }
            return(mashupXMLSchemaVersion);
        }
Exemple #5
0
		public static string GetXMLTag(MashupXMLSchemaVersion version)
		{
			if (version == MonolithicMapPositionsSchema.schema)
			{
				return "MapPosition";
			}
			return "MapPosition";
		}
Exemple #6
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;
                    }
                }
            }
        }