Feat:小地图插件支持返回图片类型的小地图
This commit is contained in:
parent
77167c572d
commit
e85f187199
@ -1,7 +1,8 @@
|
|||||||
import {
|
import {
|
||||||
isWhite,
|
isWhite,
|
||||||
isTransparent,
|
isTransparent,
|
||||||
getVisibleColorFromTheme
|
getVisibleColorFromTheme,
|
||||||
|
readBlob
|
||||||
} from '../utils/index'
|
} from '../utils/index'
|
||||||
|
|
||||||
// 小地图插件
|
// 小地图插件
|
||||||
@ -85,10 +86,18 @@ class MiniMap {
|
|||||||
Object.keys(viewBoxStyle).forEach(key => {
|
Object.keys(viewBoxStyle).forEach(key => {
|
||||||
viewBoxStyle[key] = viewBoxStyle[key] + 'px'
|
viewBoxStyle[key] = viewBoxStyle[key] + 'px'
|
||||||
})
|
})
|
||||||
|
|
||||||
this.removeNodeContent(svg)
|
this.removeNodeContent(svg)
|
||||||
|
const svgStr = svg.svg()
|
||||||
|
|
||||||
return {
|
return {
|
||||||
svgHTML: svg.svg(), // 小地图html
|
getImgUrl: async callback => {
|
||||||
|
const blob = new Blob([svgStr], {
|
||||||
|
type: 'image/svg+xml'
|
||||||
|
})
|
||||||
|
const res = await readBlob(blob)
|
||||||
|
callback(res)
|
||||||
|
},
|
||||||
|
svgHTML: svgStr, // 小地图html
|
||||||
viewBoxStyle, // 视图框的位置信息
|
viewBoxStyle, // 视图框的位置信息
|
||||||
miniMapBoxScale, // 视图框的缩放值
|
miniMapBoxScale, // 视图框的缩放值
|
||||||
miniMapBoxLeft, // 视图框的left值
|
miniMapBoxLeft, // 视图框的left值
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user