コード例 #1
0
        public static void Generate(int seed, ref Map map)
        {
            var generateSeed = seed > 0 ? seed : 1234;
            var rng          = new Random(generateSeed);

            map.tiles = new Tile[map.Width * map.Height];

            for (var itY = 0; itY < map.Height; ++itY)
            {
                for (var itX = 0; itX < map.Width; ++itX)
                {
                    var idx = GetTileIndex(itX, itY, map.Width);
                    var c   = TileChars[rng.Next(TileChars.Length)];
                    map.tiles[idx] = new Tile {
                        Location  = new CVec2(itX, itY),
                        Layers    = new Dictionary <LayerType, TileLayer>(),
                        TileType  = WorldLib.ConvertCharToTileType(c),
                        Elevation = rng.Next(-20, 55),
                    };
                    var heatLayer = new HeatLayer {
                        Heat = rng.Next(-20, 55)
                    };
                    map.tiles[idx].Layers.Add(LayerType.Heat, heatLayer);
                }
            }
            VoronoiLib.Voronoi(generateSeed, map.Dimensions, ref map);
        }
        public SelectDisplayTypeDialog(Context context, DisplayType displayType)
            : base(context)
        {
            selectDisplayTypeView = View.Inflate(context, Resource.Layout.SelectDisplayStyleTypeLayout, null);
            this.SetView(selectDisplayTypeView);

            this.displayType = displayType;

            earthquakeOverlay    = Global.MapView.Overlays[Global.EarthquakeOverlayKey] as LayerOverlay;
            earthquakePointLayer = earthquakeOverlay.Layers[Global.EarthquakePointLayerKey] as ShapeFileFeatureLayer;
            earthquakeHeatLayer  = earthquakeOverlay.Layers[Global.EarthquakeHeatLayerKey] as HeatLayer;

            heatRadioButton  = selectDisplayTypeView.FindViewById <RadioButton>(Resource.Id.HeatStyleRadioButton);
            isoRadioButton   = selectDisplayTypeView.FindViewById <RadioButton>(Resource.Id.IsoLineStyleRadioButton);
            pointRadioButton = selectDisplayTypeView.FindViewById <RadioButton>(Resource.Id.PointStyleRadioButton);

            displayTypeOkButton     = selectDisplayTypeView.FindViewById <Button>(Resource.Id.OkButton);
            displayTypeCancelButton = selectDisplayTypeView.FindViewById <Button>(Resource.Id.CancelButton);

            heatRadioButton.CheckedChange  += DisplayTypeRadioButton_CheckedChange;
            isoRadioButton.CheckedChange   += DisplayTypeRadioButton_CheckedChange;
            pointRadioButton.CheckedChange += DisplayTypeRadioButton_CheckedChange;

            displayTypeCancelButton.Click += DisplayTypeCancelButton_Click;
            displayTypeOkButton.Click     += DisplayTypeOkButton_Click;
        }
コード例 #3
0
        private void TestForm_Load(object sender, EventArgs e)
        {
            winformsMap1.MapUnit      = GeographyUnit.Meter;
            winformsMap1.ZoomLevelSet = new ThinkGeoCloudMapsZoomLevelSet();
            // Set the full extent and the background color
            winformsMap1.CurrentExtent = new RectangleShape(-16697924, 9349764, -10018754, 1804723);
            winformsMap1.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColor.FromArgb(255, 198, 255, 255));

            // Please input your ThinkGeo Cloud Client ID / Client Secret to enable the background map.
            ThinkGeoCloudRasterMapsOverlay thinkGeoCloudMapsOverlay = new ThinkGeoCloudRasterMapsOverlay("ThinkGeo Cloud Client ID", "ThinkGeo Cloud Client Secret");

            winformsMap1.Overlays.Add(thinkGeoCloudMapsOverlay);

            ShapeFileFeatureSource featureSource = new ShapeFileFeatureSource("../../data/swineflu.shp");

            HeatLayer heatLayer = new HeatLayer(featureSource);
            //Creates the HeatStyle to set the properties determining the display of the heat map with earth quake data.
            //Notice that each point is treated with an intensity depending on the value of the column "other_magn1".
            //So, in addition to the density of points location, the value for each point is also going to be counted into account
            //for the coloring of the map.
            HeatStyle heatStyle = new HeatStyle();

            heatStyle.Alpha               = 255;
            heatStyle.PointRadius         = 100;
            heatStyle.PointRadiusUnit     = DistanceUnit.Kilometer;
            heatStyle.Alpha               = 180;
            heatStyle.PointIntensity      = 10;
            heatStyle.IntensityColumnName = "CONFIRMED";
            heatStyle.IntensityRangeStart = 0;
            heatStyle.IntensityRangeEnd   = 638;

            heatLayer.HeatStyle = heatStyle;

            LayerOverlay heatMapOverlay = new LayerOverlay();

            heatMapOverlay.Layers.Add(heatLayer);

            winformsMap1.Overlays.Add("HeatOverlay", heatMapOverlay);


            winformsMap1.Refresh();
        }
