diff --git a/package.json b/package.json index 1b8770e333..15ba66461d 100755 --- a/package.json +++ b/package.json @@ -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", diff --git a/rollup.config.js b/rollup.config.js index 5ea4e2c523..d1d2510aef 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -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() ] } ]; diff --git a/src/core/scene.js b/src/core/scene.js index 0b04128292..5679344498 100644 --- a/src/core/scene.js +++ b/src/core/scene.js @@ -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', diff --git a/src/map/AMap.js b/src/map/AMap.js index 0762a442a1..81e7c238e5 100644 --- a/src/map/AMap.js +++ b/src/map/AMap.js @@ -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] ])); };