Stuck on Street Views Google API - Geocoding

Discussion in 'Google API' started by njabe567, Aug 2, 2008.

  1. #1
    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"
    type="text/javascript"></script>
    <script type="text/javascript">

    //<![CDATA[

    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[1],
    place.Point.coordinates[0]);

    // 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
    map.addOverlay(marker);

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


    }

    //]]>

    </script>
    </head>
    <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=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA"
    type="text/javascript"></script>
    <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");
    return;
    }
    }
    </script>
    </head>

    <body onload="initialize()" onunload="GUnload()">
    <div name="pano" id="pano" style="width: 500px; height: 300px"></div:mad:
     
    njabe567, Aug 2, 2008 IP
  2. njabe567

    njabe567 Peon

    Messages:
    60
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Anyone on this ?
     
    njabe567, Aug 4, 2008 IP
  3. njabe567

    njabe567 Peon

    Messages:
    60
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Bump , Any ideas ?
     
    njabe567, Aug 12, 2008 IP