latitude and longitude args on MapView => MarkerTapped Event

It would be great to have latitude and longitude on MapView MarkerTapped Event.

Since scenarios like the same place have multiple addresses and we can’t handle the behavior by label only.

follow a reprodution:

<App Background="#000">
  <iOS.StatusBarConfig Style="Light" />
  <JavaScript>

  function onMarkerTapped (args)
  {
    console.log(`Marker label ${args.label} pressed: ${args.latitude}, ${args.longitude}`);
  }
  module.exports = {
    onMarkerTapped:onMarkerTapped
  }
  </JavaScript>
  <NativeViewHost>
    <MapView ux:Name="mapView" ShowMyLocation="true" ShowMyLocationButton="true" ShowCompass="true" MarkerTapped="{onMarkerTapped}">
      <MapMarker Latitude="-23.566844" Longitude="-46.647296" Label="Marker 1"/>
      <MapMarker Latitude="-23.566544" Longitude="-46.647596" Label="Marker 2"/>
    </MapView>
  </NativeViewHost>
</App>

Hi Diego,

a solution for this is already implemented and is coming to a future Fuse version with updated bundled fuselibs.

There is going to be a Tapped event on MapMarker itself, which returns the data context of the data-bound marker. You can see the details of the implementation here: https://github.com/fusetools/fuselibs-public/pull/8

Also, if you’re up to it, you are welcome to get this fix right away by using a local checkout of fuselibs.

Perfect! tks bro