public InsaneSourceMapRemover(SourceMap sourceMap, MapTileSourceFactory mapTileSourceFactory, UndoAdddSourceMapDelegate removeSourceMapDelegate) : this(sourceMap, mapTileSourceFactory, removeSourceMapDelegate, 0) { }
public SourceMapViewManager(SourceMap sourceMap, MapTileSourceFactory mapTileSourceFactory, ViewControlIfc viewControl, DefaultReferenceView drv) { this.sourceMap = sourceMap; this.mapTileSourceFactory = mapTileSourceFactory; this.viewControl = viewControl; this.drv = drv; }
public MapRectangle GetUserBoundingBox(MapTileSourceFactory mapTileSourceFactory) { WarpedMapTileSource warpedMapTileSource = null; try { warpedMapTileSource = mapTileSourceFactory.CreateWarpedSource(this); } catch (InsufficientCorrespondencesException) { } if (warpedMapTileSource == null) { return(null); } var present = warpedMapTileSource.GetUserBounds(null, FutureFeatures.Cached) .Realize("SourceMap.AutoSelectMaxZoom"); if (!(present is BoundsPresent)) { return(null); } var boundsPresent = (BoundsPresent)present; var boundingBox = boundsPresent.GetRenderRegion().GetBoundingBox(); return(boundingBox.ClipTo( CoordinateSystemUtilities.GetRangeAsMapRectangle(MercatorCoordinateSystem.theInstance))); }
internal LatLonZoom GetDefaultView(Layer layer, Size assumedDisplaySize, MapTileSourceFactory mapTileSourceFactory, out bool allBoundsValid) { MapRectangle mapRectangle = null; allBoundsValid = true; foreach (SourceMap current in layer) { if (!AccumulateBoundingBox(current, mapTileSourceFactory, ref mapRectangle)) { allBoundsValid = false; } } LatLonZoom bestViewContaining; if (mapRectangle == null) { bestViewContaining = MercatorCoordinateSystem.theInstance.GetDefaultView(); } else { bestViewContaining = MercatorCoordinateSystem.theInstance.GetBestViewContaining(mapRectangle, assumedDisplaySize); } return(CoordinateSystemUtilities.ConstrainLLZ(MercatorCoordinateSystem.theInstance, bestViewContaining)); }
//[CompilerGenerated] //private static Comparison<ThumbnailRecord> <>9__CachedAnonymousMethodDelegate1; public SourceMapRecord(Layer layer, SourceMap sourceMap, MapTileSourceFactory mapTileSourceFactory) { displayName = sourceMap.displayName; sourceMapInfo = sourceMap.sourceMapInfo; userBoundingRect = sourceMap.GetUserBoundingBox(mapTileSourceFactory); maxZoom = sourceMap.sourceMapRenderOptions.maxZoom; try { imageTransformer = sourceMap.registration.warpStyle.getImageTransformer(sourceMap.registration, InterpolationMode.Invalid); } catch (Exception) { } foreach (Legend current in sourceMap.legendList) { legendRecords.Add(new LegendRecord("legends", sourceMap.GetLegendFilename(current), current.displayName, current.GetOutputSizeSynchronously(mapTileSourceFactory.CreateDisplayableUnwarpedSource(sourceMap) .GetUserBounds(current.latentRegionHolder, FutureFeatures.Cached)))); } sourceMapLegendFrame = new SourceMapLegendFrame(layer, sourceMap, legendRecords, thumbnailForLegendFrame); }
internal void AutoSelectMaxZooms(MapTileSourceFactory mapTileSourceFactory) { foreach (SourceMap current in sourceMaps) { current.AutoSelectMaxZoom(mapTileSourceFactory); } }
internal static LatLonZoom DefaultReferenceMapPosition(SourceMap sourceMap, MapTileSourceFactory mapTileSourceFactory, ViewControlIfc viewControl, DefaultReferenceView drv) { if (sourceMap.ReadyToLock()) { try { ViewerControlIfc sMViewerControl = viewControl.GetSMViewerControl(); MapRectangle bounds = sMViewerControl.GetBounds(); WarpedMapTileSource warpedMapTileSource = mapTileSourceFactory.CreateWarpedSource(sourceMap); IPointTransformer sourceToDestLatLonTransformer = warpedMapTileSource.GetSourceToDestLatLonTransformer(); MapRectangle mapRectangle = bounds.Transform(sourceToDestLatLonTransformer); mapRectangle = mapRectangle.ClipTo(new MapRectangle(-180.0, -360.0, 180.0, 360.0)); return(viewControl.GetVEViewerControl().GetCoordinateSystem() .GetBestViewContaining(mapRectangle, sMViewerControl.Size)); } catch (CorrespondencesAreSingularException) { } catch (InsufficientCorrespondencesException) { } } if (drv != null && drv.present) { return(drv.llz); } return(viewControl.GetVEViewerControl().GetCoordinateSystem().GetDefaultView()); }
public DynamicallyCompositingLayerViewManager(Layer layer, MapTileSourceFactory mapTileSourceFactory, ViewControlIfc viewControl) { this.layer = layer; this.mapTileSourceFactory = mapTileSourceFactory; this.viewControl = viewControl; }
internal void AutoSelectMaxZooms(MapTileSourceFactory mapTileSourceFactory) { foreach (Layer current in this.layers) { current.AutoSelectMaxZooms(mapTileSourceFactory); } }
private InsaneSourceMapRemover(SourceMap sourceMap, MapTileSourceFactory mapTileSourceFactory, UndoAdddSourceMapDelegate removeSourceMapDelegate, int tryCount) { this.sourceMap = sourceMap; this.mapTileSourceFactory = mapTileSourceFactory; undoAddSourceMapDelegate = removeSourceMapDelegate; this.tryCount = tryCount; if (tryCount > 3) { return; } Present present = mapTileSourceFactory.CreateUnwarpedSource(sourceMap) .GetImagePrototype(new ImageParameterFromTileAddress(ContinuousCoordinateSystem.theInstance), (FutureFeatures)7) .Curry(new ParamDict(new object[] { TermName.TileAddress, new TileAddress(0, 0, ContinuousCoordinateSystem.theInstance.GetDefaultView().zoom) })).Realize("SourceMap.CheckRendererSanity"); AsyncRef asyncRef = (AsyncRef)present; asyncRef.AddCallback(RendererSanityCheckComplete); new PersistentInterest(asyncRef); }
internal MapRectangle GetUserBoundingBox(MapTileSourceFactory mapTileSourceFactory) { MapRectangle mapRectangle = null; foreach (SourceMap current in this.sourceMaps) { mapRectangle = MapRectangle.Union(mapRectangle, current.GetUserBoundingBox(mapTileSourceFactory)); } return(mapRectangle); }
internal void Setup(RenderOptions renderOptions, Mashup currentMashup, MapTileSourceFactory mapTileSourceFactory, RenderProgressPanel2.LaunchRenderedBrowserDelegate LaunchRenderedBrowser, RenderState.FlushRenderedTileCachePackageDelegate flushRenderedTileCachePackage) { renderOptionsPanel.SetRenderOptions(renderOptions); renderProgressPanel.Setup(currentMashup, mapTileSourceFactory, LaunchRenderedBrowser, flushRenderedTileCachePackage); }
public CrunchedFile(Mashup mashup, RangeQueryData rangeQueryData, RenderOutputMethod renderOutput, string sourceMashupFilename, List<TileRectangle> boundsList, MapTileSourceFactory mapTileSourceFactory) { foreach (Layer current in mashup.layerList) { this.crunchedLayers.Add(new CrunchedLayer(mashup.GetRenderOptions(), current, rangeQueryData[current], mapTileSourceFactory)); } this.renderOutput = renderOutput; this.sourceMashupFilename = sourceMashupFilename; this.permitComposition = mashup.GetRenderOptions().permitComposition; this.boundsList = boundsList; }
public CrunchedLayer(RenderOptions renderOptions, Layer layer, List<RangeDescriptor> rangeDescriptors, MapTileSourceFactory mapTileSourceFactory) { this.displayName = layer.GetDisplayName(); this.namingScheme = new VENamingScheme(layer.GetFilesystemName(), renderOptions.GetOutputTileSuffix()); this.rangeDescriptors = rangeDescriptors; bool flag; this.defaultView = this.GetDefaultView(layer, new Size(600, 600), mapTileSourceFactory, out flag); foreach (SourceMap current in layer) { this.sourceMapRecords.Add(new SourceMapRecord(layer, current, mapTileSourceFactory)); } }
public CrunchedLayer(RenderOptions renderOptions, Layer layer, List <RangeDescriptor> rangeDescriptors, MapTileSourceFactory mapTileSourceFactory) { displayName = layer.GetDisplayName(); namingScheme = new VENamingScheme(layer.GetFilesystemName(), renderOptions.GetOutputTileSuffix()); this.rangeDescriptors = rangeDescriptors; bool flag; defaultView = GetDefaultView(layer, new Size(600, 600), mapTileSourceFactory, out flag); foreach (SourceMap current in layer) { sourceMapRecords.Add(new SourceMapRecord(layer, current, mapTileSourceFactory)); } }
internal bool AccumulateBoundingBox(SourceMap sourceMap, MapTileSourceFactory mapTileSourceFactory, ref MapRectangle boundingBox) { bool result; try { WarpedMapTileSource warpedMapTileSource = mapTileSourceFactory.CreateWarpedSource(sourceMap); BoundsPresent boundsPresent = (BoundsPresent)warpedMapTileSource.GetUserBounds(null, FutureFeatures.Cached).Realize("CrunchedFile.AccumulateBoundingBox"); boundsPresent.GetRenderRegion().AccumulateBoundingBox(ref boundingBox); result = true; } catch (InsufficientCorrespondencesException) { result = false; } return(result); }
public void Setup(Mashup mashup, MapTileSourceFactory mapTileSourceFactory, RenderProgressPanel2.LaunchRenderedBrowserDelegate launchRenderedBrowser, RenderState.FlushRenderedTileCachePackageDelegate flushRenderedTileCachePackage) { this.flushRenderedTileCachePackage = flushRenderedTileCachePackage; this.ReplacePreviewImage(null); if (this.mashup != null) { this.mashup.dirtyEvent.Remove(new DirtyListener(this.MashupChangedHandler)); } this.mashup = mashup; this.mapTileSourceFactory = mapTileSourceFactory; this.launchRenderedBrowser = launchRenderedBrowser; if (this.mashup != null) { this.mashup.dirtyEvent.Add(new DirtyListener(this.MashupChangedHandler)); } this.MashupChangedHandler(); }
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); } }
//[CompilerGenerated] //private static Comparison<ThumbnailRecord> <>9__CachedAnonymousMethodDelegate1; public SourceMapRecord(Layer layer, SourceMap sourceMap, MapTileSourceFactory mapTileSourceFactory) { this.displayName = sourceMap.displayName; this.sourceMapInfo = sourceMap.sourceMapInfo; this.userBoundingRect = sourceMap.GetUserBoundingBox(mapTileSourceFactory); this.maxZoom = sourceMap.sourceMapRenderOptions.maxZoom; try { this.imageTransformer = sourceMap.registration.warpStyle.getImageTransformer(sourceMap.registration, InterpolationMode.Invalid); } catch (Exception) { } foreach (Legend current in sourceMap.legendList) { this.legendRecords.Add(new LegendRecord("legends", sourceMap.GetLegendFilename(current), current.displayName, current.GetOutputSizeSynchronously(mapTileSourceFactory.CreateDisplayableUnwarpedSource(sourceMap).GetUserBounds(current.latentRegionHolder, FutureFeatures.Cached)))); } this.sourceMapLegendFrame = new SourceMapLegendFrame(layer, sourceMap, this.legendRecords, new SourceMapLegendFrame.ThumbnailDelegate(this.thumbnailForLegendFrame)); }
private InsaneSourceMapRemover(SourceMap sourceMap, MapTileSourceFactory mapTileSourceFactory, InsaneSourceMapRemover.UndoAdddSourceMapDelegate removeSourceMapDelegate, int tryCount) { this.sourceMap = sourceMap; this.mapTileSourceFactory = mapTileSourceFactory; this.undoAddSourceMapDelegate = removeSourceMapDelegate; this.tryCount = tryCount; if (tryCount > 3) { return; } Present present = mapTileSourceFactory.CreateUnwarpedSource(sourceMap).GetImagePrototype(new ImageParameterFromTileAddress(ContinuousCoordinateSystem.theInstance), (FutureFeatures)7).Curry(new ParamDict(new object[] { TermName.TileAddress, new TileAddress(0, 0, ContinuousCoordinateSystem.theInstance.GetDefaultView().zoom) })).Realize("SourceMap.CheckRendererSanity"); AsyncRef asyncRef = (AsyncRef)present; asyncRef.AddCallback(new AsyncRecord.CompleteCallback(this.RendererSanityCheckComplete)); new PersistentInterest(asyncRef); }
internal MapRectangle GetUserBoundingBox(MapTileSourceFactory mapTileSourceFactory) { MapRectangle mapRectangle = null; foreach (SourceMap current in this.sourceMaps) { mapRectangle = MapRectangle.Union(mapRectangle, current.GetUserBoundingBox(mapTileSourceFactory)); } return mapRectangle; }
internal void AutoSelectMaxZooms(MapTileSourceFactory mapTileSourceFactory) { foreach (SourceMap current in this.sourceMaps) { current.AutoSelectMaxZoom(mapTileSourceFactory); } }
internal bool AccumulateBoundingBox(SourceMap sourceMap, MapTileSourceFactory mapTileSourceFactory, ref MapRectangle boundingBox) { bool result; try { WarpedMapTileSource warpedMapTileSource = mapTileSourceFactory.CreateWarpedSource(sourceMap); BoundsPresent boundsPresent = (BoundsPresent)warpedMapTileSource.GetUserBounds(null, FutureFeatures.Cached).Realize("CrunchedFile.AccumulateBoundingBox"); boundsPresent.GetRenderRegion().AccumulateBoundingBox(ref boundingBox); result = true; } catch (InsufficientCorrespondencesException) { result = false; } return result; }
public InsaneSourceMapRemover(SourceMap sourceMap, MapTileSourceFactory mapTileSourceFactory, InsaneSourceMapRemover.UndoAdddSourceMapDelegate removeSourceMapDelegate) : this(sourceMap, mapTileSourceFactory, removeSourceMapDelegate, 0) { }
public void StartUpApplication() { try { D.SetDebugLevel(BuildConfig.theConfig.debugLevel); this.cachePackage = new CachePackage(); this.renderedTileCachePackage = this.cachePackage.DeriveCache("renderedTile"); this.InitializeComponent(); this.SetOptionsPanelVisibility(OptionsPanelVisibility.Nothing); this.mapTileSourceFactory = new MapTileSourceFactory(this.cachePackage); } catch (ConfigurationException) { this.UndoConstruction(); throw; } this.layerControls.SetLayerControl(this); this.RestoreWindowParameters(); this.SetInterfaceNoMashupOpen(); System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer(); timer.Interval = 10000; timer.Tick += new EventHandler(this.saveBackupTimer_Tick); timer.Start(); this.registrationControls.ShowDMS = new MapDrawingOption(this.registrationControls, this.showDMSMenuItem, false); this.smViewerControl.ShowCrosshairs = new MapDrawingOption(this.smViewerControl, this.showCrosshairsMenuItem, true); this.smViewerControl.ShowTileBoundaries = new MapDrawingOption(this.smViewerControl, this.showTileBoundariesMenuItem, true); this.smViewerControl.ShowPushPins = new MapDrawingOption(this.smViewerControl, this.showPushPinsMenuItem, true); this.smViewerControl.ShowTileNames = new MapDrawingOption(this.smViewerControl, this.showTileNamesMenuItem, false); this.smViewerControl.ShowSourceCrop = new MapDrawingOption(this.smViewerControl, this.showSourceCropToolStripMenuItem, true); this.smViewerControl.ShowDMS = new MapDrawingOption(this.smViewerControl, this.showDMSMenuItem, false); this.smViewerControl.SetLLZBoxLabelStyle(LLZBox.LabelStyle.XY); this.SetVEMapStyle(VirtualEarthWebDownloader.RoadStyle); this.veViewerControl.ShowCrosshairs = new MapDrawingOption(this.veViewerControl, this.showCrosshairsMenuItem, true); this.veViewerControl.ShowTileBoundaries = new MapDrawingOption(this.veViewerControl, this.showTileBoundariesMenuItem, false); this.veViewerControl.ShowPushPins = new MapDrawingOption(this.veViewerControl, this.showPushPinsMenuItem, true); this.veViewerControl.ShowTileNames = new MapDrawingOption(this.veViewerControl, this.showTileNamesMenuItem, false); this.veViewerControl.ShowDMS = new MapDrawingOption(this.veViewerControl, this.showDMSMenuItem, false); this.veViewerControl.configureLLZBoxEditable(); this.uiPosition = new UIPositionManager(this.smViewerControl, this.veViewerControl); this.uiPosition.GetVEPos().setPosition(this.veViewerControl.GetCoordinateSystem().GetDefaultView()); this.recordSnapViewMenuItem.Click += new EventHandler(this.recordSnapViewMenuItem_Click); this.restoreSnapViewMenuItem.Click += new EventHandler(this.restoreSnapViewMenuItem_Click); this.recordSnapZoomMenuItem.Click += new EventHandler(this.recordSnapZoomMenuItem_Click); this.restoreSnapZoomMenuItem.Click += new EventHandler(this.restoreSnapZoomMenuItem_Click); this.registrationControls.setAssociationIfc(this); this.setDisplayedRegistration(null); this.sourceMapInfoPanel.Initialize(new SourceMapInfoPanel.PreviewSourceMapZoomDelegate(this.PreviewSourceMapZoom)); BigDebugKnob.theKnob.AddListener(new BigDebugKnob.DebugKnobListener(this.debugKnobChanged)); BigDebugKnob.theKnob.debugFeaturesEnabled = false; this.enableDebugModeToolStripMenuItem.Visible = BuildConfig.theConfig.debugModeEnabled; this.debugModeToolStripSeparator.Visible = BuildConfig.theConfig.debugModeEnabled; if (this.startDocumentPath != null) { this.LoadMashup(Path.GetFullPath(this.startDocumentPath)); } else { this.NewMashup(); } if (this.renderOnLaunch) { this.currentMashup.AutoSelectMaxZooms(this.mapTileSourceFactory); this.LaunchRenderWindow(); this.renderWindow.StartRender(new RenderProgressPanel2.RenderCompleteDelegate(this.LaunchedRenderComplete)); base.Shown += new EventHandler(this.MainAppForm_Shown_BringRenderWindowToFront); } }
public MapRectangle GetUserBoundingBox(MapTileSourceFactory mapTileSourceFactory) { WarpedMapTileSource warpedMapTileSource = null; try { warpedMapTileSource = mapTileSourceFactory.CreateWarpedSource(this); } catch (InsufficientCorrespondencesException) { } if (warpedMapTileSource == null) { return null; } Present present = warpedMapTileSource.GetUserBounds(null, FutureFeatures.Cached).Realize("SourceMap.AutoSelectMaxZoom"); if (!(present is BoundsPresent)) { return null; } BoundsPresent boundsPresent = (BoundsPresent)present; MapRectangle boundingBox = boundsPresent.GetRenderRegion().GetBoundingBox(); return boundingBox.ClipTo(CoordinateSystemUtilities.GetRangeAsMapRectangle(MercatorCoordinateSystem.theInstance)); }
internal LatLonZoom GetDefaultView(Layer layer, Size assumedDisplaySize, MapTileSourceFactory mapTileSourceFactory, out bool allBoundsValid) { MapRectangle mapRectangle = null; allBoundsValid = true; foreach (SourceMap current in layer) { if (!this.AccumulateBoundingBox(current, mapTileSourceFactory, ref mapRectangle)) { allBoundsValid = false; } } LatLonZoom bestViewContaining; if (mapRectangle == null) { bestViewContaining = MercatorCoordinateSystem.theInstance.GetDefaultView(); } else { bestViewContaining = MercatorCoordinateSystem.theInstance.GetBestViewContaining(mapRectangle, assumedDisplaySize); } return CoordinateSystemUtilities.ConstrainLLZ(MercatorCoordinateSystem.theInstance, bestViewContaining); }
public LegendViewManager(Legend legend, MapTileSourceFactory mapTileSourceFactory, ViewControlIfc viewControl) { this.legend = legend; this.mapTileSourceFactory = mapTileSourceFactory; this.viewControl = viewControl; }
internal static LatLonZoom DefaultReferenceMapPosition(SourceMap sourceMap, MapTileSourceFactory mapTileSourceFactory, ViewControlIfc viewControl, DefaultReferenceView drv) { if (sourceMap.ReadyToLock()) { try { ViewerControlIfc sMViewerControl = viewControl.GetSMViewerControl(); MapRectangle bounds = sMViewerControl.GetBounds(); WarpedMapTileSource warpedMapTileSource = mapTileSourceFactory.CreateWarpedSource(sourceMap); IPointTransformer sourceToDestLatLonTransformer = warpedMapTileSource.GetSourceToDestLatLonTransformer(); MapRectangle mapRectangle = bounds.Transform(sourceToDestLatLonTransformer); mapRectangle = mapRectangle.ClipTo(new MapRectangle(-180.0, -360.0, 180.0, 360.0)); return viewControl.GetVEViewerControl().GetCoordinateSystem().GetBestViewContaining(mapRectangle, sMViewerControl.Size); } catch (CorrespondencesAreSingularException) { } catch (InsufficientCorrespondencesException) { } } if (drv != null && drv.present) { return drv.llz; } return viewControl.GetVEViewerControl().GetCoordinateSystem().GetDefaultView(); }
internal void Setup(RenderOptions renderOptions, Mashup currentMashup, MapTileSourceFactory mapTileSourceFactory, RenderProgressPanel2.LaunchRenderedBrowserDelegate LaunchRenderedBrowser, RenderState.FlushRenderedTileCachePackageDelegate flushRenderedTileCachePackage) { this.renderOptionsPanel.SetRenderOptions(renderOptions); this.renderProgressPanel.Setup(currentMashup, mapTileSourceFactory, LaunchRenderedBrowser, flushRenderedTileCachePackage); }
public CrunchedFile(Mashup mashup, RangeQueryData rangeQueryData, RenderOutputMethod renderOutput, string sourceMashupFilename, List <TileRectangle> boundsList, MapTileSourceFactory mapTileSourceFactory) { foreach (Layer current in mashup.layerList) { this.crunchedLayers.Add(new CrunchedLayer(mashup.GetRenderOptions(), current, rangeQueryData[current], mapTileSourceFactory)); } this.renderOutput = renderOutput; this.sourceMashupFilename = sourceMashupFilename; this.permitComposition = mashup.GetRenderOptions().permitComposition; this.boundsList = boundsList; }
internal void AutoSelectMaxZooms(MapTileSourceFactory mapTileSourceFactory) { this._layerList.AutoSelectMaxZooms(mapTileSourceFactory); }
internal void AutoSelectMaxZooms(MapTileSourceFactory mapTileSourceFactory) { layerList.AutoSelectMaxZooms(mapTileSourceFactory); }