On Feb 27, 1:24 pm, Dean <[email protected]> wrote: > Thanks for that, I stand corrected. > > This brings me back to my original question. For any location, a YAW > value of 0 will point the camera to true north. If I want to have a > view that is set to 90 degrees from the direction of the street, is it > possible to automatically determine the direction of the street > (through geocoding?) so that the street view displayed is always 90 > degrees to the street? In this case PITCH would always be set to 0 and > is not of concern. > > What I find is that there is no set yaw for any address entered and > the camera does not always point true north. So in effect what I am > trying to do is force the yaw value to be 90 degrees from the > direction of the street (i.e. for streets running NW/SE (315/135) the > yaw would be (225 or 45) degrees but for streets running N/S the yaw > would be 90 or 180 degrees) and do this automatically. > > Any thoughts?
Get directions for 2 points close to the point of interest. Use the angle of the polyline between those 2 points to determine the direction of the street. > > On Feb 28, 9:58 am, "[email protected]" <[email protected]> > wrote: > > > On Feb 27, 12:47 pm, Dean <[email protected]> wrote: > > > > Thanks for the clarification on pitch/yaw; however, in the API example > > > shown below, pitch is controlling where the camera is relative to true > > > north and yaw is the postion of the camera relative to the street view > > > vehicle. This is apparently the opposite of the definition in the > > > class GPov. > > > I suggest you try it again. It works the way I expect it to... > > > > function initialize() { > > > var myPano = new GStreetviewPanorama(document.getElementById > > > ("pano")); > > > fenwayPark = new GLatLng(42.345573,-71.098326); > > > myPOV = {yaw:370.64659986187695,pitch:-20}; > > > myPano.setLocationAndPOV(fenwayPark, myPOV); > > > GEvent.addListener(myPano, "error", handleNoFlash); > > > > } > > > > function handleNoFlash(errorCode) { > > > if (errorCode == 603) { > > > alert("Error: Flash doesn't appear to be supported by your > > > browser"); > > > return; > > > } > > > > } > > > > Try it out here (change values in > > > myPOV):http://code.google.com/apis/ajax/playground/?exp=maps#map_streetview_... > > > > On Feb 28, 9:21 am, "[email protected]" <[email protected]> > > > wrote: > > > > > On Feb 27, 12:18 pm, "[email protected]" <[email protected]> > > > > wrote: > > > > > > On Feb 27, 11:29 am, Dean <[email protected]> wrote: > > > > > > > Thanks Larry, but I was hoping that there would be a way to do this > > > > > > automatically and include it in the script. Ideally this would allow > > > > > > the bearing to be determined automatically and the pitch set > > > > > > accordingly (i.e. set pitch to 90 degrees from known bearing) > > > > > > without > > > > > > any manual input. If you have a list of addresses doing this > > > > > > manually > > > > > > for each would be quite time consuming. > > > > > > I don't understand what you mean. The script automatically calculates > > > > > the correct direction to point the streetview panorama based on the > > > > > location it gets from the geocoder and the location of the nearest > > > > > panorama. You can use a different source than the geocoder for the > > > > > "real" location that you want to look at. Other than that, that is > > > > > all you can do... > > > > > As for pitch, I don't know how to calculate how far up or down the > > > > > camera should look (elevation isn't included in any of the data). > > > > > > -- Larry > > > > > FYI - > > > > >http://code.google.com/apis/maps/documentation/reference.html#GPov > > > > class GPov > > > > This class represents the structure of a camera point of view used by > > > > street view. It has no constructor, but is instantiated as an object > > > > literal. All properties are optional. > > > > > yaw - The camera yaw in degrees relative to true north. True north is > > > > 0 degrees, east is 90 degrees, south is 180 degrees, west is 270 > > > > degrees. > > > > > pitch - The camera pitch in degrees, relative to the street view > > > > vehicle. Ranges from 90 degrees (directly upwards) to -90 degrees > > > > (directly downwards). > > > > > > > On Feb 28, 8:19 am, "[email protected]" <[email protected]> > > > > > > wrote: > > > > > > > > On Feb 27, 10:53 am, Dean <[email protected]> wrote: > > > > > > > > > The Maps API Map Streetview Object example describes how you > > > > > > > > can show > > > > > > > > a Streetview of a given location and control the pitch and yaw. > > > > > > > > The > > > > > > > > pitch is based on the orientation of the street. If you are > > > > > > > > heading > > > > > > > > north the view to the right is 270 (degrees). > > > > > > > > > My question is this...how can you determine the direction of any > > > > > > > > location so that the pitch is always at a right angle? A > > > > > > > > standard > > > > > > > > value of 270 will not always return a true 90 degree view as it > > > > > > > > is > > > > > > > > based on the direction of the street. Can anyone offer any > > > > > > > > assistance > > > > > > > > with this? Any help would be greatly appreciated. > > > > > > > > Calculate the bearing to the location from the nearest > > > > > > > StreetviewPanorama (which is where the image was taken from). > > > > > > > Set it to be the yaw (pitch is up/down) > > > > > > > > A simple example I have been playing with that does > > > > > > > that:http://www.geocodezip.com/example_geo_streetview.asp > > > > > > > (there are still issues that need debugging, but it works to first > > > > > > > order) > > > > > > > > -- Larry- Hide quoted text - > > > > > > > - Show quoted text -- Hide quoted text - > > > > > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Maps-API?hl=en -~----------~----~----~----~------~----~------~--~---
