(Please excuse my english)
I need to simulate a user mouse click on the map.
I tried with this kind of method but it seem not to work: http://stackoverflow.com/questions/6157929/how-to-simulate-a-mouse-click-using-javascript
I think it's because a script-lauched mouse click is an untrusted event and ArcGIS only listen to the trusted event (launched by an user).
I need it because my map is in an invisible iframe, and i send the click coords to it from the main page.
How could I do this ?
(nativ method ? JS hack ? I looked for it but found nothing...)
Thank you in advance for yours answers,
Robin Chappatte
Solved! Go to Solution.
This also works (from Programmatically fire map's click event 😞
map.emit('click', {mapPoint: new esri.geometry.Point(myLong,myLat, esri.SpatialReference({wkid:102100}))});
What is the click event in the invisible map used for? If it is to trigger a seperate identify or query, then rather just use the query or identify task directly from the REST endpoint.
Thanks for your answer !
In my case, the maps layers can change very often, so I could handle every cases and query the right thing, but in a sens, it duplicate the code that is already writted in the ArcGIS API.
Anyway it would have been a good way in an other case than mine, so thanks !
This also works (from Programmatically fire map's click event 😞
map.emit('click', {mapPoint: new esri.geometry.Point(myLong,myLat, esri.SpatialReference({wkid:102100}))});
I'll try it monday, thank-you very much !!
EDIT: It work just fine, thank you !