From: "Joaquin Cuenca Abela" <e98cu...@gmail.com>
Date: Tue, 26 Jul 2005 19:41:07 -0000
Local: Tues, Jul 26 2005 3:41 pm
Subject: How-to implement smooth zoom with the mouse wheel
Hi,
I've implemented smooth zoom with the mouse wheel for IE 6. You can You can see it in action at www.panoramio.com (alpha quality site, ya If anybody wants to do it, you should add this to your javascript: =========================================== function exO(a){return Math.round(a)+"px"} GMap.prototype.applyZoom = function(a) var e = Math.pow(2, d); } GMap.prototype.smoothZoomTo = function(newZoom) { var a = this; if (a.div.style.zoom == undefined) a._currentZoom = parseInt(a.getZoomLevel()); this._zoomInterval = setInterval(function() { if (Math.abs(a._targetZoom - a._currentZoom) < 0.05) } function zoom(oEvent, scr) { var new_zoom = map.getZoomLevel(); if (scr >= 120) new_zoom--; else new_zoom++; map.smoothZoomTo(new_zoom); } // Hook the mouse wheel to zoom the map on Mozilla and Internet Explorer 6.0 browsers function hookMouseWheelHandlers(id) { var d = document.getElementById(id); if (d) { try { if (document.body.addEventListener) d.addEventListener('DOMMouseScroll', function(oEvent) { zoom(oEvent, oEvent.detail * -40); }, false); else d.onmousewheel = function() { zoom(event, event.wheelDelta); return false; } } catch (ex) {} } } =========================================== And call hookMouseWheelHandlers(container); on your onLoad function [*]: Ideas to implement smooth scroll in firefox will be much You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||