void locationControl1_NewExtents(object sender, NewExtentsEventArgs e)
        {
            if (!e.Validate())
            {
                MessageHelper.Warn("Invalid extents.");
                return;
            }

            var map = App.Map;

            if (App.Map.GeoProjection.IsEmpty && App.Map.NumLayers == 0)
            {
                App.Map.Projection = tkMapProjection.PROJECTION_GOOGLE_MERCATOR;
            }

            switch (e.ExtentsType)
            {
            case ExtentType.Geogrpahic:
                if (!map.SetGeographicExtents(e.GeographicExtents))
                {
                    MessageHelper.Warn("Failed to set geographic extents: " + map.get_ErrorMsg(map.LastErrorCode));
                }
                break;

            case ExtentType.Projected:
                map.Extents = e.ProjExtents;
                break;

            case ExtentType.Known:
                map.KnownExtents = e.KnownExtents;
                break;
            }
        }
Beispiel #2
0
        protected virtual void OnNewExtents(NewExtentsEventArgs e)
        {
            if (!string.IsNullOrWhiteSpace(GeoLocationHelper.License))
            {
                lblLicense.Text = GeoLocationHelper.License;
            }

            var handler = NewExtents;

            if (handler != null)
            {
                handler(this, e);
            }
        }