コード例 #1
0
        /// <summary>
        /// Setup the map with the ThinkGeo Cloud Maps overlay. Also, add the common raster layer to the map
        /// </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 background world maps using vector tiles requested from the ThinkGeo Cloud Service and add it to the map.
            ThinkGeoCloudVectorMapsOverlay thinkGeoCloudVectorMapsOverlay = new ThinkGeoCloudVectorMapsOverlay("9ap16imkD_V7fsvDW9I8r8ULxgAB50BX_BnafMEBcKg~", "vtVao9zAcOj00UlGcK7U-efLANfeJKzlPuDB9nw7Bp4K4UxU_PdRDg~~", ThinkGeoCloudVectorMapsMapType.Light);

            thinkGeoCloudVectorMapsOverlay.VectorTileCache = new FileVectorTileCache(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "cache"), "CloudMapsVector");
            mapView.Overlays.Add(thinkGeoCloudVectorMapsOverlay);

            // Create a new overlay that will hold our new layer and add it to the map.
            LayerOverlay layerOverlay = new LayerOverlay();

            mapView.Overlays.Add(layerOverlay);

            // Create the new layer and dd the layer to the overlay we created earlier.
            NativeImageRasterLayer commonRasterLayer = new NativeImageRasterLayer(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Data/Jpg/m_3309650_sw_14_1_20160911_20161121.jpg"));

            layerOverlay.Layers.Add(commonRasterLayer);

            // Set the map view current extent to a slightly zoomed in area of the image.
            mapView.CurrentExtent = new RectangleShape(-10783910.2966461, 3917274.29233111, -10777309.4670677, 3912119.9131963);

            // Refresh the map.
            mapView.Refresh();
        }
コード例 #2
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;

            // Create the background world maps using vector tiles requested from the ThinkGeo Cloud Service and add it to the map.
            ThinkGeoCloudVectorMapsOverlay thinkGeoCloudVectorMapsOverlay = new ThinkGeoCloudVectorMapsOverlay("itZGOI8oafZwmtxP-XGiMvfWJPPc-dX35DmESmLlQIU~", "bcaCzPpmOG6le2pUz5EAaEKYI-KSMny_WxEAe7gMNQgGeN9sqL12OA~~", ThinkGeoCloudVectorMapsMapType.Light);

            mapView.Overlays.Add(thinkGeoCloudVectorMapsOverlay);

            // Create a new overlay that will hold our new layer and add it to the map.
            LayerOverlay layerOverlay = new LayerOverlay();

            mapView.Overlays.Add(layerOverlay);

            // Create the new layer and dd the layer to the overlay we created earlier.
            NativeImageRasterLayer commonRasterLayer = new NativeImageRasterLayer("../../../Data/Jpg/m_3309650_sw_14_1_20160911_20161121.jpg");

            layerOverlay.Layers.Add(commonRasterLayer);

            // Set the map view current extent to a slightly zoomed in area of the image.
            mapView.CurrentExtent = new RectangleShape(-10783910.2966461, 3917274.29233111, -10777309.4670677, 3912119.9131963);

            // Refresh the map.
            mapView.Refresh();
        }
コード例 #3
0
        protected override RasterLayer GetRasterLayer(Uri uri)
        {
            RasterLayer layer = null;

            layer = new NativeImageRasterLayer(uri.LocalPath);

            return(layer);
        }
コード例 #4
0
        protected override RasterLayer GetRasterLayer(Uri uri, WorldFileInfo wInfo)
        {
            RasterLayer layer = null;

            if (File.Exists(wInfo.WorldFilePath))
            {
                layer = new NativeImageRasterLayer(uri.LocalPath, wInfo.WorldFilePath);
            }
            else if (wInfo.ImageExtent != null)
            {
                layer = new NativeImageRasterLayer(uri.LocalPath, wInfo.ImageExtent);
            }
            return(layer);
        }
コード例 #5
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.DisplayMapView);

            NativeImageRasterLayer radarImageLayer = new NativeImageRasterLayer(SampleHelper.GetDataPath(@"Gif/EWX_N0R_0.gif"));

            radarImageLayer.UpperThreshold = double.MaxValue;
            radarImageLayer.LowerThreshold = 0;
            radarImageLayer.Open();

            LayerOverlay layerOverlay = new LayerOverlay();

            layerOverlay.Layers.Add(radarImageLayer);
            layerOverlay.TileType = TileType.MultiTile;

            androidMap = FindViewById <MapView>(Resource.Id.androidmap);
            androidMap.Overlays.Add(layerOverlay);
            androidMap.MapUnit       = GeographyUnit.DecimalDegree;
            androidMap.CurrentExtent = radarImageLayer.GetBoundingBox();

            SampleViewHelper.InitializeInstruction(this, FindViewById <RelativeLayout>(Resource.Id.MainLayout), GetType());
        }