Autodesk MapGuide Enterprise
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Using Wheel Button to Pan
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Thanks,
-Mike
Re: Using Wheel Button to Pan
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
That's where all the action starts and ends.
- Jackie
http://au.linkedin.com/in/jackieng
Re: Using Wheel Button to Pan
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I found the OnMouseDown(e) and OnMouseUp(e) functions in ajaxmappane.templ, I'm just not sure what to do with them.
My Autodesk reseller is telling me it can't be done in the AJAX viewer (which is what I'm using, forgot to mention that). Does she know what she's talking about?
Thanks again,
-Mike
Re: Using Wheel Button to Pan
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
You are basically reusing the pan behaviour which is already implemented in the AJAX viewer, you just now have to hook that behaviour to a middle mouse click and release.
Unfortuantely, I cannot show you how to implement it, because I haven't done it myself, but I do have a high-level knowledge of the internals of the AJAX viewer to tell you that such a thing is possible.
Also, resellers usually aren't programmers and/or technically minded ;-)
http://au.linkedin.com/in/jackieng
Re: Using Wheel Button to Pan
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Jackie, you are starting to sound like Andrew D.
: )
We are trying.
--
Murph
The world is not FLAT so why is your GIS data?
http://map3d.wordpress.com
Re: Using Wheel Button to Pan
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Re: Using Wheel Button to Pan
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi all. Was wondering if anyone had done this change successfully? I'd really love to enable panning with mouse wheel.
many thanks
Re: Using Wheel Button to Pan
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Would also like to know the solution
thanks,
Re: Using Wheel Button to Pan
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hello,
Firstly, Thanks Jackie for telling everyone where to look, this was pretty easy, and I'm not great at Javascript
I tackled this, and here is what I've got working...
Looks like the placement is everything to make sure you check for middle before left/ right
In ajamappane.templ....
in OnMouseDown(e) before the check for Left Button Click, check for Middle Mouse
function OnMouseDown(e)
{
if(!PopupMouseDown(e))
{
hidePopup(tbMenu);
hidePopup(ctxMenu);
hidePopup(infoMenu);
parent.ForwardMouseDown(document, e);
}
else
return false;
if(!mapInit)
return false;
// NEW CODE BLOCK START HERE
if(e.which && e.which == 2) //2 is middle button in W3C/Netscape Which
StartPanning(e);
else if(e.button && e.button == 4) //for ie, middle button is 4
StartPanning(e);
// END CODE BLOCK HERE FOR MIDDLE Mouse PANNING
if(e.which && e.which != 1)
return true;
else if(e.button && e.button != 1)//for ie
return true;
Then in OnMouseUp(e)
function OnMouseUp(e)
{
var x = e.clientX - mapPosX;
var y = e.clientY;
try
{
e.stopPropagation();
}
catch(ex)
{
e.cancelBubble = true;
}
// NEW CODE ADDED HERE, BEFORE DIGITIZATION CHECK
if(e.which && e.which == 2) //2 is middle button
EndPanning(e);
else if(e.button && e.button == 4)//for ie
EndPanning(e);
// END NEW CODE
if(digitizing)
{
digitizer.MouseUp(e, x, y);
return false;
}
if(isAlertShow)
return;I didn't test it out with other redlining or digitizing continuous commands.. ie pan will digitizing, but for my needs, just panning with the middle button adds a tonne of user experience if other things break.
Re: Using Wheel Button to Pan
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Perfect! does the trick, thankyou for posting.
