Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add bmap support * Create EChartsPanel.tsx fix script bug * Add Baidu map support * Add Baidu map support * Update Types * Update Yarn and remove package lock * Minor updates. Fix CI. * Update types, utils, constants * Update Baidu Maps * Fix Tests * Update maps dashboard Co-authored-by: huishanjiang <47376191+huishanjiang@users.noreply.github.com> Co-authored-by: Mikhail <mikhail@volkovlabs.io>
- Loading branch information
1 parent
fd8f933
commit e4a6e9e
Showing
14 changed files
with
642 additions
and
404 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import * as echarts from 'echarts'; | ||
import { BaiduOptions } from 'types'; | ||
|
||
/** | ||
* Register maps | ||
*/ | ||
export const registerMaps = () => { | ||
console.log('Maps Loaded'); | ||
|
||
const maps = require.context('./maps', false, /\.json/); | ||
maps.keys().map((m: string) => { | ||
const matched = m.match(/\.\/([0-9a-zA-Z_]*)\.json/); | ||
if (!matched) { | ||
return; | ||
} | ||
|
||
echarts.registerMap(matched[1], maps(m)); | ||
}); | ||
}; | ||
|
||
/** | ||
* Load Baidu Maps | ||
*/ | ||
export const loadBaidu = (baidu: BaiduOptions) => { | ||
const script = document.createElement('script'); | ||
script.type = 'text/javascript'; | ||
script.src = `${baidu.url}?v=3.0&ak=${baidu.key}&callback=${baidu.callback}`; | ||
|
||
document.body.appendChild(script); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* Baidu Options | ||
*/ | ||
export interface BaiduOptions { | ||
/** | ||
* URL | ||
* | ||
* @type {string} | ||
*/ | ||
url: string; | ||
|
||
/** | ||
* Access Key | ||
* | ||
* @type {string} | ||
*/ | ||
key: string; | ||
|
||
/** | ||
* Callback Function | ||
* | ||
* @type {string} | ||
*/ | ||
callback: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Format } from '../constants'; | ||
|
||
/** | ||
* Editor Options | ||
*/ | ||
export interface EditorOptions { | ||
/** | ||
* Height | ||
* | ||
* @type {number} | ||
*/ | ||
height: number; | ||
|
||
/** | ||
* Format | ||
* | ||
* @type {Format} | ||
*/ | ||
format: Format; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from './baidu'; | ||
export * from './editor'; | ||
export * from './panel'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.