From ae68b542a728267733dc815f78bb2a69a6a24749 Mon Sep 17 00:00:00 2001 From: fuzhenn Date: Fri, 9 Aug 2024 20:11:05 +0800 Subject: [PATCH] fix internal tag --- src/control/Control.Attribution.ts | 4 +- src/control/Control.Compass.ts | 12 +- src/control/Control.LayerSwitcher.ts | 12 +- src/control/Control.Overview.ts | 22 +-- src/control/Control.Panel.ts | 14 +- src/control/Control.Reset.ts | 10 +- src/control/Control.Scale.ts | 20 +-- src/control/Control.Toolbar.ts | 4 +- src/control/Control.Zoom.ts | 16 +- src/control/Control.ts | 12 +- src/core/Ajax.ts | 4 +- src/core/Animation.ts | 28 +-- src/core/Canvas.ts | 24 +-- src/core/Class.ts | 8 +- src/core/CollisionIndex.ts | 2 +- src/core/Eventable.ts | 58 +++--- src/core/JSONAble.ts | 4 +- src/core/util/path.ts | 2 +- src/core/util/style.ts | 6 +- src/core/worker/Actor.ts | 2 +- src/core/worker/WorkerPool.ts | 8 +- src/geometry/ArcCurve.ts | 4 +- src/geometry/CenterMixin.ts | 48 ++--- src/geometry/Circle.ts | 18 +- src/geometry/ConnectorLine.ts | 20 +-- src/geometry/CubicBezierCurve.ts | 6 +- src/geometry/Curve.ts | 8 +- src/geometry/Ellipse.ts | 20 +-- src/geometry/GeoJSON.ts | 10 +- src/geometry/Geometry.ts | 168 +++++++++--------- src/geometry/GeometryCollection.ts | 48 ++--- src/geometry/Label.ts | 8 +- src/geometry/LineString.ts | 4 +- src/geometry/Marker.ts | 24 +-- src/geometry/MultiGeometry.ts | 8 +- src/geometry/Path.ts | 56 +++--- src/geometry/Polygon.ts | 34 ++-- src/geometry/QuadBezierCurve.ts | 6 +- src/geometry/Rectangle.ts | 38 ++-- src/geometry/Sector.ts | 16 +- src/geometry/TextBox.ts | 12 +- src/geometry/TextMarker.ts | 18 +- src/geometry/editor/GeometryEditor.ts | 58 +++--- src/geometry/editor/TextEditable.ts | 8 +- src/geometry/ext/Geometry.Animation.ts | 8 +- src/geometry/ext/Geometry.Drag.ts | 40 ++--- src/geometry/ext/Geometry.Events.ts | 8 +- src/geometry/ext/Geometry.InfoWindow.ts | 16 +- src/handler/Drag.ts | 4 +- src/handler/Handler.ts | 2 +- src/handler/Handlerable.ts | 8 +- src/lang/translator.ts | 2 +- src/layer/CanvasLayer.ts | 2 +- src/layer/ImageLayer.ts | 18 +- src/layer/Layer.ts | 38 ++-- src/layer/OverlayLayer.ts | 52 +++--- src/layer/ParticleLayer.ts | 4 +- src/layer/VectorLayer.ts | 2 +- src/layer/tile/GroupTileLayer.ts | 14 +- src/layer/tile/TileLayer.ts | 88 ++++----- src/layer/tile/WMSTileLayer.ts | 4 +- src/layer/tile/tileinfo/TileConfig.ts | 14 +- src/map/Map.Anim.ts | 22 +-- src/map/Map.Camera.ts | 90 +++++----- src/map/Map.Collision.ts | 18 +- src/map/Map.CoordTransform.ts | 18 +- src/map/Map.DomEvents.ts | 50 +++--- src/map/Map.FullScreen.ts | 12 +- src/map/Map.Pan.ts | 12 +- src/map/Map.Topo.ts | 2 +- src/map/Map.ViewHistory.ts | 20 +-- src/map/Map.Zoom.ts | 36 ++-- src/map/Map.ts | 150 ++++++++-------- src/map/handler/Map.AutoPanAtEdge.ts | 2 +- src/map/handler/Map.BoxZoom.ts | 4 +- src/map/handler/Map.DoubleClickZoom.ts | 2 +- src/map/handler/Map.Drag.ts | 40 ++--- src/map/handler/Map.GeometryEvents.ts | 6 +- src/map/handler/Map.ScrollWheelZoom.ts | 42 ++--- src/map/handler/Map.Touch.ts | 24 +-- src/map/spatial-reference/SpatialReference.ts | 12 +- src/map/tool/AreaTool.ts | 8 +- src/map/tool/DistanceTool.ts | 46 ++--- src/map/tool/DrawTool.ts | 72 ++++---- src/map/tool/MapTool.ts | 10 +- src/renderer/edit/EditHandle.ts | 8 +- src/renderer/geometry/CollectionPainter.ts | 6 +- src/renderer/geometry/Painter.ts | 80 ++++----- src/renderer/geometry/PointRenderer.ts | 14 +- src/renderer/geometry/VectorRenderer.ts | 62 +++---- .../geometry/symbolizers/CanvasSymbolizer.ts | 6 +- .../symbolizers/DrawAltitudeSymbolizer.ts | 10 +- .../symbolizers/ImageMarkerSymbolizer.ts | 6 +- .../geometry/symbolizers/PointSymbolizer.ts | 10 +- .../symbolizers/StrokeAndFillSymbolizer.ts | 10 +- .../geometry/symbolizers/Symbolizer.ts | 4 +- .../symbolizers/TextMarkerSymbolizer.ts | 8 +- .../symbolizers/VectorMarkerSymbolizer.ts | 20 +-- .../symbolizers/VectorPathMarkerSymbolizer.ts | 6 +- src/renderer/layer/CanvasRenderer.ts | 40 ++--- src/renderer/layer/ImageGLRenderable.ts | 40 ++--- .../layer/canvaslayer/CanvasLayerRenderer.ts | 12 +- src/renderer/layer/tilelayer/QuadStencil.ts | 10 +- .../tilelayer/TileLayerCanvasRenderer.ts | 66 +++---- .../layer/tilelayer/TileLayerGLRenderer.ts | 2 +- .../vectorlayer/OverlayLayerCanvasRenderer.ts | 10 +- .../vectorlayer/VectorLayerCanvasRenderer.ts | 52 +++--- src/renderer/map/MapCanvasRenderer.ts | 94 +++++----- src/renderer/map/MapRenderer.ts | 28 +-- src/renderer/types.ts | 2 +- src/ui/InfoWindow.ts | 14 +- src/ui/Menu.ts | 6 +- src/ui/Menuable.ts | 16 +- src/ui/ToolTip.ts | 10 +- src/ui/UIComponent.ts | 74 ++++---- src/ui/UIMarker.ts | 48 ++--- tsconfig.json | 1 + 117 files changed, 1354 insertions(+), 1355 deletions(-) diff --git a/src/control/Control.Attribution.ts b/src/control/Control.Attribution.ts index c5098ff288..d59605b0eb 100644 --- a/src/control/Control.Attribution.ts +++ b/src/control/Control.Attribution.ts @@ -47,7 +47,7 @@ const layerEvents = 'addlayer removelayer setbaselayer baselayerremove'; */ class Attribution extends Control { options: AttributionOptionsType; - //@interlal + //@internal _attributionContainer: HTMLDivElement; buildOn() { @@ -66,7 +66,7 @@ class Attribution extends Control { this.getMap().off(layerEvents, this._update, this); } - //@interlal + //@internal _update() { const map = this.getMap(); if (!map) { diff --git a/src/control/Control.Compass.ts b/src/control/Control.Compass.ts index 0ecc915bd1..4fed9a9e66 100644 --- a/src/control/Control.Compass.ts +++ b/src/control/Control.Compass.ts @@ -22,9 +22,9 @@ const options = { class Compass extends Control { options: CompassOptionsType; - //@interlal + //@internal _compass: HTMLDivElement; - //@interlal + //@internal _bearing: number; /** * method to build DOM of the control @@ -47,18 +47,18 @@ class Compass extends Control { this._rotateCompass(); } - //@interlal + //@internal _getCompass() { const compass = createEl('div', 'maptalks-compass'); return compass; } - //@interlal + //@internal _registerDomEvents() { on(this._compass, 'click', this._resetView, this); } - //@interlal + //@internal _rotateCompass() { const b = this.getMap().getBearing().toFixed(1); let bearing = parseFloat(b); @@ -78,7 +78,7 @@ class Compass extends Control { delete this._bearing; } - //@interlal + //@internal _resetView() { const view = { bearing: 0 }; this.getMap().animateTo(view); diff --git a/src/control/Control.LayerSwitcher.ts b/src/control/Control.LayerSwitcher.ts index c160738d8e..40641eca78 100644 --- a/src/control/Control.LayerSwitcher.ts +++ b/src/control/Control.LayerSwitcher.ts @@ -71,7 +71,7 @@ class LayerSwitcher extends Control { } } - //@interlal + //@internal _show() { if (!hasClass(this.container, 'shown')) { addClass(this.container, 'shown'); @@ -79,14 +79,14 @@ class LayerSwitcher extends Control { } } - //@interlal + //@internal _hide(e) { if (!this.panel.contains(e.toElement || e.relatedTarget)) { setClass(this.container, this.options['containerClass']); } } - //@interlal + //@internal _createPanel() { this.panel.innerHTML = ''; const ul = createEl('ul'); @@ -94,7 +94,7 @@ class LayerSwitcher extends Control { this._renderLayers(this.getMap(), ul); } - //@interlal + //@internal _renderLayers(map: Map, elm: HTMLElement) { const base = map.getBaseLayer(), layers = map.getLayers(), @@ -203,14 +203,14 @@ class LayerSwitcher extends Control { } } - //@interlal + //@internal _isExcluded(layer: Layer) { const id = layer.getId(), excludeLayers = this.options['excludeLayers']; return !(excludeLayers.length && excludeLayers.indexOf(id) >= 0); } - //@interlal + //@internal _renderLayer(layer, isBase?: boolean, parentChecked = true) { const li = createEl('li', 'layer'), label = createEl('label'), diff --git a/src/control/Control.Overview.ts b/src/control/Control.Overview.ts index 5694a70320..428a9fea1f 100644 --- a/src/control/Control.Overview.ts +++ b/src/control/Control.Overview.ts @@ -55,9 +55,9 @@ class Overview extends Control { options: OverviewOptionsType; mapContainer: HTMLDivElement; button: HTMLDivElement; - //@interlal + //@internal _overview: Map; - //@interlal + //@internal _perspective: Polygon; /** @@ -145,7 +145,7 @@ class Overview extends Control { return this._overview; } - //@interlal + //@internal _onButtonClick() { if (!this._overview) { this.maxmize(); @@ -155,7 +155,7 @@ class Overview extends Control { this._updateButtonText(); } - //@interlal + //@internal _updateButtonText() { if (this._overview) { this.button.innerHTML = '-'; @@ -164,7 +164,7 @@ class Overview extends Control { } } - //@interlal + //@internal _createOverview() { const map = this.getMap(), dom = this.mapContainer; @@ -195,7 +195,7 @@ class Overview extends Control { this.fire('load'); } - //@interlal + //@internal _getOverviewZoom() { const map = this.getMap(), zoom = map.getZoom(), @@ -219,14 +219,14 @@ class Overview extends Control { } - //@interlal + //@internal _onDragEnd() { const center = this._perspective.getCenter(); this._overview.setCenter(center); this.getMap().panTo(center); } - //@interlal + //@internal _getPerspectiveCoords() { const map = this.getMap(); const projection = map.getProjection(); @@ -240,7 +240,7 @@ class Overview extends Control { }); } - //@interlal + //@internal _update() { if (!this._overview) { return; @@ -252,7 +252,7 @@ class Overview extends Control { this._overview.setCenterAndZoom(this.getMap().getCenter(), this._getOverviewZoom()); } - //@interlal + //@internal _updateSpatialReference() { if (!this._overview) { return; @@ -262,7 +262,7 @@ class Overview extends Control { this._overview.setSpatialReference(spatialRef); } - //@interlal + //@internal _updateBaseLayer() { if (!this._overview) { return; diff --git a/src/control/Control.Panel.ts b/src/control/Control.Panel.ts index 26bc702a0d..d3dc14320c 100644 --- a/src/control/Control.Panel.ts +++ b/src/control/Control.Panel.ts @@ -40,9 +40,9 @@ const options: PanelOptionsType = { class Panel extends Control { draggable: DragHandler; options: PanelOptionsType; - //@interlal + //@internal _startPos: Point; - //@interlal + //@internal _startPosition: DomPositionType; /** @@ -148,7 +148,7 @@ class Panel extends Control { return this.options['content']; } - //@interlal + //@internal _cancelOn(domEvent) { const target = domEvent.srcElement || domEvent.target, tagName = target.tagName.toLowerCase(); @@ -162,7 +162,7 @@ class Panel extends Control { return false; } - //@interlal + //@internal _onDragStart(param) { this._startPos = param['mousePos']; this._startPosition = extend({}, this.getPosition()); @@ -178,7 +178,7 @@ class Panel extends Control { this.fire('dragstart', param); } - //@interlal + //@internal _onDragging(param) { const pos = param['mousePos']; const offset = pos.sub(this._startPos); @@ -210,7 +210,7 @@ class Panel extends Control { this.fire('dragging', param); } - //@interlal + //@internal _onDragEnd(param) { delete this._startPos; delete this._startPosition; @@ -230,7 +230,7 @@ class Panel extends Control { * Get the connect points of panel for connector lines. * @private */ - //@interlal + //@internal _getConnectPoints() { const map = this.getMap(); const containerPoint = this.getContainerPoint(); diff --git a/src/control/Control.Reset.ts b/src/control/Control.Reset.ts index ee66f5379a..663a137b87 100644 --- a/src/control/Control.Reset.ts +++ b/src/control/Control.Reset.ts @@ -22,9 +22,9 @@ const options: ResetOptionsType = { }; class Reset extends Control { - //@interlal + //@internal _reset: HTMLDivElement; - //@interlal + //@internal _view: MapViewType; options: ResetOptionsType; /** @@ -50,13 +50,13 @@ class Reset extends Control { this._view = view; } - //@interlal + //@internal _getReset() { const reset = createEl('div', 'maptalks-reset'); return reset as HTMLDivElement; } - //@interlal + //@internal _registerDomEvents() { on(this._reset, 'click', this._resetView, this); } @@ -66,7 +66,7 @@ class Reset extends Control { delete this._view; } - //@interlal + //@internal _resetView() { this.getMap().setView(this._view); } diff --git a/src/control/Control.Scale.ts b/src/control/Control.Scale.ts index ca04fd21dc..e5b25c650e 100644 --- a/src/control/Control.Scale.ts +++ b/src/control/Control.Scale.ts @@ -38,11 +38,11 @@ const options: ScaleOptionsType = { const EVENTS_TO_LISTEN = 'zoomend moving moveend'; class Scale extends Control { - //@interlal + //@internal _scaleContainer: HTMLDivElement; - //@interlal + //@internal _mScale: HTMLDivElement; - //@interlal + //@internal _iScale: HTMLDivElement; options: ScaleOptionsType; @@ -67,7 +67,7 @@ class Scale extends Control { this.getMap().off(EVENTS_TO_LISTEN, this._update, this); } - //@interlal + //@internal _addScales() { const css = 'border: 2px solid #000000;border-top: none;line-height: 1.1;padding: 0px;' + 'color: #000000;font-size: 11px;text-align:center;white-space: nowrap;overflow: hidden' + @@ -80,14 +80,14 @@ class Scale extends Control { } } - //@interlal + //@internal _update() { const map = this._map; const maxMeters = map.pixelToDistance(this.options['maxWidth'], 0); this._updateScales(maxMeters); } - //@interlal + //@internal _updateScales(maxMeters: number) { if (this.options['metric'] && maxMeters) { this._updateMetric(maxMeters); @@ -97,7 +97,7 @@ class Scale extends Control { } } - //@interlal + //@internal _updateMetric(maxMeters: number) { const meters = this._getRoundNum(maxMeters), label = meters < 1000 ? meters + ' m' : (meters / 1000) + ' km'; @@ -105,7 +105,7 @@ class Scale extends Control { this._updateScale(this._mScale, label, meters / maxMeters); } - //@interlal + //@internal _updateImperial(maxMeters: number) { const maxFeet = maxMeters * 3.2808399; let maxMiles, miles, feet; @@ -121,13 +121,13 @@ class Scale extends Control { } } - //@interlal + //@internal _updateScale(scale: HTMLDivElement, text: string, ratio: number) { scale['style']['width'] = Math.round(this.options['maxWidth'] * ratio) + 'px'; scale['innerHTML'] = text; } - //@interlal + //@internal _getRoundNum(num: number) { const pow10 = Math.pow(10, (Math.floor(num) + '').length - 1); let d = num / pow10; diff --git a/src/control/Control.Toolbar.ts b/src/control/Control.Toolbar.ts index cdf3e44aab..7eb692dd48 100644 --- a/src/control/Control.Toolbar.ts +++ b/src/control/Control.Toolbar.ts @@ -119,7 +119,7 @@ class Toolbar extends Control { return dom; } - //@interlal + //@internal _createDropMenu(index: number) { const me = this; @@ -181,7 +181,7 @@ class Toolbar extends Control { return menuDom; } - //@interlal + //@internal _getItems() { return this.options['items'] || []; } diff --git a/src/control/Control.Zoom.ts b/src/control/Control.Zoom.ts index 20cdd4602e..a867b5aedd 100644 --- a/src/control/Control.Zoom.ts +++ b/src/control/Control.Zoom.ts @@ -35,11 +35,11 @@ const options: ZoomOptionsType = { */ class Zoom extends Control { options: ZoomOptionsType; - //@interlal + //@internal _levelDOM: HTMLSpanElement; - //@interlal + //@internal _zoomInButton: HTMLLinkElement; - //@interlal + //@internal _zoomOutButton: HTMLLinkElement; /** * method to build DOM of the control @@ -112,7 +112,7 @@ class Zoom extends Control { // } } - //@interlal + //@internal _update() { // const map = this.getMap(); // if (this._sliderBox) { @@ -128,7 +128,7 @@ class Zoom extends Control { this._updateText(); } - //@interlal + //@internal _updateText() { if (this._levelDOM) { const map = this.getMap(); @@ -140,7 +140,7 @@ class Zoom extends Control { } } - //@interlal + //@internal _registerDomEvents() { if (this._zoomInButton) { on(this._zoomInButton, 'click', this._onZoomInClick, this); @@ -159,13 +159,13 @@ class Zoom extends Control { // } } - //@interlal + //@internal _onZoomInClick(e) { preventDefault(e); this.getMap().zoomIn(); } - //@interlal + //@internal _onZoomOutClick(e) { preventDefault(e); this.getMap().zoomOut(); diff --git a/src/control/Control.ts b/src/control/Control.ts index 4421d63971..84de5be1f2 100644 --- a/src/control/Control.ts +++ b/src/control/Control.ts @@ -17,11 +17,11 @@ import Map from '../map/Map'; abstract class Control extends Eventable(Class) { - //@interlal + //@internal _map: Map; - //@interlal + //@internal __ctrlContainer: HTMLElement; - //@interlal + //@internal _controlDom: HTMLElement; options: ControlOptionsType; static positions: { [key: string]: DomPositionType }; @@ -46,7 +46,7 @@ abstract class Control extends Eventable(Class) { super(options); } - //@interlal + //@internal _appendCustomClass(dom: HTMLElement) { if (!dom) { console.warn('dom is null:', dom); @@ -248,7 +248,7 @@ abstract class Control extends Eventable(Class) { return this; } - //@interlal + //@internal _parse(position: ControlPositionType): DomPositionType { let p = position; if (isString(position)) { @@ -257,7 +257,7 @@ abstract class Control extends Eventable(Class) { return p as DomPositionType; } - //@interlal + //@internal _updatePosition() { let position = this.getPosition(); if (!position) { diff --git a/src/core/Ajax.ts b/src/core/Ajax.ts index 4e2a484eed..f3fccc9b41 100644 --- a/src/core/Ajax.ts +++ b/src/core/Ajax.ts @@ -168,7 +168,7 @@ const Ajax = { return client; }, - //@interlal + //@internal _wrapCallback: function (client, cb: Callback) { return function () { if (client.readyState === 4) { @@ -195,7 +195,7 @@ const Ajax = { }; }, - //@interlal + //@internal _getClient: function (cb: Callback) { /*eslint-disable no-empty, no-undef*/ let client; diff --git a/src/core/Animation.ts b/src/core/Animation.ts index c736051eff..73482f7cf7 100644 --- a/src/core/Animation.ts +++ b/src/core/Animation.ts @@ -115,21 +115,21 @@ class Frame { * @memberof animation */ class Player { - //@interlal + //@internal _animation: AnimationCallback options: AnimationOptionsPrivateType - //@interlal + //@internal _onFrame: (frame: Frame) => void; playState: string ready: boolean finished: boolean - target: any; + target?: any; duration: number; - //@interlal + //@internal _framer: (cb: AnimationCallback) => void; currentTime: number; startTime: number; - //@interlal + //@internal _playStartTime: number; /** @@ -138,7 +138,7 @@ class Player { * @param {Object} options - animation options * @param {Function} onFrame - callback function for animation steps */ - constructor(animation: AnimationCallback, options: object, onFrame: AnimationCallback, target: object) { + constructor(animation: AnimationCallback, options: object, onFrame: AnimationCallback, target?: object) { this._animation = animation; this.options = options; this._onFrame = onFrame; @@ -148,7 +148,7 @@ class Player { this.target = target; } - //@interlal + //@internal _prepare() { const options = this.options; let duration = options['speed'] || options['duration']; @@ -239,7 +239,7 @@ class Player { reverse() { } - //@interlal + //@internal _run() { const onFrame = this._onFrame; const t = now(); @@ -323,7 +323,7 @@ const Animation = { * @return {Object[]} styles resolved * @private */ - //@interlal + //@internal _resolveStyles(styles) { if (!styles) { return null; @@ -523,7 +523,7 @@ const Animation = { }, - //@interlal + //@internal _requestAnimFrame(fn: AnimationCallback) { if (!this._frameQueue) { this._frameQueue = []; @@ -532,14 +532,14 @@ const Animation = { this._a(); }, - //@interlal + //@internal _a() { if (!this._animationFrameId) { this._animationFrameId = requestAnimFrame(Animation._frameFn); } }, - //@interlal + //@internal _run() { if (this._frameQueue.length) { const running = this._frameQueue; @@ -562,7 +562,7 @@ const Animation = { * @param {Function} step - callback function for animation steps * @return {Player} player */ - animate(styles, options, step: AnimationCallback, target) { + animate(styles, options, step: AnimationCallback, target?: any) { if (!options) { options = {}; } @@ -571,7 +571,7 @@ const Animation = { return player; }, - //@interlal + //@internal _frameFn: () => { } }; diff --git a/src/core/Canvas.ts b/src/core/Canvas.ts index 423c402bb4..a9e90c8785 100644 --- a/src/core/Canvas.ts +++ b/src/core/Canvas.ts @@ -234,7 +234,7 @@ const Canvas = { } }, - //@interlal + //@internal _createGradient(ctx: Ctx, g, extent: Extent) { let gradient = null, places = g['places']; @@ -279,7 +279,7 @@ const Canvas = { return gradient; }, - //@interlal + //@internal _setStrokePattern(ctx: Ctx, strokePattern: string, strokeWidth: number, linePatternOffset: number, resources) { const imgUrl = extractImageUrl(strokePattern); let imageTexture; @@ -412,7 +412,7 @@ const Canvas = { return Canvas._textOnMultiRow(ctx, textDesc['rows'], style, pt, textDesc['size'], textDesc['rawSize']); }, - //@interlal + //@internal _textOnMultiRow(ctx: Ctx, texts: any[], style, point, splitTextSize: Size, textSize: Size) { const ptAlign = getAlignPoint(splitTextSize, style['textHorizontalAlignment'], style['textVerticalAlignment']), lineHeight = textSize['height'] + style['textLineSpacing'], @@ -438,7 +438,7 @@ const Canvas = { return BBOX_TEMP; }, - //@interlal + //@internal _textOnLine(ctx: Ctx, text, pt, textHaloRadius: number, textHaloFill, textHaloAlpha: number) { if (hitTesting) { textHaloAlpha = 1; @@ -498,7 +498,7 @@ const Canvas = { ctx.fillText(text, pt.x, pt.y + textOffsetY); }, - //@interlal + //@internal _stroke(ctx, strokeOpacity, x?, y?) { if (hitTesting) { strokeOpacity = 1; @@ -537,7 +537,7 @@ const Canvas = { } }, - //@interlal + //@internal _path(ctx, points, lineDashArray?, lineOpacity?, ignoreStrokePattern?) { if (!isArrayHasData(points)) { return; @@ -592,7 +592,7 @@ const Canvas = { Canvas._stroke(ctx, lineOpacity); }, - //@interlal + //@internal _multiClip(ctx, points) { if (!points || points.length === 0) return; points.forEach(pts => { @@ -730,7 +730,7 @@ const Canvas = { } }, - //@interlal + //@internal _ring(ctx, ring, lineDashArray, lineOpacity, ignorePattern?) { const isPattern = Canvas._isPattern(ctx.strokeStyle); if (!ignorePattern && isPattern && !ring[0].equals(ring[ring.length - 1])) { @@ -917,7 +917,7 @@ const Canvas = { * @param {Point} p2 point 2 * @param {Number} degree arc degree between p1 and p2 */ - //@interlal + //@internal _arcBetween(ctx: CanvasRenderingContext2D, p1: Point, p2: Point, degree: number) { //degree可能是负角度 const a = Math.abs(degree), @@ -985,7 +985,7 @@ const Canvas = { return [cx, cy]; }, - //@interlal + //@internal _lineTo(ctx: CanvasRenderingContext2D, p) { ctx.lineTo(p.x, p.y); }, @@ -1003,7 +1003,7 @@ const Canvas = { Canvas._stroke(ctx, lineOpacity); }, - //@interlal + //@internal _bezierCurveTo(ctx: CanvasRenderingContext2D, p1, p2, p3) { ctx.bezierCurveTo(p1.x, p1.y, p2.x, p2.y, p3.x, p3.y); }, @@ -1069,7 +1069,7 @@ const Canvas = { sector(ctx, pt.x, pt.y, size, startAngle, endAngle); }, - //@interlal + //@internal _isPattern(style: any) { return !isString(style) && !('addColorStop' in style); }, diff --git a/src/core/Class.ts b/src/core/Class.ts index f19059324f..8817915524 100644 --- a/src/core/Class.ts +++ b/src/core/Class.ts @@ -41,11 +41,11 @@ export type ClassOptions = Record; * @category core */ class Class { - //@interlal + //@internal _isUpdatingOptions?: boolean; - //@interlal + //@internal _initHooksCalled?: boolean; - //@interlal + //@internal _initHooks?: Function[]; options?: ClassOptions; /** @@ -193,7 +193,7 @@ class Class { } /* eslint-enable @typescript-eslint/no-unused-vars */ - //@interlal + //@internal _visitInitHooks(proto) { if (this._initHooksCalled) { return; diff --git a/src/core/CollisionIndex.ts b/src/core/CollisionIndex.ts index 22ec83a490..ddc5700511 100644 --- a/src/core/CollisionIndex.ts +++ b/src/core/CollisionIndex.ts @@ -20,7 +20,7 @@ const search: Search = { * 2.2 如果没有,如果需要的,insert到collisionIndex中 */ class CollisionIndex { - //@interlal + //@internal _tree: any constructor() { this._tree = rbush(9, ['[0]', '[1]', '[2]', '[3]']); diff --git a/src/core/Eventable.ts b/src/core/Eventable.ts index a141509b05..a8e95ec15c 100644 --- a/src/core/Eventable.ts +++ b/src/core/Eventable.ts @@ -34,12 +34,12 @@ export type HandlerFn = (result?: HandlerFnResultType) => void | boolean; export default function (Base: T) { return class EventableMixin extends Base { - //@interlal - _eventMap?: Record; - //@interlal - _eventParent?: EventableMixin; - //@interlal - _eventTarget?: any; + //@internal + _eventMap?: Record; + //@internal + _eventParent?: EventableMixin; + //@internal + _eventTarget?: any; /** * 注册事件的监听 * @@ -310,8 +310,8 @@ export default function (Base: T) { return this._fire.call(this, eventType, param); } - //@interlal - _wrapOnceHandler(evtType: string, handler: HandlerFn, context?: any) { + //@internal + _wrapOnceHandler(evtType: string, handler: HandlerFn, context?: any) { // const me = this; const key = generateWrapKey(evtType); let called = false; @@ -333,8 +333,8 @@ export default function (Base: T) { return fn; } - //@interlal - _switch(to: string, eventRecords: EventRecords, context?: any) { + //@internal + _switch(to: string, eventRecords: EventRecords, context?: any) { for (const p in eventRecords) { if (eventRecords.hasOwnProperty(p)) { this[to](p, eventRecords[p], context); @@ -343,20 +343,20 @@ export default function (Base: T) { return this; } - //@interlal - _clearListeners(eventType: string) { - if (!this._eventMap || !isString(eventType)) { - return; - } - const handlerChain = this._eventMap[eventType.toLowerCase()]; - if (!handlerChain) { - return; - } - this._eventMap[eventType] = null; - } + //@internal + // c(eventType: string) { + // if (!this._eventMap || !isString(eventType)) { + // return; + // } + // const handlerChain = this._eventMap[eventType.toLowerCase()]; + // if (!handlerChain) { + // return; + // } + // this._eventMap[eventType] = null; + // } - //@interlal - _clearAllListeners() { + //@internal + _clearAllListeners() { this._eventMap = null; } @@ -367,21 +367,21 @@ export default function (Base: T) { * Set a event parent to handle all the events * @param parent - event parent * @private + * @internal */ - //@interlal - _setEventParent(parent: EventableMixin) { + _setEventParent(parent: EventableMixin) { this._eventParent = parent; return this; } - //@interlal - _setEventTarget(target) { + //@internal + _setEventTarget(target) { this._eventTarget = target; return this; } - //@interlal - _fire(eventType: string, param: BaseEventParamsType) { + //@internal + _fire(eventType: string, param: BaseEventParamsType) { if (!this._eventMap) { return this; } diff --git a/src/core/JSONAble.ts b/src/core/JSONAble.ts index 84a50b6306..4a57204ab3 100644 --- a/src/core/JSONAble.ts +++ b/src/core/JSONAble.ts @@ -10,8 +10,8 @@ const registeredTypes:JSONTypes = {}; */ export default function (Base: Class) { return class JSONAble extends Base { - //@interlal - _jsonType?: string + //@internal + _jsonType?: string /** * 静态方法,用于将该类注册用于JSON序列化与反序列化 * diff --git a/src/core/util/path.ts b/src/core/util/path.ts index 405b3540a6..d90ca1b857 100644 --- a/src/core/util/path.ts +++ b/src/core/util/path.ts @@ -45,7 +45,7 @@ export function clipSegment(a, b, bounds, useLastCode, round, noCut) { codeOut, p, newCode; // save 2nd code to avoid calculating it on the next segment - //@interlal + //@internal _lastCode = codeB; /* eslint-disable no-constant-condition */ while (true) { diff --git a/src/core/util/style.ts b/src/core/util/style.ts index 72e31da9c3..825439b130 100644 --- a/src/core/util/style.ts +++ b/src/core/util/style.ts @@ -78,11 +78,9 @@ export function lowerSymbolOpacity(symbol: Object | Object[], ratio: number): Ob function s(_symbol, _ratio) { const op = _symbol['opacity']; if (isNil(op)) { - //@interlal - _symbol['opacity'] = _ratio; + _symbol['opacity'] = _ratio; } else { - //@interlal - _symbol['opacity'] *= _ratio; + _symbol['opacity'] *= _ratio; } } let lower; diff --git a/src/core/worker/Actor.ts b/src/core/worker/Actor.ts index 9fa3578548..31aafee543 100644 --- a/src/core/worker/Actor.ts +++ b/src/core/worker/Actor.ts @@ -58,7 +58,7 @@ const EMPTY_BUFFERS = []; }); */ class Actor { - //@interlal + //@internal _delayMessages: Message[] initializing: boolean workerKey: string diff --git a/src/core/worker/WorkerPool.ts b/src/core/worker/WorkerPool.ts index bb6283e268..9ee37a2923 100644 --- a/src/core/worker/WorkerPool.ts +++ b/src/core/worker/WorkerPool.ts @@ -8,9 +8,9 @@ const hardwareConcurrency = typeof window !== 'undefined' ? (window.navigator.ha const hardwareWorkerCount = Math.max(Math.floor(hardwareConcurrency / 2), 1); class MessageBatch { - //@interlal + //@internal _limit: number - //@interlal + //@internal _messages: Message[] buffers: ArrayBuffer[] constructor(limit = 50) { @@ -51,9 +51,9 @@ export default class WorkerPool { [key: number]: boolean } workerCount: number - //@interlal + //@internal _messages: MessageBatch[][] - //@interlal + //@internal _messageBuffers: ArrayBuffer[] workers: Worker[] constructor() { diff --git a/src/geometry/ArcCurve.ts b/src/geometry/ArcCurve.ts index b586b7cb97..36cff13ac3 100644 --- a/src/geometry/ArcCurve.ts +++ b/src/geometry/ArcCurve.ts @@ -35,7 +35,7 @@ const options: ArcCurveOptionsType = { * ).addTo(layer); */ class ArcCurve extends Curve { - //@interlal + //@internal _toJSON(options: any): any { return { 'feature': this.toGeoJSON(options), @@ -44,7 +44,7 @@ class ArcCurve extends Curve { } // paint method on canvas - //@interlal + //@internal _paintOn(ctx: CanvasRenderingContext2D, points: Array, lineOpacity: number): void { ctx.beginPath(); this._arc(ctx, points, lineOpacity); diff --git a/src/geometry/CenterMixin.ts b/src/geometry/CenterMixin.ts index a6338f5f79..47b3f1c610 100644 --- a/src/geometry/CenterMixin.ts +++ b/src/geometry/CenterMixin.ts @@ -13,20 +13,20 @@ import type { Map } from '../map'; */ export default function (Base: T) { return class extends Base { - //@interlal - _coordinates: Coordinate - //@interlal - _pcenter: Coordinate - //@interlal - _dirtyCoords: boolean + //@internal + _coordinates: Coordinate + //@internal + _pcenter: Coordinate + //@internal + _dirtyCoords: boolean getMap?(): Map - //@interlal - _getProjection?(): CommonProjectionType + //@internal + _getProjection?(): CommonProjectionType onPositionChanged?(): void - //@interlal - _verifyProjection?(): void - //@interlal - _clearCache?(): void + //@internal + _verifyProjection?(): void + //@internal + _clearCache?(): void /** * 获取几何图形的中心点 * @english @@ -62,8 +62,8 @@ export default function (Base: T) { } //Gets view point of the geometry's center - //@interlal - _getCenter2DPoint(res?: number): Point { + //@internal + _getCenter2DPoint(res?: number): Point { const map = this.getMap(); if (!map) { return null; @@ -76,8 +76,8 @@ export default function (Base: T) { return map._prjToPointAtRes(pcenter, res); } - //@interlal - _getPrjCoordinates(): Coordinate { + //@internal + _getPrjCoordinates(): Coordinate { const projection = this._getProjection(); this._verifyProjection(); if (!this._pcenter && projection) { @@ -89,15 +89,15 @@ export default function (Base: T) { } //Set center by projected coordinates - //@interlal - _setPrjCoordinates(pcenter: Coordinate): void { + //@internal + _setPrjCoordinates(pcenter: Coordinate): void { this._pcenter = pcenter; this.onPositionChanged(); } //update cached const iables if geometry is updated. - //@interlal - _updateCache(): void { + //@internal + _updateCache(): void { this._clearCache(); const projection = this._getProjection(); if (this._pcenter && projection) { @@ -105,15 +105,15 @@ export default function (Base: T) { } } - //@interlal - _clearProjection(): void { + //@internal + _clearProjection(): void { this._pcenter = null; // @ts-expect-error todo super._clearProjection(); } - //@interlal - _computeCenter(): Coordinate | null { + //@internal + _computeCenter(): Coordinate | null { return this._coordinates ? this._coordinates.copy() : null; } }; diff --git a/src/geometry/Circle.ts b/src/geometry/Circle.ts index 1fdd2ea68b..101d73408d 100644 --- a/src/geometry/Circle.ts +++ b/src/geometry/Circle.ts @@ -33,7 +33,7 @@ const options: CircleOptionsType = { * @mixes CenterMixin */ export class Circle extends CenterMixin(Polygon) { - //@interlal + //@internal _radius: number static fromJSON(json: Record): Circle { @@ -119,7 +119,7 @@ export class Circle extends CenterMixin(Polygon) { return this.show(); } - //@interlal + //@internal _containsPoint(point: Point, tolerance?: number): boolean { const map = this.getMap(); if (map.getPitch()) { @@ -132,7 +132,7 @@ export class Circle extends CenterMixin(Polygon) { return withInEllipse(point, center, se, t); } - //@interlal + //@internal _computePrjExtent(projection: CommonProjectionType): Extent { const minmax = this._getMinMax(projection); if (!minmax) { @@ -148,7 +148,7 @@ export class Circle extends CenterMixin(Polygon) { return new Extent(pcenter.add(leftx, topy), pcenter.add(rightx, bottomy)); } - //@interlal + //@internal _computeExtent(measurer: any): Extent { const minmax = this._getMinMax(measurer); if (!minmax) { @@ -157,7 +157,7 @@ export class Circle extends CenterMixin(Polygon) { return new Extent(minmax[0].x, minmax[2].y, minmax[1].x, minmax[3].y, this._getProjection()); } - //@interlal + //@internal _getMinMax(measurer: any): [Coordinate, Coordinate, Coordinate, Coordinate] { if (!measurer || !this._coordinates || isNil(this._radius)) { return null; @@ -170,7 +170,7 @@ export class Circle extends CenterMixin(Polygon) { return [p1, p2, p3, p4]; } - //@interlal + //@internal _computeGeodesicLength(): number { if (isNil(this._radius)) { return 0; @@ -178,7 +178,7 @@ export class Circle extends CenterMixin(Polygon) { return Math.PI * 2 * this._radius; } - //@interlal + //@internal _computeGeodesicArea(): number { if (isNil(this._radius)) { return 0; @@ -186,7 +186,7 @@ export class Circle extends CenterMixin(Polygon) { return Math.PI * Math.pow(this._radius, 2); } - //@interlal + //@internal _exportGeoJSONGeometry() { const coordinates = Coordinate.toNumberArrays([this.getShell()]); return { @@ -195,7 +195,7 @@ export class Circle extends CenterMixin(Polygon) { }; } - //@interlal + //@internal _toJSON(options: any) { const center = this.getCenter(); const opts = extend({}, options); diff --git a/src/geometry/ConnectorLine.ts b/src/geometry/ConnectorLine.ts index b9e9ce8a02..bfdb9bc80d 100644 --- a/src/geometry/ConnectorLine.ts +++ b/src/geometry/ConnectorLine.ts @@ -18,10 +18,10 @@ const Connectable = function (Base: T) { return class extends Base { options: ConnectableOptionsType; - //@interlal - _connSource: Geometry; - //@interlal - _connTarget: Geometry; + //@internal + _connSource: Geometry; + //@internal + _connTarget: Geometry; getMap?(): Map; getCoordinates?(): Coordinate[]; setCoordinates?(coordinates: Coordinate[]): this; @@ -98,8 +98,8 @@ const Connectable = function (Base: T) { return this; } - //@interlal - _updateCoordinates() { + //@internal + _updateCoordinates() { let map = this.getMap(); if (!map && this._connSource) { map = this._connSource.getMap(); @@ -172,8 +172,8 @@ const Connectable = function (Base: T) { } } - //@interlal - _showConnect(): void { + //@internal + _showConnect(): void { if (!this._connSource || !this._connTarget) { return; } @@ -183,8 +183,8 @@ const Connectable = function (Base: T) { } } - //@interlal - _registerEvents(): void { + //@internal + _registerEvents(): void { if (!this._connSource || !this._connTarget) { return; } diff --git a/src/geometry/CubicBezierCurve.ts b/src/geometry/CubicBezierCurve.ts index 9614f920de..5a1113cdfd 100644 --- a/src/geometry/CubicBezierCurve.ts +++ b/src/geometry/CubicBezierCurve.ts @@ -31,7 +31,7 @@ class CubicBezierCurve extends Curve { return curve; } - //@interlal + //@internal _toJSON(options: any): any { return { 'feature': this.toGeoJSON(options), @@ -40,7 +40,7 @@ class CubicBezierCurve extends Curve { } // paint method on canvas - //@interlal + //@internal _paintOn(ctx: CanvasRenderingContext2D, points: any, lineOpacity: number): void { ctx.beginPath(); ctx.moveTo(points[0].x, points[0].y); @@ -49,7 +49,7 @@ class CubicBezierCurve extends Curve { this._paintArrow(ctx, points, lineOpacity); } - //@interlal + //@internal _getArrowPoints(arrows: any[], segments: [], lineWidth: number, arrowStyle: any, tolerance: any): any { return this._getCurveArrowPoints(arrows, segments, lineWidth, arrowStyle, tolerance, 3); } diff --git a/src/geometry/Curve.ts b/src/geometry/Curve.ts index 1c07cf9203..66fbc950a8 100644 --- a/src/geometry/Curve.ts +++ b/src/geometry/Curve.ts @@ -20,7 +20,7 @@ const options: CurveOptionsType = { * @property {Boolean} [options.enableClip=false] - whether to clip curve with map's current extent */ class Curve extends LineString { - //@interlal + //@internal _arc(ctx: CanvasRenderingContext2D, points: Array, lineOpacity: number): void { let arcDegree = this.options['arcDegree']; if (arcDegree === 0) { @@ -38,7 +38,7 @@ class Curve extends LineString { } } - //@interlal + //@internal _quadraticCurve(ctx: CanvasRenderingContext2D, points: any): void { if (points.length <= 2) { Canvas2d._path(ctx, points); @@ -56,7 +56,7 @@ class Curve extends LineString { } } - //@interlal + //@internal _bezierCurve(ctx: CanvasRenderingContext2D, points: any): void { if (points.length <= 3) { Canvas2d._path(ctx, points); @@ -73,7 +73,7 @@ class Curve extends LineString { } } - //@interlal + //@internal _getCurveArrowPoints(arrows: any[], segments: [], lineWidth: number, arrowStyle: any, tolerance: any, step: number): void { const l = segments.length; let i: number; diff --git a/src/geometry/Ellipse.ts b/src/geometry/Ellipse.ts index aa43f436d4..af99330c1a 100644 --- a/src/geometry/Ellipse.ts +++ b/src/geometry/Ellipse.ts @@ -145,7 +145,7 @@ export class Ellipse extends CenterMixin(Polygon) { return this._getShell(); } - //@interlal + //@internal _getShell(): RingCoordinates { const measurer = this._getMeasurer(), center = this.getCoordinates(), @@ -201,7 +201,7 @@ export class Ellipse extends CenterMixin(Polygon) { return shell; } - //@interlal + //@internal _getPrjShell(): RingCoordinates { const shell = super._getPrjShell(); return this._rotatePrjCoordinates(shell) as RingCoordinates; @@ -221,7 +221,7 @@ export class Ellipse extends CenterMixin(Polygon) { return this.show(); } - //@interlal + //@internal _containsPoint(point: Point, tolerance?: number): boolean { const map = this.getMap(); if (map.isTransforming()) { @@ -235,7 +235,7 @@ export class Ellipse extends CenterMixin(Polygon) { return withInEllipse(point, p0, p1, t); } - //@interlal + //@internal _computePrjExtent(): Extent { if (this.isRotated()) { return this._computeRotatedPrjExtent(); @@ -244,13 +244,13 @@ export class Ellipse extends CenterMixin(Polygon) { return Circle.prototype._computePrjExtent.apply(this, arguments); } - //@interlal + //@internal _computeExtent(): any { // eslint-disable-next-line prefer-rest-params return Circle.prototype._computeExtent.apply(this, arguments); } - //@interlal + //@internal _getMinMax(measurer: any): [Coordinate, Coordinate, Coordinate, Coordinate] { if (!measurer || !this._coordinates || isNil(this.width) || isNil(this.height)) { return null; @@ -264,7 +264,7 @@ export class Ellipse extends CenterMixin(Polygon) { return [p1, p2, p3, p4]; } - //@interlal + //@internal _computeGeodesicLength(): number { if (isNil(this.width) || isNil(this.height)) { return 0; @@ -275,7 +275,7 @@ export class Ellipse extends CenterMixin(Polygon) { return 2 * Math.PI * longer / 2 - 4 * Math.abs(this.width - this.height); } - //@interlal + //@internal _computeGeodesicArea(): number { if (isNil(this.width) || isNil(this.height)) { return 0; @@ -283,7 +283,7 @@ export class Ellipse extends CenterMixin(Polygon) { return Math.PI * this.width * this.height / 4; } - //@interlal + //@internal _exportGeoJSONGeometry() { const coordinates = Coordinate.toNumberArrays([this.getShell()]); return { @@ -292,7 +292,7 @@ export class Ellipse extends CenterMixin(Polygon) { }; } - //@interlal + //@internal _toJSON(options: any) { const opts = extend({}, options); const center = this.getCenter(); diff --git a/src/geometry/GeoJSON.ts b/src/geometry/GeoJSON.ts index 852c18863f..4d3f3ffc93 100644 --- a/src/geometry/GeoJSON.ts +++ b/src/geometry/GeoJSON.ts @@ -98,7 +98,7 @@ class GeoJSONFetchActor extends Actor { super(WORKER_KEY); } - //@interlal + //@internal _sendMsg(options: any, featuresList: any, cb: any) { this.send(options, [], (error?: any, data?: any) => { if (error) { @@ -109,7 +109,7 @@ class GeoJSONFetchActor extends Actor { }, options.workerId); } - //@interlal + //@internal _fetchGeoJSON(url: any, options: any, featuresList: [] = [], cb: any): void { const opts = extend({}, options); opts.type = 'fetchdata'; @@ -117,7 +117,7 @@ class GeoJSONFetchActor extends Actor { this._sendMsg(opts, featuresList, cb); } - //@interlal + //@internal _pageFeatures(options: any, features: any, featuresList: any, cb: any): void { featuresList.push(features); if (features.length === 0) { @@ -268,7 +268,7 @@ const GeoJSON = { * @return {Geometry} * @private */ - //@interlal + //@internal _convert: function (json: any, foreachFn?: any): any { if (!json || isNil(json['type'])) { return null; @@ -330,7 +330,7 @@ const GeoJSON = { return null; }, - //@interlal + //@internal _isGeoJSON(json: any): boolean { if (!json) { return false; diff --git a/src/geometry/Geometry.ts b/src/geometry/Geometry.ts index 8a7ce3ec4b..80d3e53db3 100644 --- a/src/geometry/Geometry.ts +++ b/src/geometry/Geometry.ts @@ -93,102 +93,102 @@ const options: GeometryOptionsType = { export class Geometry extends JSONAble(Eventable(Handlerable(Class))) { options: GeometryOptionsType; type: string; - //@interlal + //@internal _layer: OverlayLayer; - //@interlal + //@internal _angle: number - //@interlal + //@internal _pivot: Coordinate - //@interlal + //@internal _id: string properties: Record; - //@interlal + //@internal _symbol: any - //@interlal + //@internal _symbolUpdated: any - //@interlal + //@internal _compiledSymbol: any - //@interlal + //@internal _symbolHash: any - //@interlal + //@internal _textDesc: any - //@interlal + //@internal _eventSymbolProperties: any - //@interlal + //@internal _sizeSymbol: any - //@interlal + //@internal _internalId: number - //@interlal + //@internal _extent: Extent - //@interlal + //@internal _fixedExtent: PointExtent - //@interlal + //@internal _extent2d: PointExtent - //@interlal + //@internal _externSymbol: any - //@interlal + //@internal _parent: Geometry | GeometryCollection - //@interlal + //@internal _silence: boolean - //@interlal + //@internal _projCode: string - //@interlal + //@internal _painter: Painter - //@interlal + //@internal _maskPainter: CollectionPainter | Painter - //@interlal + //@internal _dirtyCoords: boolean; - //@interlal + //@internal _pcenter: Coordinate - //@interlal + //@internal _coordinates: any; - //@interlal + //@internal _infoWinOptions: InfoWindowOptionsType; - //@interlal + //@internal _minAlt: number - //@interlal + //@internal _maxAlt: number; // 在 VectorLayerCanvasRenderer 附加的信息 - //@interlal + //@internal _isCheck?: boolean; - //@interlal + //@internal _cPoint?: any; - //@interlal + //@internal _inCurrentView?: boolean; // 在 Marker 中附加的信息,Marker 和其子类都具有此属性 isPoint?: boolean; - //@interlal + //@internal _savedVisible?: boolean; // - //@interlal + //@internal _paintAsPath?: () => any; - //@interlal + //@internal _getPaintParams?: (disableSimplify?: boolean) => any[]; - //@interlal + //@internal _simplified?: boolean; - //@interlal + //@internal _dirtyRotate?: boolean; // 本身应该存于 Path 类,但是由于渲染层需要大量的特殊熟悉判断,定义在这里回减少很多麻烦 getHoles?(): Array>; - //@interlal + //@internal __connectors: Array; getShell?(): Array; getGeometries?(): Geometry[]; getCoordinates?(): Coordinate | Array | Array> | Array>> setCoordinates?(coordinate: any): this; - //@interlal + //@internal _computeCenter?(T: any): Coordinate; - //@interlal + //@internal _computeExtent?(T: any): Extent; onRemove?(): void; - //@interlal + //@internal _computeGeodesicLength?(T: any): number; - //@interlal + //@internal _computeGeodesicArea?(T: any): number; getRotateOffsetAngle?(): number; - //@interlal + //@internal _computePrjExtent?(T: null | ProjectionType): Extent; - //@interlal + //@internal _updateCache?(): void; onAdd?(): void; @@ -627,7 +627,7 @@ export class Geometry extends JSONAble(Eventable(Handlerable(Class))) { return extent; } - //@interlal + //@internal _getFixedExtent(): PointExtent { // only for LineString and Polygon, Marker's will be overrided if (!this._fixedExtent) { @@ -702,7 +702,7 @@ export class Geometry extends JSONAble(Eventable(Handlerable(Class))) { // return this._containsPoint(this.getMap()._containerPointToPoint(new Point(containerPoint)), t); } - //@interlal + //@internal _containsPoint(containerPoint: Point, t?: number): boolean { const painter = this._getPainter(); if (!painter) { @@ -1224,7 +1224,7 @@ export class Geometry extends JSONAble(Eventable(Handlerable(Class))) { return this; } - //@interlal + //@internal _rotatePrjCoordinates(coordinates: Coordinate | Array): Coordinate | Coordinate[] { if (!coordinates || this._angle === 0 || !this._pivot) { return coordinates; @@ -1291,13 +1291,13 @@ export class Geometry extends JSONAble(Eventable(Handlerable(Class))) { * @return {Coordinate[]} connect points * @private */ - //@interlal + //@internal _getConnectPoints(): Coordinate[] { return [this.getCenter()]; } //options initializing - //@interlal + //@internal _initOptions(options: GeometryOptionsType): void { const opts = extend({}, options); const symbol = opts['symbol']; @@ -1319,7 +1319,7 @@ export class Geometry extends JSONAble(Eventable(Handlerable(Class))) { } //bind the geometry to a layer - //@interlal + //@internal _bindLayer(layer: OverlayLayer): void { if (layer === this.getLayer()) { return; @@ -1336,7 +1336,7 @@ export class Geometry extends JSONAble(Eventable(Handlerable(Class))) { // this.callInitHooks(); } - //@interlal + //@internal _prepareSymbol(symbol: any): any { if (Array.isArray(symbol)) { const cookedSymbols = []; @@ -1351,7 +1351,7 @@ export class Geometry extends JSONAble(Eventable(Handlerable(Class))) { return null; } - //@interlal + //@internal _checkAndCopySymbol(symbol: any): any { const s = {}; for (const i in symbol) { @@ -1364,7 +1364,7 @@ export class Geometry extends JSONAble(Eventable(Handlerable(Class))) { return s; } - //@interlal + //@internal _getSymbol(): any { return this._symbol; } @@ -1376,7 +1376,7 @@ export class Geometry extends JSONAble(Eventable(Handlerable(Class))) { * @private * @param {Object} symbol - external symbol */ - //@interlal + //@internal _setExternSymbol(symbol: any): this { this._eventSymbolProperties = symbol; if (!this._symbol) { @@ -1387,7 +1387,7 @@ export class Geometry extends JSONAble(Eventable(Handlerable(Class))) { return this; } - //@interlal + //@internal _getInternalSymbol(): any { if (this._symbol) { return this._symbol; @@ -1399,7 +1399,7 @@ export class Geometry extends JSONAble(Eventable(Handlerable(Class))) { return null; } - //@interlal + //@internal _getPrjExtent(): Extent { const p = this._getProjection(); this._verifyProjection(); @@ -1409,7 +1409,7 @@ export class Geometry extends JSONAble(Eventable(Handlerable(Class))) { return this._extent; } - //@interlal + //@internal _unbind(): void { const layer = this.getLayer(); if (!layer) { @@ -1440,18 +1440,18 @@ export class Geometry extends JSONAble(Eventable(Handlerable(Class))) { delete this._extent; } - //@interlal + //@internal _getInternalId(): number { return this._internalId; } //只能被图层调用 - //@interlal + //@internal _setInternalId(id: number): void { this._internalId = id; } - //@interlal + //@internal _getMeasurer(): any { if (this._getProjection()) { return this._getProjection(); @@ -1459,7 +1459,7 @@ export class Geometry extends JSONAble(Eventable(Handlerable(Class))) { return SpatialReference.getProjectionInstance(this.options['defaultProjection']); } - //@interlal + //@internal _getProjection(): WithNull { const map = this.getMap(); if (map) { @@ -1468,7 +1468,7 @@ export class Geometry extends JSONAble(Eventable(Handlerable(Class))) { return null; } - //@interlal + //@internal _verifyProjection(): void { const projection = this._getProjection(); if (this._projCode && projection && this._projCode !== projection.code) { @@ -1478,13 +1478,13 @@ export class Geometry extends JSONAble(Eventable(Handlerable(Class))) { } //获取geometry样式中依赖的外部图片资源 - //@interlal + //@internal _getExternalResources(): string[] { const symbol = this._getInternalSymbol(); return getExternalResources(symbol); } - //@interlal + //@internal _getPainter(): any { //for performance if (this._painter) { @@ -1513,7 +1513,7 @@ export class Geometry extends JSONAble(Eventable(Handlerable(Class))) { return this._painter; } - //@interlal + //@internal _getMaskPainter(): CollectionPainter | Painter { if (this._maskPainter) { return this._maskPainter; @@ -1522,7 +1522,7 @@ export class Geometry extends JSONAble(Eventable(Handlerable(Class))) { return this._maskPainter; } - //@interlal + //@internal _removePainter(): void { if (this._painter) { this._painter.remove(); @@ -1530,7 +1530,7 @@ export class Geometry extends JSONAble(Eventable(Handlerable(Class))) { delete this._painter; } - //@interlal + //@internal _paint(extent?: Extent): void { if (!this.symbolIsVisible()) { return; @@ -1552,20 +1552,20 @@ export class Geometry extends JSONAble(Eventable(Handlerable(Class))) { } } - //@interlal + //@internal _clearCache(): void { delete this._extent; delete this._extent2d; this._clearAltitudeCache(); } - //@interlal + //@internal _clearProjection(): void { delete this._extent; delete this._extent2d; } - //@interlal + //@internal _repaint(): void { if (this._painter) { this._painter.repaint(); @@ -1630,7 +1630,7 @@ export class Geometry extends JSONAble(Eventable(Handlerable(Class))) { this._fireEvent('symbolchange', e); } - //@interlal + //@internal _genSizeSymbol(): void { const symbol = this._getInternalSymbol(); if (!symbol) { @@ -1652,7 +1652,7 @@ export class Geometry extends JSONAble(Eventable(Handlerable(Class))) { } } - //@interlal + //@internal _getSizeSymbol(symbol: any): any { const symbolSize = loadGeoSymbol({ lineWidth: symbol['lineWidth'], @@ -1665,7 +1665,7 @@ export class Geometry extends JSONAble(Eventable(Handlerable(Class))) { return symbolSize; } - //@interlal + //@internal _getCompiledSymbol(): any { if (this._compiledSymbol) { return this._compiledSymbol; @@ -1705,19 +1705,19 @@ export class Geometry extends JSONAble(Eventable(Handlerable(Class))) { * @param {GeometryCollection} geometry - parent geometry * @private */ - //@interlal + //@internal _setParent(geometry?: Geometry | GeometryCollection): void { if (geometry) { this._parent = geometry; } } - //@interlal + //@internal _getParent(): any { return this._parent; } - //@interlal + //@internal _fireEvent(eventName: string, param?: BaseEventParamsType) { if (this._silence) { return; @@ -1733,14 +1733,14 @@ export class Geometry extends JSONAble(Eventable(Handlerable(Class))) { this.fire(eventName, param); } - //@interlal + //@internal _toJSON(options?: any): any { return { 'feature': this.toGeoJSON(options) }; } - //@interlal + //@internal _recordVisible() { let visible = this.options.visible; if (isNil(visible)) { @@ -1750,12 +1750,12 @@ export class Geometry extends JSONAble(Eventable(Handlerable(Class))) { } - //@interlal + //@internal _recoveryVisible() { delete this._savedVisible; } - //@interlal + //@internal _exportGraphicOptions(options: any): any { const json = {}; if (isNil(options['options']) || options['options']) { @@ -1775,7 +1775,7 @@ export class Geometry extends JSONAble(Eventable(Handlerable(Class))) { return json; } - //@interlal + //@internal _exportGeoJSONGeometry(): any { const points: any = this.getCoordinates(); const coordinates = Coordinate.toNumberArrays(points); @@ -1785,7 +1785,7 @@ export class Geometry extends JSONAble(Eventable(Handlerable(Class))) { }; } - //@interlal + //@internal _exportProperties(): any { let properties = null; const geoProperties = this.getProperties(); @@ -1799,7 +1799,7 @@ export class Geometry extends JSONAble(Eventable(Handlerable(Class))) { return properties; } - //@interlal + //@internal _hitTestTolerance(): number { return 0; } @@ -1808,7 +1808,7 @@ export class Geometry extends JSONAble(Eventable(Handlerable(Class))) { //------------- altitude + layer.altitude ------------- //this is for vectorlayer //内部方法 for render,返回的值受layer和layer.options.enableAltitude,layer.options.altitude影响 - //@interlal + //@internal _getAltitude(): number | number[] | number[][] { const layer = this.getLayer(); if (!layer) { @@ -1900,7 +1900,7 @@ export class Geometry extends JSONAble(Eventable(Handlerable(Class))) { return this; } - //@interlal + //@internal _genMinMaxAlt(): void { if (this._minAlt === undefined || this._maxAlt === undefined) { const altitude = this._getAltitude(); @@ -1921,7 +1921,7 @@ export class Geometry extends JSONAble(Eventable(Handlerable(Class))) { } //clear alt cache - //@interlal + //@internal _clearAltitudeCache(): Geometry { this._minAlt = undefined; this._maxAlt = undefined; diff --git a/src/geometry/GeometryCollection.ts b/src/geometry/GeometryCollection.ts index bab7c1447b..df718b422c 100644 --- a/src/geometry/GeometryCollection.ts +++ b/src/geometry/GeometryCollection.ts @@ -29,15 +29,15 @@ const TEMP_EXTENT = new PointExtent(); */ class GeometryCollection extends Geometry { - //@interlal + //@internal _geometries: Geometry[] - //@interlal + //@internal _pickGeometryIndex: number - //@interlal + //@internal _originalSymbol: any - //@interlal + //@internal _draggbleBeforeEdit: any - //@interlal + //@internal _editing: boolean /** @@ -282,7 +282,7 @@ class GeometryCollection extends Geometry { return this; } - //@interlal + //@internal _setExternSymbol(symbol: any): this { symbol = this._prepareSymbol(symbol); this._externSymbol = symbol; @@ -300,14 +300,14 @@ class GeometryCollection extends Geometry { * @param {Layer} layer * @private */ - //@interlal + //@internal _bindLayer(): void { // eslint-disable-next-line prefer-rest-params super._bindLayer.apply(this, arguments); this._bindGeometriesToLayer(); } - //@interlal + //@internal _bindGeometriesToLayer() { const layer = this.getLayer(); this.forEach(function (geometry) { @@ -322,7 +322,7 @@ class GeometryCollection extends Geometry { * @param {Geometry[]} geometries - geometries to check * @private */ - //@interlal + //@internal _checkGeometries(geometries: Geometry[]): Geometry[] { const invalidGeoError = 'The geometry added to collection is invalid.'; geometries = Array.isArray(geometries) ? geometries : [geometries]; @@ -347,12 +347,12 @@ class GeometryCollection extends Geometry { return filterGeometries; } - //@interlal + //@internal _checkGeo(geo: Geometry): boolean { return (geo instanceof Geometry); } - //@interlal + //@internal _updateCache(): void { this._clearCache(); if (this.isEmpty()) { @@ -365,7 +365,7 @@ class GeometryCollection extends Geometry { }); } - //@interlal + //@internal _removePainter(): void { if (this._painter) { this._painter.remove(); @@ -376,7 +376,7 @@ class GeometryCollection extends Geometry { }); } - //@interlal + //@internal _computeCenter(projection: null | ProjectionCommon): Coordinate { if (!projection || this.isEmpty()) { return null; @@ -402,7 +402,7 @@ class GeometryCollection extends Geometry { return new Coordinate(sumX / counter, sumY / counter); } - //@interlal + //@internal _containsPoint(point: Point, t?: number): boolean { if (this.isEmpty()) { return false; @@ -419,7 +419,7 @@ class GeometryCollection extends Geometry { } // fix #2177 GeometryCollection hitTolerance always is 0 - //@interlal + //@internal _hitTestTolerance(): number { const geometries = this.getGeometries(); let hitTolerance = 0; @@ -430,17 +430,17 @@ class GeometryCollection extends Geometry { return hitTolerance; } - //@interlal + //@internal _computeExtent(projection: null | ProjectionCommon): Extent { return computeExtent.call(this, projection, '_computeExtent'); } - //@interlal + //@internal _computePrjExtent(projection: null | ProjectionCommon): Extent { return computeExtent.call(this, projection, '_computePrjExtent'); } - //@interlal + //@internal _computeGeodesicLength(projection: null | ProjectionCommon): number { if (!projection || this.isEmpty()) { return 0; @@ -456,7 +456,7 @@ class GeometryCollection extends Geometry { return result; } - //@interlal + //@internal _computeGeodesicArea(projection: null | ProjectionCommon): number { if (!projection || this.isEmpty()) { return 0; @@ -473,7 +473,7 @@ class GeometryCollection extends Geometry { } //for toGeoJSON - //@interlal + //@internal _exportGeoJSONGeometry() { const children = []; if (!this.isEmpty()) { @@ -491,7 +491,7 @@ class GeometryCollection extends Geometry { }; } //for toJSON - //@interlal + //@internal _toJSON(options?: any) { //fix call from feature-filter package options = extend({}, options); @@ -524,7 +524,7 @@ class GeometryCollection extends Geometry { return options; } - //@interlal + //@internal _clearProjection() { if (this.isEmpty()) { return; @@ -546,7 +546,7 @@ class GeometryCollection extends Geometry { * @private * @return {Coordinate[]} */ - //@interlal + //@internal _getConnectPoints(): Coordinate[] { const extent = this.getExtent(); const anchors = [ @@ -558,7 +558,7 @@ class GeometryCollection extends Geometry { return anchors; } - //@interlal + //@internal _getExternalResources(): any { if (this.isEmpty()) { return []; diff --git a/src/geometry/Label.ts b/src/geometry/Label.ts index e801ff0ac8..d45cac3e9f 100644 --- a/src/geometry/Label.ts +++ b/src/geometry/Label.ts @@ -146,12 +146,12 @@ class Label extends TextMarker { return label; } - //@interlal + //@internal _canEdit(): boolean { return false; } - //@interlal + //@internal _toJSON(options: any) { return { 'feature': this.toGeoJSON(options), @@ -160,7 +160,7 @@ class Label extends TextMarker { }; } - //@interlal + //@internal _refresh(): void { const symbol = extend({}, this.getTextSymbol(), @@ -209,7 +209,7 @@ class Label extends TextMarker { delete this._refreshing; } - //@interlal + //@internal _getBoxSize(symbol: any): any { if (!symbol['markerType']) { symbol['markerType'] = 'square'; diff --git a/src/geometry/LineString.ts b/src/geometry/LineString.ts index 721bb4736f..08344dc15c 100644 --- a/src/geometry/LineString.ts +++ b/src/geometry/LineString.ts @@ -98,12 +98,12 @@ export class LineString extends Path { return this._getCenterInExtent(extent, this.getCoordinates(), clipLine); } - //@interlal + //@internal _computeGeodesicLength(measurer: any): number { return measurer.measureLength(this.getCoordinates()); } - //@interlal + //@internal _computeGeodesicArea(): number { return 0; } diff --git a/src/geometry/Marker.ts b/src/geometry/Marker.ts index 5d79aef750..9fe8f98840 100644 --- a/src/geometry/Marker.ts +++ b/src/geometry/Marker.ts @@ -92,7 +92,7 @@ export class Marker extends CenterMixin(Geometry) { return super.setSymbol.call(this, symbol); } - //@interlal + //@internal _getSizeSymbol(symbol: any): any { const s = {}; let dynamic = false; @@ -130,7 +130,7 @@ export class Marker extends CenterMixin(Geometry) { return sizeSymbol; } - //@interlal + //@internal _setExternSymbol(symbol: any) { if (!this._symbol) { delete this._fixedExtent; @@ -138,12 +138,12 @@ export class Marker extends CenterMixin(Geometry) { return super._setExternSymbol(symbol); } - //@interlal + //@internal _isDynamicSize(): boolean { return this._sizeSymbol && this._sizeSymbol._dynamic; } - //@interlal + //@internal _getFixedExtent(): PointExtent { if (this._fixedExtent && !this._isDynamicSize()) { return this._fixedExtent; @@ -171,7 +171,7 @@ export class Marker extends CenterMixin(Geometry) { return this._fixedExtent; } - //@interlal + //@internal _isVectorMarker(): boolean { const symbol = this._getInternalSymbol(); if (Array.isArray(symbol)) { @@ -187,7 +187,7 @@ export class Marker extends CenterMixin(Geometry) { * @return {Boolean} * @private */ - //@interlal + //@internal _canEdit(): boolean { const symbol = this._getInternalSymbol(); if (Array.isArray(symbol)) { @@ -196,7 +196,7 @@ export class Marker extends CenterMixin(Geometry) { return isVectorSymbol(symbol) || isPathSymbol(symbol) || isImageSymbol(symbol); } - //@interlal + //@internal _containsPoint(point: Point, t?: number): boolean { let extent = this.getContainerExtent(); if (t) { @@ -213,27 +213,27 @@ export class Marker extends CenterMixin(Geometry) { } } - //@interlal + //@internal _computeExtent(): Extent { return computeExtent.call(this, 'getCenter'); } - //@interlal + //@internal _computePrjExtent(): Extent { return computeExtent.call(this, '_getPrjCoordinates'); } - //@interlal + //@internal _computeGeodesicLength(): number { return 0; } - //@interlal + //@internal _computeGeodesicArea(): number { return 0; } - //@interlal + //@internal _getSprite(resources: any, canvasClass: any) { if (this._getPainter()) { return this._getPainter().getSprite(resources, canvasClass); diff --git a/src/geometry/MultiGeometry.ts b/src/geometry/MultiGeometry.ts index 437b9ba8ef..96520482de 100644 --- a/src/geometry/MultiGeometry.ts +++ b/src/geometry/MultiGeometry.ts @@ -74,7 +74,7 @@ class MultiGeometry extends GeometryCollection { return this; } - //@interlal + //@internal _initData(data: MultiGeometryData): void { data = data || []; if (data.length) { @@ -86,14 +86,14 @@ class MultiGeometry extends GeometryCollection { } } - //@interlal + //@internal _checkGeo(geo: Geometry): boolean { return (geo instanceof this.GeometryType); } //override _exportGeoJSONGeometry in GeometryCollection // @ts-expect-error 确实需要重写父类的属性 - //@interlal + //@internal _exportGeoJSONGeometry() { const points = this.getCoordinates(); const coordinates = Coordinate.toNumberArrays(points as MultiPathsCoordinates); @@ -103,7 +103,7 @@ class MultiGeometry extends GeometryCollection { }; } - //@interlal + //@internal _toJSON(options: any) { return { 'feature': this.toGeoJSON(options) diff --git a/src/geometry/Path.ts b/src/geometry/Path.ts index 3b2a45a1dd..53a9238af9 100644 --- a/src/geometry/Path.ts +++ b/src/geometry/Path.ts @@ -50,30 +50,30 @@ export type MultiPathsCoordinates = Array; */ export class Path extends Geometry { - //@interlal + //@internal _coordinates: Coordinate[]; - //@interlal + //@internal _showPlayer: Player; - //@interlal + //@internal _animIdx: number - //@interlal + //@internal _animLenSoFar: number - //@interlal + //@internal _animTailRatio: number - //@interlal + //@internal _prjAniShowCenter: Coordinate - //@interlal + //@internal _aniShowCenter: Coordinate - //@interlal + //@internal _tempCoord: Coordinate - //@interlal + //@internal _tempPrjCoord: Point - //@interlal + //@internal _simplified: boolean - //@interlal + //@internal _prjCoords: Array hasHoles?(): boolean; - //@interlal + //@internal _getPrjHoles?(): Array>; /** @@ -174,7 +174,7 @@ export class Path extends Geometry { return player; } - //@interlal + //@internal _drawAnimShowFrame(t: number, duration: number, length: number, coordinates: Coordinate[], prjCoords: Array): Coordinate { if (t === 0) { return coordinates[0]; @@ -246,7 +246,7 @@ export class Path extends Geometry { return targetCoord; } - //@interlal + //@internal _getCenterInExtent(extent: Extent, coordinates: Coordinate[], clipFn: any): Coordinate { const meExtent = this.getExtent(); if (!extent.intersects(meExtent)) { @@ -292,7 +292,7 @@ export class Path extends Geometry { * @returns {Point[]} * @private */ - //@interlal + //@internal _getPath2DPoints(prjCoords: PathCoordinates | PathsCoordinates, disableSimplify: boolean, res?: number): Point | Array | Array> { if (!isArrayHasData(prjCoords)) { return []; @@ -331,20 +331,20 @@ export class Path extends Geometry { // return forEachCoord(prjCoords, c => map._prjToPoint(c, zoom)); } - //@interlal + //@internal _shouldSimplify(): boolean { const layer = this.getLayer(); const hasAltitude = layer.options['enableAltitude']; return layer && layer.options['enableSimplify'] && !hasAltitude && this.options['enableSimplify'] && !this._showPlayer/* && !this.options['smoothness'] */; } - //@interlal + //@internal _setPrjCoordinates(prjPoints: PathCoordinates): void { this._prjCoords = prjPoints; this.onShapeChanged(); } - //@interlal + //@internal _getPrjCoordinates(): PathCoordinates { this._verifyProjection(); if (!this._prjCoords && this._getProjection()) { @@ -354,7 +354,7 @@ export class Path extends Geometry { } //update cached variables if geometry is updated. - //@interlal + //@internal _updateCache(): void { this._clearCache(); const projection = this._getProjection(); @@ -366,13 +366,13 @@ export class Path extends Geometry { } } - //@interlal + //@internal _clearProjection(): void { this._prjCoords = null; super._clearProjection(); } - //@interlal + //@internal _projectCoords(points: PathCoordinates | PathsCoordinates): PathCoordinates | PathsCoordinates { const projection = this._getProjection(); if (projection) { @@ -381,7 +381,7 @@ export class Path extends Geometry { return []; } - //@interlal + //@internal _unprojectCoords(prjPoints: PathCoordinates | PathsCoordinates): PathCoordinates | PathsCoordinates { const projection = this._getProjection(); if (projection) { @@ -390,7 +390,7 @@ export class Path extends Geometry { return []; } - //@interlal + //@internal _computeCenter(): null | Coordinate { const ring = this._coordinates; if (!isArrayHasData(ring)) { @@ -412,7 +412,7 @@ export class Path extends Geometry { return new Coordinate(sumx / counter, sumy / counter); } - //@interlal + //@internal _computeExtent(_?: any): Extent { const shell = this._coordinates; if (!isArrayHasData(shell)) { @@ -425,7 +425,7 @@ export class Path extends Geometry { return this._coords2Extent(rings, this._getProjection()); } - //@interlal + //@internal _computePrjExtent(_?: any): Extent { const coords = [this._getPrjCoordinates()]; if (this.hasHoles && this.hasHoles()) { @@ -434,7 +434,7 @@ export class Path extends Geometry { return this._coords2Extent(coords); } - //@interlal + //@internal _get2DLength(): number { const vertexes = this._getPath2DPoints(this._getPrjCoordinates(), true) as Point[]; let len = 0; @@ -444,7 +444,7 @@ export class Path extends Geometry { return len; } - //@interlal + //@internal _hitTestTolerance(): number { const symbol = this._getInternalSymbol(); let w; @@ -463,7 +463,7 @@ export class Path extends Geometry { return super._hitTestTolerance() + (isNumber(w) ? w / 2 : 1.5); } - //@interlal + //@internal _coords2Extent(coords: PathsCoordinates, proj?: CommonProjectionType): Extent { // linestring, polygon if (!coords || coords.length === 0 || (Array.isArray(coords[0]) && coords[0].length === 0)) { diff --git a/src/geometry/Polygon.ts b/src/geometry/Polygon.ts index f9bb4fb576..794a9c4fc4 100644 --- a/src/geometry/Polygon.ts +++ b/src/geometry/Polygon.ts @@ -35,13 +35,13 @@ export type RingsCoordinates = PathsCoordinates; export class Polygon extends Path { - //@interlal + //@internal _holes: RingsCoordinates; - //@interlal + //@internal _prjHoles: RingsCoordinates; - //@interlal + //@internal _prjShell: RingCoordinates; - //@interlal + //@internal _getShell?(): RingCoordinates; /** * @param {Number[][]|Number[][][]|Coordinate[]|Coordinate[][]} coordinates - coordinates, shell coordinates or all the rings. @@ -175,7 +175,7 @@ export class Polygon extends Path { return this.getHoles().length > 0; } - //@interlal + //@internal _projectRings(): void { if (!this.getMap()) { this.onShapeChanged(); @@ -186,13 +186,13 @@ export class Polygon extends Path { this.onShapeChanged(); } - //@interlal + //@internal _setPrjCoordinates(prjCoords: RingCoordinates): void { this._prjCoords = prjCoords; this.onShapeChanged(); } - //@interlal + //@internal _cleanRing(ring: RingCoordinates) { for (let i = ring.length - 1; i >= 0; i--) { if (!ring[i]) { @@ -209,7 +209,7 @@ export class Polygon extends Path { * @return {Boolean} is ring a closed one * @private */ - //@interlal + //@internal _checkRing(ring: RingCoordinates): boolean { this._cleanRing(ring); if (!ring || !isArrayHasData(ring)) { @@ -229,7 +229,7 @@ export class Polygon extends Path { * If the first coordinate is equal with the last one, then remove the last coordinates. * @private */ - //@interlal + //@internal _trimRing(ring: RingCoordinates): RingCoordinates { const isClose = this._checkRing(ring); if (isArrayHasData(ring) && isClose) { @@ -244,7 +244,7 @@ export class Polygon extends Path { * If the first coordinate is different with the last one, then copy the first coordinates and add to the ring. * @private */ - //@interlal + //@internal _copyAndCloseRing(ring: RingCoordinates): RingCoordinates { ring = ring.slice(0); const isClose = this._checkRing(ring); @@ -256,7 +256,7 @@ export class Polygon extends Path { } } - //@interlal + //@internal _getPrjShell(): RingCoordinates { if (this.getJSONType() === JSON_TYPE) { return this._getPrjCoordinates(); @@ -269,7 +269,7 @@ export class Polygon extends Path { return this._prjShell; } - //@interlal + //@internal _getPrjHoles(): RingsCoordinates { const projection = this._getProjection(); this._verifyProjection(); @@ -279,7 +279,7 @@ export class Polygon extends Path { return this._prjHoles; } - //@interlal + //@internal _computeGeodesicLength(measurer: any): number { const rings = this.getCoordinates(); if (!isArrayHasData(rings)) { @@ -292,7 +292,7 @@ export class Polygon extends Path { return result; } - //@interlal + //@internal _computeGeodesicArea(measurer: any): number { const rings = this.getCoordinates(); if (!isArrayHasData(rings)) { @@ -307,7 +307,7 @@ export class Polygon extends Path { return result; } - //@interlal + //@internal _updateCache(): void { super._updateCache(); if (this._prjHoles) { @@ -315,13 +315,13 @@ export class Polygon extends Path { } } - //@interlal + //@internal _clearCache(): any { delete this._prjShell; return super._clearCache(); } - //@interlal + //@internal _clearProjection(): void { if (this._prjHoles) { this._prjHoles = null; diff --git a/src/geometry/QuadBezierCurve.ts b/src/geometry/QuadBezierCurve.ts index 1ded540b98..72c2cd946b 100644 --- a/src/geometry/QuadBezierCurve.ts +++ b/src/geometry/QuadBezierCurve.ts @@ -29,7 +29,7 @@ class QuadBezierCurve extends Curve { return curve; } - //@interlal + //@internal _toJSON(options: any): any { return { 'feature': this.toGeoJSON(options), @@ -38,7 +38,7 @@ class QuadBezierCurve extends Curve { } // paint method on canvas - //@interlal + //@internal _paintOn(ctx: CanvasRenderingContext2D, points: any, lineOpacity: number) { ctx.beginPath(); ctx.moveTo(points[0].x, points[0].y); @@ -48,7 +48,7 @@ class QuadBezierCurve extends Curve { this._paintArrow(ctx, points, lineOpacity); } - //@interlal + //@internal _getArrowPoints(arrows: any[], segments: [], lineWidth: number, arrowStyle: any, tolerance: any) { return this._getCurveArrowPoints(arrows, segments, lineWidth, arrowStyle, tolerance, 2); } diff --git a/src/geometry/Rectangle.ts b/src/geometry/Rectangle.ts index 4a96796ffd..db24d7481f 100644 --- a/src/geometry/Rectangle.ts +++ b/src/geometry/Rectangle.ts @@ -17,13 +17,13 @@ import Polygon, { PolygonOptionsType, RingCoordinates, RingsCoordinates } from ' */ export class Rectangle extends Polygon { // @ts-expect-error 确实需要重写父类的属性 - //@interlal + //@internal _coordinates: Coordinate; - //@interlal + //@internal _width: number - //@interlal + //@internal _height: number - //@interlal + //@internal _pnw: any static fromJSON(json): Rectangle { @@ -126,7 +126,7 @@ export class Rectangle extends Polygon { return this._getShell(); } - //@interlal + //@internal _getShell(): RingCoordinates { const measurer = this._getMeasurer(); const nw = this._coordinates; @@ -170,7 +170,7 @@ export class Rectangle extends Polygon { } // @ts-expect-error 确实需要重写父类的属性 - //@interlal + //@internal _getPrjCoordinates(): Coordinate { const projection = this._getProjection(); this._verifyProjection(); @@ -182,13 +182,13 @@ export class Rectangle extends Polygon { return this._pnw; } - //@interlal + //@internal _setPrjCoordinates(pnw) { this._pnw = pnw; this.onPositionChanged(); } - //@interlal + //@internal _getPrjShell(): RingCoordinates { const shell = super._getPrjShell(); const projection = this._getProjection(); @@ -217,7 +217,7 @@ export class Rectangle extends Polygon { } //update cached variables if geometry is updated. - //@interlal + //@internal _updateCache() { this._clearCache(); const projection = this._getProjection(); @@ -226,18 +226,18 @@ export class Rectangle extends Polygon { } } - //@interlal + //@internal _clearProjection() { this._pnw = null; super._clearProjection(); } - //@interlal + //@internal _computeCenter(measurer?: any): Coordinate { return measurer.locate(this._coordinates, this._width / 2, -this._height / 2); } - //@interlal + //@internal _containsPoint(point: Point, tolerance?: number) { const map = this.getMap(); if (map.isTransforming()) { @@ -250,7 +250,7 @@ export class Rectangle extends Polygon { return extent.contains(p); } - //@interlal + //@internal _computePrjExtent(projection: CommonProjectionType): Extent { if (this.isRotated()) { return this._computeRotatedPrjExtent(); @@ -266,7 +266,7 @@ export class Rectangle extends Polygon { return new Extent(prjs[0] as Coordinate, prjs[1] as Coordinate); } - //@interlal + //@internal _computeExtent(measurer?: any): Extent { const se = this._getSouthEast(measurer); if (!se) { @@ -275,7 +275,7 @@ export class Rectangle extends Polygon { return new Extent(this._coordinates, se, this._getProjection()); } - //@interlal + //@internal _getSouthEast(measurer): Coordinate { if (!measurer || !this._coordinates || isNil(this._width) || isNil(this._height)) { return null; @@ -297,7 +297,7 @@ export class Rectangle extends Polygon { return rightPoint; } - //@interlal + //@internal _computeGeodesicLength() { if (isNil(this._width) || isNil(this._height)) { return 0; @@ -305,7 +305,7 @@ export class Rectangle extends Polygon { return 2 * (this._width + this._height); } - //@interlal + //@internal _computeGeodesicArea() { if (isNil(this._width) || isNil(this._height)) { return 0; @@ -313,7 +313,7 @@ export class Rectangle extends Polygon { return this._width * this._height; } - //@interlal + //@internal _exportGeoJSONGeometry() { const coordinates = Coordinate.toNumberArrays([this.getShell()]); return { @@ -322,7 +322,7 @@ export class Rectangle extends Polygon { }; } - //@interlal + //@internal _toJSON(options) { const opts = extend({}, options); const nw = this.getCoordinates(); diff --git a/src/geometry/Sector.ts b/src/geometry/Sector.ts index 32124ca38b..51a270d1c4 100644 --- a/src/geometry/Sector.ts +++ b/src/geometry/Sector.ts @@ -90,7 +90,7 @@ export class Sector extends Circle { } // The corrected angle is used for calculation and rendering - //@interlal + //@internal _correctAngles(): [number, number] { let startAngle = this.getStartAngle(), endAngle = this.getEndAngle(); if (endAngle < startAngle) { @@ -122,7 +122,7 @@ export class Sector extends Circle { return this._getShell(); } - //@interlal + //@internal _getShell(): RingCoordinates { const [startAngle, endAngle] = this._correctAngles(); @@ -151,13 +151,13 @@ export class Sector extends Circle { return 90; } - //@interlal + //@internal _getPrjShell(): RingCoordinates { const shell = super._getPrjShell(); return this._rotatePrjCoordinates(shell) as RingCoordinates; } - //@interlal + //@internal _computePrjExtent(): Extent { if (this.isRotated()) { return this._computeRotatedPrjExtent(); @@ -166,7 +166,7 @@ export class Sector extends Circle { return Circle.prototype._computePrjExtent.apply(this, arguments); } - //@interlal + //@internal _containsPoint(point: Point, tolerance?: number) { const map = this.getMap(); if (map.isTransforming()) { @@ -195,7 +195,7 @@ export class Sector extends Circle { return pp.distanceTo(pc) <= (size.width / 2 + t) && between; } - //@interlal + //@internal _computeGeodesicLength() { if (isNil(this._radius)) { return 0; @@ -204,7 +204,7 @@ export class Sector extends Circle { return Math.PI * 2 * this._radius * Math.abs(startAngle - endAngle) / 360 + 2 * this._radius; } - //@interlal + //@internal _computeGeodesicArea() { if (isNil(this._radius)) { return 0; @@ -213,7 +213,7 @@ export class Sector extends Circle { return Math.PI * Math.pow(this._radius, 2) * Math.abs(startAngle - endAngle) / 360; } - //@interlal + //@internal _toJSON(options) { const opts = extend({}, options); const center = this.getCenter(); diff --git a/src/geometry/TextBox.ts b/src/geometry/TextBox.ts index f8a69e221e..80e13ae04d 100644 --- a/src/geometry/TextBox.ts +++ b/src/geometry/TextBox.ts @@ -66,13 +66,13 @@ const options: TextBoxOptionsType = { class TextBox extends TextMarker { options: TextBoxOptionsType; - //@interlal + //@internal _width: number - //@interlal + //@internal _height: number - //@interlal + //@internal _oldWidth: any - //@interlal + //@internal _oldHeight: any /** * @param {String} content - TextBox's text content @@ -205,7 +205,7 @@ class TextBox extends TextMarker { return textBox; } - //@interlal + //@internal _toJSON(options: any) { return { 'feature': this.toGeoJSON(options), @@ -216,7 +216,7 @@ class TextBox extends TextMarker { }; } - //@interlal + //@internal _refresh(): void { const textStyle = this.getTextStyle() || {}, padding = textStyle['padding'] || [12, 8]; diff --git a/src/geometry/TextMarker.ts b/src/geometry/TextMarker.ts index 5309ac219a..57a7055d2b 100644 --- a/src/geometry/TextMarker.ts +++ b/src/geometry/TextMarker.ts @@ -30,11 +30,11 @@ const defaultBoxSymbol: VectorMarkerSymbol = { * @extends Marker */ class TextMarker extends Marker { - //@interlal + //@internal _content: string - //@interlal + //@internal _refreshing: boolean - //@interlal + //@internal _refresh?(): void getTextStyle?(): any setTextStyle?(tyle?: any): any @@ -111,7 +111,7 @@ class TextMarker extends Marker { return this; } - //@interlal + //@internal _parseSymbol(symbol: any): any { const t = {}; const b = {}; @@ -127,27 +127,27 @@ class TextMarker extends Marker { return [t, b]; } - //@interlal + //@internal _getTextSize(symbol: any): any { return splitTextToRow(this._content, symbol)['size']; } - //@interlal + //@internal _getInternalSymbol(): any { return this._symbol; } - //@interlal + //@internal _getDefaultTextSymbol(): TextSymbol { return extend({}, defaultSymbol); } - //@interlal + //@internal _getDefaultBoxSymbol(): VectorMarkerSymbol { return extend({}, defaultBoxSymbol); } - //@interlal + //@internal _getDefaultPadding(): [number, number] { return [12, 8]; } diff --git a/src/geometry/editor/GeometryEditor.ts b/src/geometry/editor/GeometryEditor.ts index be70a02484..0755b07560 100644 --- a/src/geometry/editor/GeometryEditor.ts +++ b/src/geometry/editor/GeometryEditor.ts @@ -61,25 +61,25 @@ const options: GeometryEditOptionsType = { */ class GeometryEditor extends Eventable(Class) { - //@interlal + //@internal _geometry: any; - //@interlal + //@internal _originalSymbol: any - //@interlal + //@internal _shadowLayer: any - //@interlal + //@internal _shadow: any - //@interlal + //@internal _geometryDraggble: boolean - //@interlal + //@internal _history: any - //@interlal + //@internal _historyPointer: any - //@interlal + //@internal _editOutline: any - //@interlal + //@internal _refreshHooks: Array - //@interlal + //@internal _updating: boolean editing: boolean; options: GeometryEditOptionsType; @@ -129,7 +129,7 @@ class GeometryEditor extends Eventable(Class) { this._prepareEditStageLayer(); } - //@interlal + //@internal _prepareEditStageLayer(): void { const layer = this._geometry.getLayer(); if (layer.options['renderer'] !== 'canvas') { @@ -269,7 +269,7 @@ class GeometryEditor extends Eventable(Class) { return this.editing; } - //@interlal + //@internal _getGeometryEvents(): GeometryEvents { return { 'symbolchange': this._onGeoSymbolChange, @@ -280,7 +280,7 @@ class GeometryEditor extends Eventable(Class) { }; } - //@interlal + //@internal _switchGeometryEvents(oper: any): void { if (this._geometry) { const events = this._getGeometryEvents(); @@ -290,14 +290,14 @@ class GeometryEditor extends Eventable(Class) { } } - //@interlal + //@internal _onGeoSymbolChange(param: any): void { if (this._shadow) { this._shadow.setSymbol(param.target._getInternalSymbol()); } } - //@interlal + //@internal _onMarkerDragEnd(): void { this._update('setCoordinates', this._shadow.getCoordinates().toArray()); } @@ -308,7 +308,7 @@ class GeometryEditor extends Eventable(Class) { * create rectangle outline of the geometry * @private */ - //@interlal + //@internal _createOrRefreshOutline(): any { const geometry = this._geometry; const outline = this._editOutline; @@ -332,7 +332,7 @@ class GeometryEditor extends Eventable(Class) { } - //@interlal + //@internal _createCenterHandle(): void { const map = this.getMap(); const symbol = this.options['centerHandleSymbol']; @@ -372,7 +372,7 @@ class GeometryEditor extends Eventable(Class) { }); } - //@interlal + //@internal _createHandleInstance(containerPoint: any, opts: any): EditHandle { const map = this.getMap(); const symbol = loadFunctionTypes(opts['symbol'], (): any => { @@ -472,7 +472,7 @@ class GeometryEditor extends Eventable(Class) { * @param {fn} onHandleMove callback * @private */ - //@interlal + //@internal _createResizeHandles(blackList: Array, onHandleMove: any, onHandleUp: any): any { //cursor styles. const cursors = [ @@ -1225,7 +1225,7 @@ class GeometryEditor extends Eventable(Class) { }); } - //@interlal + //@internal _refresh(): void { if (this._refreshHooks) { for (let i = this._refreshHooks.length - 1; i >= 0; i--) { @@ -1234,7 +1234,7 @@ class GeometryEditor extends Eventable(Class) { } } - //@interlal + //@internal _hideContext(): void { if (this._geometry) { this._geometry.closeMenu(); @@ -1242,7 +1242,7 @@ class GeometryEditor extends Eventable(Class) { } } - //@interlal + //@internal _addRefreshHook(fn: any): void { if (!fn) { return; @@ -1253,13 +1253,13 @@ class GeometryEditor extends Eventable(Class) { this._refreshHooks.push(fn); } - //@interlal + //@internal _update(method: any, ...args: any): void { this._exeHistory([method, args]); this._recordHistory(method, ...args); } - //@interlal + //@internal _updateCoordFromShadow(ignoreRecord?: any): void { const geoToEdit = this._shadow || this._geometry; @@ -1274,7 +1274,7 @@ class GeometryEditor extends Eventable(Class) { this._updating = updating; } - //@interlal + //@internal _recordHistory(method: any, ...args: any): void { if (!this._history) { this._history = []; @@ -1347,7 +1347,7 @@ class GeometryEditor extends Eventable(Class) { return this; } - //@interlal + //@internal _exeAndReset(record: any): void { if (this._updating) { return; @@ -1361,17 +1361,17 @@ class GeometryEditor extends Eventable(Class) { this.start(); } - //@interlal + //@internal _onDragStart(): void { this._updating = true; } - //@interlal + //@internal _onDragEnd(): void { this._updating = false; } - //@interlal + //@internal _exeHistory(record: any): void { if (!Array.isArray(record)) { return; diff --git a/src/geometry/editor/TextEditable.ts b/src/geometry/editor/TextEditable.ts index 1dc80dd05d..d75362901d 100644 --- a/src/geometry/editor/TextEditable.ts +++ b/src/geometry/editor/TextEditable.ts @@ -95,7 +95,7 @@ const TextEditable = { return this._editUIMarker; }, - //@interlal + //@internal _prepareEditor(): void { const map = this.getMap(); const editContainer = this._createEditor(); @@ -112,7 +112,7 @@ const TextEditable = { this._setCursorToLast(this._textEditor); }, - //@interlal + //@internal _getEditorOffset(): object { const symbol = this._getInternalSymbol() || {}; let dx = 0, @@ -131,7 +131,7 @@ const TextEditable = { }; }, - //@interlal + //@internal _createEditor(): HTMLElement { const content = this.getContent(); const labelSize = this.getSize(), @@ -162,7 +162,7 @@ const TextEditable = { return editor; }, - //@interlal + //@internal _setCursorToLast(obj) { let range; if (window.getSelection) { diff --git a/src/geometry/ext/Geometry.Animation.ts b/src/geometry/ext/Geometry.Animation.ts index 005f4feaf8..b7b17a91c7 100644 --- a/src/geometry/ext/Geometry.Animation.ts +++ b/src/geometry/ext/Geometry.Animation.ts @@ -10,8 +10,8 @@ type AnimationStyles = { [key: string]: any }; declare module "../Geometry" { interface Geometry { - //@interlal - _animPlayer: Player; + //@internal + _animPlayer: Player; animate(styles: AnimationStyles, options?: AnimationOptionsType | ((frame: Frame) => void), step?: (frame: Frame) => void): Player; } } @@ -133,7 +133,7 @@ Geometry.include(/** @lends Geometry.prototype */ { * @return {Object} styles * @private */ - //@interlal + //@internal _prepareAnimationStyles(styles: AnimationStyles): object { const symbol = this._getInternalSymbol(); @@ -193,7 +193,7 @@ Geometry.include(/** @lends Geometry.prototype */ { * Bind animation events * @param {string} playState */ - //@interlal + //@internal _fireAnimateEvent(playState: string): void { if (playState === 'finished') { delete this._animationStarted; diff --git a/src/geometry/ext/Geometry.Drag.ts b/src/geometry/ext/Geometry.Drag.ts index a19f8dfbdf..05260f46bf 100644 --- a/src/geometry/ext/Geometry.Drag.ts +++ b/src/geometry/ext/Geometry.Drag.ts @@ -25,23 +25,23 @@ class GeometryDragHandler extends Handler { container: any - //@interlal + //@internal _dragHandler: any - //@interlal + //@internal _shadow: any - //@interlal + //@internal _dragStageLayer: any - //@interlal + //@internal _shadowConnectors: any - //@interlal + //@internal _lastCoord: any - //@interlal + //@internal _lastPoint: any - //@interlal + //@internal _startParam: any - //@interlal + //@internal _moved: boolean - //@interlal + //@internal _isDragging: boolean @@ -62,7 +62,7 @@ class GeometryDragHandler extends Handler { delete this.container; } - //@interlal + //@internal _prepareDragHandler(): void { this._dragHandler = new DragHandler(this.container); this._dragHandler.on('dragging', this._dragging, this) @@ -70,7 +70,7 @@ class GeometryDragHandler extends Handler { .enable(); } - //@interlal + //@internal _prepareShadow(): void { const target = this.target; const needShadow = target.getLayer().options['renderer'] === 'canvas'; @@ -96,7 +96,7 @@ class GeometryDragHandler extends Handler { this._prepareShadowConnectors(); } - //@interlal + //@internal _updateShadowSymbol(shadow: any, target: any): void { shadow.setSymbol(target._getInternalSymbol()); if (target.options['dragShadow']) { @@ -105,7 +105,7 @@ class GeometryDragHandler extends Handler { } } - //@interlal + //@internal _prepareShadowConnectors(): void { //copy connectors const target = this.target; @@ -138,14 +138,14 @@ class GeometryDragHandler extends Handler { this._dragStageLayer.bringToFront().addGeometry(shadowConnectors); } - //@interlal + //@internal _onTargetUpdated(): void { if (this._shadow) { this._shadow.setSymbol(this.target._getSymbol()); } } - //@interlal + //@internal _prepareDragStageLayer(): void { const map = this.target.getMap(), layer = this.target.getLayer(); @@ -163,7 +163,7 @@ class GeometryDragHandler extends Handler { this._dragStageLayer._getRenderer().resources = resources; } - //@interlal + //@internal _startDrag(param: any): void { const map = this.target.getMap(); if (!map) { @@ -194,7 +194,7 @@ class GeometryDragHandler extends Handler { return; } - //@interlal + //@internal _dragging(param: any): void { const target = this.target; const map = target.getMap(); @@ -295,7 +295,7 @@ class GeometryDragHandler extends Handler { } } - //@interlal + //@internal _endDrag(param?: any): void { if (this._dragHandler) { this._dragHandler.disable(); @@ -350,7 +350,7 @@ class GeometryDragHandler extends Handler { return true; } - //@interlal + //@internal _updateTargetAndRemoveShadow(eventParam: any): void { if (!this._shadow) { return; @@ -383,7 +383,7 @@ class GeometryDragHandler extends Handler { } //find correct coordinate for coordOffset if geometry has altitude - //@interlal + //@internal _correctCoord(coord: any): any { const map = this.target.getMap(); if (!map.getPitch()) { diff --git a/src/geometry/ext/Geometry.Events.ts b/src/geometry/ext/Geometry.Events.ts index 1c41d93553..c7a70f76af 100644 --- a/src/geometry/ext/Geometry.Events.ts +++ b/src/geometry/ext/Geometry.Events.ts @@ -6,8 +6,8 @@ import Geometry from '../Geometry'; declare module "../Geometry" { interface Geometry { - //@interlal - _onEvent(event: MouseEvent | TouchEvent, type?: string): void; + //@internal + _onEvent(event: MouseEvent | TouchEvent, type?: string): void; } } @@ -20,7 +20,7 @@ Geometry.include(/** @lends Geometry.prototype */ { * @param {Event} event - dom event * @private */ - //@interlal + //@internal _onEvent(event: MouseEvent | TouchEvent, type: string): void { const map = this.getMap(); if (!map) { @@ -46,7 +46,7 @@ Geometry.include(/** @lends Geometry.prototype */ { * @param {any} domEvent * @returns */ - //@interlal + //@internal _getEventTypeToFire(domEvent: any): string { // let eventType = domEvent.type; // //change event type to contextmenu diff --git a/src/geometry/ext/Geometry.InfoWindow.ts b/src/geometry/ext/Geometry.InfoWindow.ts index 7ceaa7b4f3..9b555c195e 100644 --- a/src/geometry/ext/Geometry.InfoWindow.ts +++ b/src/geometry/ext/Geometry.InfoWindow.ts @@ -7,17 +7,17 @@ import type Coordinate from '../../geo/Coordinate'; declare module "../Geometry" { interface Geometry { - //@interlal - _infoWindow: InfoWindow; + //@internal + _infoWindow: InfoWindow; setInfoWindow(options: InfoWindowOptionsType): this; getInfoWindow(): InfoWindow; openInfoWindow(coordinate?: Coordinate): this; closeInfoWindow(): this; removeInfoWindow(): this; - //@interlal - _bindInfoWindow(): this; - //@interlal - _unbindInfoWindow(): this; + //@internal + _bindInfoWindow(): this; + //@internal + _unbindInfoWindow(): this; } } @@ -123,7 +123,7 @@ Geometry.include(/** @lends Geometry.prototype */ { * Bing InfoWindow to Geometry * @returns {Geometry} this */ - //@interlal + //@internal _bindInfoWindow() { const options = this._infoWinOptions; if (!options) { @@ -141,7 +141,7 @@ Geometry.include(/** @lends Geometry.prototype */ { * Unbind InfoWindow * @returns {Geometry} this */ - //@interlal + //@internal _unbindInfoWindow() { if (this._infoWindow) { this.closeInfoWindow(); diff --git a/src/handler/Drag.ts b/src/handler/Drag.ts index e4522fbfb1..6dabd2e3ae 100644 --- a/src/handler/Drag.ts +++ b/src/handler/Drag.ts @@ -26,7 +26,7 @@ const END_EVENTS = { class DragHandler extends Handler { options: DragOptionsType; - //@interlal + //@internal _onMouseDown: (e: any) => any; moved: boolean; startPos: Point; @@ -157,7 +157,7 @@ class DragHandler extends Handler { this.fire('mouseup', param); } - //@interlal + //@internal _offEvents() { const dom = this.dom; off(dom, 'mouseleave', this.onMouseUp); diff --git a/src/handler/Handler.ts b/src/handler/Handler.ts index 5c699251de..d0eb7a09d0 100644 --- a/src/handler/Handler.ts +++ b/src/handler/Handler.ts @@ -14,7 +14,7 @@ class Base {} abstract class Handler extends Eventable(Base) { target: any; dom?: HTMLElement; - //@interlal + //@internal _enabled: boolean = false; constructor(target: any) { diff --git a/src/handler/Handlerable.ts b/src/handler/Handlerable.ts index 78d309f509..b5dc70d227 100644 --- a/src/handler/Handlerable.ts +++ b/src/handler/Handlerable.ts @@ -10,8 +10,8 @@ import Handler from "./Handler"; export default function (Base: T) { return class Handlerable extends Base { - //@interlal - _handlers?: Handler[]; + //@internal + _handlers?: Handler[]; /** * Register a handler * @param {String} name - name of the handler @@ -67,8 +67,8 @@ export default function (Base: T) { return this; } - //@interlal - _clearHandlers() { + //@internal + _clearHandlers() { for (let i = 0, len = this._handlers.length; i < len; i++) { this._handlers[i].remove(); } diff --git a/src/lang/translator.ts b/src/lang/translator.ts index 763452c9cc..8c91cc8750 100644 --- a/src/lang/translator.ts +++ b/src/lang/translator.ts @@ -67,7 +67,7 @@ class Translator extends Class { this.nodes = newLanguageNodes; } - //@interlal + //@internal _validateNestedProps(nestedProps: string[]) { nestedProps.forEach(p => { if (p === '') throw new TranslatorError('Any of sides of a dot "." cannot be empty'); diff --git a/src/layer/CanvasLayer.ts b/src/layer/CanvasLayer.ts index a34ac2d541..d41e01352a 100644 --- a/src/layer/CanvasLayer.ts +++ b/src/layer/CanvasLayer.ts @@ -268,7 +268,7 @@ class CanvasLayer extends Layer { return this; } - //@interlal + //@internal _getRenderer() { return super._getRenderer() as CanvasLayerRenderer; } diff --git a/src/layer/ImageLayer.ts b/src/layer/ImageLayer.ts index 824460604b..909939358a 100644 --- a/src/layer/ImageLayer.ts +++ b/src/layer/ImageLayer.ts @@ -52,9 +52,9 @@ const TEMP_POINT = new Point(0, 0); }]) */ class ImageLayer extends Layer { - //@interlal + //@internal _images: Array; - //@interlal + //@internal _imageData: Array; constructor(id: string, images?: ImageLayerOptionsType | Array, options?: ImageLayerOptionsType) { @@ -95,7 +95,7 @@ class ImageLayer extends Layer { return this._images; } - //@interlal + //@internal _prepareImages(images: Array) { images = images || []; if (!Array.isArray(images)) { @@ -131,7 +131,7 @@ ImageLayer.mergeOptions(options); const EMPTY_ARRAY = []; export class ImageLayerCanvasRenderer extends CanvasRenderer { - //@interlal + //@internal _imageLoaded: boolean isDrawable() { @@ -198,7 +198,7 @@ export class ImageLayerCanvasRenderer extends CanvasRenderer { this.completeRender(); } - //@interlal + //@internal // eslint-disable-next-line @typescript-eslint/no-unused-vars _drawImages(timestamp?: number, context?: any) { const imgData = this.layer._imageData; @@ -218,7 +218,7 @@ export class ImageLayerCanvasRenderer extends CanvasRenderer { } } - //@interlal + //@internal _drawImage(image: LayerImageType, extent: PointExtent, opacity: number) { let globalAlpha = 0; const ctx = this.context; @@ -260,7 +260,7 @@ export class ImageLayerGLRenderer extends ImageGLRenderable(ImageLayerCanvasRend this.draw(timestamp, context); } - //@interlal + //@internal _prepareGLContext() { const gl = this.gl; if (gl) { @@ -275,7 +275,7 @@ export class ImageLayerGLRenderer extends ImageGLRenderable(ImageLayerCanvasRend } } - //@interlal + //@internal _drawImages(timestamp?: number, parentContext?: any) { const gl = this.gl; if (parentContext && parentContext.renderTarget) { @@ -300,7 +300,7 @@ export class ImageLayerGLRenderer extends ImageGLRenderable(ImageLayerCanvasRend return true; } - //@interlal + //@internal _drawImage(image: LayerImageType, extent: PointExtent, opacity: number) { this.drawGLImage(image, extent.xmin, extent.ymax, extent.getWidth(), extent.getHeight(), 1, opacity); } diff --git a/src/layer/Layer.ts b/src/layer/Layer.ts index 6ab93b46ad..2447b3c65f 100644 --- a/src/layer/Layer.ts +++ b/src/layer/Layer.ts @@ -74,30 +74,30 @@ const options: LayerOptionsType = { * @mixes Renderable */ class Layer extends JSONAble(Eventable(Renderable(Class))) { - //@interlal + //@internal _canvas: HTMLCanvasElement; - //@interlal + //@internal _renderer: CanvasRenderer; - //@interlal + //@internal _id: string - //@interlal + //@internal _zIndex: number - //@interlal + //@internal _drawTime: number - //@interlal + //@internal _toRedraw: boolean map: Map - //@interlal + //@internal _mask: Polygon | MultiPolygon | Marker; - //@interlal + //@internal _maskGeoJSON: Record; - //@interlal + //@internal _loaded: boolean - //@interlal + //@internal _collisionIndex: CollisionIndex - //@interlal + //@internal _optionsHook?(conf?: any): void - //@interlal + //@internal _silentConfig: boolean | undefined | any options: LayerOptionsType; getLayers?(): Layer[]; @@ -699,7 +699,7 @@ class Layer extends JSONAble(Eventable(Renderable(Class))) { onRemove() { } - //@interlal + //@internal _bindMap(map: Map, zIndex?: number) { if (!map) { return; @@ -715,7 +715,7 @@ class Layer extends JSONAble(Eventable(Renderable(Class))) { this.fire('add'); } - //@interlal + //@internal _initRenderer() { const renderer = this.options['renderer']; // eslint-disable-next-line @typescript-eslint/ban-ts-comment @@ -758,7 +758,7 @@ class Layer extends JSONAble(Eventable(Renderable(Class))) { }); } - //@interlal + //@internal _doRemove() { this._loaded = false; @@ -773,19 +773,19 @@ class Layer extends JSONAble(Eventable(Renderable(Class))) { delete this._collisionIndex; } - //@interlal + //@internal _switchEvents(to, emitter) { if (emitter && emitter.getEvents && this.getMap()) { this.getMap()[to](emitter.getEvents(), emitter); } } - //@interlal + //@internal _getRenderer() { return this._renderer; } - //@interlal + //@internal _getLayerList() { if (!this.map) { return []; @@ -794,7 +794,7 @@ class Layer extends JSONAble(Eventable(Renderable(Class))) { return this.map.getLayers().slice(beginIndex); } - //@interlal + //@internal _getMask2DExtent() { if (!this._mask || !this.getMap()) { return null; diff --git a/src/layer/OverlayLayer.ts b/src/layer/OverlayLayer.ts index 78b6c76d68..3d3ad02ff4 100644 --- a/src/layer/OverlayLayer.ts +++ b/src/layer/OverlayLayer.ts @@ -43,22 +43,22 @@ const TMP_EVENTS_ARR = []; * @extends Layer */ class OverlayLayer extends Layer { - //@interlal + //@internal _maxZIndex: number - //@interlal + //@internal _minZIndex: number - //@interlal + //@internal _geoMap: Record; - //@interlal + //@internal _geoList: Array - //@interlal + //@internal _toSort: boolean - //@interlal + //@internal _cookedStyles: any - //@interlal + //@internal _clearing: boolean options: OverlayLayerOptionsType; - //@interlal + //@internal _renderer: OverlayLayerCanvasRenderer; constructor(id: string, geometries: OverlayLayerOptionsType | Array, options?: OverlayLayerOptionsType) { @@ -405,7 +405,7 @@ class OverlayLayer extends Layer { } - //@interlal + //@internal _add(geo: Geometry, extent?: Extent, i?: number) { if (!this._toSort) { this._toSort = geo.getZIndex() !== 0; @@ -620,7 +620,7 @@ class OverlayLayer extends Layer { return this; } - //@interlal + //@internal _styleGeometry(geometry: Geometry): boolean { if (!this._cookedStyles) { return false; @@ -680,7 +680,7 @@ class OverlayLayer extends Layer { return Layer.prototype.hide.call(this); } - //@interlal + //@internal _initCache() { if (!this._geoList) { this._geoList = []; @@ -688,13 +688,13 @@ class OverlayLayer extends Layer { } } - //@interlal + //@internal _updateZIndex(...zIndex: number[]) { this._maxZIndex = Math.max(this._maxZIndex, Math.max(...zIndex)); this._minZIndex = Math.min(this._minZIndex, Math.min(...zIndex)); } - //@interlal + //@internal _sortGeometries() { if (!this._toSort) { return; @@ -708,7 +708,7 @@ class OverlayLayer extends Layer { this._toSort = false; } - //@interlal + //@internal _compare(a, b) { if (a.getZIndex() === b.getZIndex()) { return a._getInternalId() - b._getInternalId(); @@ -717,7 +717,7 @@ class OverlayLayer extends Layer { } //binarySearch - //@interlal + //@internal _findInList(geo: Geometry): number { const len = this._geoList.length; if (len === 0) { @@ -740,7 +740,7 @@ class OverlayLayer extends Layer { return -1; } - //@interlal + //@internal _onGeometryEvent(param?: HandlerFnResultType) { if (!param || !param['target']) { return; @@ -765,7 +765,7 @@ class OverlayLayer extends Layer { } } - //@interlal + //@internal _onGeometryIdChange(param: HandlerFnResultType) { if (param['new'] === param['old']) { if (this._geoMap[param['old']] && this._geoMap[param['old']] === param['target']) { @@ -784,7 +784,7 @@ class OverlayLayer extends Layer { } - //@interlal + //@internal _onGeometryZIndexChange(param: HandlerFnResultType) { if (param['old'] !== param['new']) { this._updateZIndex(param['new']); @@ -795,49 +795,49 @@ class OverlayLayer extends Layer { } } - //@interlal + //@internal _onGeometryPositionChange(param: HandlerFnResultType) { if (this._getRenderer()) { this._getRenderer().onGeometryPositionChange(param); } } - //@interlal + //@internal _onGeometryShapeChange(param: HandlerFnResultType) { if (this._getRenderer()) { this._getRenderer().onGeometryShapeChange(param); } } - //@interlal + //@internal _onGeometrySymbolChange(param: HandlerFnResultType) { if (this._getRenderer()) { this._getRenderer().onGeometrySymbolChange(param); } } - //@interlal + //@internal _onGeometryShow(param: HandlerFnResultType) { if (this._getRenderer()) { this._getRenderer().onGeometryShow(param); } } - //@interlal + //@internal _onGeometryHide(param: HandlerFnResultType) { if (this._getRenderer()) { this._getRenderer().onGeometryHide(param); } } - //@interlal + //@internal _onGeometryPropertiesChange(param: HandlerFnResultType) { if (this._getRenderer()) { this._getRenderer().onGeometryPropertiesChange(param); } } - //@interlal + //@internal _hasGeoListeners(eventTypes: string | Array): boolean { if (!eventTypes) { return false; @@ -869,7 +869,7 @@ class OverlayLayer extends Layer { } //override for typing - //@interlal + //@internal _getRenderer(): OverlayLayerCanvasRenderer { return super._getRenderer() as OverlayLayerCanvasRenderer; } diff --git a/src/layer/ParticleLayer.ts b/src/layer/ParticleLayer.ts index 44ac401981..cd76cf22e6 100644 --- a/src/layer/ParticleLayer.ts +++ b/src/layer/ParticleLayer.ts @@ -92,7 +92,7 @@ class ParticleLayer extends CanvasLayer { this._fillCanvas(context); } - //@interlal + //@internal _fillCanvas(context: CanvasRenderingContext2D) { const g = context.globalCompositeOperation; context.globalCompositeOperation = 'destination-out'; @@ -105,7 +105,7 @@ class ParticleLayer extends CanvasLayer { ParticleLayer.mergeOptions(options); ParticleLayer.registerRenderer('canvas', class extends CanvasLayerRenderer { - //@interlal + //@internal _shouldClear: boolean; layer: ParticleLayer; diff --git a/src/layer/VectorLayer.ts b/src/layer/VectorLayer.ts index 3f536a904a..932dc42477 100644 --- a/src/layer/VectorLayer.ts +++ b/src/layer/VectorLayer.ts @@ -164,7 +164,7 @@ class VectorLayer extends OverlayLayer { return this._hitGeos(this._geoList, point, options); } - //@interlal + //@internal _hitGeos(geometries: Array, cp: Point, options: LayerIdentifyOptionsType) { if (!geometries || !geometries.length) { return []; diff --git a/src/layer/tile/GroupTileLayer.ts b/src/layer/tile/GroupTileLayer.ts index 5dc873c7ff..3b81a13169 100644 --- a/src/layer/tile/GroupTileLayer.ts +++ b/src/layer/tile/GroupTileLayer.ts @@ -49,7 +49,7 @@ function checkLayers(tileLayers: TileLayer[] | TileLayer): TileLayer[] { class GroupTileLayer extends TileLayer { layers: TileLayer[]; layerMap: Record; - //@interlal + //@internal _groupChildren: any[]; /** * Reproduce a GroupTileLayer from layer's profile JSON. @@ -242,7 +242,7 @@ class GroupTileLayer extends TileLayer { return null; } - //@interlal + //@internal _removeChildTileCache(layer: TileLayer) { if (!layer) { return this; @@ -285,7 +285,7 @@ class GroupTileLayer extends TileLayer { return this; } - //@interlal + //@internal _onLayerShowHide(e: { type: string; target: any }) { const { type, target } = e || {}; //listen tilelayer.remove() method fix #1629 @@ -303,7 +303,7 @@ class GroupTileLayer extends TileLayer { } // render all layers - //@interlal + //@internal _renderLayers() { const renderer = this.getRenderer(); if (renderer) { @@ -313,7 +313,7 @@ class GroupTileLayer extends TileLayer { } // reset layerMap,_groupChildren,listen tilelayers events - //@interlal + //@internal _refresh() { const map = this.getMap(); this._groupChildren = []; @@ -347,7 +347,7 @@ class GroupTileLayer extends TileLayer { return false; } - //@interlal + //@internal _checkChildren() { const ids = {}; this.layers.forEach(layer => { @@ -360,7 +360,7 @@ class GroupTileLayer extends TileLayer { }); } - //@interlal + //@internal _sortLayers() { this.layers.sort(function (a, b) { return a.options.zIndex - b.options.zIndex; diff --git a/src/layer/tile/TileLayer.ts b/src/layer/tile/TileLayer.ts index 9551ca5243..18e1cd1247 100644 --- a/src/layer/tile/TileLayer.ts +++ b/src/layer/tile/TileLayer.ts @@ -35,7 +35,7 @@ const MAX_ROOT_NODES = 32; const isSetAvailable: boolean = typeof Set !== 'undefined'; class TileHashset { - //@interlal + //@internal _table: Set | any; constructor() { this._table = isSetAvailable ? new Set() : {}; @@ -192,35 +192,35 @@ const ARR3: Vector3 = [0, 0, 0]; */ class TileLayer extends Layer { tileInfoCache: ArrayLRUCache; - //@interlal + //@internal _tileSize: Size; - //@interlal + //@internal _coordCache: Record; - //@interlal + //@internal _disablePyramid: boolean; - //@interlal + //@internal _hasOwnSR: boolean; - //@interlal + //@internal _tileFullExtent: PointExtent; - //@interlal + //@internal _rootNodes: any; - //@interlal + //@internal _visitedTiles: TileHashset; - //@interlal + //@internal _zScale: number; - //@interlal + //@internal _sr: SpatialReference; - //@interlal + //@internal _srMinZoom: number; - //@interlal + //@internal _srMaxZoom: number; - //@interlal + //@internal _defaultTileConfig: TileConfig; - //@interlal + //@internal _tileConfig: TileConfig; - //@interlal + //@internal _polygonOffset: number; - //@interlal + //@internal _renderer: TileLayerCanvasRenderer; options: TileLayerOptionsType; @@ -313,13 +313,13 @@ class TileLayer extends Layer { - //@interlal + //@internal _isPyramidMode() { const sr = this.getSpatialReference(); return !this._disablePyramid && !this._hasOwnSR && this.options['pyramidMode'] && sr && sr.isPyramid(); } - //@interlal + //@internal _getTileFullExtent(): Extent { if (this._tileFullExtent) { return this._tileFullExtent; @@ -333,7 +333,7 @@ class TileLayer extends Layer { } - //@interlal + //@internal _getRootNodes(offset0: TileOffsetType): TileRootType { const map = this.getMap(); if (this._rootNodes) { @@ -434,7 +434,7 @@ class TileLayer extends Layer { }; } - //@interlal + //@internal _getRootError() { const map = this.getMap(); const fov = toRadian(map.getFov()); @@ -456,7 +456,7 @@ class TileLayer extends Layer { } - //@interlal + //@internal _getPyramidTiles(z: number, layer: Layer): TilesType { const map = this.getMap(); if (isNaN(+z)) { @@ -552,7 +552,7 @@ class TileLayer extends Layer { } - //@interlal + //@internal _splitNode( node: TileNodeType, projectionView: Matrix4, @@ -629,7 +629,7 @@ class TileLayer extends Layer { } - //@interlal + //@internal _createChildNode(node: TileNodeType, dx: number, dy: number, offset?: TileOffsetType, tileId?: string) { // const zoomOffset = this.options['zoomOffset']; const { x, y, idx, idy, extent2d } = node; @@ -664,7 +664,7 @@ class TileLayer extends Layer { return childNode; } - //@interlal + //@internal _isTileVisible(node: TileNodeType, projectionView: Matrix4, glScale: number, maxZoom: number, offset: TileOffsetType) { if (node.z === 0) { return 1; @@ -718,7 +718,7 @@ class TileLayer extends Layer { // return [w, h]; // } - //@interlal + //@internal _isTileInFrustum(node: TileNodeType, projectionView: Matrix4, glScale: number, offset: TileOffsetType): boolean { if (!this._zScale) { const map = this.getMap(); @@ -750,7 +750,7 @@ class TileLayer extends Layer { * from Cesium * 与cesium不同的是,我们用boundingVolume顶面的四个顶点中的最小值作为distanceToCamera */ - //@interlal + //@internal _getScreenSpaceError(node: TileNodeType, glScale: number, maxZoom: number, offset: TileOffsetType) { // const fovDenominator = this._fovDenominator; const geometricError = node.error; @@ -787,7 +787,7 @@ class TileLayer extends Layer { * @param z - zoom * @return tile descriptors */ - //@interlal + //@internal _getCascadeTiles(z: number, parentLayer: Layer): TilesType { const map = this.getMap(); const pitch = map.getPitch(); @@ -993,7 +993,7 @@ class TileLayer extends Layer { return super.getMaxZoom(); } - //@interlal + //@internal _getTileZoom(zoom: number): number { if (!this._hasOwnSR) { const res0 = this.getMap().getResolution(zoom); @@ -1022,7 +1022,7 @@ class TileLayer extends Layer { return this.options['maxAvailableZoom'] || sr && sr.getMaxZoom(); } - //@interlal + //@internal _getTiles( tileZoom: number, containerExtent: PointExtent, @@ -1247,7 +1247,7 @@ class TileLayer extends Layer { } as TileGridType; } - //@interlal + //@internal _convertToExtent2d(containerExtent: PointExtent) { const map = this.getMap(); return containerExtent.convertTo(c => { @@ -1264,7 +1264,7 @@ class TileLayer extends Layer { }); } - //@interlal + //@internal _splitTiles( frustumMatrix: Matrix4, tiles: TileNodeType[], @@ -1299,7 +1299,7 @@ class TileLayer extends Layer { if (tile) tiles.push(tile); } - //@interlal + //@internal _checkAndAddTile( frustumMatrix: Matrix4, renderer: any, @@ -1344,7 +1344,7 @@ class TileLayer extends Layer { return tileInfo; } - //@interlal + //@internal _getTileOffset(...params: number[]): TileOffsetType { // offset result can't be cached, as it varies with map's center. let offset = this.options['offset']; @@ -1361,14 +1361,14 @@ class TileLayer extends Layer { return this._getTileId(x, y, zoom, id); } - //@interlal + //@internal _getTileId(x: number, y: number, zoom: number, id?: string): string { //id is to mark GroupTileLayer's child layers return `${id || this.getId()}_${x}_${y}_${zoom}`; } - //@interlal + //@internal _project(pcoord: Coordinate, out: Point) { if (this._hasOwnSR) { const map = this.getMap(); @@ -1380,7 +1380,7 @@ class TileLayer extends Layer { } } - //@interlal + //@internal _unproject(pcoord: Coordinate, out: Point) { if (this._hasOwnSR) { const map = this.getMap(); @@ -1397,7 +1397,7 @@ class TileLayer extends Layer { * initialize [tileConfig]{@link TileConfig} for the tilelayer * @private */ - //@interlal + //@internal _initTileConfig() { const map = this.getMap(), tileSize = this.getTileSize(); @@ -1425,7 +1425,7 @@ class TileLayer extends Layer { delete this._disablePyramid; } - //@interlal + //@internal _getTileConfig(): TileConfig { if (!this._defaultTileConfig) { this._initTileConfig(); @@ -1433,7 +1433,7 @@ class TileLayer extends Layer { return this._tileConfig || this._defaultTileConfig; } - //@interlal + //@internal // eslint-disable-next-line @typescript-eslint/no-unused-vars _bindMap(args?: any) { this._onSpatialReferenceChange(); @@ -1441,7 +1441,7 @@ class TileLayer extends Layer { return super._bindMap.apply(this, arguments); } - //@interlal + //@internal _isTileInExtent(frustumMatrix: Matrix4, tileExtent: PointExtent, offset: TileOffsetType, glScale: number) { const map = this.getMap(); @@ -1464,7 +1464,7 @@ class TileLayer extends Layer { return intersectsBox(matrix, TILE_BOX); } - //@interlal + //@internal _isSplittedTileInExtent(frustumMatrix: any, tileExtent: PointExtent, offset: TileOffsetType, glScale: number): boolean { const map = this.getMap(); TILE_BOX[0][0] = (tileExtent.xmin - offset[0]) * glScale; @@ -1480,7 +1480,7 @@ class TileLayer extends Layer { }; } - //@interlal + //@internal _onSpatialReferenceChange() { delete this._tileConfig; delete this._defaultTileConfig; @@ -1527,7 +1527,7 @@ class TileLayer extends Layer { return super.getRenderer() as TileLayerCanvasRenderer; } - //@interlal + //@internal _getTileBBox(tile: TileNodeType): BBOX | null { const map = this.getMap(); if (!map) { @@ -1549,7 +1549,7 @@ class TileLayer extends Layer { } - //@interlal + //@internal _tileInMask(tile: TileNodeType): boolean { const mask = this.getMask(); if (!mask) { diff --git a/src/layer/tile/WMSTileLayer.ts b/src/layer/tile/WMSTileLayer.ts index 39d9e2b1fb..d668500605 100644 --- a/src/layer/tile/WMSTileLayer.ts +++ b/src/layer/tile/WMSTileLayer.ts @@ -59,7 +59,7 @@ let wmsExcludeParams: WMSTileLayerOptionsType; class WMSTileLayer extends TileLayer { wmsParams: WMSTileLayerOptionsType; options: WMSTileLayerOptionsType; - //@interlal + //@internal _wmsVersion: number; constructor(id: string, options: WMSTileLayerOptionsType) { @@ -76,7 +76,7 @@ class WMSTileLayer extends TileLayer { } //in Hook,Reset wmsParams - //@interlal + //@internal _optionsHook(options = {}) { for (const p in options) { //clear tilesize cache diff --git a/src/layer/tile/tileinfo/TileConfig.ts b/src/layer/tile/tileinfo/TileConfig.ts index 186902950c..bfb2a16afb 100644 --- a/src/layer/tile/tileinfo/TileConfig.ts +++ b/src/layer/tile/tileinfo/TileConfig.ts @@ -18,17 +18,17 @@ class TileConfig { map: Map; tileSize: Size; fullExtent: Extent; - //@interlal + //@internal _xScale: number; - //@interlal + //@internal _yScale: number; - //@interlal + //@internal _pointOrigin: Point; - //@interlal + //@internal _glRes: number; tileSystem: TileSystem; transformation: Transformation; - //@interlal + //@internal _tileFullIndex: Record; /** @@ -74,7 +74,7 @@ class TileConfig { * @param res - current resolution * @return tile index */ - //@interlal + //@internal _getTileNum(point: Point, res: number): { x: number, y: number } { const tileSystem = this.tileSystem, tileSize = this['tileSize'], @@ -188,7 +188,7 @@ class TileConfig { }; } - //@interlal + //@internal _getTileFullIndex(res: number) { if (!this._tileFullIndex) { this._tileFullIndex = {}; diff --git a/src/map/Map.Anim.ts b/src/map/Map.Anim.ts index 904397c54b..9e0244712e 100644 --- a/src/map/Map.Anim.ts +++ b/src/map/Map.Anim.ts @@ -7,13 +7,13 @@ import { isNil, isFunction, hasOwn, extend, clamp } from '../core/util'; declare module "./Map" { interface Map { - //@interlal - _mapAnimPlayer: Player; + //@internal + _mapAnimPlayer: Player; isRotating(): boolean; - //@interlal - _animateTo(view: MapViewType, options?: MapAnimationOptionsType, step?: (frame) => void): Player; - //@interlal - _stopAnim(player?: Player): void; + //@internal + _animateTo(view: MapViewType, options?: MapAnimationOptionsType, step?: (frame) => void): Player; + //@internal + _stopAnim(player?: Player): void; animateTo(view: MapViewType, options?: MapAnimationOptionsType, step?: (frame) => void): Player; flyTo(view: MapViewType, options?: MapAnimationOptionsType, step?: (frame) => void): this; isAnimating(): boolean; @@ -186,7 +186,7 @@ Map.include(/** @lends Map.prototype */{ return player; }, - //@interlal + //@internal _animateTo(view, options = {}, step) { if (this._mapAnimPlayer) { this._stopAnim(this._mapAnimPlayer); @@ -426,7 +426,7 @@ Map.include(/** @lends Map.prototype */{ return this.isDragRotating() || !!this._animRotating; }, - //@interlal + //@internal _endAnim(player, props, zoomOrigin, options) { delete this._animRotating; /** @@ -494,7 +494,7 @@ Map.include(/** @lends Map.prototype */{ } }, - //@interlal + //@internal _startAnim(props, zoomOrigin) { if (!this._animPlayer) { return; @@ -520,7 +520,7 @@ Map.include(/** @lends Map.prototype */{ this._animPlayer.play(); }, - //@interlal + //@internal _stopAnim(player) { if (!player) { return; @@ -539,7 +539,7 @@ Map.include(/** @lends Map.prototype */{ // this._resumePrev(player); }, - //@interlal + //@internal _resumePrev(player) { if (!this._prevAnimPlayer) { return; diff --git a/src/map/Map.Camera.ts b/src/map/Map.Camera.ts index 3f19ba63e6..58c04da954 100644 --- a/src/map/Map.Camera.ts +++ b/src/map/Map.Camera.ts @@ -17,18 +17,18 @@ declare module "./Map" { setFov(fov: number): this; getBearing(): number; setBearing(bearing: number): this; - //@interlal - _setBearing(bearing: number): this; + //@internal + _setBearing(bearing: number): this; getPitch(): number; setPitch(pitch: number): this; - //@interlal - _setPitch(pitch: number): this; - //@interlal - _calcMatrices(): void; - //@interlal - _containerPointToPoint(p: Point, zoom?: number, out?: Point): Point; - //@interlal - _recenterOnTerrain(): void; + //@internal + _setPitch(pitch: number): this; + //@internal + _calcMatrices(): void; + //@internal + _containerPointToPoint(p: Point, zoom?: number, out?: Point): Point; + //@internal + _recenterOnTerrain(): void; setCameraMovements(frameOptions: Array, option?: { autoRotate: boolean }); setCameraOrientation(params: MapViewType): this; setCameraPosition(coordinate: Coordinate); @@ -37,18 +37,18 @@ declare module "./Map" { isTransforming(): boolean; getFrustumAltitude(): number; updateCenterAltitude(); - //@interlal - _queryTerrainByProjCoord(coord: Coordinate): number; - //@interlal - _hasAltitudeLayer(): boolean; - //@interlal - _queryTerrainInfo(containerPoint: Point): { coordinate: Coordinate, altitude: number } | null; - //@interlal - _pointAtResToContainerPoint(point: Point, res?: number, altitude?: number, out?: Point): Point; - //@interlal - _pointToContainerPoint(point: Point, zoom?: number, out?: Point): Point; - //@interlal - _pointsAtResToContainerPoints(point: Point[], res?: number, altitude?: number[], out?: Point[]): Point[]; + //@internal + _queryTerrainByProjCoord(coord: Coordinate): number; + //@internal + _hasAltitudeLayer(): boolean; + //@internal + _queryTerrainInfo(containerPoint: Point): { coordinate: Coordinate, altitude: number } | null; + //@internal + _pointAtResToContainerPoint(point: Point, res?: number, altitude?: number, out?: Point): Point; + //@internal + _pointToContainerPoint(point: Point, zoom?: number, out?: Point): Point; + //@internal + _pointsAtResToContainerPoints(point: Point[], res?: number, altitude?: number[], out?: Point[]): Point[]; } } @@ -145,7 +145,7 @@ Map.include(/** @lends Map.prototype */{ return this._setBearing(view.bearing); }, - //@interlal + //@internal _setBearing(bearing) { if (Browser.ie9) { throw new Error('map can\'t rotate in IE9.'); @@ -215,7 +215,7 @@ Map.include(/** @lends Map.prototype */{ return this._setPitch(view.pitch); }, - //@interlal + //@internal _setPitch(pitch) { if (Browser.ie9) { throw new Error('map can\'t tilt in IE9.'); @@ -324,7 +324,7 @@ Map.include(/** @lends Map.prototype */{ }; }, - //@interlal + //@internal _setCameraMovement(frameOption, frame) { this.animateTo({ zoom: frameOption.zoom, @@ -449,7 +449,7 @@ Map.include(/** @lends Map.prototype */{ return this._frustumAltitude; }, - //@interlal + //@internal _calcFrustumAltitude() { const pitch = 90 - this.getPitch(); let fov = this.getFov() / 2; @@ -473,13 +473,13 @@ Map.include(/** @lends Map.prototype */{ * @private * @function */ - //@interlal + //@internal _pointToContainerPoint: function (point, zoom, altitude = 0, out) { const res = this._getResolution(zoom); return this._pointAtResToContainerPoint(point, res, altitude, out); }, - //@interlal + //@internal _pointAtResToContainerPoint: function (point, res, altitude = 0, out) { if (!out) { out = new Point(0, 0); @@ -498,7 +498,7 @@ Map.include(/** @lends Map.prototype */{ /** *Batch conversion for better performance */ - //@interlal + //@internal _pointsAtResToContainerPoints: function (points, targetRes, altitudes = [], resultPoints = []) { const pitch = this.getPitch(), bearing = this.getBearing(); const scale = targetRes / this._getResolution(); @@ -541,7 +541,7 @@ Map.include(/** @lends Map.prototype */{ return resultPoints; }, - //@interlal + //@internal _toContainerPoint: function () { const a = [0, 0, 0]; return function (out, isTransforming, altitude, centerPoint) { @@ -565,7 +565,7 @@ Map.include(/** @lends Map.prototype */{ }(), // https://forum.unity.com/threads/camera-worldtoscreenpoint-bug.85311/#post-2121212 - //@interlal + //@internal _projIfBehindCamera: function () { const vectorFromCam = new Array(3); const proj = new Array(3); @@ -590,13 +590,13 @@ Map.include(/** @lends Map.prototype */{ * @private * @function */ - //@interlal + //@internal _containerPointToPoint: function (p, zoom, out, height) { const res = this._getResolution(zoom); return this._containerPointToPointAtRes(p, res, out, height); }, - //@interlal + //@internal _containerPointToPointAtRes: function () { const cp = [0, 0, 0], coord0 = [0, 0, 0, 1], @@ -655,7 +655,7 @@ Map.include(/** @lends Map.prototype */{ * map.projViewMatrixInverse = projViewMatrix.inverse() * @private */ - //@interlal + //@internal _calcMatrices: function () { // closure matrixes to reuse const m1 = createMat4(); @@ -702,7 +702,7 @@ Map.include(/** @lends Map.prototype */{ }; }(), - //@interlal + //@internal _getCameraFar(fov, pitch) { const cameraCenterDistance = this.cameraCenterDistance = distance(this.cameraPosition, this.cameraLookAt); const distanceInMeter = cameraCenterDistance / this._meterToGLPoint; @@ -711,7 +711,7 @@ Map.include(/** @lends Map.prototype */{ return Math.max(cameraFarDistance * this._meterToGLPoint, cameraCenterDistance * 5); }, - //@interlal + //@internal _calcCascadeMatrixes: function () { // const cameraLookAt = []; // const cameraPosition = []; @@ -763,7 +763,7 @@ Map.include(/** @lends Map.prototype */{ }; }(), - //@interlal + //@internal _calcDomMatrix: function () { const m = createMat4(), m1 = createMat4(), @@ -787,14 +787,14 @@ Map.include(/** @lends Map.prototype */{ }; }(), - //@interlal + //@internal _getFovZ(zoom) { const scale = this.getGLScale(zoom); const ratio = this._getFovRatio(); return scale * (this.height || 1) / 2 / ratio; }, - //@interlal + //@internal _getCameraWorldMatrix: function () { const q = {}; return function () { @@ -869,7 +869,7 @@ Map.include(/** @lends Map.prototype */{ this._recenterOnTerrain(); }, - //@interlal + //@internal _recenterOnTerrain() { if (this.centerAltitude === undefined || this._centerZ !== undefined) { return; @@ -947,7 +947,7 @@ Map.include(/** @lends Map.prototype */{ // return zoom; // }, - //@interlal + //@internal _queryTerrainByProjCoord(coord) { const layers = this._getLayers(); for (let i = 0; i < layers.length; i++) { @@ -958,7 +958,7 @@ Map.include(/** @lends Map.prototype */{ return 0; }, - //@interlal + //@internal _hasAltitudeLayer() { const layers = this._getLayers(); for (let i = 0; i < layers.length; i++) { @@ -969,7 +969,7 @@ Map.include(/** @lends Map.prototype */{ return false; }, - //@interlal + //@internal _queryTerrainInfo(containerPoint) { const layers = this._getLayers() || []; for (let i = 0; i < layers.length; i++) { @@ -989,13 +989,13 @@ Map.include(/** @lends Map.prototype */{ return null; }, - //@interlal + //@internal _getFovRatio() { const fov = this.getFov(); return Math.tan(fov / 2 * RADIAN); }, - //@interlal + //@internal _renderLayers() { if (this.isInteracting()) { return; diff --git a/src/map/Map.Collision.ts b/src/map/Map.Collision.ts index 70044cc815..f8243ce484 100644 --- a/src/map/Map.Collision.ts +++ b/src/map/Map.Collision.ts @@ -7,13 +7,13 @@ declare module "./Map" { getCollisionIndex(): CollisionIndex createCollisionIndex(): CollisionIndex clearCollisionIndex(): this - //@interlal - _insertUICollidesQueue(): this + //@internal + _insertUICollidesQueue(): this uiCollides(): this - //@interlal - _addUI(ui: UIComponent): this - //@interlal - _removeUI(ui: UIComponent): number + //@internal + _addUI(ui: UIComponent): this + //@internal + _removeUI(ui: UIComponent): number } } @@ -59,7 +59,7 @@ Map.include({ return this; }, - //@interlal + //@internal _insertUICollidesQueue(): Map { if (!this._uiCollidesQueue) { this._uiCollidesQueue = []; @@ -127,7 +127,7 @@ Map.include({ * @private * @param ui - UIComponent对象 */ - //@interlal + //@internal _addUI(ui: UIComponent): Map { if (!this.uiList) { this.uiList = []; @@ -148,7 +148,7 @@ Map.include({ * @private * @param ui - UIComponent对象 */ - //@interlal + //@internal _removeUI(ui: UIComponent): number { if (!this.uiList) { return -1; diff --git a/src/map/Map.CoordTransform.ts b/src/map/Map.CoordTransform.ts index 0c2e354fe8..8ca56315a8 100644 --- a/src/map/Map.CoordTransform.ts +++ b/src/map/Map.CoordTransform.ts @@ -445,7 +445,7 @@ Map.include(/** @lends Map.prototype */{ }; }(), - //@interlal + //@internal _get2DExtent(zoom, out) { let cached; if ((zoom === undefined || zoom === this._zoomLevel) && this._mapExtent2D) { @@ -466,7 +466,7 @@ Map.include(/** @lends Map.prototype */{ return this._get2DExtent(zoom, out); }, - //@interlal + //@internal _get2DExtentAtRes: function () { const POINT = new Point(0, 0); return function (res, out) { @@ -486,7 +486,7 @@ Map.include(/** @lends Map.prototype */{ return this._pointToExtent(extent2D); }, - //@interlal + //@internal _pointToExtent: function () { const COORD0 = new Coordinate(0, 0); const COORD1 = new Coordinate(0, 0); @@ -522,7 +522,7 @@ Map.include(/** @lends Map.prototype */{ }; }(), - //@interlal + //@internal _viewPointToPrj: function () { const POINT = new Point(0, 0); return function (viewPoint, out) { @@ -534,7 +534,7 @@ Map.include(/** @lends Map.prototype */{ return this._viewPointToPrj(viewPoint, out); }, - //@interlal + //@internal _prjToContainerPoint(pCoordinate, zoom, out, altitude) { const res = this._getResolution(zoom); return this._prjToContainerPointAtRes(pCoordinate, res, out, altitude); @@ -544,7 +544,7 @@ Map.include(/** @lends Map.prototype */{ return this._prjToContainerPoint(pCoordinate, zoom, out, altitude); }, - //@interlal + //@internal _prjToContainerPointAtRes: function () { const POINT = new Point(0, 0); return function (pCoordinate, res, out, altitude) { @@ -556,7 +556,7 @@ Map.include(/** @lends Map.prototype */{ return this.prjToContainerPointAtRes(pCoordinate, res, out, altitude); }, - //@interlal + //@internal _prjToViewPoint: function () { const POINT = new Point(0, 0); return function (pCoordinate, out, altitude) { @@ -569,7 +569,7 @@ Map.include(/** @lends Map.prototype */{ return this._prjToViewPoint(pCoordinate, out, altitude); }, - //@interlal + //@internal _viewPointToPoint: function () { const POINT = new Point(0, 0); return function (viewPoint, zoom, out) { @@ -581,7 +581,7 @@ Map.include(/** @lends Map.prototype */{ return this._viewPointToPoint(viewPoint, zoom, out); }, - //@interlal + //@internal _pointToViewPoint: function () { const COORD = new Coordinate(0, 0); return function (point, zoom, out) { diff --git a/src/map/Map.DomEvents.ts b/src/map/Map.DomEvents.ts index b5d56526a6..52433a80d0 100644 --- a/src/map/Map.DomEvents.ts +++ b/src/map/Map.DomEvents.ts @@ -13,20 +13,20 @@ import { Coordinate, Point } from '../geo'; declare module "./Map" { interface Map { - //@interlal - _removeDomEvents(): void; - //@interlal - _ignoreEvent(domEvent: MapEventDomType): boolean; - //@interlal - _isEventOutMap(domEvent: MapEventDomType): boolean; - //@interlal - _parseEvent(e: MapEventDomType, type?: string): MapEventDataType; - //@interlal - _parseEventFromCoord(coord: Coordinate): MapEventDataType; - //@interlal - _fireDOMEvent(target: any, e: MapEventDomType, type: string); - //@interlal - _getEventParams(e: MapEventDomType): MapEventDataType; + //@internal + _removeDomEvents(): void; + //@internal + _ignoreEvent(domEvent: MapEventDomType): boolean; + //@internal + _isEventOutMap(domEvent: MapEventDomType): boolean; + //@internal + _parseEvent(e: MapEventDomType, type?: string): MapEventDataType; + //@internal + _parseEventFromCoord(coord: Coordinate): MapEventDataType; + //@internal + _fireDOMEvent(target: any, e: MapEventDomType, type: string); + //@internal + _getEventParams(e: MapEventDomType): MapEventDataType; } } @@ -232,21 +232,21 @@ const events = 'drop '; Map.include(/** @lends Map.prototype */ { - //@interlal + //@internal _registerDomEvents() { const dom = this._panels.mapWrapper || this._containerDOM; addDomEvent(dom, events, this._handleDOMEvent, this); addDomEvent(dom, DRAGEVENTS, dragEventHanlder, this); }, - //@interlal + //@internal _removeDomEvents() { const dom = this._panels.mapWrapper || this._containerDOM; removeDomEvent(dom, events, this._handleDOMEvent); removeDomEvent(dom, DRAGEVENTS, dragEventHanlder); }, - //@interlal + //@internal _handleDOMEvent(e: MapEventDomType) { if (e && e.type === 'drop') { // https://developer.mozilla.org/zh-CN/docs/Web/API/HTML_Drag_and_Drop_API @@ -331,7 +331,7 @@ Map.include(/** @lends Map.prototype */ { } }, - //@interlal + //@internal _ignoreEvent(domEvent) { //ignore events originated from control and ui doms. if (!domEvent || !this._panels.control) { @@ -356,7 +356,7 @@ Map.include(/** @lends Map.prototype */ { return false; }, - //@interlal + //@internal _isEventOutMap(domEvent: MapEventDomType) { if (this.getPitch() > this.options['maxVisualPitch']) { const actualEvent = this._getActualEvent(domEvent); @@ -368,14 +368,14 @@ Map.include(/** @lends Map.prototype */ { return false; }, - //@interlal + //@internal _wrapTerrainData(eventParam: MapEventDataType) { if (eventParam.containerPoint && !eventParam.terrain) { eventParam.terrain = this._queryTerrainInfo(eventParam.containerPoint); } }, - //@interlal + //@internal _parseEvent(e: MapEventDomType, type: string): MapEventDataType { if (!e) { return null; @@ -405,7 +405,7 @@ Map.include(/** @lends Map.prototype */ { return eventParam; }, - //@interlal + //@internal _parseEventFromCoord(coord: Coordinate): MapEventDataType { const containerPoint = this.coordToContainerPoint(coord), viewPoint = this.containerPointToViewPoint(containerPoint); @@ -418,7 +418,7 @@ Map.include(/** @lends Map.prototype */ { return e; }, - //@interlal + //@internal _getActualEvent(e: MapEventDomType) { e = e as TouchEvent; return e.touches && e.touches.length > 0 ? @@ -426,7 +426,7 @@ Map.include(/** @lends Map.prototype */ { e.changedTouches[0] : e; }, - //@interlal + //@internal _fireDOMEvent(target, e: MapEventDomType, type: string) { if (this.isRemoved()) { return; @@ -456,7 +456,7 @@ Map.include(/** @lends Map.prototype */ { // } // Extract _ geteventparams is reused in other plug-ins,such as maptalks.three plugin - //@interlal + //@internal _getEventParams(e): MapEventDataType { const map = this; const eventParam = { diff --git a/src/map/Map.FullScreen.ts b/src/map/Map.FullScreen.ts index 6168a35d0a..dda1d3f3d5 100644 --- a/src/map/Map.FullScreen.ts +++ b/src/map/Map.FullScreen.ts @@ -5,10 +5,10 @@ declare module "./Map" { isFullScreen(): boolean; requestFullScreen(dom?: HTMLDivElement): this; cancelFullScreen(): this; - //@interlal - _requestFullScreen(dom: HTMLDivElement): void; - //@interlal - _cancelFullScreen(): void; + //@internal + _requestFullScreen(dom: HTMLDivElement): void; + //@internal + _cancelFullScreen(): void; } } @@ -72,7 +72,7 @@ Map.include(/** @lends Map.prototype */ { return this; }, - //@interlal + //@internal _requestFullScreen(dom) { if (dom.requestFullscreen) { dom.requestFullscreen(); @@ -95,7 +95,7 @@ Map.include(/** @lends Map.prototype */ { } }, - //@interlal + //@internal _cancelFullScreen() { const doc=document as any; if (document.exitFullscreen) { diff --git a/src/map/Map.Pan.ts b/src/map/Map.Pan.ts index 918fcafc0b..9f13735b57 100644 --- a/src/map/Map.Pan.ts +++ b/src/map/Map.Pan.ts @@ -9,11 +9,11 @@ declare module "./Map" { interface Map { panTo(coordinate: Coordinate, options?: MapAnimationOptionsType, step?: (frame) => void): this; - //@interlal - _panTo(prjCoord: Coordinate, options?: MapAnimationOptionsType): this; + //@internal + _panTo(prjCoord: Coordinate, options?: MapAnimationOptionsType): this; panBy(offset: Point | Array, options?: MapAnimationOptionsType, step?: (frame) => void): this; - //@interlal - _panAnimation(target: Coordinate, t?: number, cb?: (frame) => void): void; + //@internal + _panAnimation(target: Coordinate, t?: number, cb?: (frame) => void): void; } } @@ -47,7 +47,7 @@ Map.include(/** @lends Map.prototype */ { return this; }, - //@interlal + //@internal _panTo: function (prjCoord, options: MapAnimationOptionsType = {}) { if (typeof (options['animation']) === 'undefined' || options['animation']) { return this._panAnimation(prjCoord, options['duration']); @@ -104,7 +104,7 @@ Map.include(/** @lends Map.prototype */ { return this; }, - //@interlal + //@internal _panAnimation: function (target: Coordinate, t: number, cb: (frame) => void) { return this._animateTo({ 'prjCenter': target diff --git a/src/map/Map.Topo.ts b/src/map/Map.Topo.ts index ceb62e8a1b..8e39f76d7b 100644 --- a/src/map/Map.Topo.ts +++ b/src/map/Map.Topo.ts @@ -165,7 +165,7 @@ Map.include(/** @lends Map.prototype */ { }); }, - //@interlal + //@internal _identify: function (opts, callback, fn) { const reqLayers = opts['layers']; if (!isArrayHasData(reqLayers)) { diff --git a/src/map/Map.ViewHistory.ts b/src/map/Map.ViewHistory.ts index 0bae2397df..af15b1eb9a 100644 --- a/src/map/Map.ViewHistory.ts +++ b/src/map/Map.ViewHistory.ts @@ -3,17 +3,17 @@ import Map, { MapAnimationOptionsType, MapViewType } from './Map'; declare module "./Map" { interface Map { - //@interlal - _viewHistory: Array; + //@internal + _viewHistory: Array; zoomToPreviousView(options?: any): MapViewType; hasPreviousView(): boolean; zoomToNextView(options?: any): MapViewType; hasNextView(): boolean; getViewHistory(): Array; - //@interlal - _onViewChange(view: MapViewType): void; - //@interlal - _getCurrentView(): MapViewType; + //@internal + _onViewChange(view: MapViewType): void; + //@internal + _getCurrentView(): MapViewType; } @@ -22,7 +22,7 @@ declare module "./Map" { Map.include(/** @lends Map.prototype */ { - //@interlal + //@internal _onViewChange(view: MapViewType) { if (!this._viewHistory) { this._viewHistory = []; @@ -108,7 +108,7 @@ Map.include(/** @lends Map.prototype */ { return true; }, - //@interlal + //@internal _zoomToView(view: MapViewType, options: MapAnimationOptionsType) { const old = this.getView(); if (options['animation']) { @@ -133,7 +133,7 @@ Map.include(/** @lends Map.prototype */ { return this._viewHistory; }, - //@interlal + //@internal _fireViewChange(old: MapViewType, view: MapViewType) { this._fireEvent('viewchange', { 'old': old, @@ -142,7 +142,7 @@ Map.include(/** @lends Map.prototype */ { this._insertUICollidesQueue(); }, - //@interlal + //@internal _getCurrentView(): MapViewType { if (!this._viewHistory) { return null; diff --git a/src/map/Map.Zoom.ts b/src/map/Map.Zoom.ts index 0cf1a3302f..f35e4c5799 100644 --- a/src/map/Map.Zoom.ts +++ b/src/map/Map.Zoom.ts @@ -6,21 +6,21 @@ import Map from './Map'; declare module "./Map" { interface Map { - //@interlal - _zoom(nextZoom: number, origin?: Point); - //@interlal - _zoomAnimation(nextZoom: number, origin?: Point, startScale?: number); - //@interlal - _checkZoomOrigin(origin?: Point): Point; - //@interlal - _startZoomAnim(nextZoom: number, origin?: Point, startScale?: number); + //@internal + _zoom(nextZoom: number, origin?: Point); + //@internal + _zoomAnimation(nextZoom: number, origin?: Point, startScale?: number); + //@internal + _checkZoomOrigin(origin?: Point): Point; + //@internal + _startZoomAnim(nextZoom: number, origin?: Point, startScale?: number); onZoomStart(nextZoom: number, origin?: Point); onZooming(nextZoom: number, origin?: Point, startScale?: number); onZoomEnd(nextZoom: number, origin?: Point); - //@interlal - _zoomTo(nextZoom: number, origin?: Point); - //@interlal - _checkZoom(nextZoom: number): number; + //@internal + _zoomTo(nextZoom: number, origin?: Point); + //@internal + _checkZoom(nextZoom: number): number; } } @@ -28,7 +28,7 @@ declare module "./Map" { Map.include(/** @lends Map.prototype */{ - //@interlal + //@internal _zoom(nextZoom: number, origin?: Point) { if (!this.options['zoomable'] || this.isZooming()) { return; } origin = this._checkZoomOrigin(origin); @@ -38,7 +38,7 @@ Map.include(/** @lends Map.prototype */{ this.onZoomEnd(nextZoom, origin); }, - //@interlal + //@internal _zoomAnimation(nextZoom: number, origin?: Point, startScale?: number) { if (!this.options['zoomable'] || this.isZooming()) { return; } @@ -50,7 +50,7 @@ Map.include(/** @lends Map.prototype */{ this._startZoomAnim(nextZoom, origin, startScale); }, - //@interlal + //@internal _checkZoomOrigin(origin?: Point) { if (!origin || this.options['zoomInCenter']) { origin = new Point(this.width / 2, this.height / 2); @@ -61,7 +61,7 @@ Map.include(/** @lends Map.prototype */{ return origin; }, - //@interlal + //@internal _startZoomAnim(nextZoom: number, origin?: Point, startScale?: number) { if (isNil(startScale)) { startScale = 1; @@ -169,7 +169,7 @@ Map.include(/** @lends Map.prototype */{ } }, - //@interlal + //@internal _zoomTo(nextZoom: number, origin?: Point) { this._zoomLevel = nextZoom; this._calcMatrices(); @@ -180,7 +180,7 @@ Map.include(/** @lends Map.prototype */{ } }, - //@interlal + //@internal _checkZoom(nextZoom: number) { const maxZoom = this.getMaxZoom(), minZoom = this.getMinZoom(); diff --git a/src/map/Map.ts b/src/map/Map.ts index 980597a5c7..8c6dc599e7 100644 --- a/src/map/Map.ts +++ b/src/map/Map.ts @@ -188,75 +188,75 @@ const options: MapOptionsType = { */ export class Map extends Handlerable(Eventable(Renderable(Class))) { VERSION: string; - //@interlal + //@internal _loaded: boolean; - //@interlal + //@internal _panels: Record; - //@interlal + //@internal _baseLayer: Layer; - //@interlal + //@internal _layers: Array; - //@interlal + //@internal _zoomLevel: number; - //@interlal + //@internal _center: Coordinate; - //@interlal + //@internal _centerZ: number; - //@interlal + //@internal _mapViewPoint: Point; isMap: boolean; - //@interlal + //@internal _containerDOM: HTMLDivElement | HTMLCanvasElement; - //@interlal + //@internal _spatialReference: SpatialReference; - //@interlal + //@internal _originLng: number; - //@interlal + //@internal _altitudeOriginDirty: boolean; - //@interlal + //@internal _glScale: number; - //@interlal + //@internal _cursor: string; - //@interlal + //@internal _prjCenter: Coordinate; centerAltitude: number; width: number; height: number; - //@interlal + //@internal _prjMaxExtent: PointExtent; - //@interlal + //@internal _glRes: number; - //@interlal + //@internal _zooming: boolean; - //@interlal + //@internal _layerCache: { [key: string]: Layer }; - //@interlal + //@internal _mapViewCoord: Coordinate; - //@interlal + //@internal _eventSilence: boolean; - //@interlal + //@internal _moving: boolean; - //@interlal + //@internal _originCenter: Coordinate; - //@interlal + //@internal _suppressRecenter: boolean; - //@interlal + //@internal _dragRotating: boolean; CanvasClass: any; - //@interlal + //@internal _priorityCursor: string; - //@interlal + //@internal _initTime: number; - //@interlal + //@internal _renderer: any; - //@interlal + //@internal _containerDomContentRect: DOMRect; - //@interlal + //@internal _mapRes: number; - //@interlal + //@internal _onLoadHooks: Array<(...args) => void>; cameraCenterDistance: number; - //@interlal + //@internal _limitMaxExtenting: boolean; options: MapOptionsType; static VERSION: string; @@ -427,7 +427,7 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) { return this; } - //@interlal + //@internal _updateSpatialReference(ref: SpatialReferenceType, oldRef) { if (isString(ref)) { ref = SpatialReference.getPreset(ref); @@ -639,7 +639,7 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) { return new PointExtent(0, this.height - visualHeight, this.width, this.height); } - //@interlal + //@internal _getVisualHeight(visualPitch) { // const pitch = this.getPitch(); // const visualDistance = this.height / 2 * Math.tan(visualPitch * Math.PI / 180); @@ -975,7 +975,7 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) { * @param {Number} [options.paddingBottom] - Sets the amount of padding in the bottom of a map container * @returns {Object|null} */ - //@interlal + //@internal _getPaddingSize(options = {}) { if (options['paddingLeft'] || options['paddingTop'] || options['paddingRight'] || options['paddingBottom']) { return { @@ -1037,7 +1037,7 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) { }; } - //@interlal + //@internal _validateView(view: MapViewType) { if (!view || !isObject(view)) { return; @@ -1116,7 +1116,7 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) { * @param {Number} [padding.paddingBottom] - Sets the amount of padding in the bottom of a map container * @return {Coordinate} */ - //@interlal + //@internal _getCenterByPadding(center: Coordinate, zoom?: number, padding?: MapPaddingType) { const point = this.coordinateToPoint(center, zoom); const { paddingLeft = 0, paddingRight = 0, paddingTop = 0, paddingBottom = 0 } = padding || {}; @@ -1917,7 +1917,7 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) { //----------------------------------------------------------- - //@interlal + //@internal _initContainer(container: MapContainerType) { if (isString(container)) { this._containerDOM = document.getElementById(container) as HTMLDivElement; @@ -1945,7 +1945,7 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) { * @private * @param {String} cursor css cursor */ - //@interlal + //@internal _trySetCursor(cursor: string) { if (!this._cursor && !this._priorityCursor) { if (!cursor) { @@ -1956,7 +1956,7 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) { return this; } - //@interlal + //@internal _setPriorityCursor(cursor: string) { if (!cursor) { let hasCursor = false; @@ -1974,7 +1974,7 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) { return this; } - //@interlal + //@internal _setCursorToPanel(cursor: string) { const panel = this.getMainPanel(); if (panel && panel.style && panel.style.cursor !== cursor) { @@ -1984,7 +1984,7 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) { //remove a layer from the layerList - //@interlal + //@internal _removeLayer(layer: Layer, layerList: Array) { if (!layer || !layerList) { return; @@ -1995,7 +1995,7 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) { } } - //@interlal + //@internal _sortLayersByZIndex() { if (!this._layers) { return; @@ -2019,7 +2019,7 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) { } - //@interlal + //@internal _fireEvent(eventName: string, param?: { [key: string]: any }) { if (this._eventSilence) { return; @@ -2032,7 +2032,7 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) { this.fire(eventName, param); } - //@interlal + //@internal _Load() { this._resetMapStatus(); if (this.options['pitch']) { @@ -2051,7 +2051,7 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) { this._initTime = now(); } - //@interlal + //@internal _initRenderer() { const renderer = this.options['renderer']; const clazz = Map.getRendererClass(renderer) as any; @@ -2059,12 +2059,12 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) { this._renderer.load(); } - //@interlal + //@internal _getRenderer() { return this._renderer; } - //@interlal + //@internal _loadAllLayers() { function loadLayer(layer) { if (layer) { @@ -2083,7 +2083,7 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) { * @return {Layer[]} * @private */ - //@interlal + //@internal _getLayers(filter?: (layer: Layer) => boolean) { const layers = this._baseLayer ? [this._baseLayer].concat(this._layers) : this._layers; const result = []; @@ -2095,7 +2095,7 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) { return result; } - //@interlal + //@internal _eachLayer(fn, ...layerLists) { if (arguments.length < 2) { return; @@ -2113,7 +2113,7 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) { } } - //@interlal + //@internal _onLayerEvent(param) { if (!param) { return; @@ -2125,7 +2125,7 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) { } //Check and reset map's status when map's spatial reference is changed. - //@interlal + //@internal _resetMapStatus() { let maxZoom = this.getMaxZoom(), minZoom = this.getMinZoom(); @@ -2164,7 +2164,7 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) { this._containerDomContentRect = domRect; } - //@interlal + //@internal _getContainerDomSize(): Size | null { if (!this._containerDOM) { return null; @@ -2196,7 +2196,7 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) { return new Size(width, height); } - //@interlal + //@internal _updateMapSize(mSize: Size) { this.width = mSize['width']; this.height = mSize['height']; @@ -2210,12 +2210,12 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) { * @return {Coordinate} * @private */ - //@interlal + //@internal _getPrjCenter() { return this._prjCenter; } - //@interlal + //@internal _setPrjCenter(pcenter: Coordinate) { this._prjCenter = pcenter; if (this.isInteracting() && !this.isMoving()) { @@ -2226,7 +2226,7 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) { this._calcMatrices(); } - //@interlal + //@internal _setPrjCoordAtContainerPoint(coordinate: Coordinate, point: Point) { if (!this.centerAltitude && point.x === this.width / 2 && point.y === this.height / 2) { return this; @@ -2238,14 +2238,14 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) { return this; } - //@interlal + //@internal _setPrjCoordAtOffsetToCenter(prjCoord: Coordinate, offset: Point) { const pcenter = this._pointToPrj(this._prjToPoint(prjCoord)._sub(offset)); this._setPrjCenter(pcenter); return this; } - //@interlal + //@internal _verifyExtent(prjCenter: Coordinate) { if (!prjCenter) { return false; @@ -2257,7 +2257,7 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) { return maxExt.contains(prjCenter); } - //@interlal + //@internal _limitMaxExtent() { if (this._limitMaxExtenting || !this.options.limitExtentOnMaxExtent) { return this; @@ -2357,7 +2357,7 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) { * @ * @returns {Coordinate} the new projected center. */ - //@interlal + //@internal _offsetCenterByPixel(pixel: Point) { const pos = TEMP_POINT.set(this.width / 2 - pixel.x, this.height / 2 - pixel.y); const coord = this._containerPointToPrj(pos, TEMP_COORD); @@ -2400,7 +2400,7 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) { } - //@interlal + //@internal _resetMapViewPoint() { this._mapViewPoint = new Point(0, 0); // mapViewCoord is the proj coordinate of current view point @@ -2412,7 +2412,7 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) { * @return {Number} resolution * @private */ - //@interlal + //@internal _getResolution(zoom?: number) { if ((zoom === undefined || zoom === this._zoomLevel) && this._mapRes !== undefined) { return this._mapRes; @@ -2423,7 +2423,7 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) { return this._spatialReference.getResolution(zoom); } - //@interlal + //@internal _getResolutions() { return this._spatialReference.getResolutions(); } @@ -2435,14 +2435,14 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) { * @return {Point} 2D point * @private */ - //@interlal + //@internal _prjToPoint(pCoord, zoom?: number, out?: Point) { zoom = (isNil(zoom) ? this.getZoom() : zoom); const res = this._getResolution(zoom); return this._prjToPointAtRes(pCoord, res, out); } - //@interlal + //@internal _prjToPointAtRes(pCoord: Coordinate, res?: number, out?: Point): Point { return this._spatialReference.getTransformation().transform(pCoord, res, out); } @@ -2453,8 +2453,8 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) { * @param {Number} res - point's resolution * @return {Point} 2D point * @private + * @internal */ - //@interlal _prjsToPointsAtRes(pCoords: Array, res?: number, resultPoints = []): Array { const transformation = this._spatialReference.getTransformation(); const pts = []; @@ -2472,14 +2472,14 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) { * @return {Coordinate} projected coordinate * @private */ - //@interlal + //@internal _pointToPrj(point: Point, zoom?: number, out?: Coordinate): Coordinate { zoom = (isNil(zoom) ? this.getZoom() : zoom); const res = this._getResolution(zoom); return this._pointToPrjAtRes(point, res, out); } - //@interlal + //@internal _pointToPrjAtRes(point: Point, res?: number, out?: Coordinate): Coordinate { return this._spatialReference.getTransformation().untransform(point, res, out); } @@ -2491,7 +2491,7 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) { * @return {Point} point at current zoom * @private */ - //@interlal + //@internal _pointToPoint(point: Point, zoom?: number, out?: Point): Point { if (!isNil(zoom)) { return this._pointAtResToPoint(point, this._getResolution(zoom), out); @@ -2505,7 +2505,7 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) { return out; } - //@interlal + //@internal _pointAtResToPoint(point: Point, res?: number, out?: Point): Point { if (out) { out.x = point.x; @@ -2523,7 +2523,7 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) { * @return {Point} point at target res * @private */ - //@interlal + //@internal _pointToPointAtRes(point: Point, res?: number, out?: Point): Point { if (out) { out.x = point.x; @@ -2541,14 +2541,14 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) { * @return {Coordinate} * @private */ - //@interlal + //@internal _containerPointToPrj(containerPoint: Point, out?: Coordinate) { return this._pointToPrj(this._containerPointToPoint(containerPoint, undefined, out as Point), undefined, out); } /* eslint no-extend-native: 0 */ - //@interlal + //@internal _callOnLoadHooks() { const proto = Map.prototype; if (!proto._onLoadHooks) { @@ -2559,7 +2559,7 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) { } } //fix prj value when current view is world wide - //@interlal + //@internal _fixPrjOnWorldWide(prjCoord: Coordinate) { const projection = this.getProjection() as any; if (projection && projection.fullExtent && prjCoord) { diff --git a/src/map/handler/Map.AutoPanAtEdge.ts b/src/map/handler/Map.AutoPanAtEdge.ts index ba1ed0024f..0094ab8e32 100644 --- a/src/map/handler/Map.AutoPanAtEdge.ts +++ b/src/map/handler/Map.AutoPanAtEdge.ts @@ -20,7 +20,7 @@ class MapAutoPanAtEdgeHandler extends Handler { this.target.off('_mousemove', this._onMouseMove, this); } - //@interlal + //@internal _onMouseMove(event: Event) { const map = this.target; if (map.options['autoPanAtEdge']) { diff --git a/src/map/handler/Map.BoxZoom.ts b/src/map/handler/Map.BoxZoom.ts index a7f90b8f22..fb21dde393 100644 --- a/src/map/handler/Map.BoxZoom.ts +++ b/src/map/handler/Map.BoxZoom.ts @@ -27,7 +27,7 @@ class MapBoxZoomHander extends Handler { } } - //@interlal + //@internal _onMouseDown(param: Param) { if (!this.target.options['boxZoom']) { return; @@ -39,7 +39,7 @@ class MapBoxZoomHander extends Handler { } } - //@interlal + //@internal _boxZoom(param: Param) { const map = this.target; this.drawTool.remove(); diff --git a/src/map/handler/Map.DoubleClickZoom.ts b/src/map/handler/Map.DoubleClickZoom.ts index 32bb88cb7f..e1ff4e8802 100644 --- a/src/map/handler/Map.DoubleClickZoom.ts +++ b/src/map/handler/Map.DoubleClickZoom.ts @@ -18,7 +18,7 @@ class MapDoubleClickZoomHandler extends Handler { this.target.off('_dblclick', this._onDoubleClick, this); } - //@interlal + //@internal _onDoubleClick(param: Param) { const map = this.target; if (map.options['doubleClickZoom']) { diff --git a/src/map/handler/Map.Drag.ts b/src/map/handler/Map.Drag.ts index 80ca8810d8..11353c506c 100644 --- a/src/map/handler/Map.Drag.ts +++ b/src/map/handler/Map.Drag.ts @@ -7,24 +7,24 @@ import { type Param } from './CommonType'; class MapDragHandler extends Handler { - //@interlal + //@internal _dragHandler: DragHandler startDragTime: number startBearing: number - //@interlal + //@internal _mode: 'rotatePitch' | 'move' preX: number preY: number startX: number startY: number // TODO:等待补充Coordinate类型定义 - //@interlal + //@internal _startPrjCenter: any // TODO:等待补充Coordinate类型定义 startPrjCoord: any - //@interlal + //@internal _rotateMode: 'rotate_pitch' | 'rotate' | 'pitch' - //@interlal + //@internal _db: number // TODO:等待补充Map类型定义 // target: Map @@ -55,7 +55,7 @@ class MapDragHandler extends Handler { delete this._dragHandler; } - //@interlal + //@internal _cancelOn(domEvent: any) { if (this.target.isZooming() || this._ignore(domEvent)) { return true; @@ -63,7 +63,7 @@ class MapDragHandler extends Handler { return false; } - //@interlal + //@internal _ignore(param: any) { if (!param) { return false; @@ -74,7 +74,7 @@ class MapDragHandler extends Handler { return this.target._ignoreEvent(param) || this.target._isEventOutMap(param); } - //@interlal + //@internal _onMouseDown(param: any) { delete this.startDragTime; delete this._mode; @@ -93,7 +93,7 @@ class MapDragHandler extends Handler { preventDefault(param['domEvent']); } - //@interlal + //@internal _onDragStart(param) { this.startDragTime = now(); if (this._mode === 'move') { @@ -103,7 +103,7 @@ class MapDragHandler extends Handler { } } - //@interlal + //@internal _onDragging(param) { const map = this.target; if (map._isEventOutMap(param['domEvent'])) { @@ -116,7 +116,7 @@ class MapDragHandler extends Handler { } } - //@interlal + //@internal _onDragEnd(param) { if (this._mode === 'move') { this._moveEnd(param); @@ -127,7 +127,7 @@ class MapDragHandler extends Handler { delete this.startBearing; } - //@interlal + //@internal _start(param) { this.preX = param['mousePos'].x; this.preY = param['mousePos'].y; @@ -136,7 +136,7 @@ class MapDragHandler extends Handler { this._startPrjCenter = this.target._getPrjCenter().copy(); } - //@interlal + //@internal _moveStart(param) { this._start(param); const map = this.target; @@ -145,7 +145,7 @@ class MapDragHandler extends Handler { this.startPrjCoord = this._containerPointToPrj(p); } - //@interlal + //@internal _moving(param) { if (!this.startDragTime) { return; @@ -159,7 +159,7 @@ class MapDragHandler extends Handler { map.onMoving(param); } - //@interlal + //@internal _containerPointToPrj(p) { const map = this.target; const queryCoord = map._queryTerrainInfo(p); @@ -171,7 +171,7 @@ class MapDragHandler extends Handler { return map._containerPointToPrj(p); } - //@interlal + //@internal _moveEnd(param: Param) { if (!this.startDragTime) { return; @@ -199,7 +199,7 @@ class MapDragHandler extends Handler { } } - //@interlal + //@internal _rotateStart(param: Param) { this._start(param); delete this._rotateMode; @@ -208,7 +208,7 @@ class MapDragHandler extends Handler { this._db = 0; } - //@interlal + //@internal _rotating(param: Param) { const map = this.target; const mx = param['mousePos'].x, @@ -260,7 +260,7 @@ class MapDragHandler extends Handler { } } - //@interlal + //@internal _rotateEnd(param: Param) { const map = this.target; const bearing = map.getBearing(); @@ -278,7 +278,7 @@ class MapDragHandler extends Handler { } } - //@interlal + //@internal _clear() { delete this.startPrjCoord; delete this.preX; diff --git a/src/map/handler/Map.GeometryEvents.ts b/src/map/handler/Map.GeometryEvents.ts index 03b6a523b5..7c2f93db9f 100644 --- a/src/map/handler/Map.GeometryEvents.ts +++ b/src/map/handler/Map.GeometryEvents.ts @@ -185,9 +185,9 @@ const fireGeoEvent = (geometry, domEvent, type?) => { }; class MapGeometryEventsHandler extends Handler { - //@interlal + //@internal _mouseDownTime: number - //@interlal + //@internal _queryIdentifyTimeout: number // target: Map; @@ -203,7 +203,7 @@ class MapGeometryEventsHandler extends Handler { off(dom, EVENTS, this._identifyGeometryEvents); } - //@interlal + //@internal _identifyGeometryEvents(domEvent, type) { const map = this.target; if (map.isInteracting() || map._ignoreEvent(domEvent)) { diff --git a/src/map/handler/Map.ScrollWheelZoom.ts b/src/map/handler/Map.ScrollWheelZoom.ts index d792e90c6c..360af77722 100644 --- a/src/map/handler/Map.ScrollWheelZoom.ts +++ b/src/map/handler/Map.ScrollWheelZoom.ts @@ -17,35 +17,35 @@ const wheelZoomRate = 1 / 450; const maxScalePerFrame = 2; class MapScrollWheelZoomHandler extends Handler { - //@interlal + //@internal _thisScrollZoom: () => void - //@interlal + //@internal _thisCheckIfEndZoom: () => void - //@interlal + //@internal _wheelZoomRate: number - //@interlal + //@internal _defaultZoomRate: number - //@interlal + //@internal _delta: number - //@interlal + //@internal _zooming: boolean - //@interlal + //@internal _trackPadSuspect: number - //@interlal + //@internal _ensureTrackpad: boolean - //@interlal + //@internal _active: boolean - //@interlal + //@internal _requesting: number - //@interlal + //@internal _startZoom: number - //@interlal + //@internal _origin: any - //@interlal + //@internal _zoomOrigin: any - //@interlal + //@internal _lastWheelEvent: any - //@interlal + //@internal _scrollTime: number constructor(target) { @@ -65,7 +65,7 @@ class MapScrollWheelZoomHandler extends Handler { removeDomEvent(this.target._containerDOM, 'wheel', this._onWheelScroll); } - //@interlal + //@internal _onWheelScroll(evt) { const map = this.target; if (map.options['preventWheelScroll']) { @@ -89,7 +89,7 @@ class MapScrollWheelZoomHandler extends Handler { } } - //@interlal + //@internal _seamless(evt, origin) { let value = evt.deltaMode === window.WheelEvent.DOM_DELTA_LINE ? evt.deltaY * 60 : evt.deltaY; if (value % wheelZoomDelta !== 0) { @@ -127,7 +127,7 @@ class MapScrollWheelZoomHandler extends Handler { this._start(); } - //@interlal + //@internal _start() { if (!this._delta) return; this._zooming = true; @@ -138,7 +138,7 @@ class MapScrollWheelZoomHandler extends Handler { } } - //@interlal + //@internal _scrollZoom() { this._active = false; if (!this._delta) { @@ -158,7 +158,7 @@ class MapScrollWheelZoomHandler extends Handler { map.getRenderer().callInNextFrame(this._thisCheckIfEndZoom); } - //@interlal + //@internal _checkIfEndZoom() { if (!this._zooming) { return; @@ -174,7 +174,7 @@ class MapScrollWheelZoomHandler extends Handler { } } - //@interlal + //@internal _interval(evt, origin) { const map = this.target; if (this._zooming) { diff --git a/src/map/handler/Map.Touch.ts b/src/map/handler/Map.Touch.ts index f5544b2ff9..79808cfff6 100644 --- a/src/map/handler/Map.Touch.ts +++ b/src/map/handler/Map.Touch.ts @@ -6,22 +6,22 @@ import Map from '../Map'; //handler to zoom map by pinching class MapTouchZoomHandler extends Handler { preY: number - //@interlal + //@internal _startP1: Point - //@interlal + //@internal _startP2: Point - //@interlal + //@internal _startDist: number - //@interlal + //@internal _startVector: Point - //@interlal + //@internal _startZoom: number - //@interlal + //@internal _startBearing: number mode: 'rotate_zoom' | 'pitch' | 'rotate' | 'zoom' - //@interlal + //@internal _scale: number - //@interlal + //@internal _Origin: Point addHooks() { @@ -32,7 +32,7 @@ class MapTouchZoomHandler extends Handler { removeDomEvent(this.target.getContainer(), 'touchstart', this._onTouchStart); } - //@interlal + //@internal _onTouchStart(event) { const map = this.target; if (!event.touches || event.touches.length < 2) { @@ -68,7 +68,7 @@ class MapTouchZoomHandler extends Handler { map._fireEvent('touchactstart'); } - //@interlal + //@internal _onTouchMove(event) { const map = this.target; if (!event.touches || event.touches.length < 2) { @@ -123,7 +123,7 @@ class MapTouchZoomHandler extends Handler { map._fireEvent('touchactinging'); } - //@interlal + //@internal _startTouching(param) { const map = this.target; if (this.mode === 'zoom' || this.mode === 'rotate_zoom') { @@ -136,7 +136,7 @@ class MapTouchZoomHandler extends Handler { } } - //@interlal + //@internal _onTouchEnd(event) { delete this.preY; const map = this.target; diff --git a/src/map/spatial-reference/SpatialReference.ts b/src/map/spatial-reference/SpatialReference.ts index c6b9495b9f..16d3fc30a1 100644 --- a/src/map/spatial-reference/SpatialReference.ts +++ b/src/map/spatial-reference/SpatialReference.ts @@ -143,16 +143,16 @@ DefaultSpatialReference['PRESET-4490-512'] = DefaultSpatialReference['PRESET-VT- */ export default class SpatialReference { options: SpatialReferenceType - //@interlal + //@internal _projection: ProjectionType isEPSG: boolean - //@interlal + //@internal _resolutions: number[] - //@interlal + //@internal _pyramid: boolean - //@interlal + //@internal _fullExtent: Extent; - //@interlal + //@internal _transformation: Transformation json: SpatialReferenceType constructor(options: SpatialReferenceType = ({} as SpatialReferenceType)) { @@ -286,7 +286,7 @@ export default class SpatialReference { return true; } - //@interlal + //@internal _initSpatialRef() { let projection: ProjectionType; if (this.options['projection']) { diff --git a/src/map/tool/AreaTool.ts b/src/map/tool/AreaTool.ts index 3a72306832..ac76c8d1f2 100644 --- a/src/map/tool/AreaTool.ts +++ b/src/map/tool/AreaTool.ts @@ -89,7 +89,7 @@ class AreaTool extends DistanceTool { this._measureLayers = []; } - //@interlal + //@internal _measure(toMeasure: Geometry | Array) { const map: any = this.getMap(); let area: number; @@ -126,12 +126,12 @@ class AreaTool extends DistanceTool { return content; } - //@interlal + //@internal _msGetCoordsToMeasure(param: any) { return param['geometry'].getShell().concat([param['coordinate']]); } - //@interlal + //@internal _msOnDrawVertex(param: any) { // const prjCoord = this.getMap()._pointToPrj(param['point2d']); const lastCoordinate = this._getLasttCoordinate() || param.coordinate; @@ -144,7 +144,7 @@ class AreaTool extends DistanceTool { this._addVertexMarker(vertexMarker); } - //@interlal + //@internal _msOnDrawEnd(param: any) { this._clearTailMarker(); let prjCoord; diff --git a/src/map/tool/DistanceTool.ts b/src/map/tool/DistanceTool.ts index 822a9ce960..54fd93d3ca 100644 --- a/src/map/tool/DistanceTool.ts +++ b/src/map/tool/DistanceTool.ts @@ -122,20 +122,20 @@ const options: DistanceToolOptions = { */ class DistanceTool extends DrawTool { options: DistanceToolOptions; - //@interlal + //@internal _measureLayers: Array; translator: Translator; - //@interlal + //@internal _tailMarker?: any; - //@interlal + //@internal _tailLabel?: any; - //@interlal + //@internal _lastMeasure?: number | string; - //@interlal + //@internal _lastVertex?: any - //@interlal + //@internal _measureMarkerLayer?: any - //@interlal + //@internal _measureLineLayer?: any /** @@ -244,7 +244,7 @@ class DistanceTool extends DrawTool { return this; } - //@interlal + //@internal _formatLabelContent(params: any) { const formatLabelContent = this.options.formatLabelContent; if (formatLabelContent && isFunction(formatLabelContent)) { @@ -253,7 +253,7 @@ class DistanceTool extends DrawTool { return null; } - //@interlal + //@internal _measure(toMeasure: any) { const map: any = this.getMap(); let length; @@ -289,7 +289,7 @@ class DistanceTool extends DrawTool { return content; } - //@interlal + //@internal _registerMeasureEvents() { this.on('drawstart', this._msOnDrawStart, this) .on('drawvertex', this._msOnDrawVertex, this) @@ -297,12 +297,12 @@ class DistanceTool extends DrawTool { .on('drawend', this._msOnDrawEnd, this); } - //@interlal + //@internal _afterEnable() { this._registerMeasureEvents(); } - //@interlal + //@internal _afterDisable() { this.off('drawstart', this._msOnDrawStart, this) .off('drawvertex', this._msOnDrawVertex, this) @@ -310,7 +310,7 @@ class DistanceTool extends DrawTool { .off('drawend', this._msOnDrawEnd, this); } - //@interlal + //@internal _msOnDrawStart(param: any) { const map: any = this.getMap(); // const prjCoord = map._pointToPrj(param['point2d']); @@ -349,7 +349,7 @@ class DistanceTool extends DrawTool { this._addVertexMarker(marker, startLabel); } - //@interlal + //@internal _msOnMouseMove(param: any) { const ms = this._measure(this._msGetCoordsToMeasure(param)); if (!this._tailMarker) { @@ -372,12 +372,12 @@ class DistanceTool extends DrawTool { // this._tailLabel._setPrjCoordinates(lastCoord); } - //@interlal + //@internal _msGetCoordsToMeasure(param: any) { return param['geometry'].getCoordinates().concat([param['coordinate']]); } - //@interlal + //@internal _msOnDrawVertex(param: any) { // const prjCoords = this._geometry._getPrjCoordinates(); // const lastCoord = prjCoords[prjCoords.length - 1]; @@ -398,7 +398,7 @@ class DistanceTool extends DrawTool { this._lastVertex = vertexLabel; } - //@interlal + //@internal _addVertexMarker(marker: Marker, vertexLabel?: any) { if (!this._vertexes) { this._vertexes = []; @@ -413,7 +413,7 @@ class DistanceTool extends DrawTool { } } - //@interlal + //@internal _msOnDrawEnd(param: any) { this._clearTailMarker(); if (param['geometry'].getCoordinates().length < 2) { @@ -435,7 +435,7 @@ class DistanceTool extends DrawTool { this._lastMeasure = geo.getLength(); } - //@interlal + //@internal _addClearMarker(coordinates: Coordinate, prjCoord: any, dx: number | string) { let symbol = this.options['clearButtonSymbol']; let dxSymbol: any | Array = { @@ -469,7 +469,7 @@ class DistanceTool extends DrawTool { // endMarker._setPrjCoordinates(prjCoord); } - //@interlal + //@internal _clearTailMarker() { if (this._tailMarker) { this._tailMarker.remove(); @@ -481,13 +481,13 @@ class DistanceTool extends DrawTool { } } - //@interlal + //@internal _clearMeasureLayers() { this._measureLineLayer.remove(); this._measureMarkerLayer.remove(); } - //@interlal + //@internal _getFirstCoordinate() { if (!this._geometry) { return null; @@ -496,7 +496,7 @@ class DistanceTool extends DrawTool { return coordinates[0]; } - //@interlal + //@internal _getLasttCoordinate() { if (!this._geometry) { return null; diff --git a/src/map/tool/DrawTool.ts b/src/map/tool/DrawTool.ts index f87cf8656d..7ff645510d 100644 --- a/src/map/tool/DrawTool.ts +++ b/src/map/tool/DrawTool.ts @@ -91,29 +91,29 @@ const registeredMode = {}; */ class DrawTool extends MapTool { options: DrawToolOptions; - //@interlal + //@internal _vertexes: Array; - //@interlal + //@internal _historyPointer: any; - //@interlal + //@internal _events: any; - //@interlal + //@internal _geometry?: any; - //@interlal + //@internal _drawToolLayer?: any; - //@interlal + //@internal _mapAutoPanAtEdge?: boolean; - //@interlal + //@internal _geometryEvents?: boolean; - //@interlal + //@internal _mapDoubleClickZoom?: boolean; - //@interlal + //@internal _ending: boolean; - //@interlal + //@internal _mapDraggable?: boolean; - //@interlal + //@internal _clickCoords?: Array; - //@interlal + //@internal _layers?: Array; /** @@ -360,17 +360,17 @@ class DrawTool extends MapTool { * @returns {boolean} * @private */ - //@interlal + //@internal _shouldRecordHistory(actions) { return Array.isArray(actions) && actions[0] === 'click' && actions[1] === 'mousemove' && actions[2] === 'dblclick'; } - //@interlal + //@internal _checkMode() { this._getRegisterMode(); } - //@interlal + //@internal _saveMapCfg() { const map = this.getMap(); this._mapDoubleClickZoom = map.options['doubleClickZoom']; @@ -394,7 +394,7 @@ class DrawTool extends MapTool { } } - //@interlal + //@internal _restoreMapCfg() { const map = this.getMap(); map.config({ @@ -407,7 +407,7 @@ class DrawTool extends MapTool { delete this._mapDoubleClickZoom; } - //@interlal + //@internal _loadResources() { const symbol = this.getSymbol(); const resources = getExternalResources(symbol); @@ -417,12 +417,12 @@ class DrawTool extends MapTool { } } - //@interlal + //@internal _getProjection() { return this._map.getProjection(); } - //@interlal + //@internal _getRegisterMode() { const mode = this.getMode(); const registerMode = DrawTool.getRegisterMode(mode); @@ -437,8 +437,8 @@ class DrawTool extends MapTool { const _events = {}; if (Array.isArray(action)) { for (let i = 0; i < action.length; i++) { - //@interlal - _events[action[i]] = this._events[action[i]]; + //@internal + _events[action[i]] = this._events[action[i]]; } return _events; } @@ -453,7 +453,7 @@ class DrawTool extends MapTool { * @param event * @private */ - //@interlal + //@internal _mouseDownHandler(event: any) { this._createGeometry(event); } @@ -466,7 +466,7 @@ class DrawTool extends MapTool { * @param event * @private */ - //@interlal + //@internal _mouseUpHandler(event: any) { this.endDraw(event); } @@ -479,7 +479,7 @@ class DrawTool extends MapTool { * @param event * @private */ - //@interlal + //@internal _clickHandler(event: any) { if (!this.options.interactive) { return this; @@ -557,7 +557,7 @@ class DrawTool extends MapTool { * @param event * @private */ - //@interlal + //@internal _createGeometry(event: any) { const mode = this.getMode(); const map: any = this.getMap() @@ -632,7 +632,7 @@ class DrawTool extends MapTool { * @param event * @private */ - //@interlal + //@internal _mouseMoveHandler(event) { if (!this.options.interactive) { return this; @@ -702,7 +702,7 @@ class DrawTool extends MapTool { * @param event * @private */ - //@interlal + //@internal _doubleClickHandler(event) { if (!this.options.interactive) { return this; @@ -741,7 +741,7 @@ class DrawTool extends MapTool { this.endDraw(event); } - //@interlal + //@internal _addGeometryToStage(geometry) { const drawLayer = this._getDrawLayer(); drawLayer.addGeometry(geometry); @@ -792,7 +792,7 @@ class DrawTool extends MapTool { return this; } - //@interlal + //@internal _clearStage() { this._getDrawLayer().clear(); delete this._geometry; @@ -808,7 +808,7 @@ class DrawTool extends MapTool { * @return * @private */ - //@interlal + //@internal _getMouseContainerPoint(event: Event): Point { const action = this._getRegisterMode()['action']; if (action[0].indexOf('mousedown') >= 0 || action[0].indexOf('touchstart') >= 0) { @@ -818,7 +818,7 @@ class DrawTool extends MapTool { return event['containerPoint']; } - //@interlal + //@internal _isValidContainerPoint(containerPoint) { const mapSize = this._map.getSize(); const w = mapSize['width'], @@ -831,7 +831,7 @@ class DrawTool extends MapTool { return true; } - //@interlal + //@internal _getSnapResult(snapTo, containerPoint) { const map: any = this.getMap(); const lastContainerPoints = []; @@ -855,7 +855,7 @@ class DrawTool extends MapTool { }; } - //@interlal + //@internal _getDrawLayer() { const drawLayerId = INTERNAL_LAYER_PREFIX + 'drawtool'; let drawToolLayer: any = this._map.getLayer(drawLayerId); @@ -871,7 +871,7 @@ class DrawTool extends MapTool { return drawToolLayer; } - //@interlal + //@internal _fireEvent(eventName, param) { if (!param) { param = {}; @@ -884,7 +884,7 @@ class DrawTool extends MapTool { MapTool.prototype._fireEvent.call(this, eventName, param); } - //@interlal + //@internal _pushLayers(layers) { if (!layers) { return this; @@ -901,7 +901,7 @@ class DrawTool extends MapTool { return this; } - //@interlal + //@internal _outLayers(layers) { if (!layers) { return this; diff --git a/src/map/tool/MapTool.ts b/src/map/tool/MapTool.ts index 11d9411c3c..3581d9f00f 100644 --- a/src/map/tool/MapTool.ts +++ b/src/map/tool/MapTool.ts @@ -22,9 +22,9 @@ const key = '_map_tool'; * @mixes Eventable */ class MapTool extends Eventable(Class) { - //@interlal + //@internal _map: Map; - //@interlal + //@internal _enabled?: boolean; onEnable?(): void; getEvents?(): void; @@ -159,12 +159,12 @@ class MapTool extends Eventable(Class) { return this; } - //@interlal + //@internal _registerEvents() { this._switchEvents('on'); } - //@interlal + //@internal _switchEvents(to: any) { const events:any = this.getEvents(); if (events) { @@ -172,7 +172,7 @@ class MapTool extends Eventable(Class) { } } - //@interlal + //@internal _fireEvent(eventName:string, param?: any) { if (!param) { param = {}; diff --git a/src/renderer/edit/EditHandle.ts b/src/renderer/edit/EditHandle.ts index d21a83b97e..c5e73b1820 100644 --- a/src/renderer/edit/EditHandle.ts +++ b/src/renderer/edit/EditHandle.ts @@ -33,11 +33,11 @@ export default class EditHandle extends Eventable(Class) { url: string; bbox: BBOX; - //@interlal + //@internal _point: Point; - //@interlal + //@internal _img: any; - //@interlal + //@internal _dragger: DragHandler; constructor(target: GeometryEditor, map: Map, options: EditHandleOptions) { @@ -59,7 +59,7 @@ export default class EditHandle extends Eventable(Class) { return this.options['cursor'] || 'default'; } - //@interlal + //@internal _fetchImage() { const map = this.map; const symbol = this.options.symbol; diff --git a/src/renderer/geometry/CollectionPainter.ts b/src/renderer/geometry/CollectionPainter.ts index ab36de346c..6d4481a5a4 100644 --- a/src/renderer/geometry/CollectionPainter.ts +++ b/src/renderer/geometry/CollectionPainter.ts @@ -15,7 +15,7 @@ const TEMP_EXTENT = new PointExtent(); * @private */ export default class CollectionPainter extends Class { - //@interlal + //@internal _drawTime: number; bbox: BBOX; @@ -33,7 +33,7 @@ export default class CollectionPainter extends Class { this._drawTime = 0; } - //@interlal + //@internal _setDrawTime(time: number) { this._drawTime = time; this._eachPainter((painter: Painter) => { @@ -61,7 +61,7 @@ export default class CollectionPainter extends Class { return null; } - //@interlal + //@internal _eachPainter(fn: (p: Painter) => void) { const geometries = this.geometry.getGeometries(); let painter: Painter; diff --git a/src/renderer/geometry/Painter.ts b/src/renderer/geometry/Painter.ts index 9975d90374..bb9cafd113 100644 --- a/src/renderer/geometry/Painter.ts +++ b/src/renderer/geometry/Painter.ts @@ -54,43 +54,43 @@ const TEMP_BBOX = { * @private */ class Painter extends Class { - //@interlal + //@internal _drawTime: number; - //@interlal + //@internal _hasPoint: boolean; - //@interlal + //@internal _debugSymbolizer: DebugSymbolizer; - //@interlal + //@internal _renderPoints: Record; - //@interlal + //@internal _hitPoint: WithUndef; - //@interlal + //@internal _sprite: any; - //@interlal + //@internal _paintParams: any; - //@interlal + //@internal _cachedParams: any; - //@interlal + //@internal _unsimpledParams: any; - //@interlal + //@internal _spriting: boolean; - //@interlal + //@internal _extent2D: Extent & { _zoom: number }; - //@interlal + //@internal _fixedExtent: PointExtent; - //@interlal + //@internal _altAtGL: any; - //@interlal + //@internal _propAlt: number | number[] | number[][]; - //@interlal + //@internal _projCode: string; - //@interlal + //@internal _pitched: boolean; - //@interlal + //@internal _rotated: boolean; - //@interlal + //@internal _painted: boolean; - //@interlal + //@internal _containerBbox: typeof TEMP_BBOX; bbox: BBOX; @@ -112,7 +112,7 @@ class Painter extends Class { this._drawTime = 0; } - //@interlal + //@internal _setDrawTime(time: number) { this._drawTime = time; return this; @@ -149,7 +149,7 @@ class Painter extends Class { /** * create symbolizers */ - //@interlal + //@internal _createSymbolizers() { const geoSymbol = this.getSymbol(), symbolizers = [], @@ -291,7 +291,7 @@ class Painter extends Class { return tr; } - //@interlal + //@internal _pointContainerPoints(points, dx, dy, ignoreAltitude, disableClip, pointPlacement, ptkey = '_pt') { if (this._aboveCamera()) { return null; @@ -450,7 +450,7 @@ class Painter extends Class { return cPoints; } - //@interlal + //@internal _clip(points: Point[], altitude?: number) { // linestring polygon clip if (isNumber(altitude) && altitude !== 0) { @@ -484,13 +484,13 @@ class Painter extends Class { const mapStateCache = renderer.mapStateCache; let _2DExtent, glExtent, pitch; if (mapStateCache) { - //@interlal - _2DExtent = mapStateCache._2DExtent; + //@internal + _2DExtent = mapStateCache._2DExtent; glExtent = mapStateCache.glExtent; pitch = mapStateCache.pitch; } else { - //@interlal - _2DExtent = map.get2DExtent(); + //@internal + _2DExtent = map.get2DExtent(); glExtent = map.get2DExtentAtRes(map.getGLRes()); pitch = map.getPitch(); } @@ -586,7 +586,7 @@ class Painter extends Class { * @param {Number|Number[]} altitude * @private */ - //@interlal + //@internal _interpolateSegAlt(clipSegs, orig, altitude) { if (!Array.isArray(altitude)) { const fn = cc => cc.point; @@ -625,7 +625,7 @@ class Painter extends Class { return this.geometry._getInternalSymbol(); } - //@interlal + //@internal _resetSymbolizersBBOX() { //reset all symbolizers render bbox for (let i = this.symbolizers.length - 1; i >= 0; i--) { @@ -757,7 +757,7 @@ class Painter extends Class { return !!this._hitPoint; } - //@interlal + //@internal _prepareShadow(ctx: CanvasRenderingContext2D, symbol: Record) { if (symbol['shadowBlur']) { //Ignore shadows when hit detection @@ -773,7 +773,7 @@ class Painter extends Class { } } - //@interlal + //@internal _eachSymbolizer(fn, context?: any) { if (!this.symbolizers) { return; @@ -827,7 +827,7 @@ class Painter extends Class { return this._extent2D.add(TEMP_FIXED_EXTENT); } - //@interlal + //@internal _computeExtent2D(extent) { for (let i = this.symbolizers.length - 1; i >= 0; i--) { const symbolizer = this.symbolizers[i]; @@ -836,7 +836,7 @@ class Painter extends Class { return extent; } - //@interlal + //@internal _computeFixedExtent(resources, extent) { for (let i = this.symbolizers.length - 1; i >= 0; i--) { const symbolizer = this.symbolizers[i]; @@ -847,7 +847,7 @@ class Painter extends Class { return extent; } - //@interlal + //@internal _isDynamicSize() { for (let i = this.symbolizers.length - 1; i >= 0; i--) { const symbolizer = this.symbolizers[i]; @@ -858,7 +858,7 @@ class Painter extends Class { return false; } - //@interlal + //@internal _aboveCamera() { let altitude = this.getMinAltitude(); const map = this.getMap(); @@ -934,7 +934,7 @@ class Painter extends Class { this._removeSymbolizers(); } - //@interlal + //@internal _removeSymbolizers() { this._eachSymbolizer(function (symbolizer) { delete symbolizer.painter; @@ -981,7 +981,7 @@ class Painter extends Class { return this.maxAltitude; } - //@interlal + //@internal _getGeometryAltitude() { const map = this.getMap(); if (!map) { @@ -1002,7 +1002,7 @@ class Painter extends Class { return altitude; } - //@interlal + //@internal _verifyProjection() { const projection = this.geometry._getProjection() || PROJECTION; if (this._projCode && this._projCode !== projection.code) { @@ -1011,11 +1011,11 @@ class Painter extends Class { this._projCode = (projection as any).code; } - //@interlal + //@internal _beforePaint() { } - //@interlal + //@internal _afterPaint() { } } diff --git a/src/renderer/geometry/PointRenderer.ts b/src/renderer/geometry/PointRenderer.ts index 5c671db2fc..41615fad27 100644 --- a/src/renderer/geometry/PointRenderer.ts +++ b/src/renderer/geometry/PointRenderer.ts @@ -10,7 +10,7 @@ import {WithNull} from "../../types/typings"; // 有中心点的图形的共同方法 const CenterPointRenderer = { - //@interlal + //@internal _getRenderPoints(): [Point[], WithNull] { return [[this._getCenter2DPoint(this.getMap().getGLRes())], null]; } @@ -34,7 +34,7 @@ Circle.include(CenterPointRenderer); Sector.include(CenterPointRenderer); Rectangle.include({ - //@interlal + //@internal _getRenderPoints(placement?: string): [Point[], WithNull] { const map = this.getMap(); const glRes = map.getGLRes(); @@ -56,7 +56,7 @@ Rectangle.include({ //---------------------------------------------------- const PolyRenderer = { - //@interlal + //@internal _getRenderPoints(placement?: string) { const map = this.getMap(); const glRes = map.getGLRes(); @@ -147,8 +147,8 @@ const PolyRenderer = { declare module '../../geometry/LineString' { // @ts-expect-error 确实需要重写父类的属性 interface LineString { - //@interlal - _getRenderPoints(placement?: string): [Point[], WithNull]; + //@internal + _getRenderPoints(placement?: string): [Point[], WithNull]; } } @@ -156,8 +156,8 @@ LineString.include(PolyRenderer); declare module '../../geometry/Polygon' { interface Polygon { - //@interlal - _getRenderPoints(placement?: string): [Point[], WithNull]; + //@internal + _getRenderPoints(placement?: string): [Point[], WithNull]; } } diff --git a/src/renderer/geometry/VectorRenderer.ts b/src/renderer/geometry/VectorRenderer.ts index 0832b6f292..d1c3b4beba 100644 --- a/src/renderer/geometry/VectorRenderer.ts +++ b/src/renderer/geometry/VectorRenderer.ts @@ -42,13 +42,13 @@ function isWithinPixel(painter: Painter) { } const geometryInclude = { - //@interlal + //@internal _redrawWhenPitch: () => false, - //@interlal + //@internal _redrawWhenRotate: () => false, - //@interlal + //@internal _getRenderBBOX(ctx: CanvasRenderingContext2D, points: Point[]) { if (!ctx.isHitTesting) { resetBBOX(BBOX_TEMP); @@ -91,18 +91,18 @@ function getRotatedShell() { } //for Ellipse,Circle, const el = { - //@interlal + //@internal _redrawWhenPitch: (): boolean => true, - //@interlal + //@internal _redrawWhenRotate: function (): boolean { return (this instanceof Ellipse) || (this instanceof Sector); }, - //@interlal + //@internal _computeRotatedPrjExtent, getRotatedShell, - //@interlal + //@internal _paintAsPath: function (): boolean { //why? when rotate need draw by path if (this.isRotated()) { @@ -114,7 +114,7 @@ const el = { return altitude > 0 || map.getPitch() || ((this instanceof Ellipse) && map.getBearing()); }, - //@interlal + //@internal _getPaintParams(): any[] { const map = this.getMap(); if (this._paintAsPath()) { @@ -126,7 +126,7 @@ const el = { return [pt, ...size]; }, - //@interlal + //@internal _paintOn: function (...args: any[]) { if (this._paintAsPath()) { // @ts-expect-error @@ -137,7 +137,7 @@ const el = { } }, - //@interlal + //@internal _getRenderSize(pt: Coordinate) { const map = this.getMap(), glRes = map.getGLRes(); @@ -163,7 +163,7 @@ declare module '../../geometry/Circle' { Circle.include(el); const rectangleInclude = { - //@interlal + //@internal _getPaintParams() { const map = this.getMap(); const shell = this._getPrjShell(); @@ -171,9 +171,9 @@ const rectangleInclude = { return [points]; }, - //@interlal + //@internal _paintOn: Canvas.polygon, - //@interlal + //@internal _computeRotatedPrjExtent, getRotatedShell }; @@ -188,10 +188,10 @@ declare module '../../geometry/Rectangle' { Rectangle.include(rectangleInclude); const sectorInclude = { - //@interlal + //@internal _redrawWhenPitch: (): boolean => true, - //@interlal + //@internal _getPaintParams(): [Point, number, [number, number]] { if (this._paintAsPath()) { return Polygon.prototype._getPaintParams.call(this, true); @@ -207,7 +207,7 @@ const sectorInclude = { ]; }, - //@interlal + //@internal _paintOn: function (...args: any[]) { if (this._paintAsPath()) { // @ts-expect-error @@ -235,13 +235,13 @@ Sector.include(el, sectorInclude); declare module '../../geometry/Path' { interface Path { - //@interlal - _paintAsPath: () => boolean; + //@internal + _paintAsPath: () => boolean; } } Path.include({ - //@interlal + //@internal _paintAsPath: () => true }); @@ -251,7 +251,7 @@ const lineStringInclude = { 'classic': [3, 4] }, - //@interlal + //@internal _getArrowShape(prePoint?: Point, point?: any, lineWidth?: number, arrowStyle?: any, tolerance?: number) { if (!prePoint || !point || prePoint.equals(point)) { return null; @@ -283,14 +283,14 @@ const lineStringInclude = { return [p0, point, p2, p0]; }, - //@interlal + //@internal _getPaintParams(): [Point[]] { const prjVertexes = this._getPrjCoordinates(); const points = this._getPath2DPoints(prjVertexes, false, this.getMap().getGLRes()); return [points]; }, - //@interlal + //@internal _paintOn(ctx: CanvasRenderingContext2D, points: Point[], lineOpacity?: number, fillOpacity?: number, dasharray?: number[]) { const r = isWithinPixel(this._painter); if (r.within) { @@ -304,12 +304,12 @@ const lineStringInclude = { return this._getRenderBBOX(ctx, points); }, - //@interlal + //@internal _getArrowPlacement() { return this.options['arrowPlacement']; }, - //@interlal + //@internal _getArrowStyle() { const arrowStyle = this.options['arrowStyle']; if (arrowStyle) { @@ -318,7 +318,7 @@ const lineStringInclude = { return null; }, - //@interlal + //@internal _getArrows(points: Array | Array>, lineWidth: number, tolerance?: number) { const arrowStyle = this._getArrowStyle(); if (!arrowStyle || points.length < 2) { @@ -391,7 +391,7 @@ const lineStringInclude = { return arrows; }, - //@interlal + //@internal _getArrowPoints(arrows: any[], segments: any[], lineWidth?: number, arrowStyle?: any, tolerance?: number) { for (let ii = 0, ll = segments.length - 1; ii < ll; ii++) { const pre = segments[ii]; @@ -404,7 +404,7 @@ const lineStringInclude = { } }, - //@interlal + //@internal _paintArrow(ctx: CanvasRenderingContext2D, points: Point[], lineOpacity?: number) { let lineWidth = this._getInternalSymbol()['lineWidth']; if (!isNumber(lineWidth) || lineWidth < 3) { @@ -434,7 +434,7 @@ declare module '../../geometry/LineString' { LineString.include(lineStringInclude); const polygonInclude = { - //@interlal + //@internal _getPaintParams(disableSimplify?: boolean) { const glRes = this.getMap().getGLRes(); const prjVertexes = this._getPrjShell(); @@ -477,7 +477,7 @@ const polygonInclude = { return [points]; }, - //@interlal + //@internal _paintOn(ctx: CanvasRenderingContext2D, points: Point[], lineOpacity?: number, fillOpacity?: number, dasharray?: number[]) { const r = isWithinPixel(this._painter); if (r.within) { @@ -491,8 +491,8 @@ const polygonInclude = { declare module '../../geometry/Polygon' { interface Polygon { - //@interlal - _paintOn(ctx: CanvasRenderingContext2D, points: Point[], lineOpacity?: number, fillOpacity?: number, dasharray?: number[]): WithNull; + //@internal + _paintOn(ctx: CanvasRenderingContext2D, points: Point[], lineOpacity?: number, fillOpacity?: number, dasharray?: number[]): WithNull; } } diff --git a/src/renderer/geometry/symbolizers/CanvasSymbolizer.ts b/src/renderer/geometry/symbolizers/CanvasSymbolizer.ts index a4d313fa8d..f24d0e7287 100644 --- a/src/renderer/geometry/symbolizers/CanvasSymbolizer.ts +++ b/src/renderer/geometry/symbolizers/CanvasSymbolizer.ts @@ -19,9 +19,9 @@ import { ResourceCache } from '../../layer/CanvasRenderer'; */ abstract class CanvasSymbolizer extends Symbolizer { symbol: any; - //@interlal + //@internal _opacityFn: any; - //@interlal + //@internal _prepareContext(ctx: CanvasRenderingContext2D): void { if (isFunctionDefinition(this.symbol['opacity'])) { if (!this._opacityFn) { @@ -58,7 +58,7 @@ abstract class CanvasSymbolizer extends Symbolizer { hide(): void { } - //@interlal + //@internal _defineStyle(style: any): any { if (this.symbol) { style.visible = this.symbol.visible; diff --git a/src/renderer/geometry/symbolizers/DrawAltitudeSymbolizer.ts b/src/renderer/geometry/symbolizers/DrawAltitudeSymbolizer.ts index 9c1dbbe600..6c2e846ffc 100644 --- a/src/renderer/geometry/symbolizers/DrawAltitudeSymbolizer.ts +++ b/src/renderer/geometry/symbolizers/DrawAltitudeSymbolizer.ts @@ -92,19 +92,19 @@ export default class DrawAltitudeSymbolizer extends PointSymbolizer { return 'point'; } - //@interlal + //@internal _getPaintParams(dx: any, dy: any): any[] { return this.getPainter().getPaintParams(dx || 0, dy || 0, null, true, '_altpt'); } - //@interlal + //@internal _drawMarkerAltitude(ctx: CanvasRenderingContext2D, point: Point, groundPoint: Point): void { const style = this._getStyle(); this.prepareCanvas(ctx, style); Canvas.path(ctx, [point, groundPoint], style['lineOpacity'], null, style['lineDasharray']); } - //@interlal + //@internal _drawLineAltitude(ctx: CanvasRenderingContext2D, points: any[], groundPoints: any[]): void { const style = this._getStyle(); const isSplitted = points.length > 0 && Array.isArray(points[0]); @@ -122,7 +122,7 @@ export default class DrawAltitudeSymbolizer extends PointSymbolizer { } } - //@interlal + //@internal _drawLine(ctx: CanvasRenderingContext2D, points: any[], groundPoints: any[]): void { const style = this._getStyle(); this.prepareCanvas(ctx, style); @@ -131,7 +131,7 @@ export default class DrawAltitudeSymbolizer extends PointSymbolizer { } } - //@interlal + //@internal _getStyle(): any { // read drawAltitude from layer every time const layer = this.geometry.getLayer(); diff --git a/src/renderer/geometry/symbolizers/ImageMarkerSymbolizer.ts b/src/renderer/geometry/symbolizers/ImageMarkerSymbolizer.ts index fb527dd57b..dd82bb46de 100644 --- a/src/renderer/geometry/symbolizers/ImageMarkerSymbolizer.ts +++ b/src/renderer/geometry/symbolizers/ImageMarkerSymbolizer.ts @@ -13,9 +13,9 @@ const TEMP_SIZE = new Size(1, 1); const TEMP_EXTENT = new PointExtent(); export default class ImageMarkerSymbolizer extends PointSymbolizer { - //@interlal + //@internal _url: [string, string | number, string | number]; - //@interlal + //@internal _fixedExtent: PointExtent; static test(symbol: any): boolean { return isImageSymbol(symbol); @@ -107,7 +107,7 @@ export default class ImageMarkerSymbolizer extends PointSymbolizer { } } - //@interlal + //@internal _getImage(resources: ResourceCache): any { return getImage(resources, this.style['markerFile']); } diff --git a/src/renderer/geometry/symbolizers/PointSymbolizer.ts b/src/renderer/geometry/symbolizers/PointSymbolizer.ts index ae2c290236..fbd6a46793 100644 --- a/src/renderer/geometry/symbolizers/PointSymbolizer.ts +++ b/src/renderer/geometry/symbolizers/PointSymbolizer.ts @@ -56,12 +56,12 @@ abstract class PointSymbolizer extends CanvasSymbolizer { } - //@interlal + //@internal _rotateExtent(fixedExtent: PointExtent, angle: number): PointExtent { return fixedExtent.convertTo((p: Point) => p._rotate(angle)); } - //@interlal + //@internal _getRenderPoints(): Point[][] { const painter = this.getPainter(); const placement = painter.isSpriting() ? 'center' : this.getPlacement(); @@ -74,7 +74,7 @@ abstract class PointSymbolizer extends CanvasSymbolizer { * @english * Get container points to draw on Canvas */ - //@interlal + //@internal _getRenderContainerPoints(ignoreAltitude?: boolean): Point[] { const painter = this.getPainter(); if (painter.isSpriting()) { @@ -128,7 +128,7 @@ abstract class PointSymbolizer extends CanvasSymbolizer { return new Point(dx, dy); } - //@interlal + //@internal _getRotationAt(i: number): number { let r = this.getRotation(); if (!r) { @@ -153,7 +153,7 @@ abstract class PointSymbolizer extends CanvasSymbolizer { } } - //@interlal + //@internal _rotate(ctx: CanvasRenderingContext2D, origin: Point, rotation: number): Point | null { if (rotation) { const dxdy = this.getDxDy(); diff --git a/src/renderer/geometry/symbolizers/StrokeAndFillSymbolizer.ts b/src/renderer/geometry/symbolizers/StrokeAndFillSymbolizer.ts index f11bf574d4..468a22748d 100644 --- a/src/renderer/geometry/symbolizers/StrokeAndFillSymbolizer.ts +++ b/src/renderer/geometry/symbolizers/StrokeAndFillSymbolizer.ts @@ -11,11 +11,11 @@ const TEMP_COORD0 = new Coordinate(0, 0); const TEMP_COORD1 = new Coordinate(0, 0); export default class StrokeAndFillSymbolizer extends CanvasSymbolizer { - //@interlal + //@internal _extMin: Coordinate; - //@interlal + //@internal _extMax: Coordinate; - //@interlal + //@internal _pxExtent: PointExtent; static test(symbol: any, geometry: Geometry): boolean { if (!symbol) { @@ -148,7 +148,7 @@ export default class StrokeAndFillSymbolizer extends CanvasSymbolizer { return new PointExtent(-t, -t, t, t); } - //@interlal + //@internal _getPaintParams(): any[] { // @ts-expect-error todo fix must has four params return this.getPainter().getPaintParams(this.style['lineDx'], this.style['lineDy']); @@ -184,7 +184,7 @@ export default class StrokeAndFillSymbolizer extends CanvasSymbolizer { return result; } - //@interlal + //@internal _createGradient(ctx: CanvasRenderingContext2D, points: any[], lineColor: any): void { if (!Array.isArray(points) || !points.length) { return; diff --git a/src/renderer/geometry/symbolizers/Symbolizer.ts b/src/renderer/geometry/symbolizers/Symbolizer.ts index d897243d41..43e14606b9 100644 --- a/src/renderer/geometry/symbolizers/Symbolizer.ts +++ b/src/renderer/geometry/symbolizers/Symbolizer.ts @@ -26,7 +26,7 @@ abstract class Symbolizer { this.bbox = getDefaultBBOX(); } - //@interlal + //@internal _setBBOX(ctx: CanvasRenderingContext2D, x1?: number | BBOX, y1?: number, x2?: number, y2?: number): Symbolizer { if (!ctx.isHitTesting) { setBBOX(this.bbox, x1, y1, x2, y2); @@ -34,7 +34,7 @@ abstract class Symbolizer { return this; } - //@interlal + //@internal _bufferBBOX(ctx: CanvasRenderingContext2D, bufferSize: number): Symbolizer { if (!ctx.isHitTesting) { bufferBBOX(this.bbox, bufferSize); diff --git a/src/renderer/geometry/symbolizers/TextMarkerSymbolizer.ts b/src/renderer/geometry/symbolizers/TextMarkerSymbolizer.ts index fa1a31cacb..3dea1c824a 100644 --- a/src/renderer/geometry/symbolizers/TextMarkerSymbolizer.ts +++ b/src/renderer/geometry/symbolizers/TextMarkerSymbolizer.ts @@ -14,14 +14,14 @@ import { ResourceCache } from '../..'; const TEMP_EXTENT = new PointExtent(); export default class TextMarkerSymbolizer extends PointSymbolizer { - //@interlal + //@internal _dynamic: any; strokeAndFill: any; - //@interlal + //@internal _textDesc: any; - //@interlal + //@internal _fixedExtent: PointExtent; - //@interlal + //@internal _index: number; static test(symbol: any): boolean { diff --git a/src/renderer/geometry/symbolizers/VectorMarkerSymbolizer.ts b/src/renderer/geometry/symbolizers/VectorMarkerSymbolizer.ts index a2aab7a404..330750ebe6 100644 --- a/src/renderer/geometry/symbolizers/VectorMarkerSymbolizer.ts +++ b/src/renderer/geometry/symbolizers/VectorMarkerSymbolizer.ts @@ -19,13 +19,13 @@ const TEMP_EXTENT = new PointExtent(); const DEFAULT_ANCHOR = new Point(0, 0); export default class VectorMarkerSymbolizer extends PointSymbolizer { - //@interlal + //@internal _dynamic: any; strokeAndFill: any; padding: number; - //@interlal + //@internal _stamp: any; - //@interlal + //@internal _fixedExtent: PointExtent; static test(symbol: any): boolean { @@ -72,7 +72,7 @@ export default class VectorMarkerSymbolizer extends PointSymbolizer { } } - //@interlal + //@internal _drawMarkers(ctx: CanvasRenderingContext2D, cookedPoints: any[], resources: ResourceCache) { for (let i = cookedPoints.length - 1; i >= 0; i--) { let point = cookedPoints[i]; @@ -100,7 +100,7 @@ export default class VectorMarkerSymbolizer extends PointSymbolizer { } } - //@interlal + //@internal _drawMarkersWithCache(ctx: CanvasRenderingContext2D, cookedPoints: any[], resources: ResourceCache) { const stamp = this._stampSymbol(); let image = resources.getImage(stamp); @@ -133,7 +133,7 @@ export default class VectorMarkerSymbolizer extends PointSymbolizer { } } - //@interlal + //@internal _createMarkerImage(ctx: CanvasRenderingContext2D, resources: ResourceCache): any { const canvasClass = ctx.canvas.constructor, size = calVectorMarkerSize(MARKER_SIZE, this.style), @@ -144,7 +144,7 @@ export default class VectorMarkerSymbolizer extends PointSymbolizer { return canvas; } - //@interlal + //@internal _stampSymbol(): any { if (!this._stamp) { this._stamp = hashCode([ @@ -166,7 +166,7 @@ export default class VectorMarkerSymbolizer extends PointSymbolizer { return this._stamp; } - //@interlal + //@internal _getCacheImageAnchor(w: number, h: number): Point { const shadow = 2 * (this.symbol['shadowBlur'] || 0), margin = shadow + this.padding; @@ -180,7 +180,7 @@ export default class VectorMarkerSymbolizer extends PointSymbolizer { } } - //@interlal + //@internal _getGraidentExtent(points: PointExtent | Extent): PointExtent { const e = new PointExtent(), dxdy = this.getDxDy(), @@ -199,7 +199,7 @@ export default class VectorMarkerSymbolizer extends PointSymbolizer { return e; } - //@interlal + //@internal _drawVectorMarker(ctx: CanvasRenderingContext2D, point: Point, resources: ResourceCache) { drawVectorMarker(ctx, point, this.style, resources); } diff --git a/src/renderer/geometry/symbolizers/VectorPathMarkerSymbolizer.ts b/src/renderer/geometry/symbolizers/VectorPathMarkerSymbolizer.ts index 7b75683a32..e5f59333db 100644 --- a/src/renderer/geometry/symbolizers/VectorPathMarkerSymbolizer.ts +++ b/src/renderer/geometry/symbolizers/VectorPathMarkerSymbolizer.ts @@ -7,7 +7,7 @@ import { ResourceCache } from '../../layer/CanvasRenderer'; // import { ResourceProxy } from '../../../core/ResourceProxy'; export default class VectorPathMarkerSymbolizer extends ImageMarkerSymbolizer { - //@interlal + //@internal _url: any; static test(symbol: any): boolean { return isPathSymbol(symbol); @@ -34,12 +34,12 @@ export default class VectorPathMarkerSymbolizer extends ImageMarkerSymbolizer { } } - //@interlal + //@internal _prepareContext(): void { //for VectorPathMarkerSymbolizer, opacity is already added into SVG element. } - //@interlal + //@internal _getImage(resources: ResourceCache): any { if (resources && resources.isResourceLoaded(this._url)) { return resources.getImage(this._url); diff --git a/src/renderer/layer/CanvasRenderer.ts b/src/renderer/layer/CanvasRenderer.ts index b365b0991a..e4471dd7f0 100644 --- a/src/renderer/layer/CanvasRenderer.ts +++ b/src/renderer/layer/CanvasRenderer.ts @@ -45,34 +45,34 @@ class CanvasRenderer extends Class { gl: TileRenderingContext; middleWest: Point; canvasExtent2D: Extent; - //@interlal + //@internal _extent2D: Extent; - //@interlal + //@internal _maskExtent: Extent; - //@interlal + //@internal _painted: boolean; - //@interlal + //@internal _drawTime: number; - //@interlal + //@internal _frameTime: number; - //@interlal + //@internal _resWorkerConn: ResourceWorkerConnection; - //@interlal + //@internal _toRedraw: boolean; - //@interlal + //@internal _loadingResource: boolean; - //@interlal + //@internal _renderComplete: boolean; - //@interlal + //@internal _canvasUpdated: boolean; - //@interlal + //@internal _renderZoom: number; - //@interlal + //@internal _errorThrown: boolean; - //@interlal + //@internal __zoomTransformMatrix: number[]; drawOnInteracting?(...args: any[]): void; @@ -473,7 +473,7 @@ class CanvasRenderer extends Class { } - //@interlal + //@internal _canvasContextScale(context: CanvasRenderingContext2D, dpr: number) { context.scale(dpr, dpr); context.dpr = dpr; @@ -812,7 +812,7 @@ class CanvasRenderer extends Class { return this._drawTime; } - //@interlal + //@internal _tryToDraw(framestamp) { this._toRedraw = false; if (!this.canvas && this.layer.isEmpty && this.layer.isEmpty()) { @@ -823,7 +823,7 @@ class CanvasRenderer extends Class { this._drawAndRecord(framestamp); } - //@interlal + //@internal _drawAndRecord(framestamp: number) { if (!this.getMap()) { return; @@ -840,7 +840,7 @@ class CanvasRenderer extends Class { } } - //@interlal + //@internal _promiseResource(url) { const layer = this.layer; const resources = this.resources; @@ -917,7 +917,7 @@ class CanvasRenderer extends Class { } - //@interlal + //@internal _cacheResource(url: [string, number | string, string | number], img: ImageType) { if (!this.layer || !this.resources) { return; @@ -946,7 +946,7 @@ export type ResourceUrl = string | string[] export class ResourceCache { resources: any; - //@interlal + //@internal _errors: any; constructor() { @@ -1045,7 +1045,7 @@ export class ResourceCache { return this; } - //@interlal + //@internal _getImgUrl(url: ResourceUrl) { if (!Array.isArray(url)) { return url; diff --git a/src/renderer/layer/ImageGLRenderable.ts b/src/renderer/layer/ImageGLRenderable.ts index 1460528ccb..9bb2e7aa5d 100644 --- a/src/renderer/layer/ImageGLRenderable.ts +++ b/src/renderer/layer/ImageGLRenderable.ts @@ -72,25 +72,25 @@ const ImageGLRenderable = function (Base: T) { gl: TileRenderingContext; canvas: TileRenderingCanvas; // HTMLCHTMLCanvasElementnvasElement canvas2?: TileRenderingCanvas; - //@interlal - _debugInfoCanvas?: TileRenderingCanvas; + //@internal + _debugInfoCanvas?: TileRenderingCanvas; program?: TileRenderingProgram; // webgl point for layerAltitude - //@interlal - _layerAlt: number = 0; - //@interlal - _layerAltitude: number = 0; + //@internal + _layerAlt: number = 0; + //@internal + _layerAltitude: number = 0; layer?: any; texBuffer?: TileImageBuffer; - //@interlal - _debugBuffer?: TileImageBuffer; + //@internal + _debugBuffer?: TileImageBuffer; posBuffer?: TileImageBuffer; - //@interlal - _imageBuffers?: TileImageBuffer[]; - //@interlal - _buffers?: TileImageBuffer[]; - //@interlal - _textures?: TileImageTexture[]; + //@internal + _imageBuffers?: TileImageBuffer[]; + //@internal + _buffers?: TileImageBuffer[]; + //@internal + _textures?: TileImageTexture[]; getMap?(): Map; /** @@ -372,8 +372,8 @@ const ImageGLRenderable = function (Base: T) { delete image.glBuffer; } - //@interlal - _createTexture(image: TileImageType): TileImageTexture { + //@internal + _createTexture(image: TileImageType): TileImageTexture { const gl = this.gl; const texture = this.getTexture() || gl.createTexture(); // Create a texture object // Bind the texture object to the target @@ -595,8 +595,8 @@ const ImageGLRenderable = function (Base: T) { return uSampler; } - //@interlal - _initUniforms(program: TileRenderingProgram, uniforms: string[]): void { + //@internal + _initUniforms(program: TileRenderingProgram, uniforms: string[]): void { for (let i = 0; i < uniforms.length; i++) { let name = uniforms[i]; let uniform = uniforms[i]; @@ -612,8 +612,8 @@ const ImageGLRenderable = function (Base: T) { } } - //@interlal - _getUniform(program: TileRenderingProgram, uniformName: string): WebGLUniformLocation { + //@internal + _getUniform(program: TileRenderingProgram, uniformName: string): WebGLUniformLocation { const gl = this.gl; const uniform = gl.getUniformLocation(program, uniformName); if (!uniform) { diff --git a/src/renderer/layer/canvaslayer/CanvasLayerRenderer.ts b/src/renderer/layer/canvaslayer/CanvasLayerRenderer.ts index 9755d1ef38..c0cfd4563e 100644 --- a/src/renderer/layer/canvaslayer/CanvasLayerRenderer.ts +++ b/src/renderer/layer/canvaslayer/CanvasLayerRenderer.ts @@ -3,11 +3,11 @@ import CanvasRenderer from '../../../renderer/layer/CanvasRenderer'; export default class CanvasLayerRenderer extends CanvasRenderer { buffer: HTMLCanvasElement; - //@interlal + //@internal _drawContext: any[]; - //@interlal + //@internal _predrawed: boolean; - //@interlal + //@internal _shouldClear: boolean; getPrepareParams() { @@ -118,7 +118,7 @@ export default class CanvasLayerRenderer extends CanvasRenderer { } } - //@interlal + //@internal _prepareDrawParams() { if (!this.getMap()) { return null; @@ -137,7 +137,7 @@ export default class CanvasLayerRenderer extends CanvasRenderer { ]; } - //@interlal + //@internal _drawLayer(...args: any[]) { const params = this._prepareDrawParams(); if (!params) { @@ -148,7 +148,7 @@ export default class CanvasLayerRenderer extends CanvasRenderer { this.completeRender(); } - //@interlal + //@internal _drawLayerOnInteracting(...args: any[]) { if (!this.layer.drawOnInteracting) { return; diff --git a/src/renderer/layer/tilelayer/QuadStencil.ts b/src/renderer/layer/tilelayer/QuadStencil.ts index eab47f35bf..544340629c 100644 --- a/src/renderer/layer/tilelayer/QuadStencil.ts +++ b/src/renderer/layer/tilelayer/QuadStencil.ts @@ -36,7 +36,7 @@ class QuadStencil { buffer: any; program: TileRenderingProgram; - //@interlal + //@internal _savedProgram: TileRenderingProgram; colorLoc: WebGLUniformLocation; transformLoc: WebGLUniformLocation; @@ -130,13 +130,13 @@ class QuadStencil { return this; } - //@interlal + //@internal _save() { const gl = this.gl; this._savedProgram = gl.program; } - //@interlal + //@internal _restore() { const gl = this.gl; gl.program = this._savedProgram; @@ -145,7 +145,7 @@ class QuadStencil { } } - //@interlal + //@internal _createBuffer() { const gl = this.gl; this.buffer = gl.createBuffer(); @@ -156,7 +156,7 @@ class QuadStencil { gl.bufferData(gl.ARRAY_BUFFER, this.quadVertices, gl.STATIC_DRAW); } - //@interlal + //@internal _createProgram() { const { program, vertexShader, fragmentShader } = createProgram(this.gl, vert, frag); program.vertexShader = vertexShader; diff --git a/src/renderer/layer/tilelayer/TileLayerCanvasRenderer.ts b/src/renderer/layer/tilelayer/TileLayerCanvasRenderer.ts index 59169aa863..a2409bea43 100644 --- a/src/renderer/layer/tilelayer/TileLayerCanvasRenderer.ts +++ b/src/renderer/layer/tilelayer/TileLayerCanvasRenderer.ts @@ -68,37 +68,37 @@ class TileWorkerConnection extends Actor { class TileLayerCanvasRenderer extends CanvasRenderer { tilesInView: TilesInViewType; tilesLoading: { [key: string]: any }; - //@interlal + //@internal _parentTiles: any[]; - //@interlal + //@internal _childTiles: any[]; - //@interlal + //@internal _tileZoom: number; - //@interlal + //@internal _tileQueue: { tileInfo: any; tileData: any; }[]; - //@interlal + //@internal _tileQueueIds: Set; tileCache: typeof LRUCache; - //@interlal + //@internal _compareTiles: any; - //@interlal + //@internal _tileImageWorkerConn: TileWorkerConnection; - //@interlal + //@internal _renderTimestamp: number; - //@interlal + //@internal _frameTiles: { empty: boolean; timestamp: number; }; - //@interlal + //@internal _terrainHelper: TerrainHelper; - //@interlal + //@internal _tilePlaceHolder: any; - //@interlal + //@internal _frameTileGrids: TileGrids; drawingCurrentTiles: WithUndef; @@ -206,7 +206,7 @@ class TileLayerCanvasRenderer extends CanvasRenderer { return this._renderTimestamp || 0; } - //@interlal + //@internal _getTilesInCurrentFrame() { const map = this.getMap(); const layer = this.layer; @@ -448,7 +448,7 @@ class TileLayerCanvasRenderer extends CanvasRenderer { return this._getTileFadingOpacity(tileImage) < 1; } - //@interlal + //@internal _drawTiles(tiles, parentTiles, childTiles, placeholders, parentContext, missedTiles, incompleteTiles) { if (parentTiles.length) { //closer the latter (to draw on top) @@ -525,7 +525,7 @@ class TileLayerCanvasRenderer extends CanvasRenderer { } - //@interlal + //@internal _drawChildTiles(childTiles, parentContext) { // _hasOwnSR 时,瓦片之间会有重叠,会产生z-fighting,所以背景瓦片要后绘制 this.drawingChildTiles = true; @@ -533,7 +533,7 @@ class TileLayerCanvasRenderer extends CanvasRenderer { delete this.drawingChildTiles; } - //@interlal + //@internal _drawParentTiles(parentTiles, parentContext) { this.drawingParentTiles = true; this._parentTiles.forEach(t => this._drawTile(t.info, t.image, parentContext)); @@ -545,14 +545,14 @@ class TileLayerCanvasRenderer extends CanvasRenderer { // eslint-disable-next-line @typescript-eslint/no-unused-vars onDrawTileEnd(context: RenderContext, parentContext: RenderContext) { } - //@interlal + //@internal _drawTile(info, image, parentContext) { if (image) { this.drawTile(info, image, parentContext); } } - //@interlal + //@internal _drawTileAndCache(tile: Tile, parentContext) { if (this.isValidCachedTile(tile)) { this.tilesInView[tile.info.id] = tile; @@ -589,7 +589,7 @@ class TileLayerCanvasRenderer extends CanvasRenderer { * @private * limit tile number to load when map is interacting */ - //@interlal + //@internal _getLoadLimit(): number { if (this.getMap().isInteracting()) { return this.layer.options['loadingLimitOnInteracting']; @@ -620,7 +620,7 @@ class TileLayerCanvasRenderer extends CanvasRenderer { super.clear(); } - //@interlal + //@internal _isLoadingTile(tileId: TileId): boolean { return !!this.tilesLoading[tileId]; } @@ -634,7 +634,7 @@ class TileLayerCanvasRenderer extends CanvasRenderer { } // clip canvas to avoid rough edge of tiles - //@interlal + //@internal _clipByPitch(ctx: CanvasRenderingContext2D): boolean { const map = this.getMap(); if (map.getPitch() <= map.options['maxVisualPitch']) { @@ -703,7 +703,7 @@ class TileLayerCanvasRenderer extends CanvasRenderer { return tileImage; } - //@interlal + //@internal _fetchImage(image: any, tile: Tile['info']) { if (image instanceof Image) { image.src = tile.url; @@ -758,7 +758,7 @@ class TileLayerCanvasRenderer extends CanvasRenderer { this.setToRedraw(); } - //@interlal + //@internal _consumeTileQueue(): void { let count = 0; const limit = this.layer.options['tileLimitPerFrame']; @@ -779,7 +779,7 @@ class TileLayerCanvasRenderer extends CanvasRenderer { /* eslint-enable no-unmodified-loop-condition */ } - //@interlal + //@internal _computeAvgTileAltitude() { let sumMin = 0; let sumMax = 0; @@ -956,7 +956,7 @@ class TileLayerCanvasRenderer extends CanvasRenderer { return this._findChildTiles(info); } - //@interlal + //@internal _findChildTiles(info: Tile['info']): Tile[] | any { const layer = this._getLayerOfTile(info.layer); const terrainTileMode = layer && layer.options['terrainTileMode'] && layer._isPyramidMode(); @@ -1110,7 +1110,7 @@ class TileLayerCanvasRenderer extends CanvasRenderer { return children; } - //@interlal + //@internal _findChildTilesAt(children: Tile[], pmin: number, pmax: number, layer: any, childZoom: number) { const layerId = layer.getId(), res = layer.getSpatialReference().getResolution(childZoom); @@ -1140,7 +1140,7 @@ class TileLayerCanvasRenderer extends CanvasRenderer { return this._findParentTile(info, targetDiff); } - //@interlal + //@internal _findParentTile(info: Tile['info'], targetDiff?: number): Tile { const map = this.getMap(), layer = this._getLayerOfTile(info.layer); @@ -1201,7 +1201,7 @@ class TileLayerCanvasRenderer extends CanvasRenderer { return true; } - //@interlal + //@internal _getLayerOfTile(layerId: LayerId) { return this.layer.getChildLayer ? this.layer.getChildLayer(layerId) : this.layer; } @@ -1233,7 +1233,7 @@ class TileLayerCanvasRenderer extends CanvasRenderer { return cached; } - //@interlal + //@internal _addTileToCache(tileInfo: Tile['info'], tileImage: Tile['image']) { if (this.isValidCachedTile({ info: tileInfo, image: tileImage } as Tile)) { const cached = { @@ -1256,7 +1256,7 @@ class TileLayerCanvasRenderer extends CanvasRenderer { return opacity; } - //@interlal + //@internal _getTileFadingOpacity(tileImage: Tile['image']): number { if (!this.layer.options['fadeAnimation'] || !tileImage.loadTime) { return 1; @@ -1333,7 +1333,7 @@ class TileLayerCanvasRenderer extends CanvasRenderer { } } - //@interlal + //@internal _generatePlaceHolder(res: number): HTMLCanvasElement { const map = this.getMap(); const placeholder = this.layer.options['placeholder']; @@ -1425,8 +1425,8 @@ export interface Tile { // todo:检查是否存在定义 minAltitude?: number; maxAltitude?: number; - //@interlal - _glScale: number; + //@internal + _glScale: number; }; image: TileImage; diff --git a/src/renderer/layer/tilelayer/TileLayerGLRenderer.ts b/src/renderer/layer/tilelayer/TileLayerGLRenderer.ts index 19b8008580..325eb2959c 100644 --- a/src/renderer/layer/tilelayer/TileLayerGLRenderer.ts +++ b/src/renderer/layer/tilelayer/TileLayerGLRenderer.ts @@ -109,7 +109,7 @@ class TileLayerGLRenderer extends ImageGLRenderable(TileLayerCanvasRenderer) { } } - //@interlal + //@internal _bindGLBuffer(image: Tile['image'], w: number, h: number): void { if (!image.glBuffer) { image.glBuffer = this.bufferTileData(0, 0, w, h); diff --git a/src/renderer/layer/vectorlayer/OverlayLayerCanvasRenderer.ts b/src/renderer/layer/vectorlayer/OverlayLayerCanvasRenderer.ts index 97d59b1652..2b502c1e5b 100644 --- a/src/renderer/layer/vectorlayer/OverlayLayerCanvasRenderer.ts +++ b/src/renderer/layer/vectorlayer/OverlayLayerCanvasRenderer.ts @@ -10,7 +10,7 @@ interface MapStateCacheType { bearing: number; glScale: number; glRes: number; - //@interlal + //@internal _2DExtent: Extent; glExtent: Extent; containerExtent: Extent; @@ -29,12 +29,12 @@ interface MapStateCacheType { * @extends renderer.CanvasRenderer */ class OverlayLayerRenderer extends CanvasRenderer { - //@interlal + //@internal _geosToCheck: Geometries[]; - //@interlal + //@internal _resourceChecked: boolean; clearImageData?(): void; - //@interlal + //@internal _lastGeosToDraw: Geometry[]; mapStateCache: MapStateCacheType; @@ -85,7 +85,7 @@ class OverlayLayerRenderer extends CanvasRenderer { return super.render.apply(this, args); } - //@interlal + //@internal _addGeoToCheckRes(res: Geometries | Geometries[]) { if (!res) { return; diff --git a/src/renderer/layer/vectorlayer/VectorLayerCanvasRenderer.ts b/src/renderer/layer/vectorlayer/VectorLayerCanvasRenderer.ts index e1de053479..591a23e0e0 100644 --- a/src/renderer/layer/vectorlayer/VectorLayerCanvasRenderer.ts +++ b/src/renderer/layer/vectorlayer/VectorLayerCanvasRenderer.ts @@ -43,23 +43,23 @@ function isDebug(layer: any) { * @param layer - layer to render */ class VectorLayerRenderer extends OverlayLayerCanvasRenderer { - //@interlal + //@internal _lastRenderTime: number; - //@interlal + //@internal _lastCollisionTime: number; - //@interlal + //@internal _imageData: ImageData; - //@interlal + //@internal _geosToDraw: Geometries[]; - //@interlal + //@internal _lastGeosToDraw: Geometries[]; - //@interlal + //@internal _hasPoint: boolean; - //@interlal + //@internal _onlyHasPoint: WithUndef; - //@interlal + //@internal _displayExtent: Extent; - //@interlal + //@internal _drawnRes: number; renderEnd: boolean; @@ -75,7 +75,7 @@ class VectorLayerRenderer extends OverlayLayerCanvasRenderer { return this; } - //@interlal + //@internal _geoIsCollision(geo: GeoType, collisionIndex: any) { if (!geo) { return false; @@ -268,7 +268,7 @@ class VectorLayerRenderer extends OverlayLayerCanvasRenderer { this.layer.forEach(fn, context); } - //@interlal + //@internal _checkGeos() { const geos = this._getCurrentNeedRenderGeos(); for (let i = 0, len = geos.length; i < len; i++) { @@ -310,7 +310,7 @@ class VectorLayerRenderer extends OverlayLayerCanvasRenderer { return this; } - //@interlal + //@internal _setDrawGeosDrawTime() { const time = now(); const drawTime = this.layer._drawTime; @@ -366,7 +366,7 @@ class VectorLayerRenderer extends OverlayLayerCanvasRenderer { this._geosToDraw.push(geo); } - //@interlal + //@internal _collidesGeos() { const collision = this.layer.options['collision']; if (!collision) { @@ -411,7 +411,7 @@ class VectorLayerRenderer extends OverlayLayerCanvasRenderer { super.onGeometryPropertiesChange(param); } - //@interlal + //@internal _updateDisplayExtent() { let extent2D = this.canvasExtent2D; if (this._maskExtent) { @@ -432,7 +432,7 @@ class VectorLayerRenderer extends OverlayLayerCanvasRenderer { return this.layer._hitGeos(geometries, point, options); } - //@interlal + //@internal _updateMapStateCache() { const map = this.getMap(); const offset = map._pointToContainerPoint(this.middleWest)._add(0, -map.height / 2); @@ -450,8 +450,8 @@ class VectorLayerRenderer extends OverlayLayerCanvasRenderer { bearing, glScale, glRes, - //@interlal - _2DExtent, + //@internal + _2DExtent, glExtent, containerExtent, offset @@ -466,7 +466,7 @@ class VectorLayerRenderer extends OverlayLayerCanvasRenderer { * Better performance of batch coordinate conversion * @param glRes */ - //@interlal + //@internal _batchConversionMarkers(glRes: number) { this._onlyHasPoint = undefined; if (!this._constructorIsThis()) { @@ -554,7 +554,7 @@ class VectorLayerRenderer extends OverlayLayerCanvasRenderer { return pts; } - //@interlal + //@internal _sortByDistanceToCamera(cameraPosition: Vector3) { if (!this.layer.options['sortByDistanceToCamera']) { return; @@ -589,7 +589,7 @@ class VectorLayerRenderer extends OverlayLayerCanvasRenderer { }); } - //@interlal + //@internal _constructorIsThis(): boolean { return this.constructor === VectorLayerRenderer; } @@ -625,7 +625,7 @@ class VectorLayerRenderer extends OverlayLayerCanvasRenderer { return this.geoPainterList || []; } - //@interlal + //@internal _checkSnapshotCanvas() { if (!this.isProgressiveRender()) { delete this.snapshotCanvas; @@ -654,7 +654,7 @@ class VectorLayerRenderer extends OverlayLayerCanvasRenderer { } - //@interlal + //@internal _getCurrentNeedRenderGeos(): Geometries[] { const geos = this.layer._geoList || []; if (!this.isProgressiveRender()) { @@ -672,7 +672,7 @@ class VectorLayerRenderer extends OverlayLayerCanvasRenderer { return pageGeos; } - //@interlal + //@internal _resetProgressiveRender() { if (isDebug(this.layer)) { console.log('progressiveRender resetProgressiveRender'); @@ -685,7 +685,7 @@ class VectorLayerRenderer extends OverlayLayerCanvasRenderer { this._clearSnapshotCanvas(); } - //@interlal + //@internal _clearSnapshotCanvas() { const snapshotCanvas = this._checkSnapshotCanvas(); if (snapshotCanvas) { @@ -693,7 +693,7 @@ class VectorLayerRenderer extends OverlayLayerCanvasRenderer { } } - //@interlal + //@internal _snapshot() { const progressiveRender = this.isProgressiveRender(); const geosToDraw = this._geosToDraw || []; @@ -733,7 +733,7 @@ class VectorLayerRenderer extends OverlayLayerCanvasRenderer { return this; } - //@interlal + //@internal _drawSnapshot() { if (!this.isProgressiveRender()) { return this; diff --git a/src/renderer/map/MapCanvasRenderer.ts b/src/renderer/map/MapCanvasRenderer.ts index 67ad0517ec..5a876b4a4a 100644 --- a/src/renderer/map/MapCanvasRenderer.ts +++ b/src/renderer/map/MapCanvasRenderer.ts @@ -27,52 +27,52 @@ const tempCollisionIndex = new CollisionIndex(); * @memberOf renderer */ class MapCanvasRenderer extends MapRenderer { - //@interlal + //@internal _containerIsCanvas: boolean; - //@interlal + //@internal _loopTime: number; - //@interlal + //@internal _resizeTime: number; - //@interlal + //@internal _resizeCount: number; - //@interlal + //@internal _frameCycleRenderCount: number; - //@interlal + //@internal _resizeEventList: ResizeObserverEntry[]; - //@interlal + //@internal _needClear: boolean; - //@interlal + //@internal _canvasUpdated: boolean; - //@interlal + //@internal _isViewChanged: WithUndef; - //@interlal + //@internal _spatialRefChanged: WithUndef; - //@interlal + //@internal _resizeObserver: ResizeObserver; - //@interlal + //@internal _resizeInterval: number; - //@interlal + //@internal _checkSizeInterval: number; - //@interlal + //@internal _hitDetectFrame: number; - //@interlal + //@internal _animationFrame: number; - //@interlal + //@internal _mapview: MapView; - //@interlal + //@internal _zoomMatrix: number[]; - //@interlal + //@internal _eventParam: any; - //@interlal + //@internal _canvasIds: string[]; - //@interlal + //@internal _updatedIds: string[]; - //@interlal + //@internal _frameTimestamp: number; - //@interlal + //@internal _checkPositionTime: number; - //@interlal + //@internal _tops: (EditHandle | EditOutline)[]; context: CanvasRenderingContext2D; @@ -167,7 +167,7 @@ class MapCanvasRenderer extends MapRenderer { } //need redraw all layer,cause by collision/crs change/view change etc... - //@interlal + //@internal _needRedrawAllLayers(layers: Layer[]) { if (this.isSpatialReferenceChanged()) { return true; @@ -305,7 +305,7 @@ class MapCanvasRenderer extends MapRenderer { * check if need to call layer's draw/drawInteracting * @param layer */ - //@interlal + //@internal _checkLayerRedraw(layer: Layer): boolean { if (this.isSpatialReferenceChanged()) { return true; @@ -335,7 +335,7 @@ class MapCanvasRenderer extends MapRenderer { * @returns time to draw this layer * @private */ - //@interlal + //@internal _drawCanvasLayerOnInteracting(layer: Layer, t: number, timeLimit: number, framestamp: number): number { const map = this.map, renderer = layer._getRenderer(), @@ -384,7 +384,7 @@ class MapCanvasRenderer extends MapRenderer { * Make sure layer are drawn on map when firing the events * @private */ - //@interlal + //@internal _fireLayerLoadEvents() { if (this._updatedIds && this._updatedIds.length > 0) { const map = this.map; @@ -614,7 +614,7 @@ class MapCanvasRenderer extends MapRenderer { map._trySetCursor(cursor); } - //@interlal + //@internal _getLayerImage(layer: Layer) { const renderer = layer._getRenderer(); if (renderer.getCanvasImage) { @@ -701,7 +701,7 @@ class MapCanvasRenderer extends MapRenderer { return this._isViewChanged; } - //@interlal + //@internal _recordView() { const map = this.map; if (!map._onViewChange || map.isInteracting() || map.isAnimating()) { @@ -716,7 +716,7 @@ class MapCanvasRenderer extends MapRenderer { return this._spatialRefChanged; } - //@interlal + //@internal _getMapView(): MapView { const map = this.map; const center = map._getPrjCenter(); @@ -731,7 +731,7 @@ class MapCanvasRenderer extends MapRenderer { }; } - //@interlal + //@internal _lockFrameRenderEnable() { const { maxFPS } = this.map.options || {}; if (maxFPS <= 0 || GlobalConfig.maxFPS <= maxFPS) { @@ -744,7 +744,7 @@ class MapCanvasRenderer extends MapRenderer { /** * Main frame loop */ - //@interlal + //@internal _frameLoop(framestamp: number) { if (!this.map) { this._cancelFrameLoop(); @@ -764,14 +764,14 @@ class MapCanvasRenderer extends MapRenderer { this._animationFrame = requestAnimFrame((framestamp: number) => { this._frameLoop(framestamp); }); } - //@interlal + //@internal _cancelFrameLoop() { if (this._animationFrame) { cancelAnimFrame(this._animationFrame); } } - //@interlal + //@internal _drawLayerCanvasImage(layer: Layer, layerImage: any, targetWidth?: number, targetHeight?: number) { const ctx = this.context; const point = layerImage['point'].round(); @@ -844,7 +844,7 @@ class MapCanvasRenderer extends MapRenderer { ctx.globalAlpha = alpha; } - //@interlal + //@internal _drawCenterCross() { const cross = this.map.options['centerCross']; if (cross) { @@ -858,7 +858,7 @@ class MapCanvasRenderer extends MapRenderer { } } - //@interlal + //@internal _drawContainerExtent() { const { cascadePitches } = this.map.options; const h30 = this.map.height - this.map._getVisualHeight(cascadePitches[0]); @@ -884,7 +884,7 @@ class MapCanvasRenderer extends MapRenderer { // console.log(extent.ymin, h30, h60); } - //@interlal + //@internal _drawFog() { const map = this.map; if (map.getPitch() <= map.options['maxVisualPitch'] || !map.options['fog']) { @@ -910,7 +910,7 @@ class MapCanvasRenderer extends MapRenderer { ctx.fillRect(0, top, Math.ceil(clipExtent.getWidth()) * r, Math.ceil(h + fogThickness)); } - //@interlal + //@internal _debugSky() { const map = this.map; if (!map) { @@ -926,7 +926,7 @@ class MapCanvasRenderer extends MapRenderer { return this; } - //@interlal + //@internal _getAllLayerToRender() { return this.map._getLayers(); } @@ -938,7 +938,7 @@ class MapCanvasRenderer extends MapRenderer { Canvas2D.clearRect(this.context, 0, 0, this.canvas.width, this.canvas.height); } - //@interlal + //@internal _updateCanvasSize() { if (!this.canvas || this._containerIsCanvas) { return false; @@ -978,7 +978,7 @@ class MapCanvasRenderer extends MapRenderer { this.context = this.canvas.getContext('2d'); } - //@interlal + //@internal _updateDomPosition(framestamp: number) { if (this._checkPositionTime === undefined) { this._checkPositionTime = -Infinity; @@ -992,7 +992,7 @@ class MapCanvasRenderer extends MapRenderer { return this; } - //@interlal + //@internal _handleResizeEventList(time: number) { if (!this._resizeEventList) { return this; @@ -1015,7 +1015,7 @@ class MapCanvasRenderer extends MapRenderer { return this; } - //@interlal + //@internal _checkSize() { if (!this.map) { return; @@ -1023,7 +1023,7 @@ class MapCanvasRenderer extends MapRenderer { this.map.checkSize(); } - //@interlal + //@internal _setCheckSizeInterval(interval: number) { // ResizeObserver priority of use // https://developer.mozilla.org/zh-CN/docs/Web/API/ResizeObserver @@ -1057,7 +1057,7 @@ class MapCanvasRenderer extends MapRenderer { } } - //@interlal + //@internal _registerEvents() { const map = this.map; @@ -1100,7 +1100,7 @@ class MapCanvasRenderer extends MapRenderer { } } - //@interlal + //@internal _onMapMouseMove(param: any) { const map = this.map; if (map.isInteracting() || !map.options['hitDetect']) { @@ -1114,7 +1114,7 @@ class MapCanvasRenderer extends MapRenderer { }); } - //@interlal + //@internal _getCanvasLayers() { return this.map._getLayers(layer => layer.isCanvasRender()); } diff --git a/src/renderer/map/MapRenderer.ts b/src/renderer/map/MapRenderer.ts index 10d4498708..387d75ed3a 100644 --- a/src/renderer/map/MapRenderer.ts +++ b/src/renderer/map/MapRenderer.ts @@ -19,22 +19,22 @@ type handlerQueueFn = () => void abstract class MapRenderer extends Class { map: Map; - //@interlal + //@internal _handlerQueue: handlerQueueFn[]; - //@interlal + //@internal _frontCount: WithUndef; - //@interlal + //@internal _backCount: WithUndef; - //@interlal + //@internal _uiCount: WithUndef; - //@interlal + //@internal _thisDocVisibilitychange: () => void; - //@interlal + //@internal _thisDocDragStart: () => void; - //@interlal + //@internal _thisDocDragEnd: () => void; - //@interlal + //@internal _thisDocDPRChange: () => void; constructor(map: Map) { @@ -135,7 +135,7 @@ abstract class MapRenderer extends Class { this._frameLoop(); } - //@interlal + //@internal _onDocVisibilitychange() { if (document.visibilityState !== 'visible') { return; @@ -143,7 +143,7 @@ abstract class MapRenderer extends Class { this.setToRedraw(); } - //@interlal + //@internal _getWrapPanel() { if (!this.map) { return null; @@ -151,7 +151,7 @@ abstract class MapRenderer extends Class { const panels = this.map.getPanels(); return panels && panels.mapWrapper; } - //@interlal + //@internal _onDocDragStart() { const wrapPanel = this._getWrapPanel(); if (wrapPanel) { @@ -160,7 +160,7 @@ abstract class MapRenderer extends Class { return; } - //@interlal + //@internal _onDocDragEnd() { const wrapPanel = this._getWrapPanel(); if (wrapPanel) { @@ -169,7 +169,7 @@ abstract class MapRenderer extends Class { return; } - //@interlal + //@internal _onDocDPRChange() { const map = this.map; if (!map || !map.options || map.options['devicePixelRatio'] || !map.checkSize || !map.getRenderer) { @@ -181,7 +181,7 @@ abstract class MapRenderer extends Class { } } - //@interlal + //@internal _containerIsOffscreen() { const container = this.map.getContainer(); if (!container || !container.style || container.style.display === 'none') { diff --git a/src/renderer/types.ts b/src/renderer/types.ts index 05366f52d6..f8f9e3f951 100644 --- a/src/renderer/types.ts +++ b/src/renderer/types.ts @@ -1,7 +1,7 @@ export type TileRenderingCanvas = { gl?: TileRenderingContext; texture?: TileImageTexture; - //@interlal + //@internal _parentTileTimestamp?: number; } & HTMLCanvasElement; diff --git a/src/ui/InfoWindow.ts b/src/ui/InfoWindow.ts index c30993ba62..3787b2b5b8 100644 --- a/src/ui/InfoWindow.ts +++ b/src/ui/InfoWindow.ts @@ -49,11 +49,11 @@ const EMPTY_SIZE = new Size(0, 0); class InfoWindow extends UIComponent { options: InfoWindowOptionsType; - //@interlal + //@internal _onCloseBtnClick: (event: MouseEvent | TouchEvent) => void; // TODO: obtain class in super - //@interlal + //@internal _getClassName() { return 'InfoWindow'; } @@ -218,7 +218,7 @@ class InfoWindow extends UIComponent { return dom; } - //@interlal + //@internal _replaceTemplate(dom: Element) { const geo = this._owner as Geometry; if (this.options['enableTemplate'] && geo && geo.getProperties && dom && dom.innerHTML) { @@ -321,7 +321,7 @@ class InfoWindow extends UIComponent { } } - //@interlal + //@internal _onAutoOpen(e: MapEventDataType) { const owner = this.getOwner(); setTimeout(() => { @@ -340,7 +340,7 @@ class InfoWindow extends UIComponent { }, 1); } - //@interlal + //@internal _rectifyMouseCoordinte(owner: Geometry | Map, mouseCoordinate: Coordinate): Coordinate { if (owner instanceof LineString) { return this._rectifyLineStringMouseCoordinate(owner, mouseCoordinate).coordinate; @@ -355,7 +355,7 @@ class InfoWindow extends UIComponent { return mouseCoordinate; } - //@interlal + //@internal _rectifyLineStringMouseCoordinate(lineString: LineString, mouseCoordinate: Coordinate) { const map = this.getMap(); const coordinates = lineString.getCoordinates() || []; @@ -453,7 +453,7 @@ class InfoWindow extends UIComponent { }; } - //@interlal + //@internal _getWindowWidth() { const defaultWidth = options.width; let width = this.options['width']; diff --git a/src/ui/Menu.ts b/src/ui/Menu.ts index 65aed64b33..3db167214f 100644 --- a/src/ui/Menu.ts +++ b/src/ui/Menu.ts @@ -53,7 +53,7 @@ class Menu extends UIComponent { } // TODO: obtain class in super - //@interlal + //@internal _getClassName() { return 'Menu'; } @@ -164,7 +164,7 @@ class Menu extends UIComponent { }; } - //@interlal + //@internal _createMenuItemDom() { const me = this; const map = this.getMap(); @@ -216,7 +216,7 @@ class Menu extends UIComponent { return ul; } - //@interlal + //@internal _getMenuWidth() { const defaultWidth = 160; const width = this.options['width'] || defaultWidth; diff --git a/src/ui/Menuable.ts b/src/ui/Menuable.ts index 069a3a51d3..19112abcbc 100644 --- a/src/ui/Menuable.ts +++ b/src/ui/Menuable.ts @@ -4,9 +4,9 @@ import Menu, { MenuItem, MenuOptionsType } from './Menu'; import { Coordinate } from '../geo'; interface MenuAbles { - //@interlal + //@internal _menuOptions: MenuOptionsType; - //@interlal + //@internal _menu: Menu; setMenu(options: MenuOptionsType): this; getMenu(): Menu; @@ -15,11 +15,11 @@ interface MenuAbles { getMenuItems(): Array; closeMenu(): this; removeMenu(): this; - //@interlal + //@internal _bindMenu(): this; - //@interlal + //@internal _unbindMenu(): this; - //@interlal + //@internal _defaultOpenMenu(param: any): boolean; } @@ -215,7 +215,7 @@ const Menuable = { return this; }, - //@interlal + //@internal _bindMenu() { if (!this._menuOptions) { return this; @@ -226,7 +226,7 @@ const Menuable = { return this; }, - //@interlal + //@internal _unbindMenu() { if (this._menu) { this.closeMenu(); @@ -243,7 +243,7 @@ const Menuable = { * @return {Boolean} true | false to stop event propagation * @private */ - //@interlal + //@internal _defaultOpenMenu(param) { // 如果用户想自定义右键菜单,其不应该setMenu,既然其设置了说明就是想用默认的menu,应该根据是否设置了menu为参考依据而不是 contextmenu监听次数 this.openMenu(param['coordinate']); diff --git a/src/ui/ToolTip.ts b/src/ui/ToolTip.ts index 45ac673d98..3f4d0b7ac4 100644 --- a/src/ui/ToolTip.ts +++ b/src/ui/ToolTip.ts @@ -32,15 +32,15 @@ const options: ToolTipOptionsType = { class ToolTip extends UIComponent { options: ToolTipOptionsType; - //@interlal + //@internal _content: string; - //@interlal + //@internal _timeout: NodeJS.Timeout; - //@interlal + //@internal _owner: Geometry; // TODO:obtain class in super - //@interlal + //@internal _getClassName() { return 'ToolTip'; } @@ -171,7 +171,7 @@ class ToolTip extends UIComponent { * override UIComponent method * ignore altitude calculation */ - //@interlal + //@internal _getViewPoint() { return this.getMap().coordToViewPoint(this._coordinate, undefined, 0) ._add(this.options['dx'], this.options['dy']); diff --git a/src/ui/UIComponent.ts b/src/ui/UIComponent.ts index 87eb0f7589..0228396335 100644 --- a/src/ui/UIComponent.ts +++ b/src/ui/UIComponent.ts @@ -76,25 +76,25 @@ const options: UIComponentOptionsType = { class UIComponent extends Eventable(Class) { options: UIComponentOptionsType; - //@interlal + //@internal _owner: Map | Geometry; - //@interlal + //@internal _coordinate: Coordinate; - //@interlal + //@internal _showBySymbolChange: boolean; - //@interlal + //@internal _mapEventsOn: boolean; - //@interlal + //@internal __uiDOM: HTMLElement; - //@interlal + //@internal _pos: Point; - //@interlal + //@internal _autoPanId: NodeJS.Timeout; - //@interlal + //@internal _domContentRect: { width: number, height: number }; - //@interlal + //@internal _size: Size; - //@interlal + //@internal _resizeObserver: ResizeObserver; /** @@ -119,7 +119,7 @@ class UIComponent extends Eventable(Class) { this.proxyOptions(); } - //@interlal + //@internal _appendCustomClass(dom: HTMLElement) { if (!dom) { console.warn('dom is null:', dom); @@ -203,7 +203,7 @@ class UIComponent extends Eventable(Class) { return (this._owner as Geometry).getMap(); } - //@interlal + //@internal _collides() { const map = this.getMap(); if (!map) { @@ -214,7 +214,7 @@ class UIComponent extends Eventable(Class) { return this; } - //@interlal + //@internal _collidesEffect(show: boolean) { const dom = this.getDOM(); if (!dom) { @@ -524,7 +524,7 @@ class UIComponent extends Eventable(Class) { return this; } - //@interlal + //@internal _roundPoint(point: Point) { if (this.options.roundPoint) { point = point._round(); @@ -546,7 +546,7 @@ class UIComponent extends Eventable(Class) { return p; } - //@interlal + //@internal _getAnimation() { const anim = { 'fade': false, @@ -576,7 +576,7 @@ class UIComponent extends Eventable(Class) { return anim; } - //@interlal + //@internal _getViewPoint() { let altitude = 0; //后期有了地形后,拿到的数据会带altitude,这里适配下,以后点击地图拿到的数据应该带海拔的(lng,lat,alt) @@ -605,14 +605,14 @@ class UIComponent extends Eventable(Class) { ._add(this.options['dx'], this.options['dy']); } - //@interlal + //@internal _meterToPoint(center: Coordinate, altitude: number) { return altitude; // const map = this.getMap(); // return map.altitudeToPoint(altitude, map._getResolution()) * sign(altitude); } - //@interlal + //@internal _autoPan() { const map = this.getMap(), dom = this.getDOM(); @@ -705,7 +705,7 @@ class UIComponent extends Eventable(Class) { * @return {Size} size * @private */ - //@interlal + //@internal _measureSize(dom: HTMLElement) { const container = this._getUIContainer(); dom.style.position = 'absolute'; @@ -731,7 +731,7 @@ class UIComponent extends Eventable(Class) { * * @private */ - //@interlal + //@internal _removePrevDOM() { if (this.onDomRemove) { this.onDomRemove(); @@ -777,27 +777,27 @@ class UIComponent extends Eventable(Class) { * @private * @return {String} cache key */ - //@interlal + //@internal _uiDomKey() { return '__ui_' + this._getClassName(); } - //@interlal + //@internal _singleton() { return this.options['single']; } - //@interlal + //@internal _getUIContainer() { return this.getMap().getPanels()['ui']; } - //@interlal + //@internal _getClassName() { return 'UIComponent'; } - //@interlal + //@internal _switchMapEvents(to: string) { const map = this.getMap(); if (!map) { @@ -817,7 +817,7 @@ class UIComponent extends Eventable(Class) { } } - //@interlal + //@internal _switchEvents(to: string) { //At the beginning,not bind map events,bind evetns when show // this._switchMapEvents(to); @@ -831,7 +831,7 @@ class UIComponent extends Eventable(Class) { } } - //@interlal + //@internal _getDefaultEvents() { return { 'zooming rotate pitch': this.onEvent, @@ -842,7 +842,7 @@ class UIComponent extends Eventable(Class) { }; } - //@interlal + //@internal _getOwnerEvents() { const events: { [key: string]: (...args) => void } = {}; if (this._owner && (this._owner instanceof Geometry)) { @@ -905,7 +905,7 @@ class UIComponent extends Eventable(Class) { } } - //@interlal + //@internal _updatePosition() { if (!this.getMap()) { return this; @@ -916,7 +916,7 @@ class UIComponent extends Eventable(Class) { return this; } - //@interlal + //@internal _setPosition() { const dom = this.getDOM(); if (!dom) return; @@ -926,7 +926,7 @@ class UIComponent extends Eventable(Class) { dom.style[TRANSFORM] = this._toCSSTranslate(p) + ' scale(1)'; } - //@interlal + //@internal _toCSSTranslate(p: Point) { if (!p) { return ''; @@ -948,7 +948,7 @@ class UIComponent extends Eventable(Class) { } } - //@interlal + //@internal _observerDomSize(dom: HTMLElement) { if (!dom || !Browser.resizeObserver || this._resizeObserver) { return this; @@ -997,7 +997,7 @@ class UIComponent extends Eventable(Class) { return false; } - //@interlal + //@internal _bindDomEvents(dom: HTMLElement, to: string) { if (!dom) { return; @@ -1013,7 +1013,7 @@ class UIComponent extends Eventable(Class) { } } - //@interlal + //@internal _getDomEvents() { return { 'mouseover': this._onDomMouseover, @@ -1021,7 +1021,7 @@ class UIComponent extends Eventable(Class) { }; } - //@interlal + //@internal _configMapPreventWheelScroll(preventWheelScroll: boolean) { const map = this.getMap(); if (!map) { @@ -1034,13 +1034,13 @@ class UIComponent extends Eventable(Class) { } // eslint-disable-next-line no-unused-vars - //@interlal + //@internal _onDomMouseover() { this._configMapPreventWheelScroll(false); } // eslint-disable-next-line no-unused-vars - //@interlal + //@internal _onDomMouseout() { this._configMapPreventWheelScroll(true); } diff --git a/src/ui/UIMarker.ts b/src/ui/UIMarker.ts index 54c73d8933..a15f3619af 100644 --- a/src/ui/UIMarker.ts +++ b/src/ui/UIMarker.ts @@ -212,16 +212,16 @@ const domEvents = * }).addTo(map); */ class UIMarker extends Handlerable(UIComponent) { - //@interlal + //@internal _markerCoord: Coordinate; options: UIMarkerOptionsType; - //@interlal + //@internal _owner: Map; - //@interlal + //@internal _mousedownEvent: MouseEvent; - //@interlal + //@internal _mouseupEvent: MouseEvent; - //@interlal + //@internal _touchstartTime: number; /** @@ -237,7 +237,7 @@ class UIMarker extends Handlerable(UIComponent) { } // TODO: obtain class in super - //@interlal + //@internal _getClassName() { return 'UIMarker'; } @@ -449,12 +449,12 @@ class UIMarker extends Handlerable(UIComponent) { return false; } - //@interlal + //@internal _registerDOMEvents(dom: HTMLElement) { on(dom, domEvents, this._onDomEvents, this); } - //@interlal + //@internal _onDomEvents(e: MouseEvent, type?: string) { const event = this.getMap()._parseEvent(e, e.type); type = type || e.type; @@ -480,12 +480,12 @@ class UIMarker extends Handlerable(UIComponent) { } } - //@interlal + //@internal _removeDOMEvents(dom: HTMLElement) { off(dom, domEvents, this._onDomEvents); } - //@interlal + //@internal _mouseClickPositionIsChange() { const { x: x1, y: y1 } = this._mousedownEvent || {}; const { x: x2, y: y2 } = this._mouseupEvent || {}; @@ -496,7 +496,7 @@ class UIMarker extends Handlerable(UIComponent) { * Get the connect points of panel for connector lines. * @private */ - //@interlal + //@internal _getConnectPoints() { const map = this.getMap(); const containerPoint = map.coordToContainerPoint(this.getCoordinates()); @@ -525,7 +525,7 @@ class UIMarker extends Handlerable(UIComponent) { return anchors; } - //@interlal + //@internal _getViewPoint() { let alt = 0; if (this._owner) { @@ -538,12 +538,12 @@ class UIMarker extends Handlerable(UIComponent) { ._add(this.options['dx'], this.options['dy']); } - //@interlal + //@internal _getDefaultEvents() { return extend({}, super._getDefaultEvents(), { 'zooming zoomend': this.onZoomFilter }); } - //@interlal + //@internal _setPosition() { //show/hide zoomFilter this.onZoomFilter(); @@ -587,13 +587,13 @@ UIMarker.mergeOptions(options); const EVENTS = Browser.touch ? 'touchstart mousedown' : 'mousedown'; class UIMarkerDragHandler extends Handler { - //@interlal + //@internal _lastCoord: Coordinate; - //@interlal + //@internal _lastPoint: Point; - //@interlal + //@internal _dragHandler: DragHandler; - //@interlal + //@internal _isDragging: boolean; target: UIMarker; @@ -609,7 +609,7 @@ class UIMarkerDragHandler extends Handler { this.target.off(EVENTS, this._startDrag, this); } - //@interlal + //@internal _startDrag(param) { const domEvent = param['domEvent']; if (domEvent.touches && domEvent.touches.length > 1 || domEvent.button === 2) { @@ -638,7 +638,7 @@ class UIMarkerDragHandler extends Handler { this.target.fire('dragstart', param); } - //@interlal + //@internal _prepareDragHandler() { this._dragHandler = new DragHandler(this.target.getDOM(), { 'cancelOn': this._cancelOn.bind(this), @@ -650,7 +650,7 @@ class UIMarkerDragHandler extends Handler { this._dragHandler.enable(); } - //@interlal + //@internal _cancelOn(domEvent) { const target = domEvent.srcElement || domEvent.target, tagName = target.tagName.toLowerCase(); @@ -664,12 +664,12 @@ class UIMarkerDragHandler extends Handler { return false; } - //@interlal + //@internal _onMouseDown(param) { stopPropagation(param['domEvent']); } - //@interlal + //@internal _dragging(param) { const target = this.target, map = target.getMap(), @@ -715,7 +715,7 @@ class UIMarkerDragHandler extends Handler { } - //@interlal + //@internal _endDrag(param) { const target = this.target, map = target.getMap(); diff --git a/tsconfig.json b/tsconfig.json index 981ff64fbb..1dce624f12 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,6 +16,7 @@ "isolatedModules": true, "removeComments": false, "moduleResolution": "node", + "stripInternal": true, // ask tsc not to mess up with for ... of "downlevelIteration": true, "module": "esnext",