Select to view content in your preferred language

Javascript API map 3.7 has no coordinates when handling map click

5427
13
10-17-2013 08:44 AM
GregHawk
Emerging Contributor
In the new 3.7 API a map click generated by a touch on a mobile device no longer has any coordinates for X and Y.  This is obviously an issue if you intend to place a graphic on the map or do anything based on where the tap was.

[ATTACH=CONFIG]28408[/ATTACH]
0 Kudos
13 Replies
deleted-user-Jie3eyjOl9XM
Deactivated User
I'm definitely seeing this error on Android, using both 3.7 compact and 3.7 complete. Consequently, infoWindows are appearing in the wrong place.

Using dojoClick solves the InfoWindow problem on an Android 2.3 phone, but on a Kindle Fire HD, the fix prevents any InfoWindow from showing. Any thoughts on that?

The click twice issue doesn't affect me, since my web app is presenting a map from ArcGIS.com, using the InfoWindow defined for the map service, so I don't even have a click handler.
0 Kudos
AzharIbrahim
Occasional Contributor
Would this be why my toolbars.draw.polyline only keeps the first and last points on a mobile device? It works fine on desktop browsers.
0 Kudos
deleted-user-Jie3eyjOl9XM
Deactivated User
I'm definitely seeing this error on Android, using both 3.7 compact and 3.7 complete. Consequently, infoWindows are appearing in the wrong place. Using dojoClick solves the InfoWindow problem on an Android 2.3 phone, but on a Kindle Fire HD, the fix prevents any InfoWindow from showing. Any thoughts on that?.


To clarify and update my situation, for me the dojoClick fix resolves the issue where the infoWindow shows in the wrong place. This fix works on all devices. (I was wrong about the Kindle) But, I am still getting the click event firing twice on Android phones. It doesn't appear to be happening on iOS or Android tablets -- just phones.
0 Kudos
KarenRobine
Frequent Contributor
To clarify and update my situation, for me the dojoClick fix resolves the issue where the infoWindow shows in the wrong place. This fix works on all devices. (I was wrong about the Kindle) But, I am still getting the click event firing twice on Android phones. It doesn't appear to be happening on iOS or Android tablets -- just phones.


I fixed this by setting a variable, doInfoWindow, to true if I'm processing the first time the event fires. When the infowindow is done processing, I set it back to false. I then check this variable in my click event to make sure the Info Window code doesn't process twice.
0 Kudos