Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
/**
* BMap component extension
*/
import * as echarts from 'echarts';
import BMapCoordSys from './BMapCoordSys';
import './BMapModel';
import './BMapView';
echarts.registerCoordinateSystem('bmap', BMapCoordSys);
// Action
echarts.registerAction({
type: 'bmapRoam',
event: 'bmapRoam',
update: 'updateLayout'
}, function (payload, ecModel) {
ecModel.eachComponent('bmap', function (bMapModel) {
var bmap = bMapModel.getBMap();
var center = bmap.getCenter();
bMapModel.setCenterAndZoom([center.lng, center.lat], bmap.getZoom());
});
});
export var version = '1.0.0';
private registerMap() {
if (!this._isRegistered) {
this.coordinateSystemId = `openlayers_${uuid()}`;
// @ts-ignore
echarts.registerCoordinateSystem(this.coordinateSystemId, this.getCoordinateSystem(this._options));
this._isRegistered = true;
}
if (this._chartOptions) {
// @ts-ignore
const series = this._chartOptions.series;
if (series && isObject(series)) {
const convertTypes = this._options.convertTypes;
if (convertTypes) {
for (let i = series.length - 1; i >= 0; i--) {
if (!(convertTypes.indexOf(series[i].type) > -1)) {
series[i].coordinateSystem = this.coordinateSystemId;
}
series[i].animation = false;
}
}
private registerMap() {
if (!this._isRegistered) {
this.coordinateSystemId = `openlayers_${uuid()}`;
// @ts-ignore
echarts.registerCoordinateSystem(this.coordinateSystemId, this.getCoordinateSystem(this._options));
this._isRegistered = true;
}
if (this._chartOptions) {
// @ts-ignore
const series = this._chartOptions.series;
if (series && isObject(series)) {
const convertTypes = this._options.convertTypes;
if (convertTypes) {
for (let i = series.length - 1; i >= 0; i--) {
if (!(convertTypes.indexOf(series[i].type) > -1)) {
series[i].coordinateSystem = this.coordinateSystemId;
}
series[i].animation = false;
}
}
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
/**
* BMap component extension
*/
echarts.registerCoordinateSystem('bmap', BMapCoordSys); // Action
echarts.registerAction({
type: 'bmapRoam',
event: 'bmapRoam',
update: 'updateLayout'
}, function (payload, ecModel) {
ecModel.eachComponent('bmap', function (bMapModel) {
var bmap = bMapModel.getBMap();
var center = bmap.getCenter();
bMapModel.setCenterAndZoom([center.lng, center.lat], bmap.getZoom());
});
});
var version = '1.0.0';
exports.version = version;
define(function (require) {
require('echarts').registerCoordinateSystem(
'bmap', require('./BMapCoordSys')
);
require('./BMapModel');
require('./BMapView');
// Action
require('echarts').registerAction({
type: 'bmapRoam',
event: 'bmapRoam',
update: 'updateLayout'
}, function (payload, ecModel) {
ecModel.eachComponent('bmap', function (bMapModel) {
var bmap = bMapModel.getBMap();
var center = bmap.getCenter();
bMapModel.setCenterAndZoom([center.lng, center.lat], bmap.getZoom());
});
_registerMap () {
if (!this._isRegistered) {
echarts.registerCoordinateSystem('openlayers', _getCoordinateSystem(this.getMap(), this.$options));
this._isRegistered = true;
}
const series = this.$chartOptions.series;
if (series && isObject(series)) {
for (let i = series.length - 1; i >= 0; i--) {
if (!(this.$options.convertTypes.indexOf(series[i]['type']) > -1)) {
series[i]['coordinateSystem'] = 'openlayers';
}
series[i]['animation'] = false;
}
}
}
_class.prototype._prepareECharts = function _prepareECharts() {
if (!this._registered) {
this._coordSystemName = 'maptalks' + Util.GUID();
registerCoordinateSystem(this._coordSystemName, this._getE3CoordinateSystem(this.getMap()));
this._registered = true;
}
var series = this.layer._ecOptions.series;
if (series) {
for (var i = series.length - 1; i >= 0; i--) {
series[i]['coordinateSystem'] = this._coordSystemName;
series[i]['animation'] = false;
}
}
};
_registerMap () {
if (!this._isRegistered) {
echarts.registerCoordinateSystem('openlayers', _getCoordinateSystem(this.getMap(), this.$options));
this._isRegistered = true;
}
const series = this.$chartOptions.series;
if (series && isObject(series)) {
for (let i = series.length - 1; i >= 0; i--) {
if (!(this.$options.convertTypes.indexOf(series[i]['type']) > -1)) {
series[i]['coordinateSystem'] = 'openlayers';
}
series[i]['animation'] = false;
}
}
}