Example #1
0
        public void PointMutatorCreationWithMapControlTest()
        {
            IMapControl mapControl = new MapControl {
                Map = { Size = new Size(1000, 1000) }
            };
            ICoordinateConverter coordinateConverter = new CoordinateConverter(mapControl);
            PointEditor          pointMutator        = new PointEditor(coordinateConverter, null,
                                                                       sampleFeature, GetStyle(Pens.Red));

            Assert.AreEqual(null, pointMutator.TargetFeature);
            Assert.AreNotEqual(null, pointMutator.SourceFeature);

            ITrackerFeature tracker = pointMutator.GetTrackerAtCoordinate(new Coordinate(0, 0));

            Assert.AreNotEqual(null, tracker);

            pointMutator.Start();
            pointMutator.MoveTracker(tracker, 5.0, 5.0, null);
            pointMutator.Stop();

            Assert.AreEqual(5.0, tracker.Geometry.Coordinates[0].X);
            Assert.AreEqual(5.0, tracker.Geometry.Coordinates[0].Y);
            Assert.AreEqual(5.0, sampleFeature.Geometry.Coordinates[0].X);
            Assert.AreEqual(5.0, sampleFeature.Geometry.Coordinates[0].Y);
        }
Example #2
0
        /// <summary>
        /// Updates when currently in placement mode.
        /// </summary>
        private void UpdatePlacing()
        {
            var pos = CoordinateConverter.GetCurrentMouseTilePosition(cam);

            instance.transform.position = CoordinateConverter.ToVector3Int(pos);

            // Update color of instance.
            var color = buildingsData.InMap(CoordinateConverter.WorldToArray(pos, worldData.worldSize)) &&
                        buildingsData.IsPlaceable(placeable, pos) ? placeableColor : notPlaceableColor;

            color = city.CanBuyByCost(placeable.GetCost()) ? color : cantBuyColor;
            for (int i = 0; i < spriteRenderers.Length; i++)
            {
                spriteRenderers[i].color = color;
            }

            // Place building if possible.
            if (Input.GetMouseButtonDown(0) && !EventSystem.current.IsPointerOverGameObject() &&
                buildingsData.InMap(CoordinateConverter.WorldToArray(pos, worldData.worldSize)) &&
                buildingsData.IsPlaceable(placeable, pos) && city.Buy(placeable.GetCost()))
            {
                GameObject gameObject = Instantiate(placeable.GetObject(), instance.transform.position, Quaternion.identity, parent);
                if (!buildingsData.TrySet(gameObject.GetComponent <IPlaceable <Building> >(), pos))
                {
                    throw new InvalidOperationException("This shouldn't be possible!");
                }
            }
        }
Example #3
0
        public void TestDecodingRelative1()
        {
            double delta = 0.0001;

            // manually specify a binary coordinate (see example in OpenLR whitepaper).
            byte[] data = new byte[4];
            data[0] = 0;
            data[1] = 155;
            data[2] = 254;
            data[3] = 59;

            // decode the coordinate relative to another coordinate.
            var reference = new Coordinate()
            {
                Latitude  = 49.60851,
                Longitude = 6.12683
            };
            var coordinate = CoordinateConverter.DecodeRelative(reference, data);

            Assert.IsNotNull(coordinate);
            Assert.AreEqual(6.12838, coordinate.Longitude, delta);
            Assert.AreEqual(49.60398, coordinate.Latitude, delta);

            // (ensure full code coverage).
            coordinate = CoordinateConverter.DecodeRelative(reference, data, 0);

            Assert.IsNotNull(coordinate);
            Assert.AreEqual(6.12838, coordinate.Longitude, delta);
            Assert.AreEqual(49.60398, coordinate.Latitude, delta);
        }
