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); }
/// <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); }