Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var citys = ["北京", "天津", "上海", "重庆", "石家庄", "太原", "呼和浩特", "哈尔滨", "长春", "沈阳", "济南", "南京", "合肥", "杭州", "南昌", "福州", "郑州", "武汉", "长沙", "广州", "南宁", "西安", "银川", "兰州", "西宁", "乌鲁木齐", "成都", "贵阳", "昆明", "拉萨", "海口"];
// 构造数据
while (randomCount--) {
var cityCenter1 = utilCityCenter.getCenterByCityName(citys[parseInt(Math.random() * citys.length)]);
var cityCenter2 = utilCityCenter.getCenterByCityName(citys[parseInt(Math.random() * citys.length)]);
data.push({
geometry: {
type: 'LineString',
coordinates: [[cityCenter1.lng - 1 + Math.random() * 1, cityCenter1.lat - 1 + Math.random() * 1],
[cityCenter2.lng - 1 + Math.random() * 1, cityCenter2.lat - 1 + Math.random() * 1]
]
},
count: 30 * Math.random()
});
}
dataSet = new DataSet(data);
if (!map.getLayer("mapv")) {
mapvLayer = new MapvLayer(map, dataSet, options);
}
});
afterEach(() => {
refresh: function () {
var mapvOptions = this.model.get('map_v_options')
mapvOptions.size = this.model.get('size');
mapvOptions.globalAlpha = this.model.get('global_alpha');
mapvOptions.fillStyle = this.model.get('fill_style');
mapvOptions.shadowColor = this.model.get('shadow_color');
mapvOptions.shadowBlur = this.model.get('shadow_blur');
// mapvOptions.lineWidth = this.model.get('line_width');
var dataSet = this.model.get('data_set');
var mapvDataSet = new mapv.DataSet(dataSet);
this.obj.update({data: mapvDataSet, options: mapvOptions})
},
createLayers() {
this._createLayer = true;
var map = this.map;
this.project = map.getMapType().getProjection();
let self = this;
let shadowSet = this.shadowSet = new DataSet([]);
let circleSet = this.circleSet = new DataSet([]);
let textSet = this.textSet = new DataSet([]);
let numSet = this.numSet = new DataSet([]);
let otherSet = this.otherSet = new DataSet([]);
let otherShadowSet = this.otherShadowSet = new DataSet([]);
this.layers = [];
let otherOptions = {
coordType: 'bd09mc',
splitList: {
4: '#d53938',
3: '#fe6261',
2: '#ffb02d',
other: '#80db69'
},
shadowBlur: 10,
size: 5,
max: 30,
methods: {
click: function (item) {
createLayers() {
this._createLayer = true;
var map = this.map;
this.project = map.getMapType().getProjection();
let self = this;
let shadowSet = this.shadowSet = new DataSet([]);
let circleSet = this.circleSet = new DataSet([]);
let textSet = this.textSet = new DataSet([]);
let numSet = this.numSet = new DataSet([]);
let otherSet = this.otherSet = new DataSet([]);
let otherShadowSet = this.otherShadowSet = new DataSet([]);
this.layers = [];
let otherOptions = {
coordType: 'bd09mc',
splitList: {
4: '#d53938',
3: '#fe6261',
2: '#ffb02d',
other: '#80db69'
},
shadowBlur: 10,
size: 5,
max: 30,
methods: {
click: function (item) {
if (item) {
createLayers() {
this._createLayer = true;
var map = this.map;
let self = this;
this.lineDataSet = new DataSet([]);
this.lineLayer = new baiduMapLayer(map, this.lineDataSet, {});
this.pointDataSet = new DataSet([]);
this.pointLayer = new baiduMapLayer(map, this.pointDataSet, {});
this.textLayer = new baiduMapLayer(map, this.pointDataSet, {});
if (this.props.enableAnimation) {
this.animationLayer = new baiduMapAnimationLayer(map, this.lineDataSet, {});
}
}
createLayers() {
this._createLayer = true;
var map = this.map;
this.project = map.getMapType().getProjection();
let self = this;
let shadowSet = this.shadowSet = new DataSet([]);
let circleSet = this.circleSet = new DataSet([]);
let textSet = this.textSet = new DataSet([]);
let numSet = this.numSet = new DataSet([]);
let otherSet = this.otherSet = new DataSet([]);
let otherShadowSet = this.otherShadowSet = new DataSet([]);
this.layers = [];
let otherOptions = {
coordType: 'bd09mc',
splitList: {
4: '#d53938',
3: '#fe6261',
2: '#ffb02d',
other: '#80db69'
},
shadowBlur: 10,
size: 5,
max: 30,
methods: {
initialize() {
var map = this.props.map;
if (!map) {
return;
}
if (!this.mapvLayer) {
this.dataSet = new DataSet([]);
var options = this.props.layerOptions || {
gradient: {
0: 'yellow',
1: 'red'
},
max: 100,
globalAlpha: 0.8,
draw: 'intensity'
}
this.mapvLayer = new baiduMapLayer(map, this.dataSet, options);
}
this.getBoundaryData();
}