Im trying to add StreetView functionality to my OpenLayers web app, and would like to add the overlay showing StreetView availability to the map itself. I have seen an example of it being done successfully here, but i cannot get the code to work in my own solution. Specifically :
var layer = new OpenLayers.Layer.Google("Google Street", {sphericalMercator: true});
layer.mapObject.addOverlay(new GStreetviewOverlay());
results in the error:
layer.mapObject is null
Has anyone got any idea what i might be doing wrong, and if so, how can i fix this?
Thanks in advance!
C

