mirror of https://gitee.com/antv-l7/antv-l7
Merge pull request #621 from antvis/fix/meta
fix: getViewPortScale边界情况处理
This commit is contained in:
commit
ac3c9c37f5
|
@ -155,6 +155,9 @@ export function printCanvas(canvas: HTMLCanvasElement) {
|
|||
|
||||
export function getViewPortScale() {
|
||||
const meta = document.querySelector('meta[name="viewport"]');
|
||||
if (!meta) {
|
||||
return 1;
|
||||
}
|
||||
const contentItems = (meta as any).content?.split(',');
|
||||
const scale = contentItems.find((item: string) => {
|
||||
const [key, value] = item.split('=');
|
||||
|
|
Loading…
Reference in New Issue