简体   繁体   English

使用谷歌街景图像 api v3 如何使用 javascript 保存街景图像

[英]Using the google street view image api v3 how do I Save street view images with javascript

I have a google street map and I would to create a button that allows to capture from the google images and for them to save it either to a document file so that they can add the information needed.我有一个谷歌街道地图,我想创建一个按钮,允许从谷歌图像中捕获并让他们将其保存到文档文件中,以便他们可以添加所需的信息。

I understand that I have to use Street view with all the details.我知道我必须使用包含所有细节的街景视图

I first need my javascript to make sure that its capturing from the correct google street image and then i need to be able to save it to a specified spot all with a click of the one button created.我首先需要我的 javascript 来确保它从正确的谷歌街道图像中捕获,然后我需要能够通过单击创建的一个按钮将其保存到指定的位置。

I have been looking around for many answers and all the ways do not seem to work in the way i need it to work.我一直在寻找许多答案,但所有方法似乎都无法按照我需要的方式工作。 I am new to the whole programming environment specifically with javascript.我是整个编程环境的新手,特别是使用 javascript。

I have tried adding in this:我试过添加这个:

$('#getStatic').click(function() {
                var maplatlong = map.getCenter().clone();
                maplatlong.transform(new OpenLayers.Projection("EPSG:900913"),
                new OpenLayers.Projection("EPSG:4326"));
                panoLatLon = new google.maps.LatLng(maplatlong.lat, maplatlong.lon);   

                $('#map_canvas').html('<img src="http://maps.googleapis.com/maps/api/streetview?location=' + panoLatLon.lat() + ',' + panoLatLon.lng() + '&maptype=' + map.getMapTypeId() + '&zoom=' + map.getZoom() + '&size=400x400&sensor=false">');

and then just attempting to try to alter it and then moving on to attempt add the code to get it show a saveto popup然后只是尝试尝试更改它,然后继续尝试添加代码以使其显示 saveto 弹出窗口

You could use the Streetview Image API to get an image, but use of that imagery is subject to the Terms of Service/Use , and you won't be able to do much with the image automatically because Javascript is sandboxed.您可以使用Streetview Image API获取图像,但该图像的使用受服务/使用条款的约束,并且您将无法自动对图像执行太多操作,因为 Javascript 已被沙盒化。

To save you looking it up, Terms 10.1.3 prohibit the storage of imagery and usage outside a web page.为方便您查找,条款 10.1.3 禁止在网页外存储图像和使用。

1 - Javascript has no access to the file system, therefore you cannot save a file with it. 1 - Javascript 无法访问文件系统,因此您无法使用它保存文件。

2 - Saving images from Google Maps is not allowed. 2 - 不允许从 Google 地图保存图像。 See here:看这里:

https://developers.google.com/maps/faq#tos_screenshots https://developers.google.com/maps/faq#tos_screenshots

Use of Google Maps imagery in printed materials and offline media is subject to the Permission Guidelines published at:在印刷材料和离线媒体中使用 Google 地图图像须遵守发布于以下网址的许可指南:

http://www.google.com/permissions/geoguidelines.html http://www.google.com/permissions/geoguidelines.html

you can request permission, but I don't think it's easy to obtain, unless you are a paying business customer.您可以请求许可,但我认为这并不容易获得,除非您是付费商业客户。

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

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