Пример #1
0
 public Directions()
 {
     //Default values for the mainMap
     //mapChanged = true;
     mapDetails = null;
     // Do not need to set mainMap because it is a value within map
     //and the rest of the values from the Result
     time = 0;
     realTime = 0;
     fuelUsed = 0.0;
     distance = 0.0;
     hasFerry = false;
     hasUnpaved = false;
     hasHighway = false;
     hasTollRoad = false;
     hasCountryCross = false;
     hasSeasonalClosure = false;
     sessionId = String.Empty;
     formattedTime = String.Empty;
     shape = new Shape();
     options = new Options();
     boundingBox = new BoundingBox();
     locationSequence = new List<int>();
     legs = new List<Leg>();
     locations = new List<Locations>();
 }
Пример #2
0
        // Leonard modified 04/30/2015

        public StaticMap(string sessionId, BoundingBox inbBox, Directions_Result_Class.Shape _shape, int _zoom = 0, uint width = 640, uint height = 480, StaticMap.ImageType _imageType = StaticMap.ImageType.png, StaticMap.MapType _mapType = StaticMap.MapType.hyb, bool _declutter = false, List<XIS> _xis = null) 
        {

            session_ = sessionId;
            bBox_ = inbBox;
            zoom_ = _zoom;
            imageType_ = _imageType;
            declutter_ = false;
            size_ = new Size(width, height);
            mapType_ = _mapType;
            center_ = null;
            mCenter_ = null;
            pCenter_ = null;
            sCenter_ = (_shape.shapePoints.Count > 1 ? new Center(_shape.shapePoints[0], _shape.shapePoints[1]) : null);
            eCenter_ = (sCenter == null ? null : new Center(_shape.shapePoints[_shape.shapePoints.Count - 2], _shape.shapePoints[_shape.shapePoints.Count - 1]));
            if (_shape.legIndexes.Count > 2)
            {
                stops_ = new List<Center>();
                char letter = 'A';
                for (int i = 1; i < _shape.legIndexes.Count - 1; ++i)
                {
                    stops_.Add(new Center(_shape.shapePoints[_shape.legIndexes[i] * 2], _shape.shapePoints[_shape.legIndexes[i] * 2 + 1], 0, 0, letter++));
                }
            }
            else
            {
                stops_ = null;
            }
            shape_ = null;
            ellipse_ = null;
            polyline_ = null;
            polygon_ = null;
            map_ = null;
            xis_ = _xis;
            pois_ = new List<Center>();
            mapChanged = false;

        
        }
Пример #3
0
 public StaticMap(List<LatLng> highlightPoints, Color boarder, Color fill, BoundingBox bestFit = null, int polygonWidth = 0, uint width = 640, uint height = 480, StaticMap.ImageType _imageType = StaticMap.ImageType.png, StaticMap.MapType _mapType = StaticMap.MapType.hyb, bool _declutter = false, List<XIS> _xis = null)
 {
     session_ = String.Empty;
     if(bestFit == null && highlightPoints.Count > 0)
     {
         bBox_ = new BoundingBox(new LatLng(highlightPoints[0].lat, highlightPoints[0].lng), new LatLng(highlightPoints[0].lat, highlightPoints[0].lng));
         for(int i = 1; i < highlightPoints.Count; ++i){
             if(bBox_.ul.lat < highlightPoints[i].lat)
             {
                 bBox_.ul.lat = highlightPoints[i].lat;
             }
             if(bBox_.ul.lng > highlightPoints[i].lng)
             {
                 bBox_.ul.lng = highlightPoints[i].lng;
             }
             if(bBox_.lr.lat > highlightPoints[i].lat)
             {
                 bBox_.lr.lat = highlightPoints[i].lat;
             }
             if(bBox_.lr.lng < highlightPoints[i].lng)
             {
                 bBox_.lr.lng = highlightPoints[i].lng;
             }
         }
     }
     else
     {
         bBox_ = bestFit;
     }            
     zoom_ = 0;
     imageType_ = _imageType;
     declutter_ = false;
     size_ = new Size(width, height);
     mapType_ = _mapType;
     center_ = null;
     mCenter_ = null;
     pCenter_ = null;
     sCenter_ = null;
     eCenter_ = null;
     stops_ = null;
     shape_ = null;
     ellipse_ = null;
     polyline_ = null;
     polygon_ = new Polygon(boarder, polygonWidth, fill, highlightPoints);
     map_ = null;
     xis_ = _xis;
     pois_ = null;
 }
Пример #4
0
        // Ngwa T Leonard

        public StaticMap(List<Locations> locations, int _zoom = 0, uint width = 640, uint height = 480, StaticMap.ImageType _imageType = StaticMap.ImageType.png, StaticMap.MapType _mapType = StaticMap.MapType.hyb, bool _declutter = false, List<XIS> _xis = null)
        {
            session_ = String.Empty;
            bBox_ = null;
            zoom_ = _zoom;
            imageType_ = _imageType;
            declutter_ = false;
            size_ = new Size(width, height);
            mapType_ = _mapType;
            center_ = null;
            mCenter_ = null;
            pCenter_ = null;
            sCenter_ = null;
            eCenter_ = null;
            stops_ = null;
            shape_ = null;
            ellipse_ = null;
            polyline_ = null;
            polygon_ = null;
            map_ = null;
            xis_ = _xis;
            pois_ = new List<Center>();
            foreach (Locations l in locations)
            {
                pois_.Add(new Center(l.displayLatLng));
            }
            mapChanged = false;
        }
Пример #5
0
        // Ngwa T Leonard
        public StaticMap()
        {
            zoom_ = 0;
            declutter_ = false;
            mapType_ = StaticMap.MapType.map;
            imageType_ = StaticMap.ImageType.png;
            size_ = new Size(640, 480);
            map_ = null;
            center_ = null;
            mCenter_ = null;
            pCenter_ = null;
            sCenter_ = null;
            eCenter_ = null;
            stops_ = null;
            polygon_ = null;
            ellipse_ = null;
            polyline_ = null;
            shape_ = null;
            xis_ = null;
            pois_ = null;
            mapChanged = false;
            session_ = String.Empty;
            bBox_ = null;

        }