当我想在openstreetmap上显示用户地理位置时,为什么在PyQt5 QWebenginePage中位置访问失败?

2024-09-29 23:24:21 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在PyQt5 webenginePage中加载openstreetmap,但无法在地图上显示用户位置,尽管我通过messagebox获得用户权限

question = questionForFeature.get(feature)
if question:
    question = question.format(feature=securityOrigin.host())
    if QMessageBox.question(self.view().window(), title, question) == QMessageBox.Yes:
        self.setFeaturePermission(securityOrigin, feature, QWebEnginePage.PermissionGrantedByUser)
    else:
        self.setFeaturePermission(securityOrigin, feature, QWebEnginePage.PermissionDeniedByUser)

地图上什么也没有发生,控制台中只显示以下消息: serialnmea:找不到串行端口 位置访问失败

我的操作系统是Windows10,但我的用户可能有旧版本的windows


Tags: 用户self权限if地图pyqt5featureopenstreetmap

热门问题