Skip to content

Instantly share code, notes, and snippets.

@tugcearar
Created September 10, 2020 14:12
Show Gist options
  • Save tugcearar/f51826cd9e38e91e950d423ea98bd671 to your computer and use it in GitHub Desktop.
Save tugcearar/f51826cd9e38e91e950d423ea98bd671 to your computer and use it in GitHub Desktop.
private void HMap_MapClick(object sender, HuaweiMap.MapClickEventArgs e)
{
selectedCoordinates.LatLng = e.P0;
if (circle != null)
{
circle.Remove();
circle = null;
}
AddMarkerOnMap();
}
void AddMarkerOnMap()
{
if (marker != null) marker.Remove();
var markerOption = new MarkerOptions()
.InvokeTitle("You are here now")
.InvokePosition(selectedCoordinates.LatLng);
hMap.SetInfoWindowAdapter(new MapInfoWindowAdapter(this));
marker = hMap.AddMarker(markerOption);
bool isInfoWindowShown = marker.IsInfoWindowShown;
if (isInfoWindowShown)
marker.HideInfoWindow();
else
marker.ShowInfoWindow();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment