I'm working on custom navigation as well, but haven't come up with
something beautiful yet ( ;) ). However, I have managed to create a
custom navigator window (working in at least Firefox and Opera,
haven't had time to try them in any other browser). What I do is I
create a separate layer (div) and place it over the map, then placing
regular DOM objects (like images) in the div, and associate events to
these objects. I'm putting a screenshot among the images on the groups
front page.
I can give you a code snippet, and if you don't get it - ask me and I
will try to guide you more. As I'm using mootools for a bunch of
functionality on my site, my example below will be full of mootools
code. Hopefully you sort it out anyway.
var map = new google.maps.Map(document.getElementById
('YourGoogleMap'), {
zoom: 7,
position: YOUR_POSITION,
disableDefaultUI: true,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
var controllers = new Element('div', {
'style': 'background-image: url(/path/to/background-image.png);
width: 500px; height: 35px; position: absolute; left: 0; top: 0; z-
index: 1001';
});
var zoomIn = new Element('img', {
'src': '/path/to/zoom-in-image.png',
'style': 'cursor: pointer'
});
var zoomOut = new Element('img', {
'src': '/path/to/zoom-out-image.png',
'style': 'cursor: pointer'
});
/* Above is probably the same as the following, new Element(...) is
mootools specific:
*
* var controllers = document.createElement('div');
* controllers.style.backgroundImage = 'url(...)';
* controllers.style.width = '500px';
* ...
*/
zoomIn.addEvent('click', function() {
map.set_zoom(map.get_zoom() + 1);
});
zoomOut.addEvent('click', function() {
map.set_zoom(map.get_zoom() - 1);
});
/* Above is probably the same as the following, if you're not using
mootools (addEvent is mootools specific):
*
* google.maps.event.addDomListener(zoomIn, 'click', function() {
* map.set_zoom(map.get_zoom() + 1);
* });
* ...
*/
zoomIn.inject(controllers);
zoomOut.inject(controllers);
controllers.inject(document.getElementById('YourGoogleMap'));
/* Above is probably the same as the following, since element.inject
() is mootools specific:
*
* controllers.appendChild(zoomIn);
* controllers.appendChild(zoomOut);
* document.getElementById('YourGoogleMap').appendChild(controllers);
*/