HI all,
i am trying to add a streetview inside a infowindow that popups when i
click on the map .
i want to add a d<div> tag which will show the street view in the
infowindow.
can anyone help me with the exact code.
Below is the code i am using.
It works fine, but the infowindow needs to display street view within
a <div> tag.
here is the code i am using:
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/
>
<title>Play with InfoWindow</title>
<script src="http://maps.google.com/maps?
file=api&v=2&sensor=false&key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-
m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA"
type="text/javascript"></script>
<script type="text/javascript">
var map;
var geocoder;
var address;
function initialize() {
map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(40.730885,-73.997383), 15);
map.setUIToDefault();
GEvent.addListener(map, "click", getAddress);
geocoder = new GClientGeocoder();
}
function getAddress(overlay, latlng) {
if (latlng != null) {
address = latlng;
geocoder.getLocations(latlng, showAddress);
}
}
function showAddress(response) {
map.clearOverlays();
if (!response || response.Status.code != 200) {
alert("Status Code:" + response.Status.code);
} else {
place = response.Placemark[0];
point = new GLatLng(place.Point.coordinates[1],
place.Point.coordinates[0]);
marker = new GMarker(point);
map.addOverlay(marker);
marker.openInfoWindowHtml(
'<b>orig latlng:</b>' + response.name + '<br/>' +
'<b>latlng:</b>' + place.Point.coordinates[1] + "," +
place.Point.coordinates[0] +
'<b>Country code:</b> ' +
place.AddressDetails.Country.CountryNameCode+
'panoDiv');
GEvent.addListener(map, 'click', a1);
}
}
function a1(){
var panoDiv =
document.createElement('div');
panoDiv.style.width = "400px"; // can be anything,
will be auto resized
panoDiv.style.width = "200px";
}
</script>
</head>
<body onload="initialize()" onunload="GUnload()">
<div id="map_canvas" style="width: 500px; height: 300px"></div>
</body>
</html>
--
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.