private void Form1_Load(object sender, EventArgs e)
        {
            map.MapUnit      = GeographyUnit.Meter;
            map.ZoomLevelSet = new ThinkGeoCloudMapsZoomLevelSet();

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

            // Set up the TileCache for the background overlay.
            thinkgeoBackgroundOverlay.TileCache = new XyzFileBitmapTileCache(".\\Cache");
            map.Overlays.Add(thinkgeoBackgroundOverlay);

            ShapeFileFeatureLayer shapeFileFeatureLayer = new ShapeFileFeatureLayer(@"..\..\Data\Countries.shp");

            shapeFileFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle    = AreaStyles.CreateSimpleAreaStyle(GeoColors.Transparent, GeoColors.Black);
            shapeFileFeatureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
            shapeFileFeatureLayer.FeatureSource.Projection = new Proj4Projection(Proj4Projection.GetDecimalDegreesParametersString(), Proj4Projection.GetSphericalMercatorParametersString());

            LayerOverlay layerOverlay = new LayerOverlay();

            layerOverlay.Layers.Add(shapeFileFeatureLayer);
            // Set up the TileCache for LayerOverlay.
            layerOverlay.TileCache = new FileBitmapTileCache(".\\Cache", "LayerOverlay");
            map.Overlays.Add(layerOverlay);

            map.CurrentExtent = new RectangleShape(-19489607.6157655, 12836528.7107853, 19293928.8244426, -8022830.44424083);
        }
Example #2
0
        private void InitalizeMap()
        {
            mapView.MapUnit      = GeographyUnit.Meter;
            mapView.ZoomLevelSet = new ThinkGeoCloudMapsZoomLevelSet();
            mapView.SingleTap   += MapView_SingleTap;

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

            mapView.Overlays.Add(baseOverlay);

            layerOverlay = new LayerOverlay();
            routingLayer = new RoutingLayer();
            layerOverlay.Layers.Add(routingLayer);
            mapView.Overlays.Add(layerOverlay);

            var routingSource = new RtgRoutingSource(DataManager.GetDataPath("DallasCounty-3857.rtg"));
            var featureSource = new ShapeFileFeatureSource(DataManager.GetDataPath("DallasCounty-3857.shp"));

            routingEngine = new RoutingEngine(routingSource, featureSource);
            routingEngine.GeographyUnit        = GeographyUnit.Meter;
            routingEngine.SearchRadiusInMeters = 100;

            mapView.CurrentExtent = new RectangleShape(-10781100.2970769, 3875007.18710502, -10767407.8727504, 3854947.78546675);
        }
Example #3
0
        /// <summary>
        /// Switch the Map Type based on the radio buttons
        /// </summary>
        private void rbMapType_Checked(object sender, EventArgs e)
        {
            RadioButton button = (RadioButton)sender;

            if (mapView.Overlays.Contains("Cloud Overlay"))
            {
                ThinkGeoCloudRasterMapsOverlay cloudOverlay = (ThinkGeoCloudRasterMapsOverlay)mapView.Overlays["Cloud Overlay"];

                switch (button.Text.ToString())
                {
                case "Light":
                    cloudOverlay.MapType = ThinkGeoCloudRasterMapsMapType.Light;
                    break;

                case "Dark":
                    cloudOverlay.MapType = ThinkGeoCloudRasterMapsMapType.Dark;
                    break;

                case "Aerial":
                    cloudOverlay.MapType = ThinkGeoCloudRasterMapsMapType.Aerial;
                    break;

                case "Hybrid":
                    cloudOverlay.MapType = ThinkGeoCloudRasterMapsMapType.Hybrid;
                    break;

                default:
                    break;
                }
                mapView.Refresh();
            }
        }
Example #4
0
        private Map InitializeMap()
        {
            Map Map1 = new Map("Map1");

            Map1.MapUnit                              = GeographyUnit.Meter;
            Map1.ZoomLevelSet                         = new ThinkGeoCloudMapsZoomLevelSet();
            Map1.Width                                = new System.Web.UI.WebControls.Unit(100, System.Web.UI.WebControls.UnitType.Percentage);
            Map1.Height                               = new System.Web.UI.WebControls.Unit(100, System.Web.UI.WebControls.UnitType.Percentage);
            Map1.CurrentExtent                        = new RectangleShape(-10785241.6495495, 3916508.33762434, -10778744.5183967, 3912187.74540771);
            Map1.MapTools.MiniMap.Enabled             = true;
            Map1.MapTools.OverlaySwitcher.Enabled     = true;
            Map1.EditOverlay.EditSettings.IsResizable = false;

            // Please input your ThinkGeo Cloud API Key to enable the background map.
            ThinkGeoCloudRasterMapsOverlay ThinkGeoCloudMapsLight = new ThinkGeoCloudRasterMapsOverlay("ThinkGeo Cloud API Key")
            {
                Name    = "ThinkGeo Cloud Maps Light",
                MapType = ThinkGeoCloudRasterMapsMapType.Light
            };

            Map1.CustomOverlays.Add(ThinkGeoCloudMapsLight);

            ThinkGeoCloudRasterMapsOverlay ThinkGeoCloudMapsAerial = new ThinkGeoCloudRasterMapsOverlay("ThinkGeo Cloud API Key")
            {
                Name    = "ThinkGeo Cloud Maps Aerial",
                MapType = ThinkGeoCloudRasterMapsMapType.Aerial
            };

            Map1.CustomOverlays.Add(ThinkGeoCloudMapsAerial);

            ThinkGeoCloudRasterMapsOverlay ThinkGeoCloudMapsHybrid = new ThinkGeoCloudRasterMapsOverlay("ThinkGeo Cloud API Key")
            {
                Name    = "ThinkGeo Cloud Maps Hybrid",
                MapType = ThinkGeoCloudRasterMapsMapType.Hybrid
            };

            Map1.CustomOverlays.Add(ThinkGeoCloudMapsHybrid);

            OpenStreetMapOverlay openStreetMapOverlay = new OpenStreetMapOverlay("Open Street Map");

            Map1.CustomOverlays.Add(openStreetMapOverlay);

            // Add spatial fences
            AddSpatialFenceOverlay(Map1);

            // Add vehicles.
            AddVehicleMarkerOverlay(Map1);

            // Add vehicles position history.
            AddVehicleHistoryMarkerOverlay(Map1);

            // Add scale bar
            ScaleBarAdornmentLayer scaleBarAdormentLayer = new ScaleBarAdornmentLayer();

            scaleBarAdormentLayer.XOffsetInPixel = 10;
            scaleBarAdormentLayer.UnitFamily     = UnitSystem.Metric;
            //Map1.AdornmentOverlay.Layers.Add(scaleBarAdormentLayer);

            return(Map1);
        }
