Ejemplo n.º 1
0
        public void DrawPointMap(string category, ScaleImageView image)
        {
            if (DRAW_KEY == 1)
            {
                DRAW_KEY = 0;
                Canvas c = null;
                Paint  p = null;
                try {
                    c = new Canvas(this.canvas);
                    c.DrawBitmap(this.origin, 0, 0, null);

                    p       = new Paint();
                    p.Color = Color.Red;
                }
                catch (System.Exception e)
                { }
                //////////////////////////////////////////

                foreach (var value in Data_ShopInfo.DIC_SHOPINFO_OVERALL_INFO[localKey])
                {
                    if (category.Equals(value.EngCategory))
                    {
                        c.DrawBitmap(this.indicator, value.ShopLocation.X * MainActivity.DPI_XSCALE
                                     , value.ShopLocation.Y * MainActivity.DPI_YSCALE, null);
                        //c.DrawCircle(value.ShopLocation.X * MainActivity.DPI_XSCALE
                        //    , value.ShopLocation.Y * MainActivity.DPI_YSCALE, 12, p);
                    }
                }
                image.SetImageBitmap(this.canvas);

                DRAW_KEY = 1;
            }
        }
Ejemplo n.º 2
0
        protected override async void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            if (MainActivity.Activities.ContainsKey("UnderShopMapActivity"))
            {
                MainActivity.Activities["UnderShopMapActivity"].Finish();
                MainActivity.Activities.Remove("UnderShopMapActivity");
                MainActivity.Activities.Add("UnderShopMapActivity", this);
            }
            else
            {
                MainActivity.Activities.Add("UnderShopMapActivity", this);
            }
            // Create your application here
            SetContentView(Resource.Layout.ScaleImage);

            FrameLayout fr = FindViewById <FrameLayout>(Resource.Id.fr);

            local = Intent.GetStringExtra("Local");
            id    = Intent.GetStringExtra("SHOP_ID_NUMBER");

            image = FindViewById <ScaleImageView>(Resource.Id.AnimateImage);

            //foreach(var i in Data_ShopInfo.DIC_SHOP_XML_INFO_OVERALL_INFO)
            //{
            //    if (i.Value.IdentificationNumber.Equals(id))
            //    {
            //        iv = FindViewById<ImageView>(Resource.Id.iv);
            //        iv.SetImageResource(Resource.Drawable.directions9);
            //        iv.TranslationX = i.Value.ShopLocation.X;
            //        iv.TranslationY = i.Value.ShopLocation.Y - 10;
            //        iv.Tag = i.Value.IdentificationNumber;
            //    }
            //}

            TextView iv = null;

            shopNameList = new List <ShopNameLocation>();
            foreach (var i in Data_ShopInfo.DIC_SHOPINFO_OVERALL_INFO[local])
            {
                TextView tv = new TextView(this);
                tv.SetTextColor(Android.Graphics.Color.Black);
                if (i.Category.Equals(GetString(Resource.String.station)))
                {
                    tv.Text   = i.ShopName;
                    tv.Click += Tv_Subway_Click;
                    tv.Tag    = i.IdentificationNumber.Split(',')[0] + "," + i.EngCategory;
                    tv.SetTypeface(null, TypefaceStyle.Bold);
                    tv.SetTextColor(Color.White);
                }
                else if (i.Category.Equals(GetString(Resource.String.rest)))
                {
                    tv.SetBackgroundResource(Resource.Drawable.restroom16);
                    tv.Tag = i.IdentificationNumber + "," + i.EngCategory;
                }
                else if (i.Category.Equals(GetString(Resource.String.gateway)))
                {
                    tv.Text = i.ShopName;
                    tv.Tag  = i.IdentificationNumber + "," + i.EngCategory;
                }
                else if (i.Category.Equals(GetString(Resource.String.move)))
                {
                    tv.Text   = i.ShopName;
                    tv.Click += MapTransfer;
                    tv.SetTextColor(Color.White);
                    tv.Tag = i.IdentificationNumber.Split(',')[0] + "," + i.EngCategory;
                }
                else
                {
                    tv.Text   = i.ShopName;
                    tv.Click += Tv_Click;
                    tv.Tag    = i.IdentificationNumber + "," + i.EngCategory;

                    if (id != null)
                    {
                        if (id.Equals(i.IdentificationNumber))
                        {
                            iv = tv;
                            iv.SetBackgroundColor(Color.Red);
                            iv.SetTextColor(Color.White);
                        }
                    }
                }
                var lparam = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent,
                                                          ViewGroup.LayoutParams.WrapContent);
                tv.LayoutParameters = lparam;
                ShopNameLocation snl = new ShopNameLocation()
                {
                    myView      = tv,
                    myLocationX = i.ShopLocation.X,
                    myLocationY = i.ShopLocation.Y
                };
                shopNameList.Add(snl);
                fr.AddView(tv);
            }
            image.LocalKey = local;
            try
            {
                BitmapResize          br      = new BitmapResize();
                BitmapFactory.Options options = await br.GetBitmapOptionsOfImageAsync(Resources, Data_ShopInfo.DIC_SHOPMAP[local]);

                bitmapToDisplay = await br.LoadScaledDownBitmapForDisplayAsync(Resources, Data_ShopInfo.DIC_SHOPMAP[local], options, 370, 370);

                if (iv != null)
                {
                    image.SetImageBitmapAndMarker(bitmapToDisplay, iv, iv.TranslationX, iv.TranslationY, shopNameList);
                }
                else
                {
                    image.SetImageBitmapAndMarker(bitmapToDisplay, shopNameList);
                }
            }
            catch
            {
            }


            TV_Categories = new TextView[] {
                FindViewById <TextView>(Resource.Id.TV_ALL),
                FindViewById <TextView>(Resource.Id.TV_FOOD),
                FindViewById <TextView>(Resource.Id.TV_FASHION),
                FindViewById <TextView>(Resource.Id.TV_CONVE),
                FindViewById <TextView>(Resource.Id.TV_INTERIOR),
                FindViewById <TextView>(Resource.Id.TV_BEAUTY),
                FindViewById <TextView>(Resource.Id.TV_OTHERS),
                FindViewById <TextView>(Resource.Id.TV_DIGITAL)
            };
            for (int i = 0; i < TV_Categories.Length; i++)
            {
                TV_Categories[i].Click += LEGEND_TV_CLICK;
            }
            Toast.MakeText(this, GetString(Resource.String.UnderMapComment), ToastLength.Short).Show();
        }
Ejemplo n.º 3
0
 public void DrawPointMap(string text, ScaleImageView image)
 {
     drawMap.DrawPointMap(text, image);
 }
Ejemplo n.º 4
0
 public ScaleImageViewGestureDetector(ScaleImageView imageView)
 {
     m_ScaleImageView = imageView;
 }