Example #4
0
        private async Task <GeoCoordinate> ShowMyCurrentLocationOnTheMap()
        {
            // Get my current location.
            Geolocator  myGeolocator  = new Geolocator();
            Geoposition myGeoposition = await myGeolocator.GetGeopositionAsync();

            myGeocoordinate = myGeoposition.Coordinate;

            //wayPoints.Add(new GeoCoordinate(myGeocoordinate.Latitude, myGeocoordinate.Longitude));

            myGeoCoordinate = CoordinateConverter.ConvertGeocoordinate(myGeocoordinate);

            // Make my current location the center of the Map.
            this.mapMain.Center    = myGeoCoordinate;
            this.mapMain.ZoomLevel = 16;

            // Create a MapOverlay to contain the circle.
            MapOverlay myCurentLocationOverlay = MarkerDraw.DrawMapMarker(myGeoCoordinate);

            // Create a MapLayer to contain the MapOverlay.
            MapLayer myLocationLayer = new MapLayer();

            myLocationLayer.Add(myCurentLocationOverlay);

            // Add the MapLayer to the Map.
            mapMain.Layers.Add(myLocationLayer);

            return(myGeoCoordinate);
        }
        private void Control_MouseMove(object sender, MouseEventArgs e)
        {
            if (this._isDragging)
            {
                Size canvasSize = new Size(this._canvas.ActualWidth, this._canvas.ActualHeight);

                Point  p = e.GetPosition(this._canvas);
                Vector m = new Vector(p.X, p.Y);

                Vector toMousePosition = CoordinateConverter.FromPointToCoordinate(canvasSize,
                                                                                   this._data,
                                                                                   m);

                Vector fromMousePosition = CoordinateConverter.FromPointToCoordinate(canvasSize,
                                                                                     this._data,
                                                                                     this._mouseLocationWithinCanvas);

                double scrollspeed = (this._data.UnitX + this._data.UnitY) / 2;
                Vector distance    = (fromMousePosition - toMousePosition) * scrollspeed;


                this._data.MinX += distance.X;
                this._data.MaxX += distance.X;
                this._data.MinY += distance.Y;
                this._data.MaxY += distance.Y;

                this._mouseLocationWithinCanvas = m;

                this.Update();
            }
        }
Example #6
0
 /**
  * 构造方法
  *
  * @param longitude
  * @param latitude
  * @param content
  */
 public TextPoint(double longitude, double latitude, string content)
 {
     //进行坐标转换
     double[] BL = CoordinateConverter.UTMWGSXYtoBL(longitude, latitude);
     this.latitude  = BL[0];
     this.longitude = BL[1];
     this.content   = content;
 }
Example #7
0
 public List <Vector2Int> CalculatePositionWithOffset(List <Vector2Int> poss, Vector2Int pos)
 {
     for (int i = 0; i < poss.Count; i++)
     {
         poss[i] = CoordinateConverter.WorldToArray(poss[i] + pos, worldData.worldSize);
     }
     return(poss);
 }
Example #8
0
        /// <summary>
        /// Decodes the given data into a location reference.
        /// </summary>
        public static CircleLocation Decode(byte[] data)
        {
            var circleLocation = new CircleLocation();

            circleLocation.Coordinate = CoordinateConverter.Decode(data, 1);
            circleLocation.Radius     = data[7];
            return(circleLocation);
        }
Example #9
0
        public void Initialize()
        {
            var kinectParams = HandInputParams.GetKinectParams(
                Properties.Resources.ColorToDepthRelationalParameters);

            converter = new CoordinateConverter(new CoordinateMapper(kinectParams),
                                                HandInputParams.ColorImageFormat, HandInputParams.DepthImageFormat);
        }
Example #10
0
        /// <summary>
        ///     Creates coordinate object from single string
        ///     Coordinate in text in given manner: 'A4'
        ///     Where 'A' is row and '4' is column
        /// </summary>
        /// <param name="coordinate">Coordinate as single string (e.g. 'A4')</param>
        /// <returns>Coordinate object</returns>
        public static Coordinate Create(string coordinate)
        {
            CoordinateConverter.SplitLettersFromNumbers(coordinate, out string row, out int column);

            return(new Coordinate(
                       CoordinateConverter.ConvertUserInputRowToBoardRow(row),
                       CoordinateConverter.ConvertUserInputNumberToBoardColumnNumber(column)));
        }
Example #11
0
        /// <summary>
        /// Decodes the given data into a location reference.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        protected override CircleLocation Decode(byte[] data)
        {
            var circleLocation = new CircleLocation();

            circleLocation.Coordinate = CoordinateConverter.Decode(data, 1);
            circleLocation.Radius     = data[7];
            return(circleLocation);
        }
