Created
September 10, 2020 14:12
-
-
Save tugcearar/f51826cd9e38e91e950d423ea98bd671 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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