-
Notifications
You must be signed in to change notification settings - Fork 640
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: amap next * test: sleepTime * test: add heatmap snapshot * test: sleepTime * fix: getMinZoom * chore: zoom offset * refactor: base map * chore(CI): update snapshots (#2391) * fix: type * test: sleepTime * wip: demo * fix: source update 事件访问图层初始化未完成 * test: set pitch * chore: common viewport to lib * chore: note todo * chore: fix path * chore: remove path * chore: meterToCoord * test: sleepTime * chore: ingore path for ci * test: update snapshot * chore: rename * chore: demo shakking --------- Co-authored-by: lvisei <26923747+lvisei@users.noreply.github.com>
- Loading branch information
Showing
34 changed files
with
831 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { generateCanvasTestCases } from './utils/generator'; | ||
|
||
const TEST_CASES = [ | ||
{ | ||
name: 'normal', | ||
sleepTime: 1000, | ||
}, | ||
{ | ||
name: 'grid', | ||
snapshots: false, | ||
}, | ||
{ | ||
name: 'hexagon', | ||
snapshots: false, | ||
}, | ||
]; | ||
|
||
describe('Heatmap Snapshot', () => { | ||
generateCanvasTestCases('Heatmap', TEST_CASES); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ const TEST_CASES = [ | |
}, | ||
{ | ||
name: 'column', | ||
sleepTime: 200, | ||
}, | ||
{ | ||
name: 'fill_image', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { LineLayer, Scene, Source } from '@antv/l7'; | ||
import * as allMap from '@antv/l7-maps'; | ||
import type { RenderDemoOptions } from '../../types'; | ||
|
||
export function MapRender(options: RenderDemoOptions) { | ||
const scene = new Scene({ | ||
id: 'map', | ||
renderer: options.renderer, | ||
map: new allMap[options.map]({ | ||
style: 'normal', | ||
center: [121.434765, 31.256735], | ||
zoom: 14.83, | ||
}), | ||
}); | ||
const geoData = { | ||
type: 'FeatureCollection', | ||
features: [ | ||
{ | ||
type: 'Feature', | ||
properties: {}, | ||
geometry: { | ||
type: 'LineString', | ||
coordinates: [ | ||
[120.104021, 30.262493], | ||
[120.103875, 30.262601], | ||
[120.103963, 30.262694], | ||
], | ||
}, | ||
}, | ||
], | ||
}; | ||
|
||
const source = new Source(geoData); | ||
const layer = new LineLayer({ blend: 'normal', autoFit: true }) | ||
.source(source) | ||
.size(2) | ||
.shape('line') | ||
.color('#f00') | ||
.style({ | ||
opacity: 1, | ||
}); | ||
|
||
scene.on('loaded', () => { | ||
scene.addLayer(layer); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { MapRender as amapData } from './amap-data'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { PointLayer, Scene } from '@antv/l7'; | ||
import * as allMap from '@antv/l7-maps'; | ||
import { featureEach, interpolate, randomPoint } from '@turf/turf'; | ||
import type { RenderDemoOptions } from '../../types'; | ||
|
||
const points = randomPoint(30, { bbox: [120.103217, 30.26128, 120.10348, 30.261506] }); | ||
|
||
featureEach(points, function (point) { | ||
// add a random property to each point | ||
point.properties.solRad = Math.random() * 50; | ||
}); | ||
|
||
const GEO_DATA = interpolate(points, 0.001, { | ||
gridType: 'point', | ||
property: 'solRad', | ||
units: 'miles', | ||
}); | ||
|
||
export function MapRender(options: RenderDemoOptions) { | ||
const scene = new Scene({ | ||
id: 'map', | ||
renderer: options.renderer, | ||
map: new allMap[options.map]({ | ||
style: 'normal', | ||
center: [121.434765, 31.256735], | ||
zoom: 14.83, | ||
maxZoom: 23, | ||
}), | ||
}); | ||
|
||
const layer = new PointLayer({ autoFit: true }) | ||
.source(GEO_DATA) | ||
.size(10) | ||
.color('#f00') | ||
.shape('simple'); | ||
|
||
scene.on('loaded', () => { | ||
scene.addLayer(layer); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import BaseMapWrapper from '../utils/BaseMapWrapper'; | ||
import MapService from './map'; | ||
|
||
export default class AMap2Wrapper extends BaseMapWrapper<AMap.Map> { | ||
protected getServiceConstructor() { | ||
return MapService; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.amap-logo { | ||
display: none !important; | ||
} | ||
.amap-copyright { | ||
display: none !important; | ||
} | ||
.amap-overlays { | ||
z-index: 3 !important; | ||
} |
Oops, something went wrong.