Hi Martin,

I checked this with firebug and the div that was created is nowhere to
be seen within the firebug source. I have tried a few work arounds but
run into problems with each method.

I have tried the following code to detect when the panorama view is
closed:

google.maps.event.addListener(panorama, 'closeclick', function(){
    var toggle = panorama.getVisible();
    if(toggle){
       newDiv();
    }
  });

The following function is called to redraw the div on the roadmap. The
HomeControl function contains the code for the innerHTML that I am
creating.

function newDiv(){

  // Create the DIV to hold the control and call the HomeControl()
constructor
  // passing in this DIV.
  var homeControlDiv = document.createElement('DIV');
  var homeControl = new HomeControl(homeControlDiv, map);

  homeControlDiv.index = 1;
 
map.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(homeControlDiv);

}

The wierd thing is that when I call this code the new div is drawn on
the roadmap and I can see the previous div that was created sitting
underneath the default map controls. If I dont call this function the
previous div is not found displayed all.

It would be nice to have the new div I have created overlaying the map
however I reckon I am just going to need to create my div outside the
map area.

Cheers,

Marc

On Dec 21, 4:59 am, Martin <[email protected]> wrote:
> I'd view the map with Firefox and after changing from StreetView back
> to RoadMap use Firebug to inspect the map.
>
> Find the custom control div if it's there and look at it's style -
> display, visibility and position etc.
>
> Martin.
>
> On Dec 20, 4:09 pm, Marc <[email protected]> wrote:
>
> > I have created custom controls on my map using the code:
>
> > map.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(homeControlDiv);
>
> > where homeControlDiv is a div that I have created with other controls inside
> > it. The controls are visible when I view the default map in RoadMap mode.
> > When I switch to StreetView and then back to RoadMap view my controls
> > disappear. I think the map object still thinks they are there because if I
> > add the controls again they are added above where they would originally be
> > added.
>
> > Anyone got any ideas what is going on and how I can fix this?
>
> > Cheers,
>
> > Matc

-- 
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 [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-js-api-v3?hl=en.

Reply via email to