コード例 #4
0
        private void TestForm_Load(object sender, EventArgs e)
        {
            // Set the full extent and the background color
            winformsMap1.CurrentExtent = new RectangleShape(-150, 64, -90, 16);
            winformsMap1.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColor.FromArgb(255, 198, 255, 255));

            //WorldMapKit
            WorldMapKitWmsDesktopOverlay worldMapKitDesktopOverlay = new WorldMapKitWmsDesktopOverlay();

            winformsMap1.Overlays.Add(worldMapKitDesktopOverlay);

            ShapeFileFeatureSource featureSource = new ShapeFileFeatureSource(@"..\..\Data\swineflu.shp");

            HeatLayer heatLayer = new HeatLayer(featureSource);
            //Creates the HeatStyle to set the properties determining the display of the heat map with earth quake data.
            //Notice that each point is treated with an intensity depending on the value of the column "other_magn1".
            //So, in addition to the density of points location, the value for each point is also going to be counted into account
            //for the coloring of the map.
            HeatStyle heatStyle = new HeatStyle();

            heatStyle.Alpha           = 255;
            heatStyle.PointRadius     = 100;
            heatStyle.PointRadiusUnit = DistanceUnit.Kilometer;
            heatStyle.Alpha           = 180;
            heatStyle.PointIntensity  = 10;

            heatStyle.IntensityColumnName = "CONFIRMED";
            heatStyle.IntensityRangeStart = 0;
            heatStyle.IntensityRangeEnd   = 638;

            heatLayer.HeatStyle = heatStyle;

            LayerOverlay heatMapOverlay = new LayerOverlay();

            heatMapOverlay.Layers.Add(heatLayer);

            winformsMap1.Overlays.Add("HeatOverlay", heatMapOverlay);


            winformsMap1.Refresh();
        }
コード例 #5
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.DisplayMapView);

            ShapeFileFeatureSource featureSource = new ShapeFileFeatureSource(SampleHelper.GetDataPath("SampleData/cities_e.shp"));
            HeatLayer heatLayer = new HeatLayer(featureSource);

            heatLayer.HeatStyle = new HeatStyle(10, 75, DistanceUnit.Kilometer);

            LayerOverlay layerOverlay = new LayerOverlay();

            layerOverlay.Layers.Add(heatLayer);

            androidMap               = FindViewById <MapView>(Resource.Id.androidmap);
            androidMap.MapUnit       = GeographyUnit.DecimalDegree;
            androidMap.CurrentExtent = (new RectangleShape(-133.2515625, 89.2484375, 126.9046875, -88.290625));
            androidMap.Overlays.Add(layerOverlay);

            SampleViewHelper.InitializeInstruction(this, FindViewById <RelativeLayout>(Resource.Id.MainLayout), GetType());
        }
