vue整合外部js

vue引入外部js
import { TrackLine } from "../../../../../static/js/trajectory.js";
import { initMap } from "../../../../../static/js/initMap.js";
写法参照js 文件夹内容
用法如下:
data{
return {
TrackLineJs: {} //外部js
}}
this.mapJs = new initMap();
this.mapJs.createIcons(
this.map,
ol.proj.transform(
element.geometry.coordinates,
"EPSG:4326",
"EPSG:3857"
),
element,
this.switchImage(element.properties.reDataType),
this.constructonLayer
);
// ==
let option = {
resolution: this.map.getView().getResolution(),
lineGeom: new ol.geom.LineString(
this.peoInspectionLineData[0].coordinates
).transform("EPSG:4326", "EPSG:3857")
};
let trackLine = new TrackLine(option);
this.peoInspectionLineLayer
.getSource()
.addFeatures(trackLine.lineFeatures());
//END

posted @ 2019-05-23 19:15  A影子放風箏  阅读(669)  评论(0编辑  收藏  举报
// 侧边栏目录 // https://blog-static.cnblogs.com/files/douzujun/marvin.nav.my1502.css