Office 插件可以像浏览器那样向用户显示通知吗?

问题描述

我在我的办公室插件中使用 Google Maps Javascript API,我正在使用以下代码在地图上定位用户的位置。这适用于浏览器,但不适用于 Excel 任务窗格。

在浏览器中运行 html 文件时,我收到一条通知,要求允许访问用户位置,然后在授予权限后显示用户的位置。

从 excel 任务窗格运行代码时,我没有看到通知,下面的代码什么也不做。

Office 插件是否支持此类操作(或显示此类通知)?

        if (navigator.geolocation) {
        navigator.geolocation.getCurrentPosition(function (position) {
            var pos = {
                lat: position.coords.latitude,lng: position.coords.longitude
            };

            map.setCenter(pos);
            map.setZoom(18);
        });
    }

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...