Je veux à mes cartes ajouter des marqueurs du magasin que j'ai cherché. Par exemple, je veux que mes cartes ne montre que tous les sept magasins onze en Angleterre et puis je veux trouver le plus proche sept onze à mon emplacement actuel. Y at-il une méthode pour faire cela ou référence que je cherchais. voici mon code actuelComment montrer un magasin dans google maps pour xamarin android
using Android.App;
using Android.Widget;
using Android.OS;
using Android.Gms.Maps;
using Android.Gms.Maps.Model;
using System;
namespace _Map
{
[Activity(Label = "_Map", Icon = "@drawable/icon", MainLauncher =true)]
public class MainActivity : Activity, IOnMapReadyCallback
{
private GoogleMap GMap;
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
// Set our view from the "main" layout resource
SetContentView(Resource.Layout.Main);
SetUpMap();
}
private void SetUpMap()
{
if (GMap == null)
{
FragmentManager.FindFragmentById<MapFragment>(Resource.Id.googlemap).GetMapAsync(this);
}
}
public void OnMapReady(GoogleMap googleMap)
{
this.GMap = googleMap;
GMap.UiSettings.ZoomControlsEnabled = true;
BitmapDescriptor image = BitmapDescriptorFactory.FromResource(Resource.Drawable.gramed);
LatLng latlng = new LatLng(Convert.ToDouble(-6.196279), Convert.ToDouble(106.822369));
LatLng latlng2 = new LatLng(Convert.ToDouble(-6.220489), Convert.ToDouble(106.814349));
LatLng latlng3 = new LatLng(Convert.ToDouble(-6.163067), Convert.ToDouble(106.832605));
CameraUpdate camera = CameraUpdateFactory.NewLatLngZoom(latlng, 15);
GMap.MoveCamera(camera);
MarkerOptions options = new MarkerOptions()
.SetPosition(latlng)
.SetIcon(image)
.SetSnippet("Open 9AM-11PM")
.SetTitle("Gramedia");
GMap.AddMarker(options);
MarkerOptions options1 = new MarkerOptions()
.SetPosition(latlng2)
.SetIcon(image)
.SetTitle("Gramedia 2")
.SetSnippet("Open 8AM - 10PM");
GMap.AddMarker(options1);
MarkerOptions options2 = new MarkerOptions()
.SetPosition(latlng3)
.SetIcon(image)
.SetSnippet("Open 8AM-9PM")
.SetTitle("Gramedia 3");
GMap.AddMarker(options2);
}
}
}
comme vous pouvez le voir, je dois ajouter le marqueur manualy pour chaque magasin, il y a comme une centaine de magasin que je devais ajouter dans la carte. Y a-t-il un moyen facile de le faire?