Skip to content

Commit

Permalink
新增map blank 主题既不含底图
Browse files Browse the repository at this point in the history
新增npmignore
  • Loading branch information
lzxue committed Aug 31, 2019
1 parent e9b2ed3 commit c83c957
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 3 deletions.
82 changes: 82 additions & 0 deletions .npmignore
@@ -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
2 changes: 1 addition & 1 deletion package.json
@@ -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",
Expand Down
21 changes: 19 additions & 2 deletions src/map/AMap.js
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit c83c957

Please sign in to comment.