コード例 #1
0
        protected override void SetBounds(Drawable marker, int markerId, NMapOverlayItem item)
        {
            // check shape of the marker to set bounds correctly.
            if (NMapPOIflagType.IsBoundsCentered(markerId))
            {
                if (marker.Bounds.IsEmpty)
                {
                    NMapOverlayItem.BoundCenter(marker);
                }

                if (null != item)
                {
                    item.SetAnchorRatio(0.5f, 0.5f);
                }
            }
            else
            {
                if (marker.Bounds.IsEmpty)
                {
                    NMapOverlayItem.BoundCenterBottom(marker);
                }

                if (null != item)
                {
                    item.SetAnchorRatio(0.5f, 1.0f);
                }
            }
        }
コード例 #2
0
        public Drawable getDrawableWithAlphabet(int resourceId, string strAlphabet, int fontColor, float fontSize)
        {
            Bitmap textBitmap = GetBitmapWithText(resourceId, strAlphabet, fontColor, fontSize, POI_FONT_OFFSET_ALPHABET);

            // set bounds
            Drawable marker = new BitmapDrawable(MContext.Resources, textBitmap);

            if (marker != null)
            {
                NMapOverlayItem.BoundCenterBottom(marker);
            }

            return(marker);
        }