コード例 #1
0
        protected override MarkerOptions CreateMarker(Pin pin)
        {
            MarkerOptions marker = new MarkerOptions();
            double        la     = 37.008503;
            double        lo     = -127.810804;

            marker.SetPosition(new LatLng(la, lo));
            marker.SetIcon(BitmapDescriptorFactory.FromResource(Resource.Drawable.pinWhite));
            return(marker);
        }
コード例 #2
0
        public void OnMapReady(GoogleMap googleMap)
        {
            for (int i = 0; i < latitudes.Length; i++)
            {
                MarkerOptions options = new MarkerOptions();
                options.SetPosition(new LatLng(latitudes[i], longitudes[i]));

                googleMap.AddMarker(options);
            }
        }
コード例 #3
0
        public static MarkerOptions CreateUserDragable()
        {
            MarkerOptions mo       = new MarkerOptions();
            LatLng        position = new LatLng(ConfigManager.DefaultLatMap, ConfigManager.DefaultLongMap);

            mo.SetPosition(position);
            mo.Draggable(true);

            return(mo);
        }
コード例 #4
0
        public void UserOffRoute(Location p0)
        {
            origin = Point.FromLngLat(lastLocation.Longitude, lastLocation.Latitude);
            GetRoute(origin, destination);
            Snackbar.Make(contentLayout, "User Off Route", Snackbar.LengthShort).Show();
            var marker = new MarkerOptions();

            marker.SetPosition(new LatLng(p0.Latitude, p0.Longitude));
            mapboxMap.AddMarker(marker);
        }
コード例 #5
0
ファイル: CampusMapRenderer.cs プロジェクト: nhazelton/GTNav
        protected override MarkerOptions CreateMarker(Pin pin)
        {
            var marker = new MarkerOptions();

            marker.SetPosition(new LatLng(pin.Position.Latitude, pin.Position.Longitude));
            marker.SetTitle(pin.Label);
            marker.SetSnippet(pin.Address);
            marker.SetIcon(BitmapDescriptorFactory.FromAsset("BusStop_blue.png"));
            return(marker);
        }
コード例 #6
0
        private void DrawOnMap(GoogleMap map, LatLng latLng, string title)
        {
            MarkerOptions marker = new MarkerOptions();

            marker.SetPosition(latLng);
            marker.SetTitle(title);
            map.AddMarker(marker);

            map.MoveCamera(CameraUpdateFactory.NewLatLngZoom(latLng, 10));
        }
コード例 #7
0
ファイル: MainActivity.cs プロジェクト: antukidem/Uride
        public MarkLocationOnMap(GoogleMap mMap, string title, string snippet, LatLng pos)
        {
            var marker = new MarkerOptions();

            marker.SetTitle(title);
            marker.SetSnippet(snippet);
            marker.Draggable(true);
            marker.SetPosition(pos);
            mMap.AddMarker(marker);
        }
コード例 #8
0
        private void GMap_MapClick(object sender, GoogleMap.MapClickEventArgs e)
        {
            Selected = new LocationHuntLocation(e.Point.Latitude, e.Point.Longitude, GMap.CameraPosition.Zoom, false);

            MarkerOptions opts = new MarkerOptions();

            opts.SetPosition(new LatLng(Selected.Lat, Selected.Long));
            GMap.Clear();
            GMap.AddMarker(opts);
        }
コード例 #9
0
        private void AddMarker(int db, double lat, double lon, string info = "Keine Infos")
        {
            MarkerOptions opt = new MarkerOptions();

            opt.SetPosition(new LatLng(lat, lon));
            opt.SetTitle(db.ToString() + "db");
            opt.SetSnippet(info);
            opt.InvokeIcon(GetIcon(GetColor(db)));
            _map.AddMarker(opt);
        }
コード例 #10
0
        /// <summary>
        /// Takes the current pin object and creates a GoogleMap marker
        /// from it.
        /// </summary>
        /// <returns>A MarkerOptions object from which to make a googlemap marker.</returns>
        public MarkerOptions CreateMarker()
        {
            var marker = new MarkerOptions();

            marker.SetPosition(new LatLng(this.Position.Latitude, this.Position.Longitude));
            marker.SetTitle(this.Label);
            marker.SetSnippet(this.Address);
            marker.SetIcon(BitmapDescriptorFactory.FromResource(Resource.Drawable.user_pin));
            return(marker);
        }
コード例 #11
0
        /// <summary>
        ///     Méthode héritée de IOnMapReadyCallback permettant de signaler à l'activité que la map est prête à être utilisée
        /// </summary>
        /// <see cref="IOnMapReadyCallback"/>
        /// <param name="map"></param>
        public void OnMapReady(GoogleMap map)
        {
            _map = map;
            MarkerOptions markerOpt1 = new MarkerOptions();

            markerOpt1.SetPosition(new LatLng(Intent.GetDoubleExtra("latitude", -34), Intent.GetDoubleExtra("longitude", 151)));
            markerOpt1.SetTitle(Intent.GetStringExtra("eventName"));
            _map.AddMarker(markerOpt1);
            _map.MoveCamera(CameraUpdateFactory.NewLatLng(new LatLng(Intent.GetDoubleExtra("latitude", -34), Intent.GetDoubleExtra("longitude", 151))));
        }
コード例 #12
0
ファイル: ShopMapFragment.cs プロジェクト: Rogaliusz/smb
        private MarkerOptions CreateMarkerOptions(Shop shop)
        {
            var marker = new MarkerOptions();

            marker.SetPosition(new LatLng(shop.Latitude, shop.Longitude));
            marker.SetTitle(shop.Name);
            marker.SetSnippet(shop.Description);

            return(marker);
        }
コード例 #13
0
        protected override MarkerOptions CreateMarker(Pin pin)
        {
            //return base.CreateMarker(pin);
            var marker = new MarkerOptions();

            marker.SetPosition(new LatLng(Pet.Latitude, Pet.Longitude));
            marker.SetTitle(Pet.Name);
            marker.SetSnippet($"{Pet.Breed} - {Pet.Age} años");
            return(marker);
        }
コード例 #14
0
        protected override MarkerOptions CreateMarker(Pin pin)
        {
            // return base.CreateMarker(pin);
            var marker = new MarkerOptions();

            marker.SetPosition(new LatLng(Trip.Latitude, Trip.Longitude));
            marker.SetTitle(Trip.Title);
            marker.SetSnippet(Trip.Notes);
            return(marker);
        }
コード例 #15
0
ファイル: MainActivity.cs プロジェクト: shubham980/Brew_Stash
        /// <summary>
        /// Adds location markers on the map
        /// </summary>
        /// <param name="map">used map</param>
        /// <param name="list">list of places</param>

        public void AddLocationMarkers(GoogleMap map, ObservableCollection <SearchData.Result> list)
        {
            foreach (var item in list)
            {
                MarkerOptions markerOpt1 = new MarkerOptions();
                markerOpt1.SetPosition(new LatLng(item.geometry.location.lat, item.geometry.location.lng));
                markerOpt1.SetTitle(item.name);
                map.AddMarker(markerOpt1);
            }
        }
コード例 #16
0
        private void addIcon(IconGenerator iconFactory, string text, LatLng position)
        {
            MarkerOptions markerOptions = new MarkerOptions();

            markerOptions.SetIcon(BitmapDescriptorFactory.FromBitmap(iconFactory.MakeIcon(text)));
            markerOptions.SetPosition(position);
            markerOptions.Anchor(iconFactory.AnchorU, iconFactory.AnchorV);

            getMap().AddMarker(markerOptions);
        }
コード例 #17
0
        protected override MarkerOptions CreateMarker(Pin pin)
        {
            //return base.CreateMarker(pin);
            var marker = new MarkerOptions();

            marker.SetPosition(new LatLng(Order.Latitude, Order.Longitude));
            marker.SetTitle(Order.Address);
            marker.SetSnippet(Order.Date.ToString());
            return(marker);
        }
コード例 #18
0
        protected virtual MarkerOptions CreateMarker(Pin pin)
        {
            var opts = new MarkerOptions();

            opts.SetPosition(new LatLng(pin.Position.Latitude, pin.Position.Longitude));
            opts.SetTitle(pin.Label);
            opts.SetSnippet(pin.Address);

            return(opts);
        }
コード例 #19
0
ファイル: BaseActivity.cs プロジェクト: Seige465/XForms
        public void MarkWithGPS()
        {
            Lat_Lng = new LatLng(_location.Latitude, _location.Longitude);
            mOptions.SetPosition(Lat_Lng);
            mOptions.SetTitle("Placed Marker");

            gmap.AddMarker(mOptions);
            //CameraUpdate cu = CameraUpdateFactory.NewLatLngZoom(new LatLng(gmap.MyLocation.Latitude, gmap.MyLocation.Longitude), 14);
            // gmap.AnimateCamera(cu);
        }
コード例 #20
0
        protected override MarkerOptions CreateMarker(Pin pin)
        {
            var marker = new MarkerOptions();

            marker.SetPosition(new LatLng(pin.Position.Latitude, pin.Position.Longitude));
            marker.SetTitle(pin.Label);
            marker.SetSnippet(pin.Address);
            marker.SetIcon(BitmapDescriptorFactory.FromResource(Resource.Drawable.pin));
            return(marker);
        }
コード例 #21
0
        protected override MarkerOptions CreateMarker(Pin pin)
        {
            var marker = new MarkerOptions();

            marker.SetPosition(new LatLng(pin.Position.Latitude, pin.Position.Longitude));
            marker.SetTitle(pin.Label);
            marker.SetSnippet(pin.Address);

            return(marker);
        }
コード例 #22
0
        private void AddMarker(Map_Location newLoc)
        {
            MarkerOptions opts = new MarkerOptions();

            opts.SetPosition(new LatLng(newLoc.Lat, newLoc.Long));
            selectedMarkers.Add(GMap.AddMarker(opts));

            UpdateText();
            UpdateButton();
        }
コード例 #23
0
        public void OnMapReady(GoogleMap googleMap)
        {
            MarkerOptions marker = new MarkerOptions();

            marker.SetPosition(new LatLng(latitude, longitude));
            marker.SetTitle("Your location");
            googleMap.AddMarker(marker);

            googleMap.MoveCamera(CameraUpdateFactory.NewLatLngZoom(new LatLng(latitude, longitude), 10));
        }
コード例 #24
0
 void MarkOnMap(string title, LatLng pos)
 {
     RunOnUiThread(() =>
     {
         var marker = new MarkerOptions();
         marker.SetTitle(title);
         marker.SetPosition(pos);
         map.AddMarker(marker);
     });
 }
コード例 #25
0
ファイル: PickUpActivity.cs プロジェクト: jp853/learnXamarin
        public void OnMapReady(GoogleMap googleMap)
        {
            MarkerOptions marker = new MarkerOptions();

            marker.SetPosition(new LatLng(lat, lng));
            marker.SetTitle("Pick up here");
            googleMap.AddMarker(marker);

            googleMap.MoveCamera(CameraUpdateFactory.NewLatLngZoom(new LatLng(lat, lng), 12));
        }
コード例 #26
0
            protected override MarkerOptions CreateMarker(Pin pin)
            {
                var marker = new MarkerOptions();

                marker.SetPosition(new LatLng(pin.Position.Latitude, pin.Position.Longitude));
                marker.SetTitle(pin.Label);
                marker.SetSnippet(pin.Address);
                marker.SetIcon(GetCustomBitmapDescriptor("#8e24aa"));
                return(marker);
            }
コード例 #27
0
        private void googleMap_MapClick(object sender, GoogleMap.MapClickEventArgs e)
        {
            ((ExtMap)Element).OnTap(new Position(e.Point.Latitude, e.Point.Longitude));
            var marker = new MarkerOptions();

            _map.Clear();
            marker.SetPosition(new LatLng(e.Point.Latitude, e.Point.Longitude));
            marker.SetTitle("Selected Place");
            _map.AddMarker(marker);
        }
コード例 #28
0
        public MarkerOptions BuildMarker(LatLng position)
        {
            Log.Debug("BuildMarker", "Building marker");

            MarkerOptions markerOptions = new MarkerOptions();

            markerOptions.SetPosition(position);

            return(markerOptions);
        }
コード例 #29
0
        protected override MarkerOptions CreateMarker(Pin pin)
        {
            //return base.CreateMarker(pin);
            var marker = new MarkerOptions();

            marker.SetPosition(new LatLng(FuelStation.Latitude, FuelStation.Longitude));
            marker.SetTitle(FuelStation.Name);
            marker.SetSnippet($"{FuelStation.Brand}");
            return(marker);
        }
コード例 #30
0
        public async Task SetupMapIfNeeded()
        {
            //if (_map == null)
            //{

            if (_map != null)
            {
                var criteria = new Criteria {
                    PowerRequirement = Power.Medium
                };
                var bestProvider = locationManager.GetBestProvider(criteria, true);
                var location     = locationManager.GetLastKnownLocation(bestProvider);
                System.Diagnostics.Debug.WriteLine("start timer maps loc " + location.Latitude);
                MarkerOptions markerOpt1 = new MarkerOptions();

                VimyRidge  = new LatLng(location.Latitude, location.Longitude);
                markerOpt1 = new MarkerOptions();
                markerOpt1.SetPosition(VimyRidge);
                markerOpt1.SetTitle("Mi ubicación");
                markerOpt1.InvokeIcon(BitmapDescriptorFactory.DefaultMarker(BitmapDescriptorFactory.HueCyan));
                _map.AddMarker(markerOpt1);



                List <Coord> requestCoord = await App.Database.GetAllCoordAsync();

                foreach (Coord item in requestCoord)
                {
                    System.Diagnostics.Debug.WriteLine("entra maps marker");
                    Passchendaele = new LatLng(Double.Parse(item.LATITUD), Double.Parse(item.LONGITUD));
                    markerOpt1    = new MarkerOptions();
                    markerOpt1.SetPosition(Passchendaele);
                    markerOpt1.SetTitle(item.CMADDRESS);
                    //markerOpt1.InvokeIcon(BitmapDescriptorFactory.DefaultMarker(BitmapDescriptorFactory.HueCyan));
                    _map.AddMarker(markerOpt1);

                    //MarkerOptions markerOpt2 = new MarkerOptions();
                    //markerOpt2.SetPosition(Passchendaele);
                    //markerOpt2.SetTitle("Passchendaele");
                    //_map.AddMarker(markerOpt2);
                }

                // We create an instance of CameraUpdate, and move the map to it.        15

                //actualizacion de la posicion de la camara
                if (ind == 0)
                {
                    CameraUpdate cameraUpdate = CameraUpdateFactory.NewLatLngZoom(VimyRidge, 10);
                    _map.MoveCamera(cameraUpdate);
                    ind = 1;
                }
            }

            //}
        }