mirror of https://gitee.com/antv-l7/antv-l7
fix(map): map style map
This commit is contained in:
parent
12ca2c7e36
commit
ac1056c3a2
|
@ -21,14 +21,18 @@
|
|||
<script src="./assets/dat.gui.min.js"></script>
|
||||
<script src="../build/L7.js"></script>
|
||||
<script>
|
||||
const scene = new L7.Scene({
|
||||
id: 'map',
|
||||
mapStyle: 'dark', // 样式URL
|
||||
center: [121.576757,31.279873 ],
|
||||
pitch: 0,
|
||||
zoom: 12,
|
||||
rotation:0
|
||||
var mapinstance = new AMap.Map('map',{
|
||||
center: [121.576757,31.279873 ],
|
||||
viewMode: '3D',
|
||||
pitch: 0,
|
||||
zoom: 12,
|
||||
maxZoom:20,
|
||||
minZoom:0,
|
||||
});
|
||||
|
||||
const scene = new L7.Scene({
|
||||
map:mapinstance,
|
||||
//mapStyle: 'dark', // 样式URL
|
||||
});
|
||||
const testdata = [
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@antv/l7",
|
||||
"version": "1.2.0-beta.2",
|
||||
"version": "1.2.0-beta.3",
|
||||
"description": "Large-scale WebGL-powered Geospatial Data Visualization",
|
||||
"main": "build/l7.js",
|
||||
"browser": "build/l7.js",
|
||||
|
|
|
@ -108,7 +108,8 @@ export default class Layer extends Base {
|
|||
if (type === 'fill') {
|
||||
this.get('pickingController').addPickMesh(object);
|
||||
}
|
||||
setTimeout(() => this.scene._engine.update(), 500);
|
||||
this.scene._engine.update();
|
||||
// setTimeout(() => this.scene._engine.update(), 200);
|
||||
}
|
||||
remove(object) {
|
||||
if (object.type === 'composer') {
|
||||
|
|
|
@ -41,7 +41,6 @@ export default class Scene extends Base {
|
|||
const Map = new MapProvider(this._attrs);
|
||||
Map.mixMap(this);
|
||||
this._container = Map.container;
|
||||
// const Map = new MapProvider(this.mapContainer, this._attrs);
|
||||
Map.on('mapLoad', () => {
|
||||
this.map = Map.map;
|
||||
this._initEngine(Map.renderDom);
|
||||
|
@ -55,8 +54,8 @@ export default class Scene extends Base {
|
|||
interaction._onHashChange();
|
||||
}
|
||||
this.emit('loaded');
|
||||
this._engine.update();
|
||||
});
|
||||
|
||||
}
|
||||
initLayer() {
|
||||
for (const key in LAYER_MAP) {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
// const Global = {};
|
||||
const FONT_FAMILY = '"-apple-system", BlinkMacSystemFont, "Segoe UI", Roboto,"Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",SimSun, "sans-serif"';
|
||||
const Global = {
|
||||
version: '1.2.0-beta.2',
|
||||
version: '1.2.0-beta.3',
|
||||
scene: {
|
||||
mapType: 'AMAP',
|
||||
zoom: 5,
|
||||
|
|
|
@ -55,7 +55,7 @@ export default class GaodeMap extends Base {
|
|||
if (map instanceof AMap.Map) {
|
||||
this.map = map;
|
||||
this.container = map.getContainer();
|
||||
this.map.setMapStyle(this.get('mapStyle'));
|
||||
this.get('mapStyle') && this.map.setMapStyle(this.get('mapStyle'));
|
||||
} else {
|
||||
this.map = new AMap.Map(this.container, this._attrs);
|
||||
}
|
||||
|
@ -82,6 +82,7 @@ export default class GaodeMap extends Base {
|
|||
camera.lookAt(0, 0, 0);
|
||||
camera.position.x += e.camera.position.x;
|
||||
camera.position.y += -e.camera.position.y;
|
||||
this._engine.update();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue