GMouseWheelControl
What is GMouseWheelControl?
This is a custom control built by using Google Map API to enhance the usage of a mouse on Google Map. It can be used in any Google map mashups. It takes advantage of scroll wheel mouse, which has become the unofficial standard for Mouse.
What does it do?
Google map already offers the much anticipated zoom functionality using Mouse Scroll Wheel. But now you can do more and use scroll wheel to do what you want it to do. You can choose to use the scroll wheel to pan/move the map vertically, or horiznotally besides zooming in or out.
All three of the above mentioned features can be useful, if used properly or depending on one's personal preferences. For example, if viewing the map at closer to street level, you may use the Mouse Scroll Wheel to move/pan the map horizontally or vertically to view the surroundings.
Another feature/function that has been added to GMouseWheelControl is called "Click & Pan". It's another way of browsing through the globe. You don't have to keep clicking on arrows or drag and drop to move/pan the map. Simply click on the map using your middle mouse button or scroll wheel button and take your mouse pointer wherever you want the map to go. The map will automatically pan to that direction and it will continue to pan until you click on the map again. The further you move your mouse pointer, the faster the map will pan.
Let's take a look
So, here is a live demonstration of my GMouseWheelControl. Please read the instructions beside the demo map below.
Click on the Scroll Wheel button and select an option from the menu. Scroll your mouse wheel up or down to see the result. This menu is also available through Middle Click.
Click on the Click & Pan button to enable panning the map relative to the mouse pointer. Once Click & Pan is enabled, simply click on the map using scroll wheel or middle mouse button and move your mouse pointer wherever you want the map to move/pan. Clicking on the map will stop the automatic pan. Click on the Click & Pan button again to disable/exit from this feature.
Middle button click or the Scroll Wheel click will not work in every browser. As such, an alternative/shortcut has been provided. "Shift + Click" can be used if your middle click does not work in your browser. Simply press and hold the "Shift" key in your keyboard and click on the map.
But, Why use this?
Why use these methods of panning/moving the map? Frankly, you don't have to use it. It really depends on your preference. Not everyone has the same taste. Some will like the control and some will prefer the "drag and drop" way of panning the map. It's just another option for your visitors that they can choose from. For example, Some may prefer to have the map pan or move automatically when they move the mouse pointer to a specific position of the map and some may prefer to simply drag the map.
So, What's the story?
Now that Google Map has been around for a while, I actually got tired of dragging and dropping for panning the map, although I loved that most at the beginning. I was becoming lazier. After Google Map added the scroll wheel zoom feature, I liked very much. But when viewing the map at street level, for some reason I often found myself using the scroll wheel and expecting the map to move or pan but instead the map would automatically zoom in/out. That was kind of annoying to me. I guess I am so used to using scroll wheel on webpages or when viewing large images, my mind kind of expected the map to pan/move when viewing at street level. That's when I thought about having an option for scroll wheel to pan the map. Also, this way I don't have to keep dragging and dropping or I don't have to keep clicking on the Pan arrows either.
While I was working on getting the Mouse Scroll Wheel to pan or move the map, I realized that another easy way to pan the map would be move the map automatically when the mouse pointer is moved. Basically I got this idea from the Middle Click Scroll feature that is available in today's web browsers. Simply middle click and move your mouse pointer to scroll through a page. I thought that would be useful as well and started working on this feature to be added to the control. And now that it's working, I personally like that more than using the mouse scroll wheel to pan or move the map.
Well, that's the end of the story for GMouseWheelControl. I hope you find it useful.
Comments on GMouseWheelControl
3 CommentsView all comments
Comment: Nice control addons ! worked for me just fine thx
Name: Ali Ashraf
Posted on: Tuesday January 29, 2008, 8:00 pm
Comment: its kool and works well
but it'd be better for the users if the zoom scale has an upper and lower limit and is shown in the pane, beside the map in the HTML examples. I think it'll show if the Local API for GOOGLE MAPS application is modified but for people on the web it wont.
cheers :)
keep up the good work
Have something to say or just want to post your comment about GMouseWheelControl? Use the form below to post your comment. Please visit the feedback page to see all the comments.




Name: webdesign
Posted on: Thursday March 20, 2008, 5:56 pm