moshen / node-googlemaps

A simple way to query the Google Maps API from Node.js
MIT License
560 stars 148 forks source link

StreetView Nearby #42

Open stefanocudini opened 10 years ago

stefanocudini commented 10 years ago

In this package has been implemented the function getPanoramaByLocation with callback..???

I don't understand the parameters sequence :-(

I would like to get this, for search nearest streetview by location

var astorPlace = new google.maps.LatLng(40.729884, -73.990988);
var webService = new google.maps.StreetViewService();  
/**Check in a perimeter of 50 meters**/ 
var checkaround = 50;
/** checkNearestStreetView is a valid callback function **/

webService.getPanoramaByLocation(astorPlace,checkaround ,checkNearestStreetView);

function checkNearestStreetView(panoData){
    if(panoData){
        if(panoData.location){
            if(panoData.location.latLng){
                /**Well done you can use a nearest existing street view coordinates**/
            }
        }
    }
    /** Else do something... **/
}
fabriziomoscon commented 10 years ago

I think this is related to this API: https://developers.google.com/maps/documentation/javascript/streetview

As far as I can see this module do not provide it yet. But it would be a good addition in my opinion. At the moment I am heavily refactoring this library in order to overcome some issues other users already reported. Once that is done I think we can add it.

niguloto commented 9 years ago

I'm not sure it's exactly the same thing stefanocudini asked, but is there a way to "jump" or "move" to the closest streetview point from the one you're currently on, towards one of the two ways the road goes? wanted to know if I can automate via code the "arrow" clicking when you normally unse streetview on google and save a series of static images like a "walk sequence".

Thanks!

stefanocudini commented 9 years ago

yes @niguloto it's the same question!

stefanocudini commented 9 years ago

@fabriziomoscon now it's possible? :)

fabriziomoscon commented 9 years ago

There are differences between the server side node.js Google Maps library and the client JavaScript library.

The reference for server side street view is here: https://developers.google.com/maps/documentation/streetview/ and I don't see any implementation for getPanoramaByLocation()

This library strictly implements server side calls. Please refer to the first part of the readme to see the related documentations of what is currently possible.