コード例 #6
0
        public HttpResponseMessage GetHeatLayer(int z, int x, int y)
        {
            ShapeFileFeatureSource shapeFileFeatureSource = new ShapeFileFeatureSource(Path.Combine(baseDirectory, "usEarthquake.shp"));

            shapeFileFeatureSource.Projection = new Proj4Projection(4326, 3857);

            HeatLayer heatLayer = new HeatLayer(shapeFileFeatureSource);

            heatLayer.HeatStyle = new HeatStyle(10, 150, "MAGNITUDE", 0, 12, 100, DistanceUnit.Kilometer);

            ShapeFileFeatureLayer usStatesLayer = new ShapeFileFeatureLayer(Path.Combine(baseDirectory, "USStates-3857.shp"));

            usStatesLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle    = new AreaStyle(new GeoPen(GeoColor.StandardColors.LightGray, 2), new GeoSolidBrush(GeoColor.FromArgb(50, GeoColors.LightYellow)));
            usStatesLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            LayerOverlay layerOverlay = new LayerOverlay();

            layerOverlay.Layers.Add(usStatesLayer);
            layerOverlay.Layers.Add(heatLayer);

            return(DrawTileImage(layerOverlay, z, x, y));
        }
コード例 #7
0
        private void WpfMap_Loaded(object sender, RoutedEventArgs e)
        {
            wpfMap1.MapUnit = GeographyUnit.DecimalDegree;
            wpfMap1.MapTools.MouseCoordinate.IsEnabled = true;
            wpfMap1.CurrentExtent = new RectangleShape(-126.4, 48.8, -67.0, 19.0);
            wpfMap1.MaximumScale = 36911986.875;

            WorldMapKitWmsWpfOverlay worldMapKitOverlay = new WorldMapKitWmsWpfOverlay();
            wpfMap1.Overlays.Add(worldMapKitOverlay);

            ShapeFileFeatureSource featureSource = new ShapeFileFeatureSource(@"..\..\SampleData\Data\cities_e.shp");
            HeatLayer heatLayer = new HeatLayer(featureSource);
            heatLayer.HeatStyle = new HeatStyle(10, 75, DistanceUnit.Kilometer);

            LayerOverlay layerOverlay = new LayerOverlay();
            layerOverlay.TransitionEffect = TransitionEffect.None;
            layerOverlay.Layers.Add(heatLayer);
            layerOverlay.OverlayCanvas.Opacity = .8;
            wpfMap1.Overlays.Add(layerOverlay);

            wpfMap1.Refresh();
        }
コード例 #8
0
        private void TestForm_Load(object sender, EventArgs e)
        {
            winformsMap1.MapUnit       = GeographyUnit.DecimalDegree;
            winformsMap1.CurrentExtent = new RectangleShape(-125, 47, -67, 25);
            winformsMap1.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColor.FromArgb(255, 198, 255, 255));

            //Displays the World Map Kit as a background.
            WorldMapKitWmsDesktopOverlay worldMapKitDesktopOverlay = new WorldMapKitWmsDesktopOverlay();

            winformsMap1.Overlays.Add(worldMapKitDesktopOverlay);

            //Point based ShapeFileFeatureSource on earth quakes used for the HeatOverlay.
            ShapeFileFeatureSource featureSource = new ShapeFileFeatureSource(@"..\..\Data\quksigx020.shp");
            //Creates the HeatOverlay with the point based ShapeFileFeatureSource for earthquakes.
            HeatLayer heatLayer = new HeatLayer(featureSource);
            //Creates the HeatStyle to set the properties determining the display of the heat map with earth quake data.
            //Notice that each point is treated with an intensity depending on the value of the column "other_magn1".
            //So, in addition to the density of points location, the value for each point is also going to be counted into account
            //for the coloring of the map.
            HeatStyle heatStyle = new HeatStyle();

            heatStyle.IntensityColumnName = "other_mag1";
            heatStyle.IntensityRangeStart = 0;
            heatStyle.IntensityRangeEnd   = 12;
            //Sets the size of each point 100 kilometers of diameter.
            heatStyle.Alpha           = 180;
            heatStyle.PointRadius     = 60;
            heatStyle.PointRadiusUnit = DistanceUnit.Kilometer;

            heatLayer.HeatStyle = heatStyle;

            LayerOverlay heatMapOverlay = new LayerOverlay();

            heatMapOverlay.Layers.Add(heatLayer);

            winformsMap1.Overlays.Add("HeatOverlay", heatMapOverlay);

            winformsMap1.Refresh();
        }
