Skip to content

Commit

Permalink
[fix]mapboxgl ts升级 review by xiongjj
Browse files Browse the repository at this point in the history
  • Loading branch information
luoxiao-supermap committed Sep 27, 2023
1 parent 19ee496 commit ad796e4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/mapboxgl/attributes/AttributesViewModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ class FeatureTableViewModel extends mapboxgl.Evented {
if (!this.map) {
return;
}
let layer = this.map.getLayer(this.layerName);
let layer = this.map.getLayer(this.layerName) as mapboxglTypes.Layer;
let type, id: string, paint;
let features = [];
if (!layer) {
Expand Down
6 changes: 1 addition & 5 deletions src/mapboxgl/web-map/control/compass/CompassViewModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,12 @@ import mapboxgl from 'vue-iclient/static/libs/mapboxgl/mapbox-gl-enhance';
* @extends mapboxgl.Evented
*/

interface mapEnhance extends mapboxglTypes.Map {
resetNorthPitch?: (options?: mapboxglTypes.AnimationOptions, eventData?: mapboxglTypes.EventData) => this;
}

interface optionsTypes {
visualizePitch: boolean;
}

export default class CompassViewModel extends mapboxgl.Evented {
map: mapEnhance;
map: mapboxglTypes.Map;
rotatePitchCallBack: any;
visualizePitch: boolean;
rotateEventFn: (data: mapboxglTypes.MapboxEvent<MouseEvent | TouchEvent | undefined>) => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default class FillExtrusionViewModel extends mapboxgl.Evented {
}
const { layerId, layerStyle, sourceLayer, filter, minzoom, maxzoom } = this.options;
const { paint = {}, layout = {} } = layerStyle || {};
const layer: mapboxglTypes.Layer = {
const layer: mapboxglTypes.FillExtrusionLayer = {
id: layerId,
source: sourceId || layerId,
'source-layer': sourceLayer || '',
Expand Down

0 comments on commit ad796e4

Please sign in to comment.