Issue: Javascript api 3.13, tap on android not opening graphic's infowindow

4104
5
03-27-2015 10:25 AM
AndrewGianikas
New Contributor III

Using javasctip library 3.13.  I have graphics on a map that open up the graphics infowindow.  It works fine on desktop, and on IOS devices but not on my Galaxy S5 (trying to test other android devices as well).  I have tried many fixes but these seem to be related to older versions of the library...

  • esri.layers._GraphicsContainer.prototype._tolerance = 15;
  • document.dojoClick = false;

Other touch functionality works on the android device such at pinch for zoon, swipe, etc... just not the tap. Any ideas? If you need any other info please let me know.

0 Kudos
5 Replies
ØyvindIdland
New Contributor III

I have the exact same issue on Android.

Also, attaching the map.on("click") event in Android does not respond at all, neither do layer.on("click"). It fails on both devices and the emulator-mode in chrome, which suggests that somewhere in the framework something triggers when Android is being sniffed.

It does work on any other platform, so I conclude that this is a bug.

0 Kudos
MatthewLofgren
Occasional Contributor

I had the same problem and came across this post

Javascript API map 3.7 has no coordinates when handling map click

Adding the following to the function after the require statement fixed it for me

document.dojoClick = false;

require(["esri/map",
.
.
"dojo/ready"],
  function (Map, .....,ready) {
     document.dojoClick = false;

     ready(function () {....
PLadd
by
Occasional Contributor II

Thanks for posting your fix Matt.  This helped solve my problem using the Tax Parcel Viewer template.  For others using this template and having this problem(map id doesn't work with Android), place Matt's fix on js/homePage.js right above the chunk of code below.  On the original template, it starts on line 530

document.dojoClick = false;

dojo.connect(map, "onClick", function (evt) {

        if (draw) {

            map.infoWindow.hide();

            selectedGraphic = null;

            return;

        }

0 Kudos
PLadd
by
Occasional Contributor II

Oddly enough, despite having used this solution effectively for the past 5 years, this issue has reared it's ugly head.  I know it's specific to the Android OS because it's not an issue on iOS.  And on Android, it doesn't work with either Chrome or FireFox.  I tried removing "document.dojoClick = false;" just because that's how I troubleshoot when I'm clueless, but that didn't resolve it.

Has anybody else experienced this recently?  I'm wondering if it's some kind of Android update.  I know I'm using old javascript technology but, other than this issue, the coding works flawlessly.

Any suggestions are appreciated - I will follow up if I find a solution.  Thanks.

0 Kudos
PLadd
by
Occasional Contributor II

Sorry, false alarm.  Once I got DevTools working properly on an Android phone, I realized that, while the issue was presenting itself in a similar fashion to the problem raised above, it was actually a new function that I had written in March that was tripping things up for me.

0 Kudos