コード例 #9
0
        private void LoadAHeatLayer_Load(object sender, EventArgs e)
        {
            winformsMap1.MapUnit       = GeographyUnit.DecimalDegree;
            winformsMap1.CurrentExtent = new RectangleShape(-126.4, 48.8, -67.0, 19.0);
            winformsMap1.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColor.GeographicColors.ShallowOcean);

            WorldMapKitWmsDesktopOverlay worldMapKitDesktopOverlay = new WorldMapKitWmsDesktopOverlay();

            winformsMap1.Overlays.Add(worldMapKitDesktopOverlay);

            ShapeFileFeatureSource featureSource = new ShapeFileFeatureSource(Samples.RootDirectory + @"Data\cities_e.shp");

            HeatLayer heatLayer = new HeatLayer(featureSource);

            heatLayer.HeatStyle = new HeatStyle(10, 75, DistanceUnit.Kilometer);

            LayerOverlay layerOverlay = new LayerOverlay();

            layerOverlay.Layers.Add(heatLayer);
            winformsMap1.Overlays.Add(layerOverlay);

            winformsMap1.Refresh();
        }
コード例 #10
0
        private void InitializeAndroidMap()
        {
            string          baseFolder        = Android.OS.Environment.ExternalStorageDirectory.AbsolutePath;
            string          cachePathFilename = Path.Combine(baseFolder, "MapSuiteTileCaches/SampleCaches.db");
            Proj4Projection proj4             = Global.GetWgs84ToMercatorProjection();

            // WMK
            WorldMapKitOverlay wmkOverlay = new WorldMapKitOverlay();

            wmkOverlay.Projection = ThinkGeo.MapSuite.Android.WorldMapKitProjection.SphericalMercator;

            // OSM
            OpenStreetMapOverlay osmOverlay = new OpenStreetMapOverlay();

            osmOverlay.TileCache = new SqliteBitmapTileCache(cachePathFilename, "OSMSphericalMercator");
            osmOverlay.IsVisible = false;

            // Bing - Aerial
            BingMapsOverlay bingMapsAerialOverlay = new BingMapsOverlay();

            bingMapsAerialOverlay.IsVisible = false;
            bingMapsAerialOverlay.MapType   = ThinkGeo.MapSuite.Android.BingMapsMapType.AerialWithLabels;
            bingMapsAerialOverlay.TileCache = new SqliteBitmapTileCache(cachePathFilename, "BingAerialWithLabels");

            // Bing - Road
            BingMapsOverlay bingMapsRoadOverlay = new BingMapsOverlay();

            bingMapsRoadOverlay.IsVisible = false;
            bingMapsRoadOverlay.MapType   = ThinkGeo.MapSuite.Android.BingMapsMapType.Road;
            bingMapsRoadOverlay.TileCache = new SqliteBitmapTileCache(cachePathFilename, "BingRoad");

            // Earthquake points
            earthquakePointLayer = new ShapeFileFeatureLayer(SampleHelper.GetDataPath("usEarthquake.shp"));
            earthquakePointLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(PointStyles.CreateSimpleCircleStyle(GeoColor.SimpleColors.Red, 5, GeoColor.SimpleColors.White, 1));
            earthquakePointLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
            earthquakePointLayer.FeatureSource.Projection = proj4;

            ShapeFileFeatureSource earthquakeHeatFeatureSource = new ShapeFileFeatureSource(SampleHelper.GetDataPath("usEarthquake_Simplify.shp"));

            earthquakeHeatFeatureSource.Projection = proj4;

            earthquakeHeatLayer                 = new HeatLayer(earthquakeHeatFeatureSource);
            earthquakeHeatLayer.HeatStyle       = new HeatStyle(10, 75, DistanceUnit.Kilometer);
            earthquakeHeatLayer.HeatStyle.Alpha = 180;
            earthquakeHeatLayer.IsVisible       = false;

            earthquakeOverlay = new LayerOverlay();
            earthquakeOverlay.Layers.Add(Global.EarthquakePointLayerKey, earthquakePointLayer);
            earthquakeOverlay.Layers.Add(Global.EarthquakeHeatLayerKey, earthquakeHeatLayer);

            // Highlighted points
            selectedMarkerLayer = new InMemoryFeatureLayer();
            selectedMarkerLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle   = PointStyles.CreateSimpleCircleStyle(GeoColor.SimpleColors.Orange, 8, GeoColor.SimpleColors.White, 2);
            selectedMarkerLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            PointStyle highLightMarkerStyle = new PointStyle();

            highLightMarkerStyle.CustomPointStyles.Add(PointStyles.CreateSimpleCircleStyle(GeoColor.FromArgb(50, GeoColor.SimpleColors.Blue), 20, GeoColor.SimpleColors.LightBlue, 1));
            highLightMarkerStyle.CustomPointStyles.Add(PointStyles.CreateSimpleCircleStyle(GeoColor.FromArgb(255, 0, 122, 255), 10, GeoColor.SimpleColors.White, 2));

            highlightMarkerLayer = new InMemoryFeatureLayer();
            highlightMarkerLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle   = highLightMarkerStyle;
            highlightMarkerLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            highlightOverlay = new LayerOverlay();
            highlightOverlay.Layers.Add(Global.SelectMarkerLayerKey, selectedMarkerLayer);
            highlightOverlay.Layers.Add(Global.HighlightMarkerLayerKey, highlightMarkerLayer);

            // Maps
            Global.MapView         = FindViewById <MapView>(Resource.Id.androidMap);
            Global.MapView.MapUnit = GeographyUnit.Meter;
            Global.MapView.MapTools.ZoomMapTool.Visibility = ViewStates.Invisible;
            Global.MapView.ZoomLevelSet  = new ZoomLevelSet();
            Global.MapView.CurrentExtent = new RectangleShape(-19062735.6816748, 9273256.52450252, -5746827.16371793, 2673516.56066139);
            Global.MapView.SetBackgroundColor(new Android.Graphics.Color(255, 244, 242, 238));

            Global.MapView.Overlays.Add(Global.WorldMapKitOverlayKey, wmkOverlay);
            Global.MapView.Overlays.Add(Global.OpenStreetMapOverlayKey, osmOverlay);
            Global.MapView.Overlays.Add(Global.BingMapsAerialOverlayKey, bingMapsAerialOverlay);
            Global.MapView.Overlays.Add(Global.BingMapsRoadOverlayKey, bingMapsRoadOverlay);
            Global.MapView.Overlays.Add(Global.EarthquakeOverlayKey, earthquakeOverlay);
            Global.MapView.Overlays.Add(Global.HighlightOverlayKey, highlightOverlay);

            Global.MapView.TrackOverlay.TrackShapeLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Clear();
            Global.MapView.TrackOverlay.TrackShapeLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.CreateSimpleCircleStyle(GeoColor.FromArgb(80, GeoColor.SimpleColors.LightGreen), 8);
            Global.MapView.TrackOverlay.TrackShapeLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle  = LineStyles.CreateSimpleLineStyle(GeoColor.SimpleColors.White, 3, true);
            Global.MapView.TrackOverlay.TrackShapeLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle  = AreaStyles.CreateSimpleAreaStyle(GeoColor.FromArgb(80, GeoColor.SimpleColors.LightGreen), GeoColor.SimpleColors.White, 2);
            Global.MapView.TrackOverlay.TrackEnded += TrackOverlay_TrackEnded;
        }
        private void InitializeOptionsSource()
        {
            earthquakePointLayer = (ShapeFileFeatureLayer)Global.HighLightOverlay.Layers["EarthquakePointLayer"];
            earthquakeHeatLayer  = (HeatLayer)Global.HighLightOverlay.Layers["EarthquakeHeatLayer"];

            int rowWidth   = 400;
            int sliderWith = 190;

            if (Global.UserInterfaceIdiomIsPhone)
            {
                rowWidth   = 300;
                sliderWith = 90;
            }

            baseMapTypeSource           = new DataTableSource();
            baseMapTypeSource.RowClick += RowClick;

            RectangleF rowFrame = new RectangleF(10, 5, rowWidth, 30);

            Collection <RowModel> baseMapRows = new Collection <RowModel>();
            RowModel baseMapModel             = new RowModel("Base Map");

            baseMapLabel = new UILabel(new RectangleF(5, 5, rowWidth * 0.6f, 40));
            baseMapLabel.TextAlignment          = UITextAlignment.Right;
            baseMapLabel.TextColor              = UIColor.Black;
            baseMapLabel.UserInteractionEnabled = false;

            baseMapModel.CellAccessory  = UITableViewCellAccessory.DisclosureIndicator;
            baseMapModel.CustomUI       = baseMapLabel;
            baseMapModel.CustomUIBounds = new RectangleF(rowWidth * 0.35f, 10, rowWidth * 0.6f, 30);
            baseMapModel.RowHeight      = 50;
            baseMapRows.Add(baseMapModel);
            baseMapTypeSource.Sections.Add(new SectionModel("Base Map Type", baseMapRows)
            {
                HeaderHeight = 30
            });

            Collection <RowModel> displayTypeRows = new Collection <RowModel>();
            RowModel           displayTypeModel   = new RowModel(string.Empty);
            UISegmentedControl displayTypeSegment = new UISegmentedControl();

            displayTypeSegment.InsertSegment("Point Type", 1, true);
            displayTypeSegment.InsertSegment("Heat Style", 2, true);
            displayTypeSegment.InsertSegment("IsoLine Style", 3, true);
            displayTypeSegment.ValueChanged   += DisplayTypeSegmentValueChanged;
            displayTypeSegment.SelectedSegment = 0;
            displayTypeModel.CustomUI          = displayTypeSegment;
            displayTypeModel.CustomUIBounds    = new RectangleF(10, 10, rowWidth, 30);
            displayTypeModel.RowHeight         = 50;

            displayTypeRows.Add(displayTypeModel);
            baseMapTypeSource.Sections.Add(new SectionModel("Display Type", displayTypeRows)
            {
                HeaderHeight = 30
            });

            Collection <RowModel> queryOperation = new Collection <RowModel>();
            RowModel magnitude = new RowModel(string.Empty);
            RowModel depth     = new RowModel(string.Empty);
            RowModel date      = new RowModel(string.Empty);

            RectangleF silderFrame = new RectangleF(150, 0, sliderWith, 30);

            RangeSliderView magnitudeView =
                new RangeSliderView(new UIRangeSlider(silderFrame, Global.QueryConfiguration.LowerMagnitude,
                                                      Global.QueryConfiguration.UpperMagnitude, Global.QueryConfiguration.LowerMagnitude,
                                                      Global.QueryConfiguration.UpperMagnitude)
            {
                Name = "Magnitude:"
            });

            magnitudeView.Frame      = rowFrame;
            magnitude.CustomUI       = magnitudeView;
            magnitude.CustomUIBounds = rowFrame;
            magnitude.RowHeight      = 45;

            RangeSliderView depthView =
                new RangeSliderView(new UIRangeSlider(silderFrame, Global.QueryConfiguration.LowerDepth,
                                                      Global.QueryConfiguration.UpperDepth, Global.QueryConfiguration.LowerDepth,
                                                      Global.QueryConfiguration.UpperDepth)
            {
                Name = "Depth(KM):"
            });

            depthView.Frame      = rowFrame;
            depth.CustomUI       = depthView;
            depth.CustomUIBounds = rowFrame;
            depth.RowHeight      = 45;

            RangeSliderView dateView =
                new RangeSliderView(new UIRangeSlider(silderFrame, Global.QueryConfiguration.LowerYear,
                                                      Global.QueryConfiguration.UpperYear, Global.QueryConfiguration.LowerYear,
                                                      Global.QueryConfiguration.UpperYear)
            {
                Name = "Date(Year):"
            });

            dateView.Frame      = rowFrame;
            date.CustomUI       = dateView;
            date.CustomUIBounds = rowFrame;
            date.RowHeight      = 45;

            queryOperation.Add(magnitude);
            queryOperation.Add(depth);
            queryOperation.Add(date);
            baseMapTypeSource.Sections.Add(new SectionModel("Query Operation", queryOperation)
            {
                HeaderHeight = 30
            });
            tbvBaseMapType.Source = baseMapTypeSource;
        }
 public EarthquakeHeatFeatureLayer(FeatureSource featureSource)
     : base()
 {
     heatLayer     = new HeatLayer();
     FeatureSource = featureSource;
 }
