Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Google MAPS- Stuck on Street Views Google API - Geocoding

7:16 am on Aug 5, 2008 (gmt 0)

New User

10+ Year Member

joined:May 9, 2007
posts: 10
votes: 0

Well Im stuck, I finally was able to take the classic ASP on my site and use it to display a specific location using Geocoding however can't find any examples on how to do that with the Street View API. I have it working with the regular google maps with this Code Below:

<script src="http://maps.google.com/maps?file=api&v=2&key=MY API KEY"
<script type="text/javascript">


var geocoder;
var map;

var address = "<%=rs("address") %>, New York, NY";

// On page load, call this function

function load()
// Create new map object
map = new GMap2(document.getElementById("map"));

// Create new geocoding object
geocoder = new GClientGeocoder();

// Retrieve location information, pass it to addToMap()
geocoder.getLocations(address, addToMap);


// This function adds the point to the map

function addToMap(response)
// Retrieve the object
place = response.Placemark[0];

// Retrieve the latitude and longitude
point = new GLatLng(place.Point.coordinates,

// Center the map on this point
map.setCenter(point, 13);
map.addControl(new GSmallMapControl());

// Create a marker
marker = new GMarker(point);

// Add the marker to map

// Add address information to marker
marker.openInfoWindowHtml(address + '<br\>Rent : $<%= Currency_Format_Function(rs("rent")) %>');



<body onload="load()" onunload="GUnload()">
<div id="map" style="width: 400px; height: 300px"></div>

SO i basiclly want the above functionality working with the street view API below, any ideas?

<script src="http://maps.google.com/maps?file=api&amp;v=2.x&amp;key=MY API KEY"
<script type="text/javascript">

var myPano;

function initialize() {
var fenwayPark = new GLatLng(42.345573,-71.098326);
panoramaOptions = { latlng:fenwayPark };
myPano = new GStreetviewPanorama(document.getElementById("pano"), panoramaOptions);
GEvent.addListener(myPano, "error", handleNoFlash);

function handleNoFlash(errorCode) {
if (errorCode == FLASH_UNAVAILABLE) {
alert("Error: Flash doesn't appear to be supported by your browser");

<body onload="initialize()" onunload="GUnload()">
<div name="pano" id="pano" style="width: 500px; height: 300px"></div>

[1][edited by: tedster at 3:44 pm (utc) on Aug. 30, 2008]
[edit reason] remove actual API key [/edit]

4:51 am on Aug 9, 2008 (gmt 0)

New User

10+ Year Member

joined:May 9, 2007
votes: 0

7:00 am on Aug 30, 2008 (gmt 0)


WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Aug 10, 2004
votes: 96

from [code.google.com...] :
var fenwayPark = new GLatLng(42.345573,-71.098326);
panoramaOptions = { latlng:fenwayPark };
var myPano = new GStreetviewPanorama(document.getElementById("pano"), panoramaOptions);

this is the simplest case with the default POV north.
there are more detailed examples in the linked documentation - error handling, setting the POV, etc...


Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members