예제 #1
0
        public static bool MapTrip(List <Trip> trips)
        {
            var trackHandles = new List <int>();
            var pointHandles = new List <int>();
            var sf           = ShapefileFactory.TrackFromTrip(trips, out trackHandles);
            var pointSF      = ShapefileFactory.PointsFromTrips(trips, out pointHandles);

            MapInteractionHandler.MapLayersHandler.AddLayer(sf, "Track", uniqueLayer: false, layerKey: sf.Key);
            MapInteractionHandler.MapLayersHandler.AddLayer(pointSF, "Waypoints", uniqueLayer: false, layerKey: sf.Key);
            TrackShapefile     = sf;
            WaypointsShapefile = pointSF;
            return(sf != null);
        }
예제 #2
0
        public static int MapTrip(Trip trip, out int shpIndex, out List <int> handles, bool showInMap = true)
        {
            shpIndex = -1;
            handles  = new List <int>();
            var utils       = new MapWinGIS.Utils();
            var shpfileName = "";

            if (showInMap)
            {
                if (trip.Track.Waypoints.Count > 0)
                {
                    Shapefile   sf    = null;
                    List <Trip> trips = new List <Trip>();
                    trips.Add(trip);
                    sf          = ShapefileFactory.TrackFromTrip(trips, out handles);
                    shpfileName = "Trip tracks";
                    MapLayersHandler.AddLayer(sf, shpfileName, uniqueLayer: true, layerKey: sf.Key, rejectIfExisting: true);
                }
            }
            return(MapLayersHandler.CurrentMapLayer.Handle);
        }