Hi,
I'm currently working on creating an extensible control that displays the Azure maps and allowing user to interact with it. I want to update my datasource record with the new coordinates whenever the map is clicked. In javascript, I created an observable that will be fired when a click event occurs. The observe function will the run the callFunction framework to update my record in x++. Seem very easy but I got the following error in the console. Apparently callFunction cannot be used in an interaction which in this case i think is the click event in azure maps

Here is my code in javascript. Is there a way around this?
var coordChanged;
coordChanged = $dyn.observable(false);
//map is the azure map instance and below is the click event
map.events.add('click', function (e) {
coordChanged(true);
});
$dyn.observe(coordChanged, function (value) {
if (value == true) {
$dyn.callFunction(control.UpdateLatLon, control, { _latitude: newLat, _longitude: newLon }, {});
}
coordChanged(false);
});