Example #1
0
        protected virtual void UpdateData()
        {
            if (parentMap != null && Data != null && Location != null)
            {
                var location = Location;
                var viewPos  = parentMap.LocationToView(location);

                if (parentMap.MapProjection.IsNormalCylindrical &&
                    (viewPos.X < 0d || viewPos.X > parentMap.RenderSize.Width ||
                     viewPos.Y < 0d || viewPos.Y > parentMap.RenderSize.Height))
                {
                    var constrainedLongitude = parentMap.ConstrainedLongitude(location.Longitude);
                    if (constrainedLongitude != location.Longitude)
                    {
                        location = new Location(location.Latitude, constrainedLongitude);
                        viewPos  = parentMap.LocationToView(location);
                    }
                }

                var scale     = parentMap.GetScale(location);
                var transform = new Matrix(scale.X, 0d, 0d, scale.Y, 0d, 0d);

                transform.Rotate(parentMap.ViewTransform.Rotation);
                transform.Translate(viewPos.X, viewPos.Y);

                Data.Transform = new MatrixTransform {
                    Matrix = transform
                };
            }
        }
Example #2
0
        protected virtual void UpdateData()
        {
            MapPanel.SetLocation(this, Location);

            if (parentMap != null && Data != null && Location != null)
            {
                var scale     = parentMap.GetScale(Location);
                var transform = new Matrix(scale.X, 0d, 0d, scale.Y, 0d, 0d);

                transform.Rotate(parentMap.ViewTransform.Rotation);

                Data.Transform = new MatrixTransform {
                    Matrix = transform
                };
            }
        }
Example #3
0
        protected virtual void UpdateData()
        {
            if (parentMap != null && Data != null && Location != null)
            {
                if (dataTransform == null)
                {
                    Data.Transform = dataTransform = new MatrixTransform();
                }

                var viewPos   = LocationToView(Location);
                var scale     = parentMap.GetScale(Location);
                var transform = new Matrix(scale.X, 0d, 0d, scale.Y, 0d, 0d);
                transform.Rotate(parentMap.ViewTransform.Rotation);
                transform.Translate(viewPos.X, viewPos.Y);
                dataTransform.Matrix = transform;
            }
        }