OpenLayers With StreetView Overlay

Openlayers with Streetview

requires the GeoExt ux extension

all the code is available - so you can see what you are missing

(if you could post a live link to your current map - users could debug it for you.)

enter image description here

http://api.geo.admin.ch/main/wsgi/doc/build/api/streetview.html


To use Google layers and meet licensing requirements you have to access Google layers through the Google API. When you add a Google layer to an OpenLayers map OpenLayers loads the Google API.

The layer.mapObject (as opposed to layer.map which is the OL map object) should give you a reference to the Google Map. As this is null something has gone wrong loading the Google API. You can check in FireBug if it has loaded correctly.

The example you point to may be using the older Google 2 API rather than version 3. You no longer need an API key and can add in the Google API using:

<script src="http://maps.google.com/maps/api/js?sensor=false"></script>

Have a look at the unit tests for the Google v3 API layers which may help you.

Remember the StreetView also needs Flash in the browser.