[Google Maps API v3] Problem with getVisible()

781 views
Skip to first unread message

Al

unread,
May 24, 2010, 10:01:28 PM5/24/10
to Google Maps JavaScript API v3
I don't think the xxx.getVisible() is working correctly. If I
display
a place without a street view I would think that it should return
false. The best I can tell it always returns true.

A sample good display is at: http://m.vpike.com/?p=pgh&submit=Streetview&r=b
A sample failing display is at: http://m.vpike.com/?p=lax&submit=Streetview&r=b


Possibly there is a coding error. Please take a look at it.


Thanks,
Al

--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To post to this group, send email to google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Al

unread,
May 25, 2010, 1:20:14 PM5/25/10
to Google Maps JavaScript API v3
As a workaround I changed the code to add a 5 second timer. If the
timer fires then a no street view message is displayed.

Will wait for a possible a sample demonstating a better way to handle
the case where a street view is not available for the specific point.

Chad Killingsworth

unread,
May 25, 2010, 2:25:02 PM5/25/10
to Google Maps JavaScript API v3
When the timer fires, does getVisible() still return true?

Chad Killingsworth

Marc Ridey

unread,
May 25, 2010, 9:35:17 PM5/25/10
to google-map...@googlegroups.com
getVisible applies to the StreetVIewPanorama view. It makes the whole StreetVIew panorama with all the controls visible. Even if a valid panorama is not currently loaded in the view, getVisible() will still return true. getVisible() is mostly usefull when the map and panorama are used together to detect that the view is in StreetVIew mode instead of map mode. When the panorama is used stand-alone, getVisible() always returns true.

To detect that a valid Street View panorama is loaded after you set a position, monitor pano_changed. When pano id is not null, a valid view is displayed.
for example:

var panorama =new google.maps.StreetVIewPanorama(div);
google.maps.event.addListener(panorama, 'pano_changed', function() {
  if (panorama.getPano()) {
    // The view is loaded with a valid panorama.
  }
});
panorama.setPosition(new LatLng(...));

Al

unread,
May 26, 2010, 12:28:28 PM5/26/10
to Google Maps JavaScript API v3
Hi Marc,

Thank you for the detailed response. I gave it a try and noticed that
I don't think the 'pano_changed' event triggers if a streetview is not
available. It seems that you need to put a timer (for example) around
the code to activate in the event a streetview is not available. A
timer is OK I guess but it would be nice to get an instantaneous
status if a streetview is not available. Maybe I'm doing something
wrong. Please take a look at it.

The test of the code you mentioned is at http://m.vpike.com/test.htm .

Live examples with the timer are at...

Thanks,
Al

> > google-maps-js-a...@googlegroups.com<google-maps-js-api-v3%2B­unsub...@googlegroups.com>


> > .
> > For more options, visit this group at

> >http://groups.google.com/group/google-maps-js-api-v3?hl=en.- Hide quoted text -
>
> - Show quoted text -

Marc Ridey

unread,
May 26, 2010, 8:26:29 PM5/26/10
to google-map...@googlegroups.com
by setting setVisible(false), you are disabling the StreetViewPanorama
and it will not load.

> To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.

Al

unread,
May 31, 2010, 3:17:27 PM5/31/10
to Google Maps JavaScript API v3
Thanks Marc. I've been away and didn't see your response.

I removed the setVisible(false) but it doesn't make any difference.
Also, I am hiding the pano div initially since if you don't you get a
blank streetview with the controls displayed. I guess what is there
now works but it would be nice to have an instanteous indication as to
whether or not a streetview is present. Are you saying that there is
an instanteous indication available?

Thanks,
Al
> >> >http://groups.google.com/group/google-maps-js-api-v3?hl=en.-Hide quoted text -
>
> >> - Show quoted text -
>
> > --
> > You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
> > To post to this group, send email to google-map...@googlegroups.com.
> > To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/google-maps-js-api-v3?hl=en.- Hide quoted text -

alexdrimbe

unread,
May 31, 2010, 3:29:06 PM5/31/10
to Google Maps JavaScript API v3
I am also interested to find out a method which display instantly if
the street view is not available.
> > >> >http://groups.google.com/group/google-maps-js-api-v3?hl=en.-Hidequoted text -
>
> > >> - Show quoted text -
>
> > > --
> > > You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
> > > To post to this group, send email to google-map...@googlegroups.com.
> > > To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
> > > For more options, visit this group athttp://groups.google.com/group/google-maps-js-api-v3?hl=en.-Hide quoted text -

adamkempa

unread,
Jun 1, 2010, 2:25:33 PM6/1/10
to Google Maps JavaScript API v3
Agreed, I'm also searching for something to flag whether a streetview
pano is available at the current latlng.
-- Adam


On May 31, 3:29 pm, alexdrimbe <alexdri...@gmail.com> wrote:
> I am also interested to find out a method which display instantly if
> the street view is not available.
>
> On May 31, 10:17 pm, Al <a...@infosports.com> wrote:
>
>
>
> > Thanks Marc.  I've been away and didn't see your response.
>
> > I removed the setVisible(false) but it doesn't make any difference.
> > Also, I am hiding the pano div initially since if you don't you get a
> > blankstreetviewwith the controls displayed.  I guess what is there
> > now works but it would be nice to have an instanteous indication as to
> > whether or not astreetviewis present.  Are you saying that there is
> > an instanteous indication available?
>
> > Thanks,
> > Al
>
> > On May 26, 5:26 pm, Marc Ridey <mri...@google.com> wrote:
>
> > > by setting setVisible(false), you are disabling the StreetViewPanorama
> > > and it will not load.
>
> > > On Thu, May 27, 2010 at 2:28 AM, Al <a...@infosports.com> wrote:
> > > > Hi Marc,
>
> > > > Thank you for the detailed response.  I gave it a try and noticed that
> > > > I don't think the 'pano_changed' event triggers if astreetviewis not
> > > > available.  It seems that you need to put a timer (for example) around
> > > > the code to activate in the event astreetviewis not available. A
> > > > timer is OK I guess but it would be nice to get an instantaneous
> > > > status if astreetviewis not available. Maybe I'm doing something
> > > > wrong.  Please take a look at it.
>
> > > > The test of the code you mentioned is athttp://m.vpike.com/test.htm.
>
> > > > Live examples with the timer are at...
> > > > A sample good display is at:http://m.vpike.com/?p=pgh&submit=Streetview&r=b
> > > > A sample failing display is at:http://m.vpike.com/?p=lax&submit=Streetview&r=b
>
> > > > Thanks,
> > > > Al
>
> > > > On May 25, 6:35 pm, Marc Ridey <mri...@google.com> wrote:
> > > >> getVisible applies to the StreetVIewPanorama view. It makes the whole
> > > >>StreetVIewpanorama with all the controls visible. Even if a valid panorama
> > > >> is not currently loaded in the view, getVisible() will still return true.
> > > >> getVisible() is mostly usefull when the map and panorama are used together
> > > >> to detect that the view is inStreetVIewmode instead of map mode. When the
> > > >> >http://groups.google.com/group/google-maps-js-api-v3?hl=en.-Hidequotedtext -
>
> > > >> - Show quoted text -
>
> > > > --
> > > > You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
> > > > To post to this group, send email to google-map...@googlegroups.com.
> > > > To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
> > > > For more options, visit this group athttp://groups.google.com/group/google-maps-js-api-v3?hl=en.-Hidequoted text -
Reply all
Reply to author
Forward
0 new messages