简体   繁体   English

在pyv8中使用python中的getPanoramaByLocation

[英]use getPanoramaByLocation in python by pyv8

I need to determine if a given location has street view or not. 我需要确定给定位置是否具有街景。 So getPanoramaByLocation js API is the only way I can use as far as i know. 因此,据我所知,getPanoramaByLocation js API是我可以使用的唯一方法。

However, I have a python script to handle all those location data. 但是,我有一个python脚本来处理所有这些位置数据。 So I am wondering how can I call getPanoramaByLocation from python by using PyV8? 所以我想知道如何使用PyV8从python调用getPanoramaByLocation吗? Do I need to load https://maps.googleapis.com/maps/api/js in python? 我是否需要在python中加载https://maps.googleapis.com/maps/api/js

I am kinda new to this. 我对此有些陌生。 So any hint and guide would be greatly appreciated!. 因此,任何提示和指导将不胜感激!

Thanks 谢谢

Having had a quick look at the JS file you linked, the following answer applies for the most part [1] . 快速浏览您链接的JS文件后,以下答案大部分适用于[1]。 You'd have to bridge both 'window' and 'document' somehow since these objects are not available in PyV8. 您必须以某种方式桥接“窗口”和“文档”,因为这些对象在PyV8中不可用。 The difficulty doing this is rather high, so if you're not very experienced in JS and python I'd look for other solutions. 这样做的难度相当高,因此,如果您对JS和python不太熟悉,我会寻找其他解决方案。 I recommend using a python native library instead. 我建议改为使用python本机库。 A quick google reveals quite a few options. 一个快速的谷歌揭示了很多选择。

[1] Loading JavaScript library in Python using PyV8 [1] 使用PyV8在Python中加载JavaScript库

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM