예제 #1
0
        public SourceMapInfoPanel()
        {
            this.InitializeComponent();
            this.mapFileURLTextBox.LostFocus     += new EventHandler(this.mapFileURLTextBox_LostFocus);
            this.mapHomePageTextBox.LostFocus    += new EventHandler(this.mapHomePageTextBox_LostFocus);
            this.mapDescriptionTextBox.LostFocus += new EventHandler(this.descriptionTextBox_LostFocus);
            MercatorCoordinateSystem mercatorCoordinateSystem = new MercatorCoordinateSystem();

            this.closestZoomUpDown.Minimum = mercatorCoordinateSystem.GetZoomRange().min;
            this.closestZoomUpDown.Maximum = mercatorCoordinateSystem.GetZoomRange().max;
        }
예제 #2
0
        public SourceMapInfoPanel()
        {
            InitializeComponent();
            mapFileURLTextBox.LostFocus     += mapFileURLTextBox_LostFocus;
            mapHomePageTextBox.LostFocus    += mapHomePageTextBox_LostFocus;
            mapDescriptionTextBox.LostFocus += descriptionTextBox_LostFocus;
            MercatorCoordinateSystem mercatorCoordinateSystem = new MercatorCoordinateSystem();

            closestZoomUpDown.Minimum = mercatorCoordinateSystem.GetZoomRange().min;
            closestZoomUpDown.Maximum = mercatorCoordinateSystem.GetZoomRange().max;
        }
예제 #3
0
        public override bool DoWork(ITileWorkFeedback feedback)
        {
            this.feedback = feedback;
            bool result;

            try
            {
                D.Sayf(0, "{0} start compositing {1}", new object[]
                {
                    Clocker.theClock.stamp(),
                    this
                });
                if (!this.NeedThisTile())
                {
                    D.Say(10, "Skipping extant file: " + this.outputFilename);
                    result = false;
                }
                else
                {
                    D.Sayf(10, "Compositing {0}", new object[]
                    {
                        this.address
                    });
                    Size tileSize = new MercatorCoordinateSystem().GetTileSize();
                    GDIBigLockedImage gDIBigLockedImage = new GDIBigLockedImage(tileSize, "CompositeTileUnit");
                    D.Say(10, string.Format("Start({0}) sm.count={1}", this.address, this.singleSourceUnits.Count));
                    foreach (SingleSourceUnit current in this.singleSourceUnits)
                    {
                        current.CompositeImageInto(gDIBigLockedImage);
                    }
                    this.SaveTile(gDIBigLockedImage);
                    result = true;
                }
            }
            catch (NonredundantRenderComplaint complaint)
            {
                feedback.PostComplaint(complaint);
                result = false;
            }
            catch (Exception arg)
            {
                feedback.PostMessage(string.Format("Exception compositing tile {0}: {1}", this.address, arg));
                result = false;
            }
            return(result);
        }
예제 #4
0
 public void AutoSelectMaxZoom(MapTileSourceFactory mapTileSourceFactory)
 {
     if (this.sourceMapRenderOptions.maxZoom == -1)
     {
         MapRectangle userBoundingBox = this.GetUserBoundingBox(mapTileSourceFactory);
         if (userBoundingBox == null)
         {
             return;
         }
         Size         size = new Size(600, 600);
         LatLonZoom   bestViewContaining = new MercatorCoordinateSystem().GetBestViewContaining(userBoundingBox, size);
         IntParameter intParameter       = (IntParameter)mapTileSourceFactory.CreateUnwarpedSource(this).GetImageDetailPrototype(FutureFeatures.Cached).Curry(new ParamDict(new object[]
         {
             TermName.ImageDetail,
             new SizeParameter(size)
         })).Realize("SourceMap.AutoSelectMaxZoom");
         this.sourceMapRenderOptions.maxZoom = MercatorCoordinateSystem.theInstance.GetZoomRange().Constrain(bestViewContaining.zoom + intParameter.value + BuildConfig.theConfig.autoMaxZoomOffset);
     }
 }