Esempio n. 1
0
        private Map InitializeMap()
        {
            Map Map1 = new Map("Map1");

            Map1.MapUnit                              = GeographyUnit.Meter;
            Map1.ZoomLevelSet                         = ThinkGeoCloudMapsOverlay.GetZoomLevelSet();
            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;

            // base map layer
            ThinkGeoCloudMapsOverlay ThinkGeoCloudMapsLight = new ThinkGeoCloudMapsOverlay
            {
                Name    = "ThinkGeo Cloud Maps Light",
                MapType = ThinkGeoCloudMapsMapType.Light
            };

            Map1.CustomOverlays.Add(ThinkGeoCloudMapsLight);

            ThinkGeoCloudMapsOverlay ThinkGeoCloudMapsAerial = new ThinkGeoCloudMapsOverlay()
            {
                Name    = "ThinkGeo Cloud Maps Aerial",
                MapType = ThinkGeoCloudMapsMapType.Aerial
            };

            Map1.CustomOverlays.Add(ThinkGeoCloudMapsAerial);

            ThinkGeoCloudMapsOverlay ThinkGeoCloudMapsHybrid = new ThinkGeoCloudMapsOverlay()
            {
                Name    = "ThinkGeo Cloud Maps Hybrid",
                MapType = ThinkGeoCloudMapsMapType.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);
        }
Esempio n. 2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            mapView = new MapView(View.Frame);
            View.Add(mapView);
            ComposeTableControl();

            mapView.MapUnit       = GeographyUnit.Meter;
            mapView.ZoomLevelSet  = ThinkGeoCloudMapsOverlay.GetZoomLevelSet();
            mapView.MapSingleTap += MapViewMapSingleTap;

            ThinkGeoCloudMapsOverlay thinkGeoCloudMapsOverlay = new ThinkGeoCloudMapsOverlay();

            mapView.Overlays.Add(thinkGeoCloudMapsOverlay);

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

            string shapeFilePath = Path.Combine("AppData", "DallasCounty-3857.shp");
            string rtgPath       = Path.Combine("AppData", "DallasCounty-3857.rtg");
            var    routingSource = new RtgRoutingSource(rtgPath);
            var    featureSource = new ShapeFileFeatureSource(shapeFilePath);

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

            mapView.CurrentExtent = new RectangleShape(-10781100.2970769, 3875007.18710502, -10767407.8727504, 3854947.78546675);
            mapView.Refresh();
        }
Esempio n. 3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            timer          = new Timer();
            timer.Interval = 500;
            timer.Tick    += RefreshPointLayer;

            winformsMap1.MapUnit      = GeographyUnit.Meter;
            winformsMap1.ZoomLevelSet = ThinkGeoCloudMapsOverlay.GetZoomLevelSet();

            ThinkGeoCloudMapsOverlay thinkGeoCloudMapsOverlay = new ThinkGeoCloudMapsOverlay();

            winformsMap1.Overlays.Add(thinkGeoCloudMapsOverlay);

            layerOverlay = new LayerOverlay();
            winformsMap1.Overlays.Add(layerOverlay);

            winformsMap1.CurrentExtent = new RectangleShape(-12855175, 6098541, -10047697, 3806707);
            winformsMap1.Refresh();
        }