Example #12
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="startAbsolutePosition">Absolute position where the contact is plotted from</param>
        /// <param name="contactType"></param>
        /// <param name="polarCoord">Bearing and range from absolute position for the new contact</param>
        /// <param name="heading"></param>
        /// <param name="speed"></param>
        /// <param name="altitude"></param>
        /// <returns></returns>
        public IReferencePoint CreateContactAtPolarCoordinate(PointF startAbsolutePosition, ContactTypes contactType, PolarCoordinate polarCoord, double heading = 0.00, double speed = 0.00, double altitude = 0.00)
        {
            var relativePosition    = startAbsolutePosition.GetRelativePosition(RadarReceiver.ViewPortExtent);
            var newRelativePosition = CoordinateConverter.CalculatePointFromDegrees(relativePosition, polarCoord, CoordinateConverter.ROUND_DIGITS);
            var newAbsolutePosition = newRelativePosition.GetAbsolutePosition(RadarReceiver.ViewPortExtent);

            return(CreateContactAtPoint(newAbsolutePosition, contactType, heading, speed, altitude));
        }
Example #13
0
        /// <summary>
        /// Decodes the given data into a location reference.
        /// </summary>
        public static RectangleLocation Decode(byte[] data)
        {
            var rectangleLocation = new RectangleLocation();

            rectangleLocation.LowerLeft  = CoordinateConverter.Decode(data, 1);
            rectangleLocation.UpperRight = CoordinateConverter.DecodeRelative(rectangleLocation.LowerLeft, data, 7);
            return(rectangleLocation);
        }
Example #14
0
        public void GoogleSkyToEquatorialAndBack()
        {
            var start  = new GoogleSkyCs(5, 5);
            var middle = CoordinateConverter.GoogleSkyToEquatorial(start);
            var end    = CoordinateConverter.EquatorialToGoogleSky(middle);

            Assert.AreEqual(start.Latitude, end.Latitude, DELTA);
            Assert.AreEqual(start.Longitude, start.Longitude, DELTA);
        }
Example #15
0
        public void HotizontalToEquatorialAndBack()
        {
            var start  = new HorizontalCs(0, 0);
            var middle = CoordinateConverter.HorizontalToEquatorial(start);
            var end    = CoordinateConverter.EquatorialToHorizontal(middle);

            Assert.AreEqual(0, end.Azimuth, DELTA);
            Assert.AreEqual(start.Altitude, start.Altitude, DELTA);
        }
Example #16
0
        /// <summary>
        /// Decodes the given data into a location reference.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        protected override ClosedLineLocation Decode(byte[] data)
        {
            // decode first location reference point.
            var first = new LocationReferencePoint();

            first.Coordinate         = CoordinateConverter.Decode(data, 1);
            first.FuntionalRoadClass = FunctionalRoadClassConvertor.Decode(data, 7, 2);
            first.FormOfWay          = FormOfWayConvertor.Decode(data, 7, 5);
            first.LowestFunctionalRoadClassToNext = FunctionalRoadClassConvertor.Decode(data, 8, 0);
            first.Bearing        = BearingConvertor.DecodeAngleFromBearing(BearingConvertor.Decode(data, 8, 3));
            first.DistanceToNext = DistanceToNextConvertor.Decode(data[9]);

            // calculate the intermediate points count.
            var intermediateList = new List <LocationReferencePoint>();
            int intermediates    = (data.Length - 12) / 7;
            int location         = 10;
            var reference        = first.Coordinate; // the reference for the relative coordinates.

            for (int idx = 0; idx < intermediates; idx++)
            {
                // create an intermediate point.
                var intermediate = new LocationReferencePoint();
                intermediate.Coordinate = CoordinateConverter.DecodeRelative(reference, data, location);
                reference = intermediate.Coordinate;
                location  = location + 4;
                intermediate.FuntionalRoadClass = FunctionalRoadClassConvertor.Decode(data, location, 2);
                intermediate.FormOfWay          = FormOfWayConvertor.Decode(data, location, 5);
                location             = location + 1;
                intermediate.Bearing = BearingConvertor.DecodeAngleFromBearing(BearingConvertor.Decode(data, location, 3));
                intermediate.LowestFunctionalRoadClassToNext = FunctionalRoadClassConvertor.Decode(data, location, 0);
                location = location + 1;
                intermediate.DistanceToNext = DistanceToNextConvertor.Decode(data[location]);
                location = location + 1;

                intermediateList.Add(intermediate);
            }

            // decode last location reference point.
            var last = new LocationReferencePoint();

            // no last coordinates, identical to the first.
            last.Coordinate         = first.Coordinate;
            last.FuntionalRoadClass = FunctionalRoadClassConvertor.Decode(data, location, 2);
            last.FormOfWay          = FormOfWayConvertor.Decode(data, location, 5);
            location = location + 1;
            last.LowestFunctionalRoadClassToNext = FunctionalRoadClassConvertor.Decode(data, location, 0);
            last.Bearing = BearingConvertor.DecodeAngleFromBearing(BearingConvertor.Decode(data, location, 3));
            location     = location + 1;

            // create line location.
            var lineLocation = new ClosedLineLocation();

            lineLocation.First        = first;
            lineLocation.Intermediate = intermediateList.ToArray();
            lineLocation.Last         = last;
            return(lineLocation);
        }
