Esempio n. 1
0
File: Area.cs Progetto: mitice/foo
 // checks if given area is sub area of current area instance
 public bool contains(Area area)
 {
     return(this.topLeftLatitude >= area.getTopLeftLatitude() &&
            this.topLeftLongitude <= area.getTopLeftLongitude() &&
            this.bottomRightLatitude <= area.getBottomRightLatitude() &&
            this.bottomRightLongitude >= area.getBottomRightLongitude());
 }
Esempio n. 2
0
File: Area.cs Progetto: misiek/foo
 // checks if given area is sub area of current area instance
 public bool contains(Area area)
 {
     return this.topLeftLatitude >= area.getTopLeftLatitude() &&
            this.topLeftLongitude <= area.getTopLeftLongitude() &&
            this.bottomRightLatitude <= area.getBottomRightLatitude() &&
            this.bottomRightLongitude >= area.getBottomRightLongitude();
 }
Esempio n. 3
0
File: Portal.cs Progetto: misiek/foo
        public String getPois(Area area)
        {
            string portalUrl = this.config.get("portal_url");
            string mobappid = this.config.get("mobappid");
            string areaStr = area.getTopLeftLatitude() + "," + area.getTopLeftLongitude() +
                "," + area.getBottomRightLatitude() + "," + area.getBottomRightLongitude();
            string queryString = portalUrl + "/pois/area/" + areaStr +
                "/lang/pl/?mobappid=" + mobappid;

            Debug.WriteLine("getPois: queryString: " + queryString, ToString());
            return GET(new Uri(queryString));
        }
Esempio n. 4
0
        // create bigger area for cache
        private Area newCacheArea(Area area)
        {
            double deltaLatitude = Math.Abs(area.getTopLeftLatitude() - area.getBottomRightLatitude());
            double deltaLongitude = Math.Abs(area.getTopLeftLongitude() - area.getBottomRightLongitude());

            double topLeftLatitude = area.getTopLeftLatitude() + this.cacheFactor * deltaLatitude;
            double topLeftLongitude = area.getTopLeftLongitude() - this.cacheFactor * deltaLongitude;

            double bottomRightLatitude = area.getBottomRightLatitude() - this.cacheFactor * deltaLatitude;
            double bottomRightLongitude = area.getBottomRightLongitude() + this.cacheFactor * deltaLongitude;

            return new Area(topLeftLatitude, topLeftLongitude, bottomRightLatitude, bottomRightLongitude);
        }