Beispiel #1
0
        public bool BBox(double left, double bottom, double right, double top)
        {
            var mapRequest = OsmMapUrl + "bbox=" + left.ToString() + "," + bottom.ToString() + "," + right.ToString() + "," + top.ToString();

            Xdoc = MakeRequest(mapRequest);
            if (!Xdoc.Equals(null))
            {
                Tile = new TileBound(Mercator.ToMeters(top, left), Mercator.ToMeters(bottom, right));
                Buildings();
                return(true);
            }
            return(false);
        }
Beispiel #2
0
 /// <summary>
 /// Load reads map information from a xml file
 /// </summary>
 /// <param name="filename"></param>
 /// <returns></returns>
 public bool Load(string filename)
 {
     Xdoc = XDocument.Load(filename);
     if (!Xdoc.Equals(null))
     {
         double left   = Convert.ToDouble(Xdoc.Root.Element("bounds").Attribute("minlon").Value);
         double top    = Convert.ToDouble(Xdoc.Root.Element("bounds").Attribute("maxlat").Value);
         double right  = Convert.ToDouble(Xdoc.Root.Element("bounds").Attribute("maxlon").Value);
         double bottom = Convert.ToDouble(Xdoc.Root.Element("bounds").Attribute("minlat").Value);
         Tile = new TileBound(MercatorHelper.ToMeters(top, left), MercatorHelper.ToMeters(bottom, right));
         return(true);
     }
     return(false);
 }
Beispiel #3
0
        /// <summary>
        /// BBox gets map information for the geo location
        /// </summary>
        /// <param name="left"></param>
        /// <param name="bottom"></param>
        /// <param name="right"></param>
        /// <param name="top"></param>
        /// <param name="err"></param>
        /// <returns></returns>
        public bool BBox(double left, double bottom, double right, double top, out string err)
        {
            var mapRequest = OsmMapUrl + "bbox=" + left.ToString() + "," + bottom.ToString() + "," + right.ToString() + "," + top.ToString();

            Xdoc = Request(mapRequest, out err);
            if (Xdoc != null)
            {
                if (absoluteAnchor)
                {
                    Tile           = new TileBound(MercatorHelper.ToMeters(top, left), MercatorHelper.ToMeters(bottom, right));
                    absoluteAnchor = false;
                }
                return(true);
            }
            return(false);
        }