Open dlcole opened 4 years ago
@dlcole - Could be a limitation on how we're attaching the view, and maybe the bindingContext isn't refreshing.
Could mess around with deleting the reference to marker._infoWindowView
to remove the cache of the view before updating the timestamp:
@dapriett - That works! Here's my resulting code:
exports.onMarkerSelect = function (args) {
// See: https://github.com/dapriett/nativescript-google-maps-sdk/issues/372
if (args.marker.hasOwnProperty("uuid")) {
args.marker._infoWindowView = undefined;
args.marker.info = myutils.timeSince(args.marker.timestamp);
}
}
Thanks for your prompt help.
I have a custom infoWindow with a property that contains a timestamp to indicate how long the marker has been at that position. I set the property in the markerSelect event handler and it works as expected the first time. On any subsequent invocations, though, the infoWindow text remains unchanged.
That is, tapping the marker the first time accurately shows how long the marker has been at that position. Tapping the marker a second and subsequent time always shows the value of the first tap, as if the property can only be written to once.
Is this an inherent limitation, or is there a way to set the property value so that the current value will be shown on the infoWindow?