コード例 #1
0
        private void updateSize()
        {
            Size newSize = getCurrentSize();
            Size oldSize = getSize();

            if (oldSize == Size.Empty)
            {
                _size = oldSize = newSize;
            }
            if (!newSize.Equals(oldSize))
            {
                _size = newSize;

                // @@@ notify layers on resize?

                if (_baseLayer != null)
                {
                    Pixel  center = new Pixel((float)(newSize.Width / 2), (float)(newSize.Height / 2));
                    LonLat lonlat = getLonLatFromViewPortPx(center);
                    int    zoom   = getZoom().Value;
                    _zoom = null;
                    setCenter(getCenter(), zoom, null, null);
                }
            }
        }
コード例 #2
0
        public LonLat getLonLatFromViewPortPx(Pixel viewPortPx)
        {
            LonLat lonlat = null;

            if (viewPortPx != null)
            {
                Size   size   = _map.getSize();
                LonLat center = _map.getCenter();
                if (center != null)
                {
                    float res = _map.getResolution().Value;

                    float delta_x = (float)(viewPortPx.x - (size.Width / 2));
                    float delta_y = (float)(viewPortPx.y - (size.Height / 2));

                    lonlat = new LonLat(center.lon + delta_x * res,
                                        center.lat - delta_y * res);

                    if (_wrapDateLine)
                    {
                        lonlat = lonlat.wrapDateLine(_maxExtent);
                    }
                }
            }
            return(lonlat);
        }
コード例 #3
0
ファイル: Layer.cs プロジェクト: mustafayalcin/sharplayers
        public LonLat getLonLatFromViewPortPx(Pixel viewPortPx)
        {
            LonLat lonlat = null;
            if (viewPortPx != null)
            {
                Size size = _map.getSize();
                LonLat center = _map.getCenter();
                if (center != null)
                {
                    float res = _map.getResolution().Value;

                    float delta_x = (float)(viewPortPx.x - (size.Width / 2));
                    float delta_y = (float)(viewPortPx.y - (size.Height / 2));

                    lonlat = new LonLat(center.lon + delta_x * res,
                                                center.lat - delta_y * res);

                    if (_wrapDateLine)
                    {
                        lonlat = lonlat.wrapDateLine(_maxExtent);
                    }
                }
            }
            return lonlat;
        }
コード例 #4
0
        private LonLat getLonLatFromViewPortPx(Pixel viewPortPx)
        {
            LonLat lonlat = null;

            if (_baseLayer != null)
            {
                lonlat = _baseLayer.getLonLatFromViewPortPx(viewPortPx);
            }

            return(lonlat);
        }
コード例 #5
0
ファイル: LonLat.cs プロジェクト: mustafayalcin/sharplayers
        public LonLat wrapDateLine(Rect maxExtent)
        {
            LonLat newLonLat = new LonLat(this);

            if (maxExtent != Rect.Empty)
            {
                while (newLonLat.lon < maxExtent.X)
                {
                    newLonLat.lon += (float)maxExtent.Width;
                }

                while (newLonLat.lon > maxExtent.Right)
                {
                    newLonLat.lon -= (float)maxExtent.Width;
                }
            }

            return newLonLat;
        }
コード例 #6
0
        public LonLat wrapDateLine(Rect maxExtent)
        {
            LonLat newLonLat = new LonLat(this);

            if (maxExtent != Rect.Empty)
            {
                while (newLonLat.lon < maxExtent.X)
                {
                    newLonLat.lon += (float)maxExtent.Width;
                }

                while (newLonLat.lon > maxExtent.Right)
                {
                    newLonLat.lon -= (float)maxExtent.Width;
                }
            }

            return(newLonLat);
        }
コード例 #7
0
ファイル: LonLat.cs プロジェクト: mustafayalcin/sharplayers
 public LonLat(LonLat c)
 {
     this._lat = c._lat;
     this._lon = c._lon;
 }
コード例 #8
0
 public void setCenter(LonLat lonlat, int zoom, bool?dragging, bool?forceZoomChange)
 {
     //moveTo(lonlat,
 }
コード例 #9
0
 public LonLat(LonLat c)
 {
     this._lat = c._lat;
     this._lon = c._lon;
 }
コード例 #10
0
ファイル: Map.cs プロジェクト: mustafayalcin/sharplayers
 public void setCenter(LonLat lonlat, int zoom, bool? dragging, bool? forceZoomChange)
 {
     //moveTo(lonlat, 
 }