kj2w


Is there a way to disable/turn off/stop the event raised by scrolling to mouse wheel I'd like to force my users to stay just on 1 particular zoom level until something happens on the server. Then (with the help of MS Ajax) I will carry the user over to another map&zoom level.

J




Re: Question about Mouse Scroll Zoom...

kj2w


I know I can do this in javascript to capture the window.onscroll event:

window.onscroll = doThis;

function doThis(e){

// Add code here...

}

But it as I tested it, the scroll action inside the div tag is independent of the window itself.

Any ideas

J






Re: Question about Mouse Scroll Zoom...

Earthware

Hello

Here are two articles that have solutions to your requirement:

http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=785553&SiteID=1

http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=619973&SiteID=1

Both are quite messy. However if you wait a few days until V5 of the map control is released we have been promised complete mouse / keyboard event handling which I suspect would achieve your result much better.

Brian Norman
www.earthware.co.uk






Re: Question about Mouse Scroll Zoom...

spascoe

Now that we have v5, in my browsing i can only find locking / disabling of scrolling options if you use .LoadMap and set its param to false for ShowSwitch.

I however am also looking for a solution when using .Find If i dont know the lat and longs and want to use an address, i have to use this method. But, that means no disabled scrolling. (at least i havent found a way yet). hmm someone





Re: Question about Mouse Scroll Zoom...

Derrick

In v5, you can now disable the default actions of mouse events. Eg, the default action for the mouse wheel is zooming.

To disable the zoom for the mouse wheel try the following.

function wheelCallback(e)

{

//returning true to cancel default action.

return true;

}

map.AttachEvent("onmousewheel", wheelCallback);

You might want to disable double click too, since that will start a zoom.

Regarding the scrolling for the Find method, what you can do is to use the callback function.

//Check out the SDK for what the callback parameters are

function findCallback(a,b,c,d)

{

//c provide an array of VEPlace

if (c != null)

{

//Pan to the first location found

map.PanToLatLong(c[0].LatLong);

}

}

//Calling the find method and setting setBestMapView to false so that it does map/zoom the map

map.Find(null, "california, usa", null, null, null, null, null,null, null,false, findCallback);