Hi,

I have tested your code on Firefox, IE 8, Chrome and Opera and it
seems it's working on all browsers except Opera - don't know why flash
object is not loaded.
Which browser are you using?

Regards,

Michal Biniek

On 10 Gru, 21:45, Pepe <[email protected]> wrote:
> Hi everybody:
>
> I need some help with the following Streetview code. I´m not able to
> fire the "yawchanged" and "initialized" events. What´s wrong in this
> code?.
>
> Thanks in advance,
>   Pepe
>
> the code:
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
> <html xmlns="http://www.w3.org/1999/xhtml"; xmlns:v="urn:schemas-
> microsoft-com:vml" xml:lang="es" lang="es">
> <head>
>     <meta http-equiv='Content-Type' content='text/html;
> charset=iso-8859-1'/>
>     <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
>     <meta name="language" content="es"/>
>     <title>Streetview Example</title>
>     <script type="text/javascript" src="http://maps.google.es/maps?
> file=api&v=2&hl=es&key=ABQIAAAAIfJwpUCTaeuIfR7J3BEHMhTri8TP-
> LllWtjJUujJN88zREzv_RSFivK7IAbeXSL7aCRRjz-fAg5Chw&sensor=false"></
> script>
>         <script type="text/javascript">
>                 var map;
>                 var myPano;
>                 var position_pegman;
>
>                 function handleNoFlash(errorCode) {
>                         if (errorCode == 603) {
>                                 alert("Error: Flash doesn't appear to be 
> supported by your
> browser");
>                                 return;
>                         }
>                         if (errorCode == 600) {
>                                 
> document.getElementById("pano").style.backgroundColor="white";
>                                 
> document.getElementById("pano").innerHTML='<p>Please, drag Pegman
> to a street highlighted in blue. Por favor, arrastre Pegman a una via
> destacada en azul</p>';
>                                 return;
>                         }
>                 }
>
>                 function actualizaPegman(ya) {
>                         var angle = parseInt((ya/22.5)+0.5);
>                         if (angle == 16) angle = 0;
>                         
> position_pegman.setImage("http://maps.gstatic.com/mapfiles/cb/
> man_arrow-" + angle + ".png");
>                 }
>
>                 function actualizaMapa(call) {
>                         var center = call.latlng;
>                         map.setCenter(center);
>                         position_pegman.setLatLng(center);
>                 }
>
>                 function Actualiza_Streeview() {
>                         document.getElementById("pano").innerHTML='';
>                         var point=position_pegman.getLatLng();
>                         var panoClient = new GStreetviewClient();
>                         panoClient.getNearestPanoramaLatLng(point, 
> function(PanoPos){
>                                 if (PanoPos != null) {
>                                         point=PanoPos;
>                                         position_pegman.setLatLng(point);
>                                 }
>                                 myPano.setLocationAndPOV(point);
>                         });
>                 }
>
>                 function streeview() {
>                         var point=map.getCenter();
>                         var svOverlay = new GStreetviewOverlay();
>                         map.addOverlay(svOverlay);
>                         var custom_icon = new GIcon();
>                         custom_icon.image = 
> "http://maps.gstatic.com/mapfiles/cb/
> man_arrow-0.png";
>                         custom_icon.iconSize = new GSize(49,52);
>                         custom_icon.iconAnchor = new GPoint(26,32);
>                         position_pegman = new GMarker(point,{icon:custom_icon,
> draggable:true, clickable:false, bouncy:true, dragCrossMove:true,
> title: "Drag Pegman to a street highlighted in blue. Arrastre Pegman a
> una via destacada en azul"});
>                         map.addOverlay(position_pegman);
>                         GEvent.addListener(position_pegman, "dragend",
> Actualiza_Streeview);
>                         myPano = new 
> GStreetviewPanorama(document.getElementById("pano"));
>                         GEvent.addListener(myPano, "error", handleNoFlash);
>                         GEvent.addListener(myPano, "yawchanged", 
> actualizaPegman);
>                         GEvent.addListener(myPano, "initialized", 
> actualizaMapa);
>                         var panoClient = new GStreetviewClient();
>                         panoClient.getNearestPanoramaLatLng(point, 
> function(PanoPos){
>                                         if (PanoPos != null) {point=PanoPos;}
>                                         position_pegman.setLatLng(point);
>                                         myPano.setLocationAndPOV(point);
>                         });
>                 }
>
>                 function initialize() {
>                         if (GBrowserIsCompatible()) {
>                                 map = new 
> GMap2(document.getElementById("map_canvas"));
>                                 map.setCenter(new 
> GLatLng(37.433551,-4.546123), 8);
>                                 map.setMapType(G_HYBRID_MAP);
>                                 map.addControl(new GLargeMapControl3D());
>                                 map.enableContinuousZoom();
>                                 map.enableScrollWheelZoom();
>                                 map.enableDoubleClickZoom();
>                                 map.enableGoogleBar();
>                                 streeview();
>                         }
>                 }
>         </script>
> </head>
> <body onload="initialize()" onunload="GUnload()">
>         <div id="map_canvas" style="width: 100%; height: 455px"></div>
>         <div id="pano" style="width: 100%; height: 455px"></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.


Reply via email to