scene 新增设置地图要素方法,新增导出图片方法

更新package文件main 入口文件
This commit is contained in:
thinkinggis 2019-08-30 16:53:08 +08:00
parent 4ec2e2e0d7
commit e9b2ed3074
4 changed files with 17 additions and 8 deletions

View File

@ -1,10 +1,8 @@
{
"name": "@antv/l7",
"version": "1.3.2",
"version": "1.3.3",
"description": "Large-scale WebGL-powered Geospatial Data Visualization",
"main": "build/L7.js",
"browser": "build/L7-min.js",
"module": "lib/index.js",
"homepage": "https://github.com/antvis/l7",
"repository": {
"type": "git",
@ -57,6 +55,7 @@
"rollup-plugin-node-builtins": "^2.1.2",
"rollup-plugin-node-resolve": "^4.0.1",
"rollup-plugin-postcss": "^2.0.3",
"rollup-plugin-sourcemaps": "^0.4.2",
"rollup-plugin-terser": "^4.0.4",
"serve-static": "^1.13.2",
"shelljs": "~0.7.8",
@ -67,7 +66,7 @@
"scripts": {
"build-dev": "rollup -c --environment BUILD:dev",
"watch-dev": "rollup -c --environment BUILD:dev --watch & npm run demos-web ",
"build-prod": "rollup -c --environment BUILD:production",
"build-prod": "rollup -c --environment BUILD",
"build-prod-min": "rollup -c --environment BUILD:production,MINIFY:true",
"build": "rollup -c --environment BUILD:production",
"build-lib": "babel src --out-dir lib",
@ -83,11 +82,11 @@
"demos": "electron ./demos/app.js",
"demos-web": "node ./demos/app.js --web --port 2046",
"dev": "npm run watch & npm run demos-web",
"dist": "npm run build-dev && npm run build-prod && npm run build-prod-min",
"dist": "npm run build-prod && npm run build-prod-min",
"lint": "eslint --ext .html,.js ./",
"lint-fix": "eslint --ext .html,.js --fix ./",
"mkdir-dist": "node ./bin/mkdir-dist.js",
"prepublishOnly": "npm run build-lib && npm run dist",
"prepublishOnly": "npm run dist",
"screenshot": "node ./bin/screenshot.js",
"start": "npm run watch-dev",
"test": "torch --compile-opts ./.torch.compile.opts.js --compile --renderer --recursive test/unit",
@ -106,7 +105,6 @@
"silent": false
},
"dependencies": {
"@antv/g": "^3.1.3",
"@antv/geo-coord": "^1.0.8",
"@antv/util": "~2.0.1",
"@mapbox/geojson-rewind": "^0.4.0",

View File

@ -1,4 +1,5 @@
import fs from 'fs';
import sourcemaps from 'rollup-plugin-sourcemaps';
import json from 'rollup-plugin-json';
import buble from 'rollup-plugin-buble';
import resolve from 'rollup-plugin-node-resolve';
@ -74,7 +75,7 @@ const config = [
},
treeshake: false,
plugins: [
// css()
sourcemaps()
]
}
];

View File

@ -130,6 +130,13 @@ export default class Scene extends Base {
getMarkerContainer() {
return this._markerContainier;
}
map2Png() {
this.scene._engine.update();
const vis = this.scene._engine._renderer.domElement.toDataURL();
const map = this.scene.map.getContainer().getElementsByClassName('amap-layer')[0].toDataURL();
return [ map, vis ];
}
_registEvents() {
const events = [
'mouseout',

View File

@ -147,6 +147,9 @@ export default class GaodeMap extends Base {
const lnglat = new AMap.LngLat(center[0], center[1]);
return map.setZoomAndCenter(zoom, lnglat);
};
scene.setFeature = features => {
return map.setFeature(features);
};
scene.setBounds = extent => {
return map.setBounds(new AMap.Bounds([ extent[0], extent[1] ], [ extent[2], extent[3] ]));
};