Example #5
0
        public MainViewModel(WpfMap map)
        {
            this.map      = map;
            map.MapClick += WpfMap_MapClick;
            menuItems     = new Collection <object>(MenuItemHelper.GetMenus());

            LoadMessageHandlers();
            SetToolbarMenuItems();

            Messenger.Default.Register <ChartMessage>(this, (m) => ChartSelectedItem = new ChartSelectedItem(string.Empty, null));
            Messenger.Default.Register <MenuItemMessage>(this, "ShowOpacityPanel", (m) => ShowOpacityPanel = true);
            Messenger.Default.Register <MenuItemMessage>(this, HandleMenuItemMessage);
            Messenger.Default.Register <ToolBarMessage>(this, HandleToolBarMessage);
            Messenger.Default.Register <ChartMessage>(this, "LoadCharts", HandleLoadChartMessage);
            Messenger.Default.Register <ChartMessage>(this, "UnloadCharts", HandleUnloadChartMessage);
            Messenger.Default.Register <ChartSelectedItemMessage>(this, HandleChartSelectedItemMessage);
            Messenger.Default.Register <SafeWaterDepthSettingMessage>(this, HandleSafeWaterDepthMessage);

            map.MapUnit      = GeographyUnit.Meter;
            map.ZoomLevelSet = new ThinkGeoCloudMapsZoomLevelSet();

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

            map.Overlays.Add(ThinkGeoCloudMapsOverlayName, baseOverlay);

            InitBoundingBoxPreviewOverlay(map);
        }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            //Sets the correct map unit
            wpfMap1.MapUnit      = GeographyUnit.Meter;
            wpfMap1.ZoomLevelSet = new ThinkGeoCloudMapsZoomLevelSet();
            //Sets the map extent in real coordinates.
            wpfMap1.CurrentExtent = new RectangleShape(-14440660, 12417042, 16006959, -9812068);
            wpfMap1.Background    = new SolidColorBrush(Color.FromRgb(148, 196, 243));

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

            //Sets the WrapDatelineMode to WrapDateline for the overlay.
            baseOverlay.WrappingMode = WrappingMode.WrapDateline;
            wpfMap1.Overlays.Add("WMK", baseOverlay);

            //InMemoryFeatureLayer to put the feature as the result of the spatial query.
            InMemoryFeatureLayer inMemoryFeatureLayer = new InMemoryFeatureLayer();

            inMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.CreateSimpleAreaStyle
                                                                                 (GeoColor.FromArgb(150, GeoColor.StandardColors.Yellow), GeoColor.StandardColors.DarkGray, 2);
            inMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            LayerOverlay layerOverlay = new LayerOverlay();

            //Sets the WrapDatelineMode to WrapDateline for the overlay with the InMemoryFeatureLayer.
            layerOverlay.WrappingMode = WrappingMode.WrapDateline;
            layerOverlay.Layers.Add("SelectLayer", inMemoryFeatureLayer);
            wpfMap1.Overlays.Add("DynamicOverlay", layerOverlay);

            wpfMap1.Refresh();
        }
Example #7
0
        private void LayoutRoot_Loaded(object sender, RoutedEventArgs e)
        {
            btnGenerateGridFile.IsEnabled = true;

            Map1.MapUnit       = GeographyUnit.Meter;
            Map1.ZoomLevelSet  = new ThinkGeoCloudMapsZoomLevelSet();
            Map1.CurrentExtent = new RectangleShape(-11204955.4870063, 4543351.66721459, -11200273.7233416, 4539757.60752901);

            //Load the well depth points and depth data from a text file into the dictionary
            //We cache this at the class level to prevent form loading it multiple times
            wellDepthPointData = GetWellDepthPointDataFromCSV(wellDepthPointDataFilePath);

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

            Map1.Overlays.Add(baseOverlay);

            //Add the grid layer, the grid cells, and the well points to the map
            LayerOverlay isoLineOverlay = new LayerOverlay();

            isoLineOverlay.Drawn   += new EventHandler <DrawnOverlayEventArgs>(isoLineOverlay_Drawn);
            isoLineOverlay.Drawing += new EventHandler <DrawingOverlayEventArgs>(isoLineOverlay_Drawing);

            Map1.Overlays.Add("isoLineOverlay", isoLineOverlay);

            isoLineOverlay.Layers.Add("IsoLineLayer", GetDynamicIsoLineLayer());
            isoLineOverlay.Layers.Add("GridCellsLayer", GetDynamicGridFeatureLayer());
            isoLineOverlay.Layers.Add("WellsLayer", GetWellDepthPointLayer());
            isoLineOverlay.DrawingQuality = DrawingQuality.HighQuality;

            Map1.Refresh();
        }
        private void TestForm_Load(object sender, EventArgs e)
        {
            winformsMap1.MapUnit       = GeographyUnit.Meter;
            winformsMap1.ZoomLevelSet  = new ThinkGeoCloudMapsZoomLevelSet();
            winformsMap1.CurrentExtent = new RectangleShape(-31388.09, 6704526.48, -28099.15, 6703074.15);
            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("LzA6gdx9FFhH6kQD1HxnA6FDmcM_0zDA55Q8--whiUY~", "So8ndg18JxcYR6xXY6KDaFbRGCbNqLO9exm4ixeokRbzKWIJ99smoA~~");

            winformsMap1.Overlays.Add(thinkGeoCloudMapsOverlay);

            //InMemoryFeatureLayer for vehicle.
            InMemoryFeatureLayer carLayer = new InMemoryFeatureLayer();

            carLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle.PointType     = PointType.Bitmap;
            carLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle.Image         = new GeoImage(@"../../data/Sedan.png");
            carLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle.RotationAngle = 45;
            carLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel             = ApplyUntilZoomLevel.Level20;

            LayerOverlay vehicleOverlay = new LayerOverlay();

            vehicleOverlay.Layers.Add("CarLayer", carLayer);
            winformsMap1.Overlays.Add("VehicleOverlay", vehicleOverlay);

            winformsMap1.Refresh();

            timer1.Start();
            timer2.Start();
            timer3.Start();
        }
Example #9
0
        /// <summary>
        /// Create a ThinkGeo Cloud Maps raster overlay and add it to the map view.
        /// </summary>
        private void DisplayRasterCloudMaps_Click(object sender, EventArgs e)
        {
            var thinkGeoCloudRasterMapsOverlay = new ThinkGeoCloudRasterMapsOverlay(cloudMapsApiKey.Text, cloudMapsSecretKey.Text, ThinkGeoCloudRasterMapsMapType.Hybrid);

            mapView.Overlays.Add(thinkGeoCloudRasterMapsOverlay);
            mapView.Refresh();
        }
Example #10
0
        private void TestForm_Load(object sender, EventArgs e)
        {
            winformsMap1.MapUnit       = GeographyUnit.Meter;
            winformsMap1.ZoomLevelSet  = new ThinkGeoCloudMapsZoomLevelSet();
            winformsMap1.CurrentExtent = new RectangleShape(-10777598, 3912998, -10776008, 3912026);
            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);

            KmlFeatureLayer kmlFeatureLayer = new KmlFeatureLayer("../../App_Data/ThinkGeoHeadquarters.kml");

            kmlFeatureLayer.StylingType = KmlStylingType.StandardStyling;
            // Set area style,line style,point style and text style.
            TextStyle textStyle = new TextStyle("name", (new GeoFont("Arial", 12)), new GeoSolidBrush(GeoColor.StandardColors.DarkOliveGreen));

            textStyle.HaloPen    = new GeoPen(GeoColor.StandardColors.FloralWhite, 5);
            textStyle.SplineType = SplineType.ForceSplining;
            kmlFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle.FillSolidBrush = new GeoSolidBrush(new GeoColor(50, GeoColor.SimpleColors.Orange));
            kmlFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle.OutlinePen     = new GeoPen(GeoColor.SimpleColors.Black);
            kmlFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle            = new LineStyle(new GeoPen(GeoColor.SimpleColors.Orange, 5));
            kmlFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle.SymbolPen = new GeoPen(GeoColor.FromArgb(255, GeoColor.StandardColors.Green), 8);
            kmlFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle            = textStyle;
            kmlFeatureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel         = ApplyUntilZoomLevel.Level20;
            LayerOverlay overlay = new LayerOverlay();

            overlay.Layers.Add("KmlLayer", kmlFeatureLayer);
            winformsMap1.Overlays.Add("Overlay", overlay);

            winformsMap1.Refresh();
        }
Example #11
0
        private void Form_Load(object sender, EventArgs e)
        {
            // Set the map's unit of measurement to meters(Spherical Mercator)
            mapView.MapUnit = GeographyUnit.Meter;

            // Add Cloud Maps as a background overlay
            var thinkGeoCloudVectorMapsOverlay = new ThinkGeoCloudRasterMapsOverlay("itZGOI8oafZwmtxP-XGiMvfWJPPc-dX35DmESmLlQIU~", "bcaCzPpmOG6le2pUz5EAaEKYI-KSMny_WxEAe7gMNQgGeN9sqL12OA~~", ThinkGeoCloudRasterMapsMapType.Aerial);

            mapView.Overlays.Add(thinkGeoCloudVectorMapsOverlay);

            // Set the map extent
            mapView.CurrentExtent = new RectangleShape(-10779675.1746605, 3914631.77546835, -10779173.5566652, 3914204.80300804);

            // Create a layer with line data
            ShapeFileFeatureLayer friscoRailroad = new ShapeFileFeatureLayer(@"../../../Data/Railroad/Railroad.shp");
            LayerOverlay          layerOverlay   = new LayerOverlay();

            // Project the layer's data to match the projection of the map
            friscoRailroad.FeatureSource.ProjectionConverter = new ProjectionConverter(2276, 3857);

            // Add the layer to a layer overlay
            layerOverlay.Layers.Add("Railroad", friscoRailroad);

            // Add the overlay to the map
            mapView.Overlays.Add("overlay", layerOverlay);

            rbLineStyle.Checked = true;
        }
Example #12
0
        /// <summary>
        /// Initalizes the base map for the MapView.
        /// </summary>
        private void InitializeBackgroundMap()
        {
            if (!MapView.Overlays.Contains("WMK"))
            {
                // 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");

                string baseFolder        = Android.OS.Environment.ExternalStorageDirectory.AbsolutePath;
                string cachePathFilename = System.IO.Path.Combine(baseFolder, "MapSuiteTileCaches/SampleCaches.db");
                thinkGeoCloudMapsOverlay.TileCache = new SqliteBitmapTileCache(cachePathFilename, "SphericalMercator");
                MapView.Overlays.Insert(0, "WMK", thinkGeoCloudMapsOverlay);
            }
        }
Example #13
0
        private void MapView_Loaded(object sender, RoutedEventArgs e)
        {
            mapView.MapUnit       = GeographyUnit.Meter;
            mapView.ZoomLevelSet  = new ThinkGeoCloudMapsZoomLevelSet();
            mapView.CurrentExtent = new RectangleShape(-17336118, 20037508, 11623981, -16888303);

            ThinkGeoCloudRasterMapsOverlay ThinkGeoCloudRasterMapsOverlay = new ThinkGeoCloudRasterMapsOverlay(SampleHelper.ThinkGeoCloudId, SampleHelper.ThinkGeoCloudSecret);

            ThinkGeoCloudRasterMapsOverlay.DrawTilesProgressChanged += new System.EventHandler <DrawTilesProgressChangedTileOverlayEventArgs>(ThinkGeoCloudRasterMapsOverlay_DrawTilesProgressChanged);
            mapView.Overlays.Add(ThinkGeoCloudRasterMapsOverlay);

            mapView.Refresh();
        }
        private void MainForm_Load(object sender, EventArgs e)
        {
            map.MapUnit       = GeographyUnit.Meter;
            map.ZoomLevelSet  = new ThinkGeoCloudMapsZoomLevelSet();
            map.CurrentExtent = new RectangleShape(-13059527, 6484023, -8632838, 2982361);

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

            map.Overlays.Add(thinkGeoCloudMapsOverlay);

            // Add Demographic Layer
            customFeatureLayer      = new ShapeFileFeatureLayer();
            censusStateFeatureLayer = new ShapeFileFeatureLayer(@"../../App_Data/usStatesCensus2010.shp");
            censusStateFeatureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            currentFeatureLayer = censusStateFeatureLayer;

            LayerOverlay demographicLayerOverlay = new LayerOverlay();

            demographicLayerOverlay.Layers.Add(currentFeatureLayer);
            map.Overlays.Add("DemographicLayerOverlayKey", demographicLayerOverlay);

            // Add Highlight Overlay
            HighlightOverlay USDemographicOverlay = new HighlightOverlay();

            map.Overlays.Add("HighlightOverlayKey", USDemographicOverlay);

            // Initialize style builder to Thematic
            currentStyleBuilder = new ThematicDemographicStyleBuilder();
            currentStyleBuilder.SelectedColumns.Add("Population");

            // Initialize the Legend
            LegendAdornmentLayer legendAdornmentLayer = new LegendAdornmentLayer();

            legendAdornmentLayer.Location = AdornmentLocation.LowerLeft;
            legendAdornmentLayer.Title    = new LegendItem();
            legendAdornmentLayer.Title.ImageJustificationMode = LegendImageJustificationMode.JustifyImageRight;
            legendAdornmentLayer.Title.TopPadding             = 10;
            legendAdornmentLayer.Title.BottomPadding          = 10;
            legendAdornmentLayer.Title.TextStyle = new TextStyle("Population", new GeoFont("Segoe UI", 12), new GeoSolidBrush(GeoColor.SimpleColors.Black));
            map.AdornmentOverlay.Layers.Add(legendAdornmentLayer);
            //map.ZoomToScale(map.ZoomLevelSet.ZoomLevel14.Scale);
            // Update the controls and map.
            UpdateUIControls(currentStyleBuilder);
            UpdateMap(currentStyleBuilder);

            LoadDataSelectorUserControls();
        }
