public static LatLonZoom GetZoomedView(CoordinateSystemIfc coordinateSystem, LatLonZoom oldCenterPosition, int steps)
        {
            int num = oldCenterPosition.zoom + steps;

            num = coordinateSystem.GetZoomRange().Constrain(num);
            return(new LatLonZoom(oldCenterPosition.lat, oldCenterPosition.lon, num));
        }
示例#2
0
        public static LatLonZoom ReadFromAttributes(MashupParseContext context, CoordinateSystemIfc coordSys)
        {
            int    zoom   = coordSys.GetZoomRange().ParseAllowUndefinedZoom(context, "zoom", context.GetRequiredAttribute("zoom"));
            LatLon latLon = LatLon.ReadFromAttributes(context, coordSys);

            return(new LatLonZoom(latLon.lat, latLon.lon, zoom));
        }
示例#3
0
        public LatLonZoom(MashupParseContext context, CoordinateSystemIfc coordSys)
        {
            XMLTagReader xMLTagReader = context.NewTagReader("LatLonZoom");

            try
            {
                if (context.reader.GetAttribute("zoom") == null)
                {
                    throw new InvalidLLZ(context, "Missing zoom attribute");
                }

                try
                {
                    _zoom = coordSys.GetZoomRange()
                            .ParseAllowUndefinedZoom(context, "zoom", context.reader.GetAttribute("zoom"));
                }
                catch (InvalidMashupFile invalidMashupFile)
                {
                    throw new InvalidLLZ(context, invalidMashupFile.Message);
                }

                bool flag = false;
                _latlon = default(LatLon);
                while (xMLTagReader.FindNextStartTag())
                {
                    if (xMLTagReader.TagIs(LatLon.GetXMLTag()))
                    {
                        _latlon = new LatLon(context, coordSys);
                        flag    = true;
                    }
                }

                if (!flag)
                {
                    throw new InvalidLLZ(context, "Missing LatLong Tag");
                }
            }
            finally
            {
                xMLTagReader.SkipAllSubTags();
            }
        }
 internal static LatLonZoom ConstrainLLZ(CoordinateSystemIfc coordSys, LatLonZoom src)
 {
     return(new LatLonZoom(coordSys.GetLatRange().Constrain(src.lat), coordSys.GetLonRange().Constrain(src.lon), coordSys.GetZoomRange().Constrain(src.zoom)));
 }
		internal static LatLonZoom ConstrainLLZ(CoordinateSystemIfc coordSys, LatLonZoom src)
		{
			return new LatLonZoom(coordSys.GetLatRange().Constrain(src.lat), coordSys.GetLonRange().Constrain(src.lon), coordSys.GetZoomRange().Constrain(src.zoom));
		}
		public static LatLonZoom GetZoomedView(CoordinateSystemIfc coordinateSystem, LatLonZoom oldCenterPosition, int steps)
		{
			int num = oldCenterPosition.zoom + steps;
			num = coordinateSystem.GetZoomRange().Constrain(num);
			return new LatLonZoom(oldCenterPosition.lat, oldCenterPosition.lon, num);
		}
示例#7
0
		public LatLonZoom(MashupParseContext context, CoordinateSystemIfc coordSys)
		{
			XMLTagReader xMLTagReader = context.NewTagReader("LatLonZoom");
			try
			{
				if (context.reader.GetAttribute("zoom") == null)
				{
					throw new InvalidLLZ(context, "Missing zoom attribute");
				}
				try
				{
					this._zoom = coordSys.GetZoomRange().ParseAllowUndefinedZoom(context, "zoom", context.reader.GetAttribute("zoom"));
				}
				catch (InvalidMashupFile invalidMashupFile)
				{
					throw new InvalidLLZ(context, invalidMashupFile.Message);
				}
				bool flag = false;
				this._latlon = default(LatLon);
				while (xMLTagReader.FindNextStartTag())
				{
					if (xMLTagReader.TagIs(LatLon.GetXMLTag()))
					{
						this._latlon = new LatLon(context, coordSys);
						flag = true;
					}
				}
				if (!flag)
				{
					throw new InvalidLLZ(context, "Missing LatLong Tag");
				}
			}
			finally
			{
				xMLTagReader.SkipAllSubTags();
			}
		}
示例#8
0
		public static LatLonZoom ReadFromAttributes(MashupParseContext context, CoordinateSystemIfc coordSys)
		{
			int zoom = coordSys.GetZoomRange().ParseAllowUndefinedZoom(context, "zoom", context.GetRequiredAttribute("zoom"));
			LatLon latLon = LatLon.ReadFromAttributes(context, coordSys);
			return new LatLonZoom(latLon.lat, latLon.lon, zoom);
		}