Skip to content

Commit

Permalink
fix internal tag
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzhenn committed Aug 9, 2024
1 parent 27fe774 commit ae68b54
Show file tree
Hide file tree
Showing 117 changed files with 1,354 additions and 1,355 deletions.
4 changes: 2 additions & 2 deletions src/control/Control.Attribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const layerEvents = 'addlayer removelayer setbaselayer baselayerremove';
*/
class Attribution extends Control {
options: AttributionOptionsType;
//@interlal
//@internal
_attributionContainer: HTMLDivElement;

buildOn() {
Expand All @@ -66,7 +66,7 @@ class Attribution extends Control {
this.getMap().off(layerEvents, this._update, this);
}

//@interlal
//@internal
_update() {
const map = this.getMap();
if (!map) {
Expand Down
12 changes: 6 additions & 6 deletions src/control/Control.Compass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand All @@ -78,7 +78,7 @@ class Compass extends Control {
delete this._bearing;
}

//@interlal
//@internal
_resetView() {
const view = { bearing: 0 };
this.getMap().animateTo(view);
Expand Down
12 changes: 6 additions & 6 deletions src/control/Control.LayerSwitcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,30 +71,30 @@ class LayerSwitcher extends Control {
}
}

//@interlal
//@internal
_show() {
if (!hasClass(this.container, 'shown')) {
addClass(this.container, 'shown');
this._createPanel();
}
}

//@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');
this.panel.appendChild(ul);
this._renderLayers(this.getMap(), ul);
}

//@interlal
//@internal
_renderLayers(map: Map, elm: HTMLElement) {
const base = map.getBaseLayer(),
layers = map.getLayers(),
Expand Down Expand Up @@ -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'),
Expand Down
22 changes: 11 additions & 11 deletions src/control/Control.Overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ class Overview extends Control {
options: OverviewOptionsType;
mapContainer: HTMLDivElement;
button: HTMLDivElement;
//@interlal
//@internal
_overview: Map;
//@interlal
//@internal
_perspective: Polygon;

/**
Expand Down Expand Up @@ -145,7 +145,7 @@ class Overview extends Control {
return this._overview;
}

//@interlal
//@internal
_onButtonClick() {
if (!this._overview) {
this.maxmize();
Expand All @@ -155,7 +155,7 @@ class Overview extends Control {
this._updateButtonText();
}

//@interlal
//@internal
_updateButtonText() {
if (this._overview) {
this.button.innerHTML = '-';
Expand All @@ -164,7 +164,7 @@ class Overview extends Control {
}
}

//@interlal
//@internal
_createOverview() {
const map = this.getMap(),
dom = this.mapContainer;
Expand Down Expand Up @@ -195,7 +195,7 @@ class Overview extends Control {
this.fire('load');
}

//@interlal
//@internal
_getOverviewZoom() {
const map = this.getMap(),
zoom = map.getZoom(),
Expand All @@ -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();
Expand All @@ -240,7 +240,7 @@ class Overview extends Control {
});
}

//@interlal
//@internal
_update() {
if (!this._overview) {
return;
Expand All @@ -252,7 +252,7 @@ class Overview extends Control {
this._overview.setCenterAndZoom(this.getMap().getCenter(), this._getOverviewZoom());
}

//@interlal
//@internal
_updateSpatialReference() {
if (!this._overview) {
return;
Expand All @@ -262,7 +262,7 @@ class Overview extends Control {
this._overview.setSpatialReference(spatialRef);
}

//@interlal
//@internal
_updateBaseLayer() {
if (!this._overview) {
return;
Expand Down
14 changes: 7 additions & 7 deletions src/control/Control.Panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ const options: PanelOptionsType = {
class Panel extends Control {
draggable: DragHandler;
options: PanelOptionsType;
//@interlal
//@internal
_startPos: Point;
//@interlal
//@internal
_startPosition: DomPositionType;

/**
Expand Down Expand Up @@ -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();
Expand All @@ -162,7 +162,7 @@ class Panel extends Control {
return false;
}

//@interlal
//@internal
_onDragStart(param) {
this._startPos = param['mousePos'];
this._startPosition = extend({}, this.getPosition());
Expand All @@ -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);
Expand Down Expand Up @@ -210,7 +210,7 @@ class Panel extends Control {
this.fire('dragging', param);
}

//@interlal
//@internal
_onDragEnd(param) {
delete this._startPos;
delete this._startPosition;
Expand All @@ -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();
Expand Down
10 changes: 5 additions & 5 deletions src/control/Control.Reset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ const options: ResetOptionsType = {
};

class Reset extends Control {
//@interlal
//@internal
_reset: HTMLDivElement;
//@interlal
//@internal
_view: MapViewType;
options: ResetOptionsType;
/**
Expand All @@ -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);
}
Expand All @@ -66,7 +66,7 @@ class Reset extends Control {
delete this._view;
}

//@interlal
//@internal
_resetView() {
this.getMap().setView(this._view);
}
Expand Down
20 changes: 10 additions & 10 deletions src/control/Control.Scale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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' +
Expand All @@ -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);
Expand All @@ -97,15 +97,15 @@ class Scale extends Control {
}
}

//@interlal
//@internal
_updateMetric(maxMeters: number) {
const meters = this._getRoundNum(maxMeters),
label = meters < 1000 ? meters + ' m' : (meters / 1000) + ' km';

this._updateScale(this._mScale, label, meters / maxMeters);
}

//@interlal
//@internal
_updateImperial(maxMeters: number) {
const maxFeet = maxMeters * 3.2808399;
let maxMiles, miles, feet;
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/control/Control.Toolbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class Toolbar extends Control {
return dom;
}

//@interlal
//@internal
_createDropMenu(index: number) {
const me = this;

Expand Down Expand Up @@ -181,7 +181,7 @@ class Toolbar extends Control {
return menuDom;
}

//@interlal
//@internal
_getItems() {
return this.options['items'] || [];
}
Expand Down
Loading

0 comments on commit ae68b54

Please sign in to comment.