Select to view content in your preferred language

Chrome and Flex Apps: Mouse wheel to zoom in and out of Map doesn't work

2046
9
04-05-2012 12:44 PM
CarmenDurham
Frequent Contributor
Hello all,

Using Chrome:  The mouse wheel for zooming in and out of the Map in all of our Flex applications does not work. Our applications consist of a mixture of Flex Viewer (1.3 API) and Non-Flex Viewer (2.5 API) apps.  I even tried one of the ESRI flex samples directly from the sample page to no avail.

Works fine in IE 7 and 9 and Firefox. 

Am I missing something simple?  I have seen some remarks on the internet about including a bunch of javascript code in the .html wrapper but they were 3-4 yrs old. 
(Ex.  http://cookbooks.adobe.com/post_Workaround_to_support_mouse_wheel_for_FireFox_with-13086.html )


Surely I don't need this just to be able to zoom in and out with the mouse wheel just for Chrome???

Thanks,
Carmen
Tags (2)
0 Kudos
9 Replies
KenBuja
MVP Esteemed Contributor
Does the mouse wheel work if you click on the map first?
0 Kudos
CarmenDurham
Frequent Contributor
Ken,

No, it does not.   If you are using Chrome and don't have any problems, please let me know. 

Thanks,
Carmen
0 Kudos
ChenfengXiong
Emerging Contributor
I also encountered this issue. This seems not the ArcGIS API's problem, neither Flex.

After some search through the internet it seems because FF and GC doesn't pass mouse wheel event automatically to a div member. You may need to add some javascript to pass it in Flex's HTML template.

However I still hasn't found a working solution. Looking forward to JS professionals...
0 Kudos
BradleyJanke
Occasional Contributor
Using Chrome:  The mouse wheel for zooming in and out of the Map in all of our Flex applications does not work. Our applications consist of a mixture of Flex Viewer (1.3 API) and Non-Flex Viewer (2.5 API) apps.  I even tried one of the ESRI flex samples directly from the sample page to no avail.


By 'does not work' do you mean scrolling the mouse wheel does absolutely nothing when the mouse is over the map?  Have you tried adding mouse scroll event listeners on the map object to see if they fire?

I have had the mouse wheel scroll the entire page as well as zoom the map but I have never had the mouse wheel simply not work.
0 Kudos
ChenfengXiong
Emerging Contributor
By 'does not work' do you mean scrolling the mouse wheel does absolutely nothing when the mouse is over the map?  Have you tried adding mouse scroll event listeners on the map object to see if they fire?

I have had the mouse wheel scroll the entire page as well as zoom the map but I have never had the mouse wheel simply not work.


Exactly as what you are asking. Same page working fine in IE or Opera but does "absolutely nothing" in FF and GC. This happens when you change the "WMode" of the container of flash e.g "WMode=Transparent"
0 Kudos
CarmenDurham
Frequent Contributor
Sorry for the delayed reply.

Firefox(11.0): the mouse scroll wheel works as expected.

Chrome(18.0.1025.162 m):  Absolutely nothing happens on the page, in the map, nowhere when I use the mouse scroll wheel.  I have tried Flex applications from outside our organization and had the same experience. 

I have not tried adding mouse scroll event listeners.  Will try that and also look at the javascript.

If other people are having Zero trouble with Chrome using the mouse scroll wheel to zoom in and out of the Map within a flex app, please let me know, too!  This isn't a showstopper or anything, just irritating.

By the way, I have a javascript application where the mouse wheel works fine within Chrome.

Thanks,
Carmen
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Carmen,

   I am not a chrome fan, but I installed it to test for you and using 18.0.1025.162 m version of Google Chrome I have no issue zooming in and out using the mouse wheel, once you activate the map by clicking on it. If you have not applied my code for using javascript to give focus to the map then you need to give it a try.

Say your main mxml application file is called index.mxml:

In the creationComplete event use this line of code.
navigateToURL(new URLRequest("javascript: document.getElementById('index').focus();"), "_self");
0 Kudos
CarmenDurham
Frequent Contributor
Robert,

Thank you for your reply. I don't regularly use Chrome but use it for testing since a respectable percentage of browsers hitting the Greenville main site use Chrome.  Plus, I was testing some things with geolocation and javascript and needed to see how Chrome responded (and try some things I saw at a conference).

After your reply, I did some sleuthing.   I found some users at the City using Chrome and tested at their PC.  Sure enough, it worked FINE as you had experienced.  They were using the same Chrome version, but were on Windows 7.  I still have XP.  Had another coworker with XP (and similar PC) install Chrome.  The Scroll Wheel would NOT work on hers either.

I tried a new mouse from one of the PCs with Win 7 on my XP and lo and behold - the scroll wheel worked in Chrome (but now I had to click the map in IE where I didn't need to click before).

So, I took my non-working mouse to a new laptop.  The laptop had to install the new driver.  I expected it wouldn't work.  But, no, it DID work.

It turned out to be some "Mouse Suite" software that was on our PCs.  I Uninstalled Mouse Suite and now the old mouse works in Chrome, FireFox, IE. 

But now I am seeing what people talked about in the forums about having to "click" before the zoom would work.

Is that what your line of code should fix?  So to verify, if my main mxml is called TestApp.mxml, then I should use in the creationComplete event for testapp.mxml?

navigateToURL(new URLRequest("javascript: document.getElementById('TestApp').focus();"), "_self");



Thanks,
Carmen
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Carmen,

   That is correct.
0 Kudos