コード例 #13
0
        private void InitializeMap()
        {
            string targetDictionary = @"AppData/SampleData";

            Proj4Projection proj4    = Global.GetWgs84ToMercatorProjection();
            string          rootPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "/CacheImages";

            // WMK
            WorldMapKitOverlay wmkOverlay = new WorldMapKitOverlay();

            wmkOverlay.Projection = ThinkGeo.MapSuite.iOS.WorldMapKitProjection.SphericalMercator;

            // OSM
            OpenStreetMapOverlay osmOverlay = new OpenStreetMapOverlay();

            osmOverlay.TileCache = new FileBitmapTileCache(rootPath + "/OpenStreetMaps", "SphericalMercator");
            osmOverlay.TileCache.TileMatrix.BoundingBoxUnit = GeographyUnit.Meter;
            osmOverlay.TileCache.TileMatrix.BoundingBox     = osmOverlay.GetBoundingBox();
            osmOverlay.TileCache.ImageFormat = TileImageFormat.Jpeg;
            osmOverlay.IsVisible             = false;

            // Bing - Aerial
            BingMapsOverlay bingMapsAerialOverlay = new BingMapsOverlay();

            bingMapsAerialOverlay.MapStyle  = ThinkGeo.MapSuite.iOS.BingMapsMapType.AerialWithLabels;
            bingMapsAerialOverlay.TileCache = new FileBitmapTileCache(rootPath + "/BingMaps", "AerialWithLabels");
            bingMapsAerialOverlay.TileCache.TileMatrix.BoundingBoxUnit = GeographyUnit.Meter;
            bingMapsAerialOverlay.TileCache.TileMatrix.BoundingBox     = bingMapsAerialOverlay.GetBoundingBox();
            bingMapsAerialOverlay.TileCache.ImageFormat = TileImageFormat.Jpeg;
            bingMapsAerialOverlay.IsVisible             = false;

            // Bing - Road
            BingMapsOverlay bingMapsRoadOverlay = new BingMapsOverlay();

            bingMapsRoadOverlay.MapStyle  = ThinkGeo.MapSuite.iOS.BingMapsMapType.Road;
            bingMapsRoadOverlay.TileCache = new FileBitmapTileCache(rootPath + "/BingMaps", "Road");
            bingMapsRoadOverlay.TileCache.TileMatrix.BoundingBoxUnit = GeographyUnit.Meter;
            bingMapsRoadOverlay.TileCache.TileMatrix.BoundingBox     = bingMapsRoadOverlay.GetBoundingBox();
            bingMapsRoadOverlay.TileCache.ImageFormat = TileImageFormat.Jpeg;
            bingMapsRoadOverlay.IsVisible             = false;

            // Earthquake points
            ShapeFileFeatureLayer earthquakePointLayer = new ShapeFileFeatureLayer(Path.Combine(targetDictionary, "usEarthquake.shp"));

            earthquakePointLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(PointStyles.CreateSimpleCircleStyle(GeoColor.SimpleColors.Red, 5, GeoColor.SimpleColors.White, 1));
            earthquakePointLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
            earthquakePointLayer.FeatureSource.Projection = proj4;

            ShapeFileFeatureSource earthquakeHeatFeatureSource = new ShapeFileFeatureSource(Path.Combine(targetDictionary, "usEarthquake_Simplified.shp"));

            earthquakeHeatFeatureSource.Projection = proj4;

            HeatLayer earthquakeHeatLayer = new HeatLayer(earthquakeHeatFeatureSource);

            earthquakeHeatLayer.HeatStyle       = new HeatStyle(10, 75, DistanceUnit.Kilometer);
            earthquakeHeatLayer.HeatStyle.Alpha = 180;
            earthquakeHeatLayer.IsVisible       = false;

            LayerOverlay highlightOverlay = new LayerOverlay();

            highlightOverlay.Layers.Add("EarthquakePointLayer", earthquakePointLayer);
            highlightOverlay.Layers.Add("EarthquakeHeatLayer", earthquakeHeatLayer);

            // Highlighted points
            InMemoryFeatureLayer selectedMarkerLayer = new InMemoryFeatureLayer();

            selectedMarkerLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle   = PointStyles.CreateSimpleCircleStyle(GeoColor.SimpleColors.Orange, 8, GeoColor.SimpleColors.White, 2);
            selectedMarkerLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            PointStyle highLightMarkerStyle = new PointStyle();

            highLightMarkerStyle.CustomPointStyles.Add(PointStyles.CreateSimpleCircleStyle(GeoColor.FromArgb(50, GeoColor.SimpleColors.Blue), 20, GeoColor.SimpleColors.LightBlue, 1));
            highLightMarkerStyle.CustomPointStyles.Add(PointStyles.CreateSimpleCircleStyle(GeoColor.FromArgb(255, 0, 122, 255), 10, GeoColor.SimpleColors.White, 2));

            InMemoryFeatureLayer highlightMarkerLayer = new InMemoryFeatureLayer();

            highlightMarkerLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle   = highLightMarkerStyle;
            highlightMarkerLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            highlightOverlay.Layers.Add("SelectMarkerLayer", selectedMarkerLayer);
            highlightOverlay.Layers.Add("HighlightMarkerLayer", highlightMarkerLayer);

            // Maps
            iOSMap                 = new MapView(View.Frame);
            iOSMap.MapUnit         = GeographyUnit.Meter;
            iOSMap.ZoomLevelSet    = new SphericalMercatorZoomLevelSet();
            iOSMap.CurrentExtent   = new RectangleShape(-19062735.6816748, 9273256.52450252, -5746827.16371793, 2673516.56066139);
            iOSMap.BackgroundColor = new UIColor(233, 229, 220, 200);

            iOSMap.Overlays.Add(Global.OpenStreetMapOverlayKey, osmOverlay);
            iOSMap.Overlays.Add(Global.WorldMapKitOverlayKey, wmkOverlay);
            iOSMap.Overlays.Add(Global.BingMapsAerialOverlayKey, bingMapsAerialOverlay);
            iOSMap.Overlays.Add(Global.BingMapsRoadOverlayKey, bingMapsRoadOverlay);
            iOSMap.Overlays.Add(Global.HighLightOverlayKey, highlightOverlay);

            iOSMap.TrackOverlay.TrackShapeLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Clear();
            iOSMap.TrackOverlay.TrackShapeLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.CreateSimpleCircleStyle(GeoColor.FromArgb(80, GeoColor.SimpleColors.LightGreen), 8);
            iOSMap.TrackOverlay.TrackShapeLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle  = LineStyles.CreateSimpleLineStyle(GeoColor.SimpleColors.White, 3, true);
            iOSMap.TrackOverlay.TrackShapeLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle  = AreaStyles.CreateSimpleAreaStyle(GeoColor.FromArgb(80, GeoColor.SimpleColors.LightGreen), GeoColor.SimpleColors.White, 2);
            iOSMap.TrackOverlay.TrackEnded += TrackInteractiveOverlayOnTrackEnded;
            Global.MapView = iOSMap;

            View.Add(iOSMap);
            iOSMap.Refresh();
        }