I hope I’m understanding you right; what you need is to “do something when a map is moved”.
If so, using data-bound observables to Latitude and Longitude properties on MapView seems to be the right approach. I’m not sure what the problems you encountered were, so you should have shown some of your code.
Here’s something that I made as a proof of concept, and it works as expected:
<App>
<JavaScript>
var Observable = require("FuseJS/Observable");
var lat = Observable(0);
var lon = Observable(0);
var combined = lat.combineLatest(lon, function(latitude, longitude) {
return {latitude: latitude, longitude: longitude};
});
combined.onValueChanged(module, function(obj) {
console.log("coordinates have changed.");
console.log("latitude: " + obj.latitude);
console.log("longitude: " + obj.longitude);
});
module.exports = {
lat: lat,
lon: lon
};
</JavaScript>
<NativeViewHost>
<MapView Latitude="{lat}" Longitude="{lon}" />
</NativeViewHost>
</App>
My testing shows that the observables are only updated when you release the pointer (finger). Which is “drag end”.
If you see different behaviour, please share more details on what device you are testing on, describe exactly what is happening, and what you expect to happen instead.
I just re-tested this on both iOS and Android 6, and it only updates coordinates when I lift the finger (not when I just stop dragging).
As I said above: ff you see different behaviour, please share more details on what device you are testing on, describe exactly what is happening, and what you expect to happen instead.
The callback is fired twice because there are two Observables that change. So that’s expected. You could delay the polling for new data to work around this.
Unfortunately I don’t have an Android 5 device at hand, so I can’t test what you’re reporting about the “finger pause”. Would it be possible for you to check if the behaviour is different on different Android versions?