Example #15
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            wpfMap.MapUnit      = GeographyUnit.Meter;
            wpfMap.ZoomLevelSet = new ThinkGeoCloudMapsZoomLevelSet();

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

            wpfMap.Overlays.Add(baseOverlay);

            // Add marker overlay for showing the best matching place.
            bestmatchingMarkerOverlay = new SimpleMarkerOverlay();
            wpfMap.Overlays.Add("BestMatchingMarkerOverlay", bestmatchingMarkerOverlay);

            // Add marker overlay for showing result.
            nearbysMarkerOverlay = new SimpleMarkerOverlay();
            wpfMap.Overlays.Add("NearbysMarkerOverlay", nearbysMarkerOverlay);

            // Add layer for searchRadius.
            seachRadiusFeatureLayer = new InMemoryFeatureLayer();
            seachRadiusFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle    = new AreaStyle(new GeoPen(new GeoColor(100, GeoColors.Blue)), new GeoSolidBrush(new GeoColor(10, GeoColors.Blue)));
            seachRadiusFeatureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            // Add layer for showing geometry in result.
            resultGeometryFeatureLayer = new InMemoryFeatureLayer();
            resultGeometryFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle    = new AreaStyle(GeoPens.Blue, new GeoSolidBrush(new GeoColor(10, GeoColors.Blue)));
            resultGeometryFeatureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            LayerOverlay searchResultOverlay = new LayerOverlay()
            {
                DrawingQuality = DrawingQuality.HighQuality
            };

            searchResultOverlay.Layers.Add("ResultGeometryFeatureLayer", resultGeometryFeatureLayer);
            searchResultOverlay.Layers.Add("SerachRadiusFeatureLayer", seachRadiusFeatureLayer);
            wpfMap.Overlays.Add("SearchResult", searchResultOverlay);

            wpfMap.CurrentExtent = new RectangleShape(-10789506, 3924697, -10767934, 3905588);
            wpfMap.Refresh();

            // Bind search categories to comboxList.
            nearbySearchCategory.ItemsSource = new List <string>()
            {
                "None", "Common", "All", "Customized"
            };
            nearbySearchCategory.SelectedIndex = 2;
        }
Example #16
0
        /// <summary>
        /// Setup the map with the ThinkGeo Cloud Maps overlay.
        /// </summary>
        protected override void OnAppearing()
        {
            base.OnAppearing();
            // It is important to set the map unit first to either feet, meters or decimal degrees.
            mapView.MapUnit = GeographyUnit.Meter;

            // Create the layer overlay with some additional settings and add to the map.
            ThinkGeoCloudRasterMapsOverlay cloudOverlay = new ThinkGeoCloudRasterMapsOverlay("9ap16imkD_V7fsvDW9I8r8ULxgAB50BX_BnafMEBcKg~", "vtVao9zAcOj00UlGcK7U-efLANfeJKzlPuDB9nw7Bp4K4UxU_PdRDg~~");

            cloudOverlay.MapType = ThinkGeoCloudRasterMapsMapType.Hybrid;
            mapView.Overlays.Add("Cloud Overlay", cloudOverlay);

            // Set the current extent to a neighborhood in Frisco Texas.
            mapView.CurrentExtent = new RectangleShape(-10781708.9749424, 3913502.90429046, -10777685.1114043, 3910360.79646662);

            // Refresh the map.
            mapView.Refresh();
        }
        private void TestForm_Load(object sender, EventArgs e)
        {
            winformsMap1.MapUnit       = GeographyUnit.Meter;
            winformsMap1.ZoomLevelSet  = new ThinkGeoCloudMapsZoomLevelSet();
            winformsMap1.CurrentExtent = new RectangleShape(-12819569, 7708233, 13244845, -8220019);
            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);

            //Layer to do the spatial query on.
            ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer(@"..\..\Data\Countries02.shp");

            worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle    = AreaStyles.CreateSimpleAreaStyle(GeoColor.SimpleColors.Transparent, GeoColor.FromArgb(100, GeoColor.SimpleColors.Green));
            worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            LayerOverlay worldOverlay = new LayerOverlay();

            worldOverlay.Layers.Add("WorldLayer", worldLayer);
            winformsMap1.Overlays.Add("WorldOverlay", worldOverlay);

            //Using the rectangle from TrackOverlay to do the spatial query
            winformsMap1.TrackOverlay.TrackMode = TrackMode.Rectangle;

            //Event for getting the rectangle shape at the end of tracking the rectangle on the map.
            winformsMap1.TrackOverlay.TrackEnded += new EventHandler <TrackEndedTrackInteractiveOverlayEventArgs>(winformsMap1_TrackEnded);

            //InMemoryfeatureLayer to show the selected features from the spatial query.
            InMemoryFeatureLayer spatialQueryResultLayer = new InMemoryFeatureLayer();

            spatialQueryResultLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = new AreaStyle(new GeoSolidBrush(GeoColor.FromArgb(200, GeoColor.SimpleColors.PastelRed)));
            spatialQueryResultLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle.OutlinePen.Color = GeoColor.StandardColors.Red;
            spatialQueryResultLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            LayerOverlay spatialQueryResultOverlay = new LayerOverlay();

            spatialQueryResultOverlay.Layers.Add("SpatialQueryResultLayer", spatialQueryResultLayer);
            winformsMap1.Overlays.Add("SpatialQueryResultOverlay", spatialQueryResultOverlay);

            winformsMap1.Refresh();
        }
