UNPKG

@alicloud/cloud-charts

Version:

![](https://img.shields.io/npm/v/@alicloud/cloud-charts?color=%23ff8200)

40 lines 1.42 kB
import _extends from "@babel/runtime/helpers/extends"; import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose"; var _excluded = ["geoData", "children", "config"]; import * as React from 'react'; // @ts-ignore import { Wmap, pluginManager } from '@alicloud/cloud-charts'; // @ts-ignore import worldGeo from './data/world-without-antarctic.json'; var defaultWorldProjection = Wmap.getGeoProjection('geoEquirectangular'); function WorldMap(props) { var geoData = props.geoData, children = props.children, config = props.config, other = _objectWithoutPropertiesLoose(props, _excluded); var newConfig = Object.assign({}, config || {}); if (newConfig.showSouthChinaSea === undefined || newConfig.showSouthChinaSea) { newConfig.showSouthChinaSea = false; } if (!newConfig.projection) { newConfig.projection = defaultWorldProjection; } if (!newConfig.padding) { newConfig.padding = [0, 0, 0, 0]; } return /*#__PURE__*/React.createElement(Wmap, _extends({ geoData: geoData || worldGeo, config: newConfig }, other), children); } WorldMap.Area = Wmap.Area; WorldMap.Point = Wmap.Point; WorldMap.HeatMap = Wmap.HeatMap; WorldMap.Shoot = Wmap.Shoot; WorldMap.Custom = Wmap.Custom; WorldMap.worldGeoData = worldGeo; WorldMap.isG2Chart = true; if (pluginManager) { pluginManager.register('WorldMap', WorldMap); } export default WorldMap;