Beispiel #1
0
        /// <summary>
        /// Return result of WKT Service call
        /// Render geometry to layer
        /// </summary>
        /// <remarks>
        /// if result is greater than recordLimit show a message to reduce area of interest
        /// </remarks>
        private void GetDataWktCompleted(object sender, GetSQLDataWKTCompletedEventArgs e)
        {
            string layer = e.UserState.ToString();

            if (e.Error == null)
            {
                if (e.Result.ErrorCode == 0)
                {
                    MapLayer currentLayer = (MapLayer)MainMap.FindName(layer);
                    currentLayer.Children.Clear();
                    int resultCnt = e.Result.OutputShapes.Count;
                    if (resultCnt > 0)
                    {
                        if (resultCnt < recordLimit)
                        {
                            totalFeatures += e.Result.OutputShapes.Count;

                            queryTime   = e.Result.QueryTime;
                            renderStart = DateTime.Now;
                            foreach (WKTServiceReference.WKTShape shp in e.Result.OutputShapes)
                            {
                                totalByteSize += shp.WKT.Length;
                                RenderGeometry(shp, currentLayer);
                            }
                            renderStop = DateTime.Now;
                        }
                        else
                        {
                            ShowMessage("Too many records for Vector display, " + resultCnt + ". Try a smaller area of interest.");
                        }
                    }
                }
                else
                {
                    if (e.Result.ErrorCode != 2)
                    {
                        ShowMessage(e.Result.OutputMessage);
                    }
                    else
                    {
                        ShowMessage("Too many records for Vector display. Try a smaller area of interest.");
                    }
                }
            }
            else
            {
                ShowMessage("Error occurred while loading layer from database:" + e.Error.Message);
            }
            // if this is the last layer call cleanup loading and allow menu interaction
            if (--layerCnt == 0)
            {
                SidePanelBorder.IsHitTestVisible = true;
                loaderStop();
            }
            //update metrics
            ((TextBlock)metrics.FindName("features")).Text = totalFeatures.ToString();
            ((TextBlock)metrics.FindName("points")).Text   = totalPoints.ToString();
            ((TextBlock)metrics.FindName("bytesize")).Text = totalByteSize.ToString();
        }
Beispiel #2
0
        /// <summary>
        /// Return result of WKT Service call
        /// Render geometry to layer
        /// </summary>
        /// <remarks>
        /// if result is greater than recordLimit show a message to reduce area of interest
        /// </remarks>
        private void GetDataWktCompleted(object sender, GetSQLDataWKTCompletedEventArgs e)
        {
            string layer = e.UserState.ToString();
            if (e.Error == null)
            {
                if (e.Result.ErrorCode == 0)
                {
                    MapLayer currentLayer = (MapLayer)MainMap.FindName(layer);
                    currentLayer.Children.Clear();
                    int resultCnt = e.Result.OutputShapes.Count;
                    if (resultCnt > 0)
                    {
                        if (resultCnt < recordLimit)
                        {
                            totalFeatures += e.Result.OutputShapes.Count;

                            queryTime = e.Result.QueryTime;
                            renderStart = DateTime.Now;
                            foreach (WKTServiceReference.WKTShape shp in e.Result.OutputShapes)
                            {
                                totalByteSize += shp.WKT.Length;
                                RenderGeometry(shp, currentLayer);
                            }
                            renderStop = DateTime.Now;
                        }
                        else
                        {
                            ShowMessage("Too many records for Vector display, " + resultCnt + ". Try a smaller area of interest.");
                        }
                    }
                }
                else
                {
                    if (e.Result.ErrorCode != 2) ShowMessage(e.Result.OutputMessage);
                    else ShowMessage("Too many records for Vector display. Try a smaller area of interest.");
                }
            }
            else
            {
                ShowMessage("Error occurred while loading layer from database:" + e.Error.Message);
            }
            // if this is the last layer call cleanup loading and allow menu interaction
            if (--layerCnt == 0)
            {
                SidePanelBorder.IsHitTestVisible = true;
                loaderStop();
            }
            //update metrics
            ((TextBlock)metrics.FindName("features")).Text = totalFeatures.ToString();
            ((TextBlock)metrics.FindName("points")).Text = totalPoints.ToString();
            ((TextBlock)metrics.FindName("bytesize")).Text = totalByteSize.ToString();
        }