/* * @Descripttion: * @version: * @Author: 李佐宁 * @Date: 2023-06-29 10:07:16 * @LastEditors: 曹文丽 * @LastEditTime: 2023-09-04 10:08:00 */ import shandongjson from './shandong.json'; import anhuijson from './anhui.json'; import hubeijson from './hubei.json'; import { shandongCoords, anhuiCoords, hubeiCoords } from './areaCoords'; // 判断是否iframe嵌套 const isIframe = self !== top; // 地图映射数据 const mapMappingData = { '370000': { name: '山东省', en: 'shandong', coord: shandongCoords, coordjson: shandongjson, aspectScale: 0.85, onlyShowContent: isIframe, // (只展示内容区)onlyShowContent: true/false bgTransparent: isIframe, // 背景是否透明 layout: 'mixture', // (布局) layout:'mixture' | 'left-right' showButtonIcon: false, showScreenHeader: isIframe, // 大屏头部是否显示 true-隐藏/false-显示 }, '340000': { name: '安徽省', en: 'anhui', coord: anhuiCoords, coordjson: anhuijson, aspectScale: 1.2, onlyShowContent: false, showScreenHeader: isIframe, layout: isIframe ? 'left-right' : 'mixture', showButtonIcon: isIframe ? true : false, }, '420000': { name: '湖北省', en: 'hubei', coord: hubeiCoords, coordjson: hubeijson, onlyShowContent: true, // (只展示内容区)onlyShowContent: true/false bgTransparent: isIframe, // 背景是否透明 aspectScale: 0.845, layout: 'mixture', // (布局) layout:'mixture' | 'left-right' showButtonIcon: false, showScreenHeader: true, // 大屏头部是否显示 true-隐藏/false-显示 }, '430000': { name: '湖北省', en: 'hubei', coord: shandongCoords, coordjson: shandongjson, aspectScale: 0.85, onlyShowContent: isIframe, // (只展示内容区)onlyShowContent: true/false bgTransparent: isIframe, // 背景是否透明 layout: 'mixture', // (布局) layout:'mixture' | 'left-right' showButtonIcon: false, showScreenHeader: isIframe, // 大屏头部是否显示 true-隐藏/false-显示 }, }; /** * 根据code码获取地图映射 * @param code - 地区码 * @returns 地区数据 */ export const mapMapping = (code?) => { code = code || (localStorage.getItem('YA_LOCATION_CODE') as string); return mapMappingData[code || '410000']; }; // 设置相邻点 export const getNearPointData = (data = []) => { data = JSON.parse(JSON.stringify(data)); data.map((item) => { item.centroid[0] = item.centroid[0] + 0.1; }); return data; };