Example #18
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();
        }
Example #19
0
        private void Form_Load(object sender, EventArgs e)
        {
            // It is important to set the map unit first to either feet, meters or decimal degrees.
            mapView.MapUnit = GeographyUnit.Meter;

            // Set the map zoom level set to the Cloud Maps zoom level set.
            mapView.ZoomLevelSet = new ThinkGeoCloudMapsZoomLevelSet();

            // Create the layer overlay with some additional settings and add to the map.
            ThinkGeoCloudRasterMapsOverlay cloudOverlay = new ThinkGeoCloudRasterMapsOverlay("itZGOI8oafZwmtxP-XGiMvfWJPPc-dX35DmESmLlQIU~", "bcaCzPpmOG6le2pUz5EAaEKYI-KSMny_WxEAe7gMNQgGeN9sqL12OA~~");

            cloudOverlay.MapType = ThinkGeoCloudRasterMapsMapType.Hybrid;
            mapView.Overlays.Add("Cloud Overlay", cloudOverlay);

            // Set the current extent to a neighborhood in Frisco Texas.
            mapView.CurrentExtent = new RectangleShape(-10781708.9749424, 3913502.90429046, -10777685.1114043, 3910360.79646662);

            // Refresh the map.
            mapView.Refresh();
        }
        public override void Handle(Window owner, MapView map, MenuItemMessage message)
        {
            /*===========================================
            *  Backgrounds for this sample are powered by ThinkGeo Cloud Maps and require
            *  a Client ID and Secret. These were sent to you via email when you signed up
            *  with ThinkGeo, or you can register now at https://cloud.thinkgeo.com.
            *  ===========================================*/
            ThinkGeoCloudRasterMapsOverlay backgroundOverlay;

            if (map.Overlays.Contains(thinkGeoCloudMapsOverlayName))
            {
                backgroundOverlay = map.Overlays[thinkGeoCloudMapsOverlayName] as ThinkGeoCloudRasterMapsOverlay;
            }
            else
            {
                backgroundOverlay = new ThinkGeoCloudRasterMapsOverlay(thinkGeoCloudClientId, thinkGeoCloudClientSecret);
                map.Overlays.Insert(0, backgroundOverlay);
            }

            backgroundOverlay.IsVisible = true;
            switch (message.MenuItem.Action.ToLowerInvariant())
            {
            case "light":
                backgroundOverlay.MapType = ThinkGeoCloudRasterMapsMapType.Light;
                break;

            case "aerial":
                backgroundOverlay.MapType = ThinkGeoCloudRasterMapsMapType.Aerial;
                break;

            case "hybrid":
                backgroundOverlay.MapType = ThinkGeoCloudRasterMapsMapType.Hybrid;
                break;

            case "none":
                backgroundOverlay.IsVisible = false;
                break;
            }

            map.Refresh(backgroundOverlay);
        }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            //Sets the correct map unit and the extent of the map.
            wpfMap1.MapUnit       = GeographyUnit.Meter;
            wpfMap1.ZoomLevelSet  = new ThinkGeoCloudMapsZoomLevelSet();
            wpfMap1.CurrentExtent = new RectangleShape(-14248894, 6621293, -7235766, 2154935);
            wpfMap1.Background    = new SolidColorBrush(Color.FromRgb(148, 196, 243));

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

            wpfMap1.Overlays.Add(baseOverlay);

            LayerOverlay          layerOverlay   = new LayerOverlay();
            ShapeFileFeatureLayer shapeFileLayer = new ShapeFileFeatureLayer(@"../../data/USStates.shp");

            shapeFileLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.CreateSimpleAreaStyle(GeoColor.FromArgb(20, GeoColor.StandardColors.LightGreen),
                                                                                                        GeoColor.StandardColors.LightGray);
            shapeFileLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            layerOverlay.Layers.Add("StatesLayer", shapeFileLayer);
            wpfMap1.Overlays.Add("LayerFeatureOverlay", layerOverlay);

            //Highlight layer
            InMemoryFeatureLayer highlightLayer = new InMemoryFeatureLayer();

            highlightLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.CreateSimpleAreaStyle(GeoColor.FromArgb(120, GeoColor.StandardColors.Red),
                                                                                                        GeoColor.StandardColors.LightGray);
            highlightLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            LayerOverlay highlightOverlay = new LayerOverlay();

            highlightOverlay.Layers.Add("HighlightLayer", highlightLayer);
            wpfMap1.Overlays.Add("HighlightOverlay", highlightOverlay);


            wpfMap1.Refresh();
        }
        public DisplayThinkGeoWorldStreetsMaps()
        {
            InitializeComponent();

            thinkGeoMBTilesFeatureLayerLight = new ThinkGeoCloudVectorMapsLayer(SampleHelper.ThinkGeoCloudId, SampleHelper.ThinkGeoCloudSecret, new System.Uri(SampleHelper.Get("thinkgeo-world-streets-light.json"), System.UriKind.Relative))
            {
                BitmapTileCache = null
            };
            thinkGeoMBTilesFeatureLayerDark = new ThinkGeoCloudVectorMapsLayer(SampleHelper.ThinkGeoCloudId, SampleHelper.ThinkGeoCloudSecret, new System.Uri(SampleHelper.Get("thinkgeo-world-streets-dark.json"), System.UriKind.Relative))
            {
                BitmapTileCache = null
            };
            thinkGeoMBTilesFeatureLayerTransparent = new ThinkGeoCloudVectorMapsLayer(SampleHelper.ThinkGeoCloudId, SampleHelper.ThinkGeoCloudSecret, new System.Uri(SampleHelper.Get("thinkgeo-world-streets-hybrid.json"), System.UriKind.Relative))
            {
                BitmapTileCache = null
            };
            thinkGeoCloudRasterMapsOverlay = new ThinkGeoCloudRasterMapsOverlay(SampleHelper.ThinkGeoCloudId, SampleHelper.ThinkGeoCloudSecret)
            {
                TileCache = null
            };
            thinkGeoCloudRasterMapsOverlay.MapType = ThinkGeoCloudRasterMapsMapType.Light;
            layerOverlay = new LayerOverlay();
        }
