Hello,
I would like to be able to produce a similar sliding side panel effect
as that which can be currently seen on the general maps site.
So far I have a two div's
1. full side panel
2. "closed" side panel
My problem is that, when I hide the full side panel to show the closed
side panel, at first the map would move over to the left. This is
normal.
So here is what I was doing to keep the map position "static" on the
screen -
// get the map div
vMap = document.getElementById("carte");
// get the "closed" side panel div
vClosedOpts = document.getElementById("closed-options");
// disable the map object UI
vCarte.setOptions({disableDefaultUI: true });
// get the current center of the map as a LatLng object
vCtr = vCarte.getCenter();
// convert it to pixels using a custom overlay projection
vPt = vOverlay.getProjection().fromLatLngToContainerPixel(vCtr);
// adjust the x position to cover the now closed side panel area
vPt.x -= 180;
// convert back to latlng positioning
vCtr = vOverlay.getProjection().fromContainerPixelToLatLng(vPt);
// update the map center
vCarte.setCenter(vCtr);
// set the width of the closed panel bar
vClosedOpts.style.width = "20px";
// update the map div position
vMap.style.left = "20px";
vMap.style.marginRight = "20px";
// re-enable the UI
vCarte.setOptions({disableDefaultUI: false });
This works well. However, the map flashes during this process (which
is why I tried using the disableDefaultUI option) and as I would like
to use a "sliding" panel effect I would like to know if there would be
a better way of doing this ?
In addition - what would be the best way of implementing the sliding
part ?
Hope I have given enough info here.
--
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.