mirror of https://gitee.com/antv-l7/antv-l7
commit
7d7de80982
|
@ -43,11 +43,11 @@ module.exports = [
|
|||
entries: [
|
||||
{
|
||||
find: /^@antv\/l7-(.*)/,
|
||||
replacement: resolveFile('packages/$1/src'),
|
||||
replacement: resolveFile('packages/$1/src')
|
||||
},
|
||||
{
|
||||
find: /^@antv\/l7$/,
|
||||
replacement: resolveFile('packages/l7/src'),
|
||||
replacement: resolveFile('packages/l7/src')
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ module.exports = [
|
|||
commonjs({
|
||||
namedExports: {
|
||||
eventemitter3: [ 'EventEmitter' ],
|
||||
// inversify: ['inject','injectable','postConstruct','Container','decorate','interfaces'],
|
||||
inversify: [ 'inject', 'injectable', 'postConstruct', 'Container', 'decorate', 'interfaces' ],
|
||||
// @see https://github.com/rollup/rollup-plugin-commonjs/issues/266
|
||||
lodash: [
|
||||
'isNil',
|
||||
|
@ -87,8 +87,8 @@ module.exports = [
|
|||
]
|
||||
},
|
||||
dynamicRequireTargets: [
|
||||
'node_modules/inversify/lib/syntax/binding_{on,when}_syntax.js',
|
||||
],
|
||||
'node_modules/inversify/lib/syntax/binding_{on,when}_syntax.js'
|
||||
]
|
||||
}),
|
||||
babel({
|
||||
extensions: [ '.js', '.ts' ]
|
||||
|
|
|
@ -60,7 +60,7 @@ export interface IScaleOption {
|
|||
domain?: any[];
|
||||
}
|
||||
export interface IScaleOptions {
|
||||
[key: string]: IScale;
|
||||
[key: string]: IScale | undefined;
|
||||
}
|
||||
export interface IStyleScale {
|
||||
scale: any;
|
||||
|
|
|
@ -234,7 +234,7 @@ export default class BaseLayer<ChildLayerStyleOptions = {}> extends EventEmitter
|
|||
return this.container;
|
||||
}
|
||||
|
||||
public addPlugin(plugin: ILayerPlugin) {
|
||||
public addPlugin(plugin: ILayerPlugin): ILayer {
|
||||
// TODO: 控制插件注册顺序
|
||||
// @example:
|
||||
// pointLayer.addPlugin(new MyCustomPlugin(), {
|
||||
|
@ -462,7 +462,6 @@ export default class BaseLayer<ChildLayerStyleOptions = {}> extends EventEmitter
|
|||
};
|
||||
return this;
|
||||
}
|
||||
|
||||
public setData(data: any, options?: ISourceCFG) {
|
||||
if (this.inited) {
|
||||
this.layerSource.setData(data, options);
|
||||
|
@ -503,7 +502,7 @@ export default class BaseLayer<ChildLayerStyleOptions = {}> extends EventEmitter
|
|||
}
|
||||
return this;
|
||||
}
|
||||
public scale(field: string | IScaleOptions, cfg: IScale) {
|
||||
public scale(field: string | number | IScaleOptions, cfg?: IScale) {
|
||||
if (isObject(field)) {
|
||||
this.scaleOptions = {
|
||||
...this.scaleOptions,
|
||||
|
@ -533,7 +532,7 @@ export default class BaseLayer<ChildLayerStyleOptions = {}> extends EventEmitter
|
|||
return this;
|
||||
}
|
||||
|
||||
public active(options: IActiveOption) {
|
||||
public active(options: IActiveOption | boolean) {
|
||||
const activeOption: Partial<ILayerConfig> = {};
|
||||
activeOption.enableHighlight = isObject(options) ? true : options;
|
||||
if (isObject(options)) {
|
||||
|
|
|
@ -209,7 +209,7 @@ export default class FeatureScalePlugin implements ILayerPlugin {
|
|||
): IStyleScale {
|
||||
// scale 支持根据视觉通道和字段
|
||||
const scaleOption: IScale | undefined =
|
||||
this.scaleOptions[name] && this.scaleOptions[name].field === field
|
||||
this.scaleOptions[name] && this.scaleOptions[name]?.field === field
|
||||
? this.scaleOptions[name]
|
||||
: this.scaleOptions[field];
|
||||
const styleScale: IStyleScale = {
|
||||
|
|
|
@ -403,6 +403,7 @@ export default class AMapService
|
|||
token = AMAP_API_KEY,
|
||||
mapInstance,
|
||||
plugin = [],
|
||||
version = AMAP_VERSION,
|
||||
...rest
|
||||
} = this.config;
|
||||
// 高德地图创建独立的container;
|
||||
|
@ -464,7 +465,7 @@ export default class AMapService
|
|||
plugin.push('Map3D');
|
||||
AMapLoader.load({
|
||||
key: token, // 申请好的Web端开发者Key,首次调用 load 时必填
|
||||
version: AMAP_VERSION, // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
|
||||
version, // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
|
||||
plugins: plugin, // 需要使用的的插件列表,如比例尺'AMap.Scale'等
|
||||
})
|
||||
.then((AMap) => {
|
||||
|
|
|
@ -26,11 +26,11 @@ export default {
|
|||
namedExports: {
|
||||
eventemitter3: [ 'EventEmitter' ],
|
||||
lodash: [ 'merge' ],
|
||||
// inversify: ['inject','injectable']
|
||||
inversify: [ 'inject', 'injectable' ]
|
||||
},
|
||||
dynamicRequireTargets: [
|
||||
'node_modules/inversify/lib/syntax/binding_{on,when}_syntax.js',
|
||||
],
|
||||
'node_modules/inversify/lib/syntax/binding_{on,when}_syntax.js'
|
||||
]
|
||||
}),
|
||||
buble({
|
||||
transforms: { generator: false }
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { LineLayer, Scene } from '@antv/l7';
|
||||
import { GaodeMap } from '@antv/l7-maps';
|
||||
import { GaodeMapV2 } from '@antv/l7-maps';
|
||||
import * as React from 'react';
|
||||
|
||||
export default class Amap2demo_arcLineLinear extends React.Component {
|
||||
|
@ -13,12 +13,13 @@ export default class Amap2demo_arcLineLinear extends React.Component {
|
|||
public async componentDidMount() {
|
||||
const scene = new Scene({
|
||||
id: 'map',
|
||||
map: new GaodeMap({
|
||||
map: new GaodeMapV2({
|
||||
pitch: 40,
|
||||
center: [107.77791556935472, 35.443286920228644],
|
||||
zoom: 2.9142882493605033,
|
||||
viewMode: '3D',
|
||||
style: 'dark',
|
||||
version: '2.0.4',
|
||||
}),
|
||||
});
|
||||
this.scene = scene;
|
||||
|
|
Loading…
Reference in New Issue