Example #23
0
        private void MapView_Loaded(object sender, RoutedEventArgs e)
        {
            mapView.MapUnit       = GeographyUnit.Meter;
            mapView.ZoomLevelSet  = new ThinkGeoCloudMapsZoomLevelSet();
            mapView.CurrentExtent = new RectangleShape(-4904363, 6313059, 9575868, -5401887);

            ThinkGeoCloudRasterMapsOverlay worldMapKitDesktopOverlay = new ThinkGeoCloudRasterMapsOverlay(SampleHelper.ThinkGeoCloudId, SampleHelper.ThinkGeoCloudSecret);

            mapView.Overlays.Add("WorldOverlay", worldMapKitDesktopOverlay);

            RestrictionLayer restrictionLayer = new RestrictionLayer();

            restrictionLayer.Zones.Add(new RectangleShape(-1967015, 4440501, 6681396, -4120479));
            restrictionLayer.RestrictionMode = RestrictionMode.ShowZones;
            restrictionLayer.UpperScale      = 250000000;
            restrictionLayer.LowerScale      = double.MinValue;

            LayerOverlay restrictionOverlay = new LayerOverlay();

            restrictionOverlay.Layers.Add("RestrictionLayer", restrictionLayer);
            mapView.Overlays.Add("RestrictionOverlay", restrictionOverlay);

            mapView.Refresh();
        }
        private void LayoutRoot_Loaded(object sender, RoutedEventArgs e)
        {
            btnGenerateGridFile.IsEnabled = true;

            Map1.MapUnit       = GeographyUnit.Meter;
            Map1.ZoomLevelSet  = new ThinkGeoCloudMapsZoomLevelSet();
            Map1.CurrentExtent = new RectangleShape(-11204955.4870063, 4543351.66721459, -11200273.7233416, 4539757.60752901);

            //Load the well depth points and depth data from a text file into the dictionary
            //We cache this at the class level to prevent form loading it multiple times
            wellDepthPointData = GetWellDepthPointDataFromCSV(wellDepthPointDataFilePath);

            /*===========================================
            *  Backgrounds for this sample are powered by ThinkGeo Cloud Maps and require
            *  a Client ID and Secret. These were sent to you via email when you signed up
            *  with ThinkGeo, or you can register now at https://cloud.thinkgeo.com.
            *  ===========================================*/
            ThinkGeoCloudRasterMapsOverlay baseOverlay = new ThinkGeoCloudRasterMapsOverlay();

            Map1.Overlays.Add(baseOverlay);

            //Add the grid layer, the grid cells, and the well points to the map
            LayerOverlay isoLineOverlay = new LayerOverlay();

            isoLineOverlay.Drawn   += new EventHandler <DrawnOverlayEventArgs>(isoLineOverlay_Drawn);
            isoLineOverlay.Drawing += new EventHandler <DrawingOverlayEventArgs>(isoLineOverlay_Drawing);

            Map1.Overlays.Add("isoLineOverlay", isoLineOverlay);

            isoLineOverlay.Layers.Add("IsoLineLayer", GetDynamicIsoLineLayer());
            isoLineOverlay.Layers.Add("GridCellsLayer", GetDynamicGridFeatureLayer());
            isoLineOverlay.Layers.Add("WellsLayer", GetWellDepthPointLayer());
            isoLineOverlay.DrawingQuality = DrawingQuality.HighQuality;

            Map1.Refresh();
        }