Example #17
0
        public void TestDecoding1()
        {
            double delta = 0.0001;

            // manually specify a binary coordinate.
            byte[] data = new byte[6];
            data[0] = 0;
            data[1] = 0;
            data[2] = 0;
            data[3] = 0;
            data[4] = 0;
            data[5] = 0;

            // decode the coordinate.
            var coordinate = CoordinateConverter.Decode(data);

            Assert.IsNotNull(coordinate);
            Assert.AreEqual(0, coordinate.Latitude);
            Assert.AreEqual(0, coordinate.Longitude);

            // manually specify a binary coordinate.
            data[0] = 0;
            data[1] = 0;
            data[2] = 255;
            data[3] = 0;
            data[4] = 0;
            data[5] = 255;

            // decode the coordinate.
            coordinate = CoordinateConverter.Decode(data);

            Assert.IsNotNull(coordinate);
            Assert.AreEqual(0.005460978, coordinate.Latitude, delta);
            Assert.AreEqual(0.005460978, coordinate.Longitude, delta);

            // manually specify a binary coordinate (see example in OpenLR whitepaper).
            data[0] = 4;
            data[1] = 91;
            data[2] = 91;
            data[3] = 35;
            data[4] = 70;
            data[5] = 245;

            // decode the coordinate.
            coordinate = CoordinateConverter.Decode(data);

            Assert.IsNotNull(coordinate);
            Assert.AreEqual(49.60851, coordinate.Latitude, delta);
            Assert.AreEqual(6.12683, coordinate.Longitude, delta);

            // decode the coordinate (ensure full code coverage).
            coordinate = CoordinateConverter.Decode(data, 0);

            Assert.IsNotNull(coordinate);
            Assert.AreEqual(49.60851, coordinate.Latitude, delta);
            Assert.AreEqual(6.12683, coordinate.Longitude, delta);
        }
Example #18
0
        public ViewportInfo(double xmin, double xmax, double ymin, double ymax, WriteableBitmap wbitmap, CoordinateConverter converter)
        {
            this.xMin = xmin;
            this.xMax = xmax;
            this.yMin = ymin;
            this.yMax = ymax;

            this.wBitmap = wbitmap;
            this.converter = converter;
        }
Example #19
0
        public virtual void DrawYourself(DrawingContext context, CoordinateConverter converter, SnappingToolsPreferences preferences)
        {
            var relevantObjectPreferences = GetRelevantObjectPreferences(preferences);

            if (IsSelected)
            {
                DrawYourself(context, converter, relevantObjectPreferences, GetPenSelected(relevantObjectPreferences));
            }
            DrawYourself(context, converter, relevantObjectPreferences, GetPen(relevantObjectPreferences));
        }
        public override IEnumerable <Position> GetCurrentUserRoute()
        {
            var positions = _currentUserRoute?.Points.Select(r =>
            {
                var coord = MKMapPoint.ToCoordinate(r);
                return(CoordinateConverter.ConvertToAbstraction(coord));
            });

            return(positions);
        }
