Created
September 10, 2020 15:19
-
-
Save tugcearar/10a8eec68ecc30f5e37998f4af14ce31 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
public void SetSearchResultOnMap(IList<Com.Huawei.Hms.Site.Api.Model.Site> sites) | |
{ | |
hMap.Clear(); | |
if (searchMarkers != null && searchMarkers.Count > 0) | |
foreach (var item in searchMarkers) | |
item.Remove(); | |
searchMarkers = new List<Marker>(); | |
for (int i = 0; i < sites.Count; i++) | |
{ | |
MarkerOptions marker1Options = new MarkerOptions() | |
.InvokePosition(new LatLng(sites[i].Location.Lat, sites[i].Location.Lng)) | |
.InvokeTitle(sites[i].Name).Clusterable(true); | |
hMap.SetInfoWindowAdapter(new MapInfoWindowAdapter(this)); | |
var marker1 = hMap.AddMarker(marker1Options); | |
searchMarkers.Add(marker1); | |
RepositionMapCamera(sites[i].Location.Lat, sites[i].Location.Lng); | |
} | |
hMap.SetMarkersClustering(true); | |
alert.Dismiss(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment