homepage Welcome to WebmasterWorld Guest from 54.196.196.62
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld
Home / Forums Index / Google / Google Desktop Tools and Google Labs Projects
Forum Library, Charter, Moderator: open

Google Desktop Tools and Google Labs Projects Forum

    
Google MAPS- Stuck on Street Views Google API - Geocoding
njabe567




msg:3715430
 7:16 am on Aug 5, 2008 (gmt 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"
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,
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=MY API KEY"
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>

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

 

njabe567




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

Nothing?

phranque




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

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...

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Google / Google Desktop Tools and Google Labs Projects
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved