Пример #1
0
        protected void control(object sender, GridViewCommandEventArgs e)
        {
            PROJEEntities db = new PROJEEntities();

            if (e.CommandName == "cmd1")
            {
                int count = Convert.ToInt32(e.CommandArgument);
                count++;

                var query = (from a in db.mekans
                             where a.id == count
                             select a.location).SingleOrDefault();


                var y = Convert.ToDouble(query.Latitude);
                var x = Convert.ToDouble(query.Longitude);

                GMap1.Height = 1000;
                GMap1.Width  = 1000;            //500'dü ben 1000 yaptım
                GMap1.Key    = "AIzaSyBbzayQWkhyVj3CTlFAh0UoVTt6NcZTpmo";
                var latlon = new GLatLng(x, y); //istenilen enlem boylam değerlerini merkez olarak alır
                GMap1.setCenter(latlon, 12);
                GMarker gm;
                GMarker icono = new GMarker(latlon);

                PinIcon p;
                p  = new PinIcon(PinIcons.flag, Color.Red);                             //istenen yere bırakılacak bayrak işaretçisi
                gm = new GMarker(new GLatLng(Convert.ToDouble(x), Convert.ToDouble(y)), //parantezdeki sayılar enlem boylam buraya işaretçi bırakılacak
                                 new GMarkerOptions(new GIcon(p.ToString(), p.Shadow())));
                GInfoWindow win;
                win = new GInfoWindow(gm, "" + "", false, GListener.Event.mouseover);  //haritaya eklenir
                GMap1.addInfoWindow(win);
            }
        }
Пример #2
0
        private void showCafe()
        {
            PROJEEntities db    = new PROJEEntities();
            var           query = (from a in db.mekans
                                   where a.tur == "cafe"
                                   select a.ad).ToList();


            GridView1.DataSource = query;
            GridView1.DataBind();
        }