mirror of https://gitee.com/antv-l7/antv-l7
postcss inline
This commit is contained in:
parent
300e6f8f5a
commit
c266b0e2cf
|
@ -37,10 +37,6 @@ const scene = new L7.Scene({
|
||||||
|
|
||||||
// 高德数据服务 https://mvt.amap.com/district/CHN2/{z}/{x}/{y}/4096?key=608d75903d29ad471362f8c58c550daf
|
// 高德数据服务 https://mvt.amap.com/district/CHN2/{z}/{x}/{y}/4096?key=608d75903d29ad471362f8c58c550daf
|
||||||
scene.on('loaded', () => {
|
scene.on('loaded', () => {
|
||||||
const ZoomControl = new L7.Control.Zoom();
|
|
||||||
ZoomControl.addTo(scene);
|
|
||||||
const scaleControl = new L7.Control.Scale();
|
|
||||||
scaleControl.addTo(scene);
|
|
||||||
|
|
||||||
const attributeCtr = new L7.Control.Attribution();
|
const attributeCtr = new L7.Control.Attribution();
|
||||||
attributeCtr.addTo(scene);
|
attributeCtr.addTo(scene);
|
||||||
|
|
|
@ -47,6 +47,7 @@
|
||||||
"nunjucks": "~3.0.1",
|
"nunjucks": "~3.0.1",
|
||||||
"open": "~0.0.5",
|
"open": "~0.0.5",
|
||||||
"parseurl": "~1.3.2",
|
"parseurl": "~1.3.2",
|
||||||
|
"postcss-url": "^8.0.0",
|
||||||
"pre-commit": "~1.2.2",
|
"pre-commit": "~1.2.2",
|
||||||
"rollup": "^1.16.2",
|
"rollup": "^1.16.2",
|
||||||
"rollup-plugin-buble": "^0.19.6",
|
"rollup-plugin-buble": "^0.19.6",
|
||||||
|
@ -56,6 +57,7 @@
|
||||||
"rollup-plugin-json": "^4.0.0",
|
"rollup-plugin-json": "^4.0.0",
|
||||||
"rollup-plugin-node-builtins": "^2.1.2",
|
"rollup-plugin-node-builtins": "^2.1.2",
|
||||||
"rollup-plugin-node-resolve": "^4.0.1",
|
"rollup-plugin-node-resolve": "^4.0.1",
|
||||||
|
"rollup-plugin-postcss": "^2.0.3",
|
||||||
"rollup-plugin-terser": "^4.0.4",
|
"rollup-plugin-terser": "^4.0.4",
|
||||||
"serve-static": "^1.13.2",
|
"serve-static": "^1.13.2",
|
||||||
"shelljs": "~0.7.8",
|
"shelljs": "~0.7.8",
|
||||||
|
|
|
@ -1,15 +1,12 @@
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
// import sourcemaps from 'rollup-plugin-sourcemaps';
|
|
||||||
// import postcss from 'postcss';
|
|
||||||
import json from 'rollup-plugin-json';
|
import json from 'rollup-plugin-json';
|
||||||
import buble from 'rollup-plugin-buble';
|
import buble from 'rollup-plugin-buble';
|
||||||
import resolve from 'rollup-plugin-node-resolve';
|
import resolve from 'rollup-plugin-node-resolve';
|
||||||
import commonjs from 'rollup-plugin-commonjs';
|
import commonjs from 'rollup-plugin-commonjs';
|
||||||
import builtins from 'rollup-plugin-node-builtins';
|
import builtins from 'rollup-plugin-node-builtins';
|
||||||
import { createFilter } from 'rollup-pluginutils';
|
import { createFilter } from 'rollup-pluginutils';
|
||||||
import imageInliner from 'postcss-image-inliner';
|
|
||||||
import postcss from 'rollup-plugin-postcss';
|
import postcss from 'rollup-plugin-postcss';
|
||||||
import postcssImport from 'postcss-import';
|
import url from 'postcss-url';
|
||||||
import { terser } from 'rollup-plugin-terser';
|
import { terser } from 'rollup-plugin-terser';
|
||||||
const { BUILD, MINIFY } = process.env;
|
const { BUILD, MINIFY } = process.env;
|
||||||
const minified = MINIFY === 'true';
|
const minified = MINIFY === 'true';
|
||||||
|
@ -45,11 +42,7 @@ const config = [
|
||||||
json(),
|
json(),
|
||||||
// css({ raw: './build/l7.css' }),
|
// css({ raw: './build/l7.css' }),
|
||||||
postcss({
|
postcss({
|
||||||
modules: true,
|
plugins: [ url({ url: 'inline' }) ]
|
||||||
plugins: [
|
|
||||||
postcssImport(),
|
|
||||||
imageInliner({ assetPaths: [ '**/images/' ] })
|
|
||||||
]
|
|
||||||
}),
|
}),
|
||||||
// url({ url: 'inline' }),
|
// url({ url: 'inline' }),
|
||||||
buble({
|
buble({
|
||||||
|
|
|
@ -82,6 +82,9 @@
|
||||||
|
|
||||||
/* control positioning */
|
/* control positioning */
|
||||||
|
|
||||||
|
.l7-control-container {
|
||||||
|
font: 12px/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif;
|
||||||
|
}
|
||||||
.l7-control {
|
.l7-control {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 800;
|
z-index: 800;
|
||||||
|
@ -197,12 +200,12 @@
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
}
|
}
|
||||||
.l7-control-layers-toggle {
|
.l7-control-layers-toggle {
|
||||||
background-image: url(images/layers.png);
|
background-image: url(../images/layers.png);
|
||||||
width: 36px;
|
width: 36px;
|
||||||
height: 36px;
|
height: 36px;
|
||||||
}
|
}
|
||||||
.l7-retina .l7-control-layers-toggle {
|
.l7-retina .l7-control-layers-toggle {
|
||||||
background-image: url(images/layers-2x.png);
|
background-image: url(../images/layers-2x.png);
|
||||||
background-size: 26px 26px;
|
background-size: 26px 26px;
|
||||||
}
|
}
|
||||||
.l7-touch .l7-control-layers-toggle {
|
.l7-touch .l7-control-layers-toggle {
|
||||||
|
|
|
@ -9,7 +9,8 @@ import Global from '../global';
|
||||||
import { getInteraction } from '../interaction/index';
|
import { getInteraction } from '../interaction/index';
|
||||||
import { compileBuiltinModules } from '../geom/shader';
|
import { compileBuiltinModules } from '../geom/shader';
|
||||||
import Style from './style';
|
import Style from './style';
|
||||||
import Control from './controller/control';
|
import Controller from './controller/control';
|
||||||
|
import * as Control from '../component/control';
|
||||||
import { epsg3857 } from '@antv/geo-coord/lib/geo/crs/crs-epsg3857';
|
import { epsg3857 } from '@antv/geo-coord/lib/geo/crs/crs-epsg3857';
|
||||||
export default class Scene extends Base {
|
export default class Scene extends Base {
|
||||||
getDefaultCfg() {
|
getDefaultCfg() {
|
||||||
|
@ -34,8 +35,14 @@ export default class Scene extends Base {
|
||||||
compileBuiltinModules();
|
compileBuiltinModules();
|
||||||
}
|
}
|
||||||
_initContoller() {
|
_initContoller() {
|
||||||
const controlCtr = new Control({ scene: this });
|
const controlCtr = new Controller({ scene: this });
|
||||||
this.set('controlController', controlCtr);
|
this.set('controlController', controlCtr);
|
||||||
|
if (this.get('zoomControl')) {
|
||||||
|
new Control.Zoom().addTo(this);
|
||||||
|
}
|
||||||
|
if (this.get('scaleControl')) {
|
||||||
|
new Control.Scale().addTo(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 为pickup场景添加 object 对象
|
// 为pickup场景添加 object 对象
|
||||||
addPickMesh(object) {
|
addPickMesh(object) {
|
||||||
|
|
|
@ -14,7 +14,9 @@ const Global = {
|
||||||
minZoom: 3,
|
minZoom: 3,
|
||||||
maxZoom: 18,
|
maxZoom: 18,
|
||||||
pitch: 0,
|
pitch: 0,
|
||||||
hash: false
|
hash: false,
|
||||||
|
zoomControl: true,
|
||||||
|
scaleControl: true
|
||||||
},
|
},
|
||||||
animate: true,
|
animate: true,
|
||||||
height: 0,
|
height: 0,
|
||||||
|
|
Loading…
Reference in New Issue