close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Street view?

Thread began 10/12/2009 3:56 pm by ian42475 | Last modified 11/05/2009 2:27 pm by Jason Byrnes | 7678 views | 12 replies |

ian42475

Street view?

Hi
Is there anyway to get the map to show the street view onload? or is that part of API 3 and therefore no part of the extension at the moment or am i overlooking something?
Desperate to get this functionality into my application

Thanks
Ian

Sign in to reply to this post

Jason ByrnesWebAssist

Street view is not a feature that is available in Pro maps, though you can modify the promaps .js file to include it.


First you need to add a div to display the street view panorama:

html:
<div id="pano" style="width: 300px; height: 300px;"></div>




next you need to modify the maps .js file to add street view.

in the .js file, find the following line:

var map = new GMap2(document.getElementById('wagmp_map_1'));



the number "wagmp_map_1" may be differant.

and add the following after it:

var myPano = new GStreetviewPanorama(document.getElementById("pano"));



Then find each occurance of:

map.addOverlay(marker_0);



the number in "marker_0" my be different and will change depending on how many addresses are in your map.

and add the following after it:

svOverlay = new GStreetviewOverlay();
map.addOverlay(svOverlay);
myPano.setLocationAndPOV(point);
GEvent.addListener(map,"click", function(overlay,latlng) {
myPano.setLocationAndPOV(latlng);
});
Sign in to reply to this post

ian42475

awesome thanks

awesome thanks

Sign in to reply to this post

ian42475

Using lat and long

Hi
I have this working great on one site using the address to position streetview (addressType: 'address',) but a new one i'm implementing is using lat and long not address (addressType: 'coordinates',), is it possible to use lat and long with street view?
at the moment <div id="pano" style="width: 300px; height: 300px;"></div> is not showing

Many thanks for any advice
Regards
Ian

Sign in to reply to this post

Jason ByrnesWebAssist

Yes, you should be able to use street view with latitude and longitude.

Can you post a link so I can take a look.

Sign in to reply to this post

ian42475

street view

Thanks Jason
Test area is here: map.php?property_id=14472
Problem seems to be that 'mypano' is NULL or not an object

I set the webassist extension to look up the lat and long fields from the db and then applied the above amends as i did for the address version

Ian

Sign in to reply to this post

Jason ByrnesWebAssist

you are missing the code that defines the myPano variable:
var myPano = new GStreetviewPanorama(document.getElementById("pano"));

add that code just after:
var map = new GMap2(document.getElementById('wagmp_map_1'));

Sign in to reply to this post

ian42475

thanks

Doh!
Thanks, will pay more attention next time

One other question, is it possible to point the street view at a building rather than up or down the road?

Thanks
Ian

Sign in to reply to this post

Jason ByrnesWebAssist

the myPano.setLocationAndPOV() function can take 2 arguments, 1- lat long for the address, 2- options


there are 3 option: 1- yaw. 2- pitch, 3- zoom




you can control where the camera is facing using the yaw.


From googles api documetation:

  Street View Points of View (POV)

The Street View location defines the placement of the camera locus for an image, but it does not define the orientation of the camera for that image. For that purpose, the GPov object literal defines three properties:

* yaw defines the rotation angle around the camera locus in degrees relative from true north. Yaw angles are measured clockwise (90 degrees is true east).
* pitch defines the angle variance "up" or "down" from the camera's initial default pitch, which is often (but not always) flat horizontal. (For example, an image taken on a hill will likely exhibit a default pitch that is not horizontal.) Pitch angles are measured with negative values looking up (to -90 degrees straight up and orthogonal to the default pitch) and positive values looking down (to +90 degrees straight down and orthogonal to the default pitch).
* zoom defines the zoom level of this view (effectively proscribing the "field of view") with 0 being fully zoomed-out. Different Street View locations may provide higher or lower zoom levels.

By default, these values are all 0 and define a flat horizontal view directly north with the widest possible field of view.  





change:
myPano.setLocationAndPOV(point);


to:
myPOV = {yaw:90};
myPano.setLocationAndPOV(point, myPOV);

to change the POV to face East instead of north.

Sign in to reply to this post

ian42475

awesome

Amazing Jason
Thanks so much i have an excellent solution now
I am assuming that what you mean by there are only 2 arguments available is that lat/long or address is first arguement then i can either pitch zoom or yaw for that position and not use yaw with zoom also?

Many thanks, your help has been truly awesome
Ian

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...