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)));
 }
예제 #5
0
		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));
		}
예제 #6
0
		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);
		}