Community of VE/MapPoint Users and Developers
This is a discussion on Virtual Earth API: Customizing Mouse Wheel Zoom within the Virtual Earth Blogs forums, part of the Blogs category; The Virtual Earth map control supports several interactive ways to zoom in and out on the 2D map view. For ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Virtual Earth API: Customizing Mouse Wheel Zoom The Virtual Earth map control supports several interactive ways to zoom in and out on the 2D map view. For example, you can:
By default, when scrolling the mouse wheel up, it will zoom in on the center of the current view. When scrolling the mouse wheel down, it will zoom out with the center of the view the center of the scene. The Virtual Earth v5 and v6 API allow you to override many of the Virtual Earth events with the VEMap.AttachEvent call including many mouse events such as "onclick", "ondoubleclick", "onmousemove", "onmousedown", and "onmousewheel". Your event handler can override the default Virtual Earth behavior by returning true from the handler. If you return false from your event handler, your custom behavior and the default behavior will be executed. For example, the following code snippet shows how to override "onmousedown" and "onmousewheel" for 2D in v6:
Here's a link to a working example with checkboxes allowing you to turn off mouse down and mouse wheel events in 2D: The v6 also API added a simpler built-in approach to overriding the default mouse wheel zoom behavior. The default zoom in behavior for the mouse wheel is to zoom to the center of the map view. However, some users want the mouse wheel to zoom to the mouse cursor in the view. To make this simple so you do not have to override "onmousewheel", we went ahead and added the SetMouseWheelZoomToCenter call to VEMap. By default it is set to true so mouse wheel events will zoom to the center of the scene. However, if you pass false to this function, the mouse wheel will zoom to the mouse cursor. Here's a link to a working example with radio buttons allowing you to select mouse wheel "Zoom to Center" or "Zoom to Mouse" behavior in 2D: More... |
![]() |
| ||||
| Posted By | For | Type | Date | |
| Merging Multiple Routes - MapPoint Articles - MP2K Magazine | This thread | Refback | 01-08-2008 03:05 PM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Virtual Earth News from GEOINT 2007: Virtual Earth Appliance | VE For Government | Virtual Earth Blogs | 0 | 10-24-2007 12:10 PM |
| How To: Skipping Zoom Levels in Virtual Earth | VirtualEarth MSDN Blog | Virtual Earth Blogs | 0 | 09-15-2007 02:17 PM |
| Virtual Earth @ WPC | VirtualEarth MSDN Blog | Virtual Earth Blogs | 0 | 09-15-2007 02:17 PM |
| MSN Virtual Earth. | Eric Frost | News and Announcements | 0 | 11-03-2006 11:27 AM |
| Capturing Mouse Wheel Event | Anonymous | MapPoint Web Service and Virtual Earth | 2 | 11-30-2005 07:31 AM |
Andorra Ski Holidays
Andorra ski holidays offer tax-free shopping and a range of great après-ski activities when you have finished on the slopes. Book online today.
City Breaks
Top 10 City Breaks . Based on holidays booked this year, these are the most popular City Breaks for 2006
Holidays Italy
Book your holidays in Italy. Italy has a great climate and the beaches to go with it. Book a great deal for great value online at dealchecker.co.uk.
Antigua Holidays
We have the most popular Antigua holidays at highly competitive prices at The Holiday Place. Book a break in sunny Antigua today.
Cheap Morocco Holidays
Cheap Morocco holidays may be the answer to your cheap holiday search. With sunshine throughout most of the year it can be great value if you avoid the peak season. Why not include a trip to the small tranquil town of Chefchaouen Tangier in your visit?
Compare holiday prices
Compare holiday prices online where you can see all the possibilities at Travel.co.uk
Florida Holidays
Take a sunny holiday break! Find info on Florida holidays at On The Beach!