新增map blank 主题既不含底图

新增npmignore
This commit is contained in:
thinkinggis 2019-08-31 23:52:45 +08:00
parent e9b2ed3074
commit c83c957870
3 changed files with 102 additions and 3 deletions

82
.npmignore Normal file
View File

@ -0,0 +1,82 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# lock
package-lock.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Typescript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.DS_Store
# npmignore - content above this line is automatically generated and modifications may be omitted
# see npmjs.com/npmignore for more details.
test
*.sw*
*.un~
.idea
bin
bundler
demos
docs
src
temp
webpack-dev.config.js
webpack.config.js
testdemo
rollup
.si.yml

View File

@ -1,6 +1,6 @@
{
"name": "@antv/l7",
"version": "1.3.3",
"version": "1.3.3-beta.0",
"description": "Large-scale WebGL-powered Geospatial Data Visualization",
"main": "build/L7.js",
"homepage": "https://github.com/antvis/l7",

View File

@ -46,7 +46,7 @@ export default class GaodeMap extends Base {
this.set('mapStyle', mapStyle);
}
}
this.set('zooms', [ this.get('minZoom'), this.get('maxZoom') ]);
this.set('zooms', [this.get('minZoom'), this.get('maxZoom')]);
const map = this.get('map');
if (map instanceof AMap.Map) {
this.map = map;
@ -143,6 +143,23 @@ export default class GaodeMap extends Base {
scene.getBounds = () => {
return map.getBounds();
};
scene.setMapStyle = style => {
switch (style) {
case 'dark':
this.set('mapStyle', Theme.DarkTheme.mapStyle);
break;
case 'light':
this.set('mapStyle', Theme.LightTheme.mapStyle);
break;
case 'blank':
map.setFeature([]);
break;
default:
this.set('mapStyle', style);
}
return map.setMapStyle(this.get('mapStyle'));
};
scene.setZoomAndCenter = (zoom, center) => {
const lnglat = new AMap.LngLat(center[0], center[1]);
return map.setZoomAndCenter(zoom, lnglat);
@ -151,7 +168,7 @@ export default class GaodeMap extends Base {
return map.setFeature(features);
};
scene.setBounds = extent => {
return map.setBounds(new AMap.Bounds([ extent[0], extent[1] ], [ extent[2], extent[3] ]));
return map.setBounds(new AMap.Bounds([extent[0], extent[1]], [extent[2], extent[3]]));
};
scene.setRotation = rotation => {
return map.setRotation(rotation);