Example #25
0
        protected override void InitializeMap()
        {
            MapView.MapUnit       = GeographyUnit.Meter;
            MapView.ZoomLevelSet  = new ThinkGeoCloudMapsZoomLevelSet();
            MapView.CurrentExtent = new RectangleShape(-13886070, 5660597, -8906057, 2382985);

            /*===========================================
            *  Backgrounds for this sample are powered by ThinkGeo Cloud Maps and require
            *  a Client ID and Secret. These were sent to you via email when you signed up
            *  with ThinkGeo, or you can register now at https://cloud.thinkgeo.com.
            *  ===========================================*/
            ThinkGeoCloudRasterMapsOverlay thinkGeoCloudMapsOverlay = (ThinkGeoCloudRasterMapsOverlay)MapView.Overlays["WMK"];
            string baseFolder        = Android.OS.Environment.ExternalStorageDirectory.AbsolutePath;
            string cachePathFilename = Path.Combine(baseFolder, "MapSuiteTileCaches/SampleCaches.db");

            thinkGeoCloudMapsOverlay.TileCache = new SqliteBitmapTileCache(cachePathFilename, "SphericalMercator");

            LineStyle lineStyle = LineStyles.CreateSimpleLineStyle(GeoColor.FromArgb(255, 50, 0, 249), 4, false);

            //Cold Front
            CustomGeoImageLineStyle coldFrontLineStyle = GetCustomLineStyle(lineStyle, 19, CustomGeoImageLineStyle.SymbolSide.Right,
                                                                            SampleHelper.GetDataPath(@"CustomStyles/offset_circle_red_bl.png"), SampleHelper.GetDataPath(@"CustomStyles/offset_triangle_blue_revert.png"));

            InMemoryFeatureLayer inMemoryFeatureLayerColdFront = new InMemoryFeatureLayer();

            inMemoryFeatureLayerColdFront.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(coldFrontLineStyle);
            inMemoryFeatureLayerColdFront.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
            inMemoryFeatureLayerColdFront.InternalFeatures.Add(new Feature(File.ReadAllText(SampleHelper.GetDataPath(@"CustomStyles/ColdFront2.txt"))));
            inMemoryFeatureLayerColdFront.InternalFeatures.Add(new Feature(File.ReadAllText(SampleHelper.GetDataPath(@"CustomStyles/ColdFront3.txt"))));

            //Warm Front
            InMemoryFeatureLayer    inMemoryFeatureLayerWarmFront = new InMemoryFeatureLayer();
            CustomGeoImageLineStyle warmFrontLineStyle            = new CustomGeoImageLineStyle(lineStyle, new GeoImage(SampleHelper.GetDataPath(@"CustomStyles/offset_circle_blue.png")),
                                                                                                30, CustomGeoImageLineStyle.SymbolSide.Right);

            inMemoryFeatureLayerWarmFront.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(warmFrontLineStyle);
            inMemoryFeatureLayerWarmFront.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            inMemoryFeatureLayerWarmFront.InternalFeatures.Add(new Feature(File.ReadAllText(SampleHelper.GetDataPath(@"CustomStyles/WarmFront5.txt"))));
            inMemoryFeatureLayerWarmFront.InternalFeatures.Add(new Feature(File.ReadAllText(SampleHelper.GetDataPath(@"CustomStyles/WarmFront6.txt"))));
            inMemoryFeatureLayerWarmFront.InternalFeatures.Add(new Feature(File.ReadAllText(SampleHelper.GetDataPath(@"CustomStyles/WarmFront7.txt"))));
            inMemoryFeatureLayerWarmFront.InternalFeatures.Add(new Feature(File.ReadAllText(SampleHelper.GetDataPath(@"CustomStyles/WarmFront8.txt"))));

            //Occluded Front
            InMemoryFeatureLayer    inMemoryFeatureLayerOccludedFront = new InMemoryFeatureLayer();
            CustomGeoImageLineStyle occludedFrontLineStyle            = GetCustomLineStyle(lineStyle, 45, CustomGeoImageLineStyle.SymbolSide.Right,
                                                                                           SampleHelper.GetDataPath(@"CustomStyles/offset_triangle_and_circle_blue.png"), SampleHelper.GetDataPath(@"CustomStyles/offset_triangle_and_circle_red.png"));

            inMemoryFeatureLayerOccludedFront.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(occludedFrontLineStyle);
            inMemoryFeatureLayerOccludedFront.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
            inMemoryFeatureLayerOccludedFront.InternalFeatures.Add(new Feature(File.ReadAllText(SampleHelper.GetDataPath(@"CustomStyles/OccludedFront9.txt"))));
            inMemoryFeatureLayerOccludedFront.InternalFeatures.Add(new Feature(File.ReadAllText(SampleHelper.GetDataPath(@"CustomStyles/OccludedFront10.txt"))));
            inMemoryFeatureLayerOccludedFront.InternalFeatures.Add(new Feature(File.ReadAllText(SampleHelper.GetDataPath(@"CustomStyles/OccludedFront11.txt"))));

            PressureValueStyle pressureValueStyle = new PressureValueStyle();

            pressureValueStyle.ColumnName = "Pressure";

            InMemoryFeatureLayer pressureFeatureLayer = new InMemoryFeatureLayer();

            pressureFeatureLayer.Open();
            pressureFeatureLayer.Columns.Add(new FeatureSourceColumn("Pressure"));
            pressureFeatureLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(pressureValueStyle);
            pressureFeatureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
            pressureFeatureLayer.InternalFeatures.Add(new Feature(MapView.CurrentExtent.GetCenterPoint()));

            Random random = new Random();

            string[] pressures = { "H", "L" };
            for (int i = 0; i < 20; i++)
            {
                Feature pressurePoint = new Feature(random.Next(-13886070, -8906057), random.Next(3382985, 6660597));
                pressurePoint.ColumnValues["Pressure"] = pressures[random.Next(0, 2)];
                pressureFeatureLayer.InternalFeatures.Add(pressurePoint);
            }

            WindPointStyle windStyle1 = new WindPointStyle("TEXT", "LEVEL", "ANGLE", GeoColor.FromHtml("#0AF8F8"));
            WindPointStyle windStyle2 = new WindPointStyle("TEXT", "LEVEL", "ANGLE", GeoColor.FromHtml("#0FF5B0"));
            WindPointStyle windStyle3 = new WindPointStyle("TEXT", "LEVEL", "ANGLE", GeoColor.FromHtml("#F7F70D"));
            WindPointStyle windStyle4 = new WindPointStyle("TEXT", "LEVEL", "ANGLE", GeoColor.FromHtml("#FBE306"));

            ClassBreakStyle windClassBreakStyle = new ClassBreakStyle();

            windClassBreakStyle.ColumnName = "TEXT";
            windClassBreakStyle.ClassBreaks.Add(new ClassBreak(10, new Collection <Style> {
                windStyle1
            }));
            windClassBreakStyle.ClassBreaks.Add(new ClassBreak(20, new Collection <Style> {
                windStyle2
            }));
            windClassBreakStyle.ClassBreaks.Add(new ClassBreak(30, new Collection <Style> {
                windStyle3
            }));
            windClassBreakStyle.ClassBreaks.Add(new ClassBreak(40, new Collection <Style> {
                windStyle4
            }));

            InMemoryFeatureLayer windFeatureLayer = new InMemoryFeatureLayer();

            windFeatureLayer.Open();
            windFeatureLayer.Columns.Add(new FeatureSourceColumn("TEXT"));
            windFeatureLayer.Columns.Add(new FeatureSourceColumn("ANGLE"));
            windFeatureLayer.Columns.Add(new FeatureSourceColumn("LEVEL"));
            windFeatureLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(windClassBreakStyle);
            windFeatureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
            for (int i = 0; i < 20; i++)
            {
                Feature windFeature = new Feature(random.Next(-13886070, -8906057), random.Next(3382985, 6660597));
                windFeature.ColumnValues["TEXT"]  = random.Next(10, 40).ToString(CultureInfo.InvariantCulture);
                windFeature.ColumnValues["ANGLE"] = random.Next(0, 360).ToString(CultureInfo.InvariantCulture);
                windFeature.ColumnValues["LEVEL"] = random.Next(0, 5).ToString(CultureInfo.InvariantCulture);
                windFeatureLayer.InternalFeatures.Add(windFeature);
            }

            LayerOverlay dynamicOverlay = new LayerOverlay();

            dynamicOverlay.Layers.Add(inMemoryFeatureLayerColdFront);
            dynamicOverlay.Layers.Add(inMemoryFeatureLayerWarmFront);
            dynamicOverlay.Layers.Add(inMemoryFeatureLayerOccludedFront);
            dynamicOverlay.Layers.Add(pressureFeatureLayer);
            dynamicOverlay.Layers.Add(windFeatureLayer);
            MapView.Overlays.Add(dynamicOverlay);
        }