Example #21
0
        public void HorizontalToGoogleAndBackMinimum()
        {
            var s1     = new HorizontalCs(0, 0);
            var start  = CoordinateConverter.HorizontalToEquatorial(s1);
            var middle = CoordinateConverter.EquatorialToGoogleSky(start);
            var end    = CoordinateConverter.GoogleSkyToHorizonatal(middle);

            Assert.AreEqual(s1.Altitude, end.Altitude, DELTA);
            Assert.AreEqual(0, end.Azimuth, DELTA);
        }
        private async Task <IEnumerable <Position> > RequestMKMapRoutePoints(RouteModel route, CLLocationCoordinate2D from, CLLocationCoordinate2D to)
        {
            IEnumerable <Position> result = Enumerable.Empty <Position>();

            var userPlaceMark      = new MKPlacemark(from, new Foundation.NSDictionary());
            var incidencePlaceMark = new MKPlacemark(to, new Foundation.NSDictionary());

            var sourceItem = new MKMapItem(userPlaceMark);
            var destItem   = new MKMapItem(incidencePlaceMark);

            var request = new MapKit.MKDirectionsRequest
            {
                Source        = sourceItem,
                Destination   = destItem,
                TransportType = MKDirectionsTransportType.Automobile
            };

            var directions = new MKDirections(request);

            MKPolyline polyRoute = null;

            directions.CalculateDirections((response, error) =>
            {
                if (error != null)
                {
                    System.Diagnostics.Debug.WriteLine(error.LocalizedDescription);
                }
                else
                {
                    if (response.Routes.Any())
                    {
                        var firstRoute  = response.Routes.First();
                        polyRoute       = firstRoute.Polyline;
                        route.Distance += firstRoute.Distance;
                        route.Duration += firstRoute.ExpectedTravelTime / 60;
                    }
                }
            });

            do
            {
                await Task.Delay(100);
            }while (directions.Calculating);

            if (polyRoute != null)
            {
                result = polyRoute.Points.Select(s =>
                {
                    CLLocationCoordinate2D coordinate = MKMapPoint.ToCoordinate(s);
                    return(CoordinateConverter.ConvertToAbstraction(coordinate));
                });
            }

            return(result);
        }
        public void CoordinateConverter_ParseNullCoordinates_ThrowArgumentNullException()
        {
            // 1. Prepare
            // Nothing to prepare

            // 2. Execute
            Action a = () => CoordinateConverter.ParseCoordinates(null);

            // 3. Verify
            Assert.Throws <ArgumentNullException>(a);
        }
Example #24
0
        private void UnloadFarDistanceChunks()
        {
            ChunkOffset chunkOffset = CoordinateConverter.ToChunkPosition(_player.Position);

            lock (_lockList)
            {
                _chunks.RemoveAll(chunk => Math.Abs(chunkOffset.X - chunk.Offset.X) > GameConfig.ViewDistance + 1 ||
                                  Math.Abs(chunkOffset.Y - chunk.Offset.Y) > GameConfig.ViewDistance + 1 ||
                                  Math.Abs(chunkOffset.Z - chunk.Offset.Z) > GameConfig.ViewDistance + 1);
            }
        }
Example #25
0
        public void EquatorialToHorizontalAndBack()
        {
            var s1     = new HorizontalCs(360, 90);
            var start  = CoordinateConverter.HorizontalToEquatorial(s1);
            var middle = CoordinateConverter.EquatorialToHorizontal(start);
            var end    = CoordinateConverter.HorizontalToEquatorial(middle);

            Assert.AreEqual(start.RightAscension, end.RightAscension, DELTA);
            Assert.AreEqual(start.HourAngle, start.HourAngle, DELTA);
            Assert.AreEqual(start.Declination, start.Declination, DELTA);
        }
        public void CoordinateConverter_ParseInvalidCoordinates_ThrowFormatException(string s)
        {
            // 1. Prepare
            // Nothing to prepare

            // 2. Execute
            Action a = () => CoordinateConverter.ParseCoordinates(s);

            // 3. Verify
            Assert.Throws <FormatException>(a);
        }
Example #27
0
        private Position GetIconPosition(DependencyObject icon)
        {
            if (icon == null)
            {
                return(default(Position));
            }

            Geopoint geoLocation = MapControl.GetLocation(icon);

            return(CoordinateConverter.ConvertToAbstraction(geoLocation));
        }
Example #28
0
        private void GetBlock(string blockId)
        {
            Block b = Core.Blocks.FirstOrDefault(block => block.Id == blockId);

            Console.WriteLine($"{b.Id} {FormatCoordinates(b.Position)}");

            foreach (BlockFace face in b.Faces)
            {
                SphericalVector ccf = CoordinateConverter.ConvertToSpherical(face.Position);
                System.Console.WriteLine($"{face.Id} {FormatCoordinates(face.Position)} {FormatCoordinates(ccf)}");
            }
        }
