示例#1
0
        void CreateCustomMarker(MapView mapView)
        {
            mCustomMarker = new MapPOIItem();
            var name = "Custom Marker";

            mCustomMarker.ItemName = name;
            mCustomMarker.Tag      = 1;
            mCustomMarker.MapPoint = CUSTOM_MARKER_POINT;

            mCustomMarker.POIItemMarkerType = MarkerType.CustomImage;

            mCustomMarker.CustomImageResourceId = Resource.Drawable.custom_marker_red;
            mCustomMarker.CustomImageAutoscale  = false;
            mCustomMarker.SetCustomImageAnchor(0.5f, 1.0f);

            mapView.AddPOIItem(mCustomMarker);
            mapView.SelectPOIItem(mCustomMarker, true);
            mapView.SetMapCenterPoint(CUSTOM_MARKER_POINT, false);
        }
示例#2
0
        void CreateCustomBitmapMarker(MapView mapView)
        {
            mCustomBmMarker = new MapPOIItem();
            var name = "Custom Bitmap Marker";

            mCustomBmMarker.ItemName = name;
            mCustomBmMarker.Tag      = 2;
            mCustomBmMarker.MapPoint = CUSTOM_MARKER_POINT2;

            mCustomBmMarker.POIItemMarkerType = MarkerType.CustomImage;
            Bitmap bm = BitmapFactory.DecodeResource(Resources, Resource.Drawable.custom_marker_star);

            mCustomBmMarker.CustomImageBitmap    = bm;
            mCustomBmMarker.CustomImageAutoscale = false;
            mCustomBmMarker.SetCustomImageAnchor(0.5f, 0.5f);

            mapView.AddPOIItem(mCustomBmMarker);
            mapView.SelectPOIItem(mCustomBmMarker, true);
            mapView.SetMapCenterPoint(CUSTOM_MARKER_POINT, false);
        }