Example #26
0
        private void InitializeOverlays()
        {
            string cacheFolder = Path.Combine(Path.GetTempPath(), "TileCache");

            ThinkGeoCloudRasterMapsOverlay thinkGeoCloudMapLightOverlay = new ThinkGeoCloudRasterMapsOverlay();

            thinkGeoCloudMapLightOverlay.Name       = Resources.ThinkGeoCloudMapHybridOverlay;
            thinkGeoCloudMapLightOverlay.TileHeight = 512;
            thinkGeoCloudMapLightOverlay.TileWidth  = 512;
            thinkGeoCloudMapLightOverlay.MapType    = ThinkGeoCloudRasterMapsMapType.Light;
            thinkGeoCloudMapLightOverlay.IsVisible  = false;
            thinkGeoCloudMapLightOverlay.TileCache  = new FileBitmapTileCache(cacheFolder, Resources.ThinkGeoCloudMapHybridOverlay);
            mapControl.Overlays.Add(thinkGeoCloudMapLightOverlay);

            ThinkGeoCloudRasterMapsOverlay thinkGeoCloudMapDarkOverlay = new ThinkGeoCloudRasterMapsOverlay();

            thinkGeoCloudMapDarkOverlay.Name       = Resources.ThinkGeoCloudMapLightOverlay;
            thinkGeoCloudMapDarkOverlay.TileHeight = 512;
            thinkGeoCloudMapDarkOverlay.TileWidth  = 512;
            thinkGeoCloudMapDarkOverlay.MapType    = ThinkGeoCloudRasterMapsMapType.Dark;
            thinkGeoCloudMapDarkOverlay.IsVisible  = true;
            thinkGeoCloudMapDarkOverlay.TileCache  = new FileBitmapTileCache(cacheFolder, Resources.ThinkGeoCloudMapLightOverlay);
            mapControl.Overlays.Add(thinkGeoCloudMapDarkOverlay);

            ThinkGeoCloudRasterMapsOverlay thinkGeoCloudMapHybridOverlay = new ThinkGeoCloudRasterMapsOverlay();

            thinkGeoCloudMapHybridOverlay.Name       = Resources.ThinkGeoCloudMapAerialOverlay;
            thinkGeoCloudMapHybridOverlay.TileHeight = 512;
            thinkGeoCloudMapHybridOverlay.TileWidth  = 512;
            thinkGeoCloudMapHybridOverlay.MapType    = ThinkGeoCloudRasterMapsMapType.Hybrid;
            thinkGeoCloudMapHybridOverlay.IsVisible  = false;
            thinkGeoCloudMapHybridOverlay.TileCache  = new FileBitmapTileCache(cacheFolder, Resources.ThinkGeoCloudMapAerialOverlay);
            mapControl.Overlays.Add(thinkGeoCloudMapHybridOverlay);

            OpenStreetMapOverlay openStreetMapOverlay = new OpenStreetMapOverlay();

            openStreetMapOverlay.Name       = Resources.OpenStreetMapName;
            openStreetMapOverlay.TileHeight = 512;
            openStreetMapOverlay.TileWidth  = 512;
            openStreetMapOverlay.IsVisible  = false;
            openStreetMapOverlay.TileCache  = new FileBitmapTileCache(cacheFolder, "OpenStreetMap");
            mapControl.Overlays.Add(Resources.OpenStreetMapKey, openStreetMapOverlay);

            BingMapsOverlay bingMapsAerialOverlay = new BingMapsOverlay();

            bingMapsAerialOverlay.Name       = Resources.BingMapsAerialMapName;
            bingMapsAerialOverlay.TileHeight = 512;
            bingMapsAerialOverlay.TileWidth  = 512;
            bingMapsAerialOverlay.MapType    = BingMapsMapType.Aerial;
            bingMapsAerialOverlay.IsVisible  = false;
            bingMapsAerialOverlay.TileCache  = new FileBitmapTileCache(cacheFolder, "BingMapsAerial");
            mapControl.Overlays.Add(Resources.BingAerialKey, bingMapsAerialOverlay);

            BingMapsOverlay bingMapsRoadOverlay = new BingMapsOverlay();

            bingMapsRoadOverlay.Name       = Resources.BingMapsRoadMapName;
            bingMapsRoadOverlay.TileHeight = 512;
            bingMapsRoadOverlay.TileWidth  = 512;
            bingMapsRoadOverlay.MapType    = BingMapsMapType.Road;
            bingMapsRoadOverlay.IsVisible  = false;
            bingMapsRoadOverlay.TileCache  = new FileBitmapTileCache(cacheFolder, "BingMapsRoad");
            mapControl.Overlays.Add(Resources.BingRoadKey, bingMapsRoadOverlay);

            InMemoryFeatureLayer spatialFenceLayer = new InMemoryFeatureLayer();

            spatialFenceLayer.Open();
            spatialFenceLayer.Columns.Add(new FeatureSourceColumn(Resources.RestrictedName, "Charater", 10));
            spatialFenceLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle    = new AreaStyle(new GeoPen(GeoColor.FromArgb(255, 204, 204, 204), 2), new GeoSolidBrush(GeoColor.FromArgb(112, 255, 0, 0)));
            spatialFenceLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle    = TextStyles.CreateSimpleTextStyle(Resources.RestrictedName, "Arial", 12, DrawingFontStyles.Regular, GeoColor.StandardColors.Black, GeoColor.SimpleColors.White, 2);
            spatialFenceLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            LayerOverlay spatialFenceOverlay = new LayerOverlay();

            spatialFenceOverlay.TileType = TileType.SingleTile;
            spatialFenceOverlay.Name     = Resources.SpatialFenceOverlayName;
            spatialFenceOverlay.Layers.Add(Resources.SpatialFenceLayerName, spatialFenceLayer);
            mapControl.Overlays.Add(Resources.SpatialFenceOverlayName, spatialFenceOverlay);

            LayerOverlay traceOverlay = new LayerOverlay();

            traceOverlay.Name     = Resources.TraceOverlayName;
            traceOverlay.TileType = TileType.SingleTile;
            mapControl.Overlays.Add(Resources.TraceOverlayName, traceOverlay);

            mapControl.Overlays.Add(Resources.PopupOverlayName, new PopupOverlay {
                Name = Resources.PopupOverlayName
            });

            ScaleBarAdornmentLayer scaleBarAdormentLayer = new ScaleBarAdornmentLayer();

            scaleBarAdormentLayer.UnitFamily = UnitSystem.Metric;
            mapControl.AdornmentOverlay.Layers.Add(Resources.ScaleBarName, scaleBarAdormentLayer);
        }
        public DisplayThinkGeoCloudRasterMaps()
        {
            overlay = new ThinkGeoCloudRasterMapsOverlay(SampleHelper.ThinkGeoCloudId, SampleHelper.ThinkGeoCloudSecret);

            InitializeComponent();
        }