Example #29
0
    private void ProcessMapInfo()
    {
        BinaryFileMapInfo info = BinaryFileMapInfo.Parse(data[mapInfoKey]);

        cellsize = (float)info.pixelSize;
        CoordinateConverter conv = new CoordinateConverter(cellsize);
        int deltaX = 1 - info.refX;           // Lower left corner is map point (0, rows). The hdr top left coordinates are (1,1).
        int deltaY = -(rows + 1) + info.refY; // The amount of y pixels to move to reach lower left corner from reference point.

        lowerLeftCornerX = conv.TransformCoordinateByWebMercatorDistance(deltaX, info.refEasting);
        lowerLeftCornerY = conv.TransformCoordinateByWebMercatorDistance(deltaY, info.refNorthing);
    }
        protected override void DrawCalculatedRouteInMap(RouteModel route)
        {
            var drawingManager = new MapDrawingManager(FormsMap, route.Color);

            _nativeMap.OverlayRenderer = drawingManager.GetOverlayRenderer;

            var nativeCoordinates = route.RoutePoints.Select(p => CoordinateConverter.ConvertToNative(p));

            _currentUserRoute = MKPolyline.FromCoordinates(nativeCoordinates.ToArray());

            _nativeMap.AddOverlay(_currentUserRoute);
        }
Example #31
0
        public void Converter(double lat, double lng)
        {
            //初始化坐标转换工具类,指定源坐标类型和坐标数据
            CoordinateConverter converter = new CoordinateConverter()
                                            .From(CoordinateConverter.CoordType.Gps)
                                            .Coord(new Com.Baidu.Mapapi.Model.LatLng(lat, lng));
            //desLatLng 转换后的坐标
            var lct = converter.Convert();

            System.Diagnostics.Debug.Print($"{lct.Latitude} {lct.Longitude}");
            GlobalSettings.UpdatePoi(lct.Latitude, lct.Longitude);
        }
		private void InitView()
		{
			//设置标题栏

			var img_header_back = FindViewById<ImageView> (Resource.Id.img_header_back);
			img_header_back.Click += (sender, e) => 
			{
				this.Finish();
				OverridePendingTransition(Android.Resource.Animation.SlideInLeft,Android.Resource.Animation.SlideOutRight);
			};
			var bundle = Intent.Extras;
			var alarmPosition = bundle.GetString ("alarmPosition");
			if (!string.IsNullOrEmpty (alarmPosition) && alarmPosition.Contains (",")) {
				var Positions =  alarmPosition.Split(new char[]{','});
				nPosition =  Convert.ToDouble(Positions [0].Substring (1));
				ePosition =  Convert.ToDouble(Positions [1].Substring (1));
			}
				
			var tv_back = FindViewById<TextView> (Resource.Id.tv_back);
			tv_back.Text = "报警详细";
			var tv_desc = FindViewById<TextView> (Resource.Id.tv_desc);
			tv_desc.Text = "报警位置显示";

			mMapView = FindViewById<MapView> (Resource.Id.bmap_view);
			bdMap = mMapView.Map;
			bdMap.MapType = BaiduMap.MapTypeNormal;
			LatLng sourceLatLng = new LatLng(nPosition,ePosition);
     		// 将GPS设备采集的原始GPS坐标转换成百度坐标  
			CoordinateConverter converter  = new CoordinateConverter();  
			converter.From(Com.Baidu.Mapapi.Utils.CoordinateConverter.CoordType.Gps);  
			// sourceLatLng待转换坐标  
			converter.Coord(sourceLatLng);  
			LatLng desLatLng = converter.Convert();
			//构建MarkerOption,用于在地图上添加Marker
			//构建Marker图标  
			BitmapDescriptor bitmap = BitmapDescriptorFactory  
				.FromResource(Resource.Drawable.ic_map);  
			OverlayOptions option = new MarkerOptions().InvokePosition (desLatLng).InvokeIcon(bitmap).Draggable(true).InvokeZIndex(9);

			//在地图上添加Marker,并显示  
			bdMap.AddOverlay(option);
			// 将地图移动到覆盖物位置  
			MapStatusUpdate u = MapStatusUpdateFactory.NewLatLng(desLatLng);
			bdMap.SetMapStatus(u);

		}