On Apr 16, 3:52 am, Or3 <[email protected]> wrote:
> Hi !
>
> I have a problem in this google maps script :
>
> http://www.eficiens-serving.com/pmu/points-vente/google.php?searchtxt...
>
> I display markers on the map, witch come from an xml.
> Once you click on the marker, you have an "infobubble",
> and in it, I have put a "streetview" picto (the little orange man),
> if you click on this picto, you will have the streetview pano.
>
> But I would like to hide this picto when streetview is not available
> for this point.
> I try, but the listener seems not to have the time to execute the
> streetview check...
> as the "imgstreet" variable is undefined...
>
> I know how to display the message after "sorry streetview not
> available", but I would like to not have this picto if there is no
> streetview !

The streetview request is asynchronous:
Part 2 Asynchronous I/O
http://econym.org.uk/gmap/async.htm

You need to arrange your code to either:
1. put a first cut at the infoWindow up and fix it when the response
comes back
or
2. wait for the response and do your infowindow processing in the
callback routine

  -- Larry


>
> ----line 2020 ------------
> //streetview dispo ou non
> var myPano;
>
> var fenwayPark = new GLatLng(lat,lon);
> panoramaOptions = { latlng:fenwayPark };
> myPano = new GStreetviewPanorama(document.getElementById("pano"),
> panoramaOptions);
>
> GEvent.addListener(myPano, "error", function(errorCode) {
> if (errorCode == 600) {
>         var imgstreet="";
>  }
> else
>  {
>         var imgstreet="streetview";
>  }}
>
> );
> -----------
>
> Is anyone has the answer !?
>
> Thank you very much for your help,
>
> Aurélie
>
> --
> 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 
> athttp://groups.google.com/group/google-maps-api?hl=en.

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