Search code examples
javascriptgoogle-maps-api-3google-street-view

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.

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.

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


Solution

  • 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.

    To save you looking it up, Terms 10.1.3 prohibit the storage of imagery and usage outside a web page.