コード例 #1
0
ファイル: MainPage.xaml.cs プロジェクト: MikeH2012/xaml-sdk
 private IEnumerable <object> GetIEnumerable(InformationLayer layer)
 {
     foreach (var item in layer.Items)
     {
         yield return(item);
     }
 }
コード例 #2
0
        void CheckItinerary()
        {
            InformationLayer  routeLayer  = parentModel.Navigator.RouteLayer;
            GeoPoint          location    = routeLayer.MapUnitToGeoPoint(currentPoint);
            BingItineraryItem currentItem = itineraryItems[0];
            Size   geoSize    = new Size(Math.Abs(location.Latitude - currentItem.Location.Latitude), Math.Abs(location.Longitude - currentItem.Location.Longitude));
            Size   metricSize = routeLayer.GeoToKilometersSize(location, geoSize);
            double distance   = Math.Sqrt(metricSize.Width * metricSize.Width + metricSize.Height * metricSize.Height);

            if (distance < 0.005)
            {
                if (itineraryItems.Count > 1)
                {
                    itineraryItems.Remove(currentItem);
                }
                else
                {
                    distance = 0.0;
                }
            }
            if (distance > 0.0)
            {
                ActionText = CommonUtils.GetUserFriendlyEnumString(itineraryItems[0].Maneuver) + " after " + ((distance > 0.9) ? String.Format("{0:0} km", Math.Ceiling(distance)) : String.Format("{0:0} m", Math.Ceiling(distance * 10) * 100));
            }
            else
            {
                ActionText = "Finish! Click Stop and Clear to set a new route.";
            }
        }
コード例 #3
0
        public UIElement CreateMap()
        {
            _radMap = new RadMap
            {
                ZoomLevel                        = 3,
                MinZoomLevel                     = 3,
                MaxZoomLevel                     = 6,
                CommandBarVisibility             = Visibility.Hidden,
                NavigationVisibility             = Visibility.Hidden,
                ZoomBarVisibility                = Visibility.Hidden,
                ScaleVisibility                  = Visibility.Hidden,
                MiniMapExpanderVisibility        = Visibility.Hidden,
                MouseLocationIndicatorVisibility = Visibility.Hidden,
                UseSpringAnimations              = true,
                MouseClickMode                   = MouseBehavior.None
            };

            _radMap.InitializeCompleted += MapInitializeCompleted;
            _radMap.Provider             = GetMapProvider();
            var informationLayer = new InformationLayer {
                Visibility = Visibility.Visible
            };

            _informationLayer = informationLayer;
            _radMap.Items.Add(_informationLayer);
            return(_radMap);
        }
コード例 #4
0
ファイル: MainWindow.xaml.cs プロジェクト: jigjosh/xaml-sdk
 private IEnumerable<object> GetIEnumerable(InformationLayer layer)
 {
     foreach (var item in layer.Items)
     {
         yield return item;
     }
 }
コード例 #5
0
ファイル: queryLayer.cs プロジェクト: foobit/ChipmunkSharp
        public override void OnEnter()
        {
            base.OnEnter();


            QUERY_START = new cpVect(320, 240);

            font          = GetDefaultFontTtf("TEST");
            font.Position = new CCPoint((float)windowSize.Width * .5f, 10);
            InformationLayer.AddChild(font);
            font.Scale = .5f;

            space.SetIterations(5);

            {             // add a fat segment
                var    mass = 1;
                var    length = 100;
                cpVect a = new cpVect(-length / 2, 0), b = new cpVect(length / 2, 0);

                var body = space.AddBody(new cpBody(mass, cp.MomentForSegment(mass, a, b, 0.0f)));
                body.SetPosition(new cpVect(0.0f, 100.0f));

                space.AddShape(new cpSegmentShape(body, a, b, 20));
            }

            {             // add a static segment
                space.AddShape(new cpSegmentShape(space.GetStaticBody(), new cpVect(0, 300), new cpVect(300, 0), 0));
            }

            {             // add a pentagon
                float mass      = 1;
                int   NUM_VERTS = 5;

                cpVect[] verts = new cpVect[NUM_VERTS];
                for (int i = 0; i < NUM_VERTS; i++)
                {
                    float angle = -2 * cp.M_PI * i / (NUM_VERTS);
                    verts[i] = cpVect.cpv(30 * cp.cpfcos(angle), 30 * cp.cpfsin(angle));
                }


                var body = space.AddBody(new cpBody(mass, cp.MomentForPoly(mass, NUM_VERTS, verts, cpVect.Zero, 0.0f)));
                body.SetPosition(new cpVect(50.0f, 30.0f));

                space.AddShape(new cpPolyShape(body, NUM_VERTS, verts, cpTransform.Identity, 10f));
            }

            {             // add a circle
                var mass = 1;
                var r    = 20;

                var body = space.AddBody(new cpBody(mass, cp.MomentForCircle(mass, 0, r, new cpVect(0, 0))));
                body.SetPosition(new cpVect(100.0f, 100.0f));

                space.AddShape(new cpCircleShape(body, r, cpVect.Zero));
            }

            Schedule();
        }
コード例 #6
0
        /// <summary>
        /// Creates a subscene player
        /// </summary>
        /// <param name="subScenes"></param>
        public void CreateSubScenePlayer(int subScenes)
        {
            var menu = GetPlayerSubLayer();

            menuLayerPlayer.AnchorPoint = new CCPoint(0, 0);
            menu.Position = new CCPoint(Window.WindowSizeInPixels.Width * .67f, Window.WindowSizeInPixels.Height * .05f);
            InformationLayer.AddChild(menu);
            SubScenePlayer.Count = subScenes - 1;
        }
コード例 #7
0
        public override InformationDataProviderBase CreateDataProvider(InformationLayer layer, string search, int resultCount)
        {
            GeoPoint anchorPoint = null;

            if (AnchorPoint != null && AnchorPoint.Length > 0 && AnchorPoint.Length != 2)
            {
                throw new Exception("Invalid anchor point. Shall be a double array with 2 elements.");
            }

            if (AnchorPoint != null && AnchorPoint.Length == 2)
            {
                anchorPoint = new GeoPoint(AnchorPoint[0], AnchorPoint[1]);
            }

            SearchBoundingBox boundingBox = null;

            if (BoundingBox != null && BoundingBox.Length > 0 && BoundingBox.Length != 4)
            {
                throw new Exception("Invalid bounding box. Shall be a double array with 4 elements.");
            }

            if (BoundingBox != null && BoundingBox.Length == 4)
            {
                boundingBox = new SearchBoundingBox(BoundingBox[0], BoundingBox[1], BoundingBox[2], BoundingBox[3]);
            }

            var provider = new BingSearchDataProvider()
            {
                BingKey               = Parameters.BingMapKey,
                ConnectionProtocol    = ConnectionProtocol.Https,
                GenerateLayerItems    = true,
                MaxVisibleResultCount = resultCount,
                ProcessMouseEvents    = false
            };

            provider.SearchOptions.ResultsCount = resultCount;

            layer.DataProvider = provider;

            /*
             * var completion = new TaskCompletionSource<InformationDataProviderBase>();
             *
             * provider.SearchCompleted += (s, e) =>
             * {
             *      completion.SetResult(provider);
             * };
             */

            provider.Search(search, Culture, anchorPoint, boundingBox);

            //return completion.Task.Result;
            return(provider);
        }
コード例 #8
0
        private void SetUpMapShapes(InformationLayer layer)
        {
            foreach (MapShape seatShape in layer.Items)
            {
                seatShape.MouseLeftButtonDown += this.ShapeMouseLeftButtonDown;
                seatShape.CaptionTemplate = this.Resources["ShapeDataTemplate"] as DataTemplate;
                seatShape.CaptionLocation = seatShape.GeographicalBounds.Center;

                int seatId = int.Parse(seatShape.ExtendedData.GetValue("ID").ToString(), CultureInfo.InvariantCulture);
                seatShape.Tag = seatId;
            }
        }
コード例 #9
0
        protected internal virtual void CreateLayer(SCMap map, InformationDataProviderBase provider)
        {
            var layer = new InformationLayer()
            {
                EnableHighlighting = false,
                EnableSelection    = false
            };

            if (layer.DataProvider == null)
            {
                layer.DataProvider = provider;
            }

            map.Map.Layers.Add(layer);
            map.CurrentLayer = layer;
        }
コード例 #10
0
        public override InformationDataProviderBase CreateDataProvider(InformationLayer layer, int resultCount)
        {
            var provider = new BingRouteDataProvider()
            {
                BingKey               = Parameters.BingMapKey,
                ConnectionProtocol    = ConnectionProtocol.Https,
                GenerateLayerItems    = true,
                MaxVisibleResultCount = resultCount,
                ProcessMouseEvents    = false
            };

            if (AvoidRoads.HasValue)
            {
                provider.RouteOptions.AvoidRoads = AvoidRoads.Value;
            }
            if (DistanceUnit.HasValue)
            {
                provider.RouteOptions.DistanceUnit = DistanceUnit.Value;
            }
            if (Mode.HasValue)
            {
                provider.RouteOptions.Mode = Mode.Value;
            }
            if (RouteOptimization.HasValue)
            {
                provider.RouteOptions.RouteOptimization = RouteOptimization.Value;
            }

            var wayPoints = new List <RouteWaypoint>();

            if (WayPoints == null || WayPoints.Length < 1)
            {
                throw new Exception("Route requires at least 1 way point.");
            }

            foreach (var bingWayPoint in WayPoints)
            {
                var wayPoint = ConvertWayPoint(bingWayPoint);
                wayPoints.Add(wayPoint);
            }

            layer.DataProvider = provider;

            provider.CalculateRoute(wayPoints, Culture, null);

            return(provider);
コード例 #11
0
        private void MapShapeReader_ReadCompleted(object sender, ReadShapesCompletedEventArgs eventArgs)
        {
            InformationLayer layer = (sender as MapShapeReader).Layer;

            // extract the seat colorization information from the data attributes
            foreach (MapShape shape in layer.Items)
            {
                byte red   = byte.Parse(shape.ExtendedData.GetValue("RGB0").ToString(), CultureInfo.InvariantCulture);
                byte green = byte.Parse(shape.ExtendedData.GetValue("RGB1").ToString(), CultureInfo.InvariantCulture);
                byte blue  = byte.Parse(shape.ExtendedData.GetValue("RGB2").ToString(), CultureInfo.InvariantCulture);

                shape.Fill = new SolidColorBrush(Color.FromArgb(255, red, green, blue));
                shape.MouseLeftButtonDown += Shape_MouseLeftButtonDown;
            }

            // make sure the map zoom / center settings ensure best view of the loaded shapes
            this.SetBestView(layer);
        }
コード例 #12
0
        private void PrepareMap()
        {
            // Create a map control.
            map = new MapControl();

            // Specify the map position on the form.
            map.Dock = DockStyle.Fill;

            // Add the map control to the window.
            this.Controls.Add(map);

            // Bring the map to the front.
            map.BringToFront();

            // Create an image tiles layer and add it to the map.
            ImageLayer tilesLayer = new ImageLayer();

            map.Layers.Add(tilesLayer);

            // Create an information layer and add it to the map.
            InformationLayer infoLayer = new InformationLayer();

            map.Layers.Add(infoLayer);

            VectorItemsLayer items = new VectorItemsLayer();

            items.Data = new MapItemStorage();
            map.Layers.Add(items);

            // Create a Bing data provider and specify the Bing key.
            BingMapDataProvider bingProvider = new BingMapDataProvider();

            tilesLayer.DataProvider = bingProvider;
            bingProvider.BingKey    = yourBingKey;

            // Create a Bing search data provider and specify the Bing key.
            searchProvider                    = new BingSearchDataProvider();
            infoLayer.DataProvider            = searchProvider;
            searchProvider.GenerateLayerItems = false;
            searchProvider.BingKey            = yourBingKey;
            map.ShowSearchPanel               = false;
        }
コード例 #13
0
ファイル: MainWindow.xaml.cs プロジェクト: MikeH2012/xaml-sdk
        private void MapShapeReader_ReadCompleted(object sender, ReadShapesCompletedEventArgs eventArgs)
        {
            InformationLayer layer = (sender as MapShapeReader).Layer;

            // extract the seat colorization information from the data attributes
            foreach (MapShape shape in layer.Items)
            {
                byte red   = byte.Parse(shape.ExtendedData.GetValue("RGB0").ToString(), CultureInfo.InvariantCulture);
                byte green = byte.Parse(shape.ExtendedData.GetValue("RGB1").ToString(), CultureInfo.InvariantCulture);
                byte blue  = byte.Parse(shape.ExtendedData.GetValue("RGB2").ToString(), CultureInfo.InvariantCulture);

                shape.Fill = new SolidColorBrush(Color.FromArgb(255, red, green, blue));
                shape.MouseLeftButtonDown += Shape_MouseLeftButtonDown;
            }

            if (!layer.IsArrangeValid)
            {
                RadMap1.LayoutUpdated += this.RadMap1_LayoutUpdated;
                return;
            }
        }
コード例 #14
0
        bool Advance()
        {
            if (routeNodeIndex < (routePath.Count - 1))
            {
                routeNodeIndex++;
                InformationLayer routeLayer = parentModel.Navigator.RouteLayer;
                baseLocation    = targetLocation;
                currentPoint    = routeLayer.GeoPointToMapUnit(baseLocation);
                targetLocation  = routePath[routeNodeIndex];
                basePoint       = routeLayer.GeoPointToMapUnit(baseLocation);
                targetPoint     = routeLayer.GeoPointToMapUnit(targetLocation);
                distance        = DriveModel.DistanceBetweenPoints(targetPoint, basePoint);
                currentDistance = 0;

                drivePath.Points[drivePath.Points.Count - 1] = baseLocation;
                drivePath.Points.Add(baseLocation);

                CheckItinerary();
                CheckRoutePushpins(baseLocation);

                if (!animationTimer.IsEnabled)
                {
                    animationTimer.Start();
                }
                return(true);
            }
            else
            {
                if (routePushpins.Count > 0)
                {
                    routePushpins[routePushpins.Count - 1].Brush = parentModel.Navigator.DriveBrush;
                }
                if (animationTimer.IsEnabled)
                {
                    animationTimer.Stop();
                }
                drivePushpin.Visible = false;
                return(false);
            }
        }
コード例 #15
0
        public override InformationDataProviderBase CreateDataProvider(InformationLayer layer, string search, int resultCount)
        {
            SearchBoundingBox boundingBox = null;

            if (BoundingBox != null && BoundingBox.Length > 0 && BoundingBox.Length != 4)
            {
                throw new Exception("Invalid bounding box. Shall be a double array with 4 elements.");
            }

            if (BoundingBox != null && BoundingBox.Length == 4)
            {
                boundingBox = new SearchBoundingBox(BoundingBox[0], BoundingBox[1], BoundingBox[2], BoundingBox[3]);
            }

            var provider = new OsmSearchDataProvider()
            {
                GenerateLayerItems    = true,
                MaxVisibleResultCount = resultCount,
                ResultsCount          = resultCount,
                ProcessMouseEvents    = false
            };

            layer.DataProvider = provider;

            /*
             * var completion = new TaskCompletionSource<InformationDataProviderBase>();
             *
             * provider.SearchCompleted += (s, e) =>
             * {
             *      completion.SetResult(provider);
             * };
             */

            provider.Search(search, Culture, CountryCodes, boundingBox, resultCount);

            //return completion.Task.Result;

            return(provider);
        }
コード例 #16
0
        protected InformationLayer CreateLayer()
        {
            var layer = new InformationLayer()
            {
                EnableHighlighting = false,
                EnableSelection    = false
            };

            if (_SearchLayerContext != null)
            {
                _SearchLayerContext.MapContext = MapContext;
            }

            var provider = _SearchLayerContext?.CreateDataProvider(layer, Search, ResultCount) ?? throw new Exception("Cannot create search provider.");

            if (layer.DataProvider == null)
            {
                layer.DataProvider = provider;
            }

            return(layer);
        }
コード例 #17
0
        public UIElement CreateMap()
        {
            _radMap = new RadMap
                          {
                              ZoomLevel = 3,
                              MinZoomLevel = 3,
                              MaxZoomLevel = 6,
                              CommandBarVisibility = Visibility.Hidden,
                              NavigationVisibility = Visibility.Hidden,
                              ZoomBarVisibility = Visibility.Hidden,
                              ScaleVisibility = Visibility.Hidden,
                              MiniMapExpanderVisibility = Visibility.Hidden,
                              MouseLocationIndicatorVisibility = Visibility.Hidden,
                              UseSpringAnimations = true,
                              MouseClickMode = MouseBehavior.None
                          };

            _radMap.InitializeCompleted += MapInitializeCompleted;
            _radMap.Provider = GetMapProvider();
            var informationLayer = new InformationLayer {Visibility = Visibility.Visible};
            _informationLayer = informationLayer;
            _radMap.Items.Add(_informationLayer);
            return _radMap;
        }
コード例 #18
0
        void layer_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            if (infoLayer1.Tag != null)
            {
                infoLayer1.ItemTemplate = layerDetayOut.ItemTemplate;
            }

            int index = int.Parse(((InformationLayer)sender).Tag.ToString());
            Entities.Data = Entities.DatasList[index];
            Entities.Arac = Entities.AraclarList[index];
            
            //for (int i = 0; i < Entities.AracDataList.Count; i++)
            //{
            //    Entities.AracDataList[i].Secili = false;
            //}
            Entities.SeciliArcIndex = index;

            ((InformationLayer)sender).Items.Add(Entities.AracDataList[index]);
            ((InformationLayer)sender).ItemTemplate = layerDetayIn.ItemTemplate;
            infoLayer1 = ((InformationLayer)sender);
        }
コード例 #19
0
        private void informationLayer_MouseLeave(object sender, MouseEventArgs e)
        {
                int index = int.Parse(((InformationLayer)sender).Tag.ToString());
                Entities.Data = Entities.DatasList[index];
                Entities.Arac = Entities.AraclarList[index];
                ((InformationLayer)sender).ItemTemplate = layerDetayOut.ItemTemplate;
                infoLayer1.ItemTemplate=layerDetayOut.ItemTemplate;
                infoLayer1 = new InformationLayer();
 
        }
コード例 #20
0
        private void DoubleAniEkle(InformationLayer layer)
        {
            Duration duration = new Duration(TimeSpan.FromMilliseconds(500));
            DoubleAnimation myDoubleAnimation1 = new DoubleAnimation();
            sb.Duration = duration;
            myDoubleAnimation1 = myDoubleAni;
            
            Storyboard.SetTarget(myDoubleAnimation1, layer);
            sb.Children.Add(myDoubleAnimation1);
            sb.Begin();

        }
コード例 #21
0
 private void layerPro(Location yer, int i)
 {
         InformationLayer layer = new InformationLayer();
         layer.Tag = i.ToString();
         layer.ItemTemplate = layerDetayOut.ItemTemplate;
        // layer.MouseEnter += new MouseEventHandler(informationLayer_MouseEnter);
         layer.MouseLeftButtonUp += new MouseButtonEventHandler(layer_MouseLeftButtonUp);
         layer.MouseLeave += new MouseEventHandler(informationLayer_MouseLeave);
         //layer.MouseLeftButtonUp += new MouseButtonEventHandler(layer_MouseLeftButtonDown);
         layer.Cursor = Cursors.Hand;
         layer.Items.Add(Entities.AracDataList[i]);
         layer.Items.Add(yer);
         RadMap1.Items.Add(layer);
         AracLayers.Add(layer);
       
 }
コード例 #22
0
        private void layerArcGuncelle()
        {
            if (RadMap1.Items.Count == 0)
                LayerKro();
            
            if (MapPaneFilter)
            for (int i = 0; i < Entities.DatasYol.Count; i++)
            {

                Entities.DatasList[i].DT_ENLEM = Entities.DatasList[i].DT_ENLEM;
                Entities.DatasYol[i].DT_ENLEM = Entities.DatasYol[i].DT_ENLEM;

                if (Entities.DatasYol[i].DT_ENLEM != null && Entities.DatasYol[i].DT_BOYLAM != null)
                {
                    double en = double.Parse(Entities.DatasYol[i].DT_ENLEM);
                    double boy = double.Parse(Entities.DatasYol[i].DT_BOYLAM);
                    Location yer = new Location(en, boy);

                    for (int j = 0; j < RadMap1.Items.Count; j++)
                    {
                        try
                        {
                            InformationLayer layer = new InformationLayer();
                            layer = (InformationLayer)RadMap1.Items[j];
                            if (layer.Tag != null)
                            {
                                if (layer.Tag.ToString() == i.ToString())
                                {
                                    for (int k = 0; k < layer.Items.Count; k++)
                                    {
                                        Location loc1 = new Location();
                                        Boolean bul = false;
                                        try
                                        {
                                            loc1 = (Location)layer.Items[k];
                                            bul = true;
                                            
                                                layer.Items.Clear();
                                                layer.Items.Add(Entities.AracDataList[i]);
                                                layer.Items.Add(yer);
                                                if (!PaneMap.IsHidden)
                                                    if (listBox1.SelectedIndex == i)
                                                        RadMap1.Center = yer;
                                            

                                        }
                                        catch
                                        {
                                            if (k == layer.Items.Count - 1 && bul == false)
                                                layerPro(yer, i);
                                        }
                                    }
                                    break;
                                }
                                if (j == RadMap1.Items.Count - 1)
                                    layerPro(yer, i);
                            }
                            else
                                if (j == RadMap1.Items.Count - 1)
                                {
                                    layerPro(yer, i);
                                }


                        }
                        catch { }
                    }

                }
            }
        }
コード例 #23
0
        private InformationLayer layerBul(string serino)
        {
            InformationLayer lyr1=new InformationLayer();
            for (int i = 0; i < RadAniMap.Items.Count; i++)
            {
                try
                {
                    lyr1 = ((InformationLayer)RadAniMap.Items[i]);
                    if (lyr1.Tag.ToString() == serino)
                        return lyr1;
                    else
                        lyr1 = null;
                }
                catch
                { 

                }
            }
            return lyr1;
        }
コード例 #24
0
 public virtual InformationDataProviderBase CreateDataProvider(InformationLayer layer, int resultCount)
 {
     return(null);
 }
コード例 #25
0
        protected internal virtual void CreateLayer(SCMap map, InformationDataProviderBase provider)
        {
            var layer = new InformationLayer()
            {
                EnableHighlighting = false,
                EnableSelection    = false,
                DataProvider       = provider
            };

            if (!string.IsNullOrWhiteSpace(Name))
            {
                layer.Name = Name;
            }

            if (!string.IsNullOrWhiteSpace(ShapeTitlesPattern))
            {
                layer.ShapeTitlesPattern    = ShapeTitlesPattern;
                layer.ShapeTitlesVisibility = VisibilityMode.Visible;
            }

            if (ItemImageIndex.HasValue)
            {
                layer.ItemImageIndex = ItemImageIndex.Value;
            }

            var itemStyle = layer.ItemStyle;

            var fillColor = Utils.ColorFromString(FillColor);

            if (fillColor != Color.Empty)
            {
                itemStyle.Fill = fillColor;
            }

            var font = Utils.StringToFont(Font, out Color textColor);

            if (font != null)
            {
                itemStyle.Font = font;
            }
            if (textColor != Color.Empty)
            {
                itemStyle.TextColor = textColor;
            }

            var strokeColor = Utils.ColorFromString(StrokeColor);

            if (strokeColor != Color.Empty)
            {
                itemStyle.Stroke = strokeColor;
            }
            if (StrokeWidth.HasValue)
            {
                itemStyle.StrokeWidth = StrokeWidth.Value;
            }

            var textGlowColor = Utils.ColorFromString(TextGlowColor);

            if (textGlowColor != Color.Empty)
            {
                itemStyle.TextGlowColor = textGlowColor;
            }

            if (layer.DataProvider == null)
            {
                layer.DataProvider = provider;
            }

            map.Map.Layers.Add(layer);
            map.CurrentLayer = layer;
        }
コード例 #26
0
        private void GecmisYolCiz()
        {
            RadAniMap.Items.Clear();
            layerCalYol.Items.Clear();
            layerHamYol.Items.Clear();
            layerArac.Items.Clear();
            layerTools.Items.Clear();
            RadAniMap.Items.Add(layerTools);

            if (cvarYol.IsChecked == true)
            {
                for (int i = 0; i < Entities.GecmisYollar.CalYol.Count; i++)
                {
                    if (Entities.GecmisYollar.CalYol[i].Points != null)
                        if (Entities.GecmisYollar.CalYol[i].Points.Count > 1)
                        {
                            SetStyle(Entities.GecmisYollar.CalYol[i], "mavi");
                            layerCalYol.Items.Add(Entities.GecmisYollar.CalYol[i]);

                            RadAniMap.ZoomLevel = 10;
                            RadAniMap.Center = Entities.GecmisYollar.CalYol[i].Points[0];
                            aniSlider1.IsEnabled = true;
                            if (AnimeTimer.IsEnabled)
                            {
                                btnPlay.IsEnabled = false;
                                btnStop.IsEnabled = true;
                            }
                            else
                            {
                                btnPlay.IsEnabled = true;
                                btnStop.IsEnabled = false;

                            }
                            

                        }
                }

            }

            if (chamYol.IsChecked == true)
            {
                for (int i = 0; i < Entities.GecmisYollar.DataList.Count; i++)
                {
                    if (Entities.GecmisYollar.HamYol[i].Points != null)
                        if (Entities.GecmisYollar.HamYol[i].Points.Count > 1)
                        {
                            SetStyle(Entities.GecmisYollar.HamYol[i], "mavi");
                            layerHamYol.Items.Add(Entities.GecmisYollar.HamYol[i]);

                            RadAniMap.ZoomLevel = 10;
                            RadAniMap.Center = Entities.GecmisYollar.HamYol[i].Points[0];
                            aniSlider1.IsEnabled = true;

                             for (int k = 0; k < Entities.GecmisYollar.HamYol[i].Points.Count- 2; k++)
                                {
                                    trh1 = Entities.GecmisYollar.DataList[i][k].DT_TAR1H;
                                    trh2 = Entities.GecmisYollar.DataList[i][k+1].DT_TAR1H;
                                    if (Math.Abs(trh2.Minute - trh1.Minute) < 2)
                                    {
                                        trh3 = trh3 + (trh2 - trh1);
                                    }
                                }
                                ikm = Entities.GecmisYollar.DataList[i].Count - 1;
                                km1 = Entities.GecmisYollar.DataList[i][0].DT_MESAFE;
                                km3 = Entities.GecmisYollar.DataList[i][ikm].DT_MESAFE;
                                dKmTop.Text = (km3 - km1).ToString("#0.00") + " KM/H";
                                dSureTop.Text = trh3.ToString("HH:mm:ss");
                            
                            if (AnimeTimer.IsEnabled)
                            {
                                btnPlay.IsEnabled = false;
                                btnStop.IsEnabled = true;
                            }
                            else
                            {
                                btnPlay.IsEnabled = true;
                                btnStop.IsEnabled = false;

                            }
                            
                        }
                }

            }

            
            RadAniMap.Items.Add(layerHamYol);
            RadAniMap.Items.Add(layerCalYol);

           
            for (int i = 0; i < Entities.GecmisYollar.DataList.Count; i++)
            {
                if (Entities.GecmisYollar.HamYol[i].Points != null)
                    if (Entities.GecmisYollar.HamYol[i].Points.Count > 1)
                    {

                        InformationLayer lyr = new InformationLayer();
                        lyr.ItemTemplate = layerArac.ItemTemplate;
                        lyr.Tag = Entities.GecmisYollar.AracData[i].Arac.ARC_SERINO.ToString();
                        lyr.Items.Add(Entities.GecmisYollar.HamYol[i].Points[0]);
                        lyr.Items.Add(Entities.GecmisYollar.AracData[i]);
                        RadAniMap.Items.Add(lyr);
                    }
            }



        }
コード例 #27
0
        private void Cars_MouseLeave()
        {
            for (int i = 0; i < Entities.DatasYol.Count; i++)
            {
                for (int j = 0; j < RadMap1.Items.Count; j++)
                {
                    try
                    {
                        InformationLayer layer = new InformationLayer();
                        layer = (InformationLayer)RadMap1.Items[j];
                        if (layer.Tag != null)
                        {
                            if (layer.Tag.ToString() == i.ToString())
                            {
                                for (int k = 0; k < layer.Items.Count; k++)
                                {
                                    Location loc1 = new Location();
                                    try
                                    {
                                        loc1 = (Location)layer.Items[k];
                                        layer.ItemTemplate = layerDetayOut.ItemTemplate;
                                    }
                                    catch
                                    {

                                    }
                                }
                                break;
                            }
                        }


                    }
                    catch { }
                }
            }
        }
コード例 #28
0
        protected override void AddedToScene()
        {
            base.AddedToScene();

            //Our information layer it's on parent layer because our information text are statics
            background          = new CCSprite("Background.png");
            background.Position = windowSize.Center;
            background.Scale    = windowSize.Height / background.Texture.ContentSizeInPixels.Height;
            BackgroundLayer.AddChild(background, -3);
            this.Position = windowSize.Center;

            //Creation menu debug options
            var lbl1 = new CCMenuItemLabelTTF(GetDefaultFontTtf("Shapes"), (o) => { debug_shapes = !debug_shapes; RefreshDebug(); });

            lbl1.AnchorPoint = new CCPoint(0, .5f);
            var lbl2 = new CCMenuItemLabelTTF(GetDefaultFontTtf("Joins"), (o) => { debug_joints = !debug_joints; RefreshDebug(); });

            lbl2.AnchorPoint = new CCPoint(0, .5f);
            var lbl3 = new CCMenuItemLabelTTF(GetDefaultFontTtf("Contact"), (o) => { debug_contacts = !debug_contacts; RefreshDebug(); });

            lbl3.AnchorPoint = new CCPoint(0, .5f);
            var lbl4 = new CCMenuItemLabelTTF(GetDefaultFontTtf("BB"), (o) => { debug_bb = !debug_bb; RefreshDebug(); });

            lbl4.AnchorPoint = new CCPoint(0, .5f);
            CCMenu menu = new CCMenu(new CCMenuItem[] { lbl1, lbl2, lbl3, lbl4 });

            menu.AlignItemsVertically();
            menu.Position = new CCPoint(windowSize.Width * .02f, windowSize.Height * .35f);
            InformationLayer.AddChild(menu);

            background_white          = new CCSprite("Background-alone.png");
            background_white.Position = windowSize.Center;
            background_white.Scale    = windowSize.Height / background_white.Texture.ContentSizeInPixels.Height;
            background_white.Visible  = false;
            InformationLayer.AddChild(background_white, -4);

            logo = new LogoNode();
            logo.InitialPosition = new CCPoint(new CCPoint(windowSize.Width * .90f, windowSize.Height * .05f));
            logo.Position        = new CCPoint(logo.InitialPosition);

            InformationLayer.AddChild(logo, -2);

            logo.RunAction(new CCRepeatForever(
                               new CCEaseSineInOut(new CCMoveBy(1.5f, new CCPoint(0, 10))),
                               new CCEaseSineInOut(new CCMoveBy(1.5f, new CCPoint(0, -10))))
                           );

            //Debug draw initialization
            //m_debugDraw = new CCChipmunkDebugDraw(DEFAULT_FULL_FONT);

            //Space initialization
            space = new cpSpace();
            //space.SetDebugDraw(m_debugDraw);

            space.CollisionEnabled = CollisionEnabled;
            m_debugDraw            = new PhysicsDebugDraw(space);
            CollisionEnabled
            AddChild(m_debugDraw);

            RefreshDebug();

            //Title initialization
            example             = GetDefaultFontTtf("Physics examples");
            example.AnchorPoint = new CCPoint(.5f, 1f);
            //example.Scale = .3f;
            InformationLayer.AddChild(example);
            SetTitle(this.GetType().Name);

            //Player initialization
            menuLayerPlayer             = GetPlayerLayer();
            menuLayerPlayer.AnchorPoint = new CCPoint(0, 0);

            menuLayerPlayer.Position = new CCPoint(Window.WindowSizeInPixels.Width * .12f, Window.WindowSizeInPixels.Height * .05f);
            InformationLayer.AddChild(menuLayerPlayer);

            //Listeners initializations
            //eMouse = new CCEventListenerMouse();
            //eMouse.OnMouseMove += OnMouseMove;
            //eMouse.OnMouseDown += OnMouseDown;
            //eMouse.OnMouseUp += OnMouseUp;
            //eMouse.OnMouseScroll = e => CCMouse.Instance.OnMouseScroll(e, this);
            //AddEventListener(eMouse);

            eTouch = new CCEventListenerTouchAllAtOnce();
            eTouch.OnTouchesBegan     += OnTouchesBegan;
            eTouch.OnTouchesMoved     += OnTouchesMoved;
            eTouch.OnTouchesCancelled += OnTouchesCancelled;
            eTouch.OnTouchesEnded     += OnTouchesEnded;
            AddEventListener(eTouch);
        }
コード例 #29
0
        private void ColorizeMapShapes(InformationLayer layer)
        {
            this.selectedSeats.Clear();
            this.ViewModel.IsBuyButtonEnabled = false;

            // extract the seat colorization information from the data attributes
            foreach (MapShape seatShape in layer.Items)
            {
                SeatAvailability seatAvailability = this.GetSeatAvailability(seatShape);

                switch (seatAvailability)
                {
                    case SeatAvailability.NotAvailable:
                        seatShape.Fill = ColorizationHelper.NotAvailableBrush;
                        seatShape.Stroke = null;
                        seatShape.StrokeThickness = 0;
                        break;
                    case SeatAvailability.Reserved:
                        seatShape.Fill = ColorizationHelper.ReservedBrush;
                        seatShape.Stroke = null;
                        seatShape.StrokeThickness = 0;
                        break;
                    case SeatAvailability.Sold:
                        seatShape.Fill = ColorizationHelper.SoldBrush;
                        seatShape.Stroke = null;
                        seatShape.StrokeThickness = 0;
                        break;
                    default:
                        Color seatColor = GetSeatColor(seatShape);
                        seatShape.Fill = new SolidColorBrush(seatColor);
                        seatShape.Stroke = null;
                        seatShape.StrokeThickness = 0;
                        break;
                }
            }
        }
コード例 #30
0
        private void SetBestView(InformationLayer layer)
        {
            LocationRect bestView = layer.GetBestView(layer.Items.Cast <object>());

            RadMap1.SetView(bestView);
        }
コード例 #31
0
        private void RadAniMap_Click(object sender, MapMouseRoutedEventArgs e)
        {
            if (!PaneYol.IsHidden) 
            {
                ClientIslem.rotaPoints.Add(e.Location);
                layerKare.Items.Add(e.Location);
            }
            if (!PaneTanim1.IsHidden)
            {
                RadAniMap.Items.Clear();
                layerTanim1.Items.Clear();
                layerTanim1.Items.Add(e.Location);
                RadAniMap.Items.Add(layerTanim1);
                
                if (tanimStr == "ROTA")
                {
                    if (RotaCol.Count == 0)
                    {
                        lyr = new InformationLayer();
                        RotaLine.Points = new LocationCollection();
                        
                    }
                    RotaCol.Add(e.Location);
                    

                    if (RotaCol.Count > 1)
                    {
                        RotaLine.Points = RotaCol;
                        SetStyle(RotaLine,"mavi");
                        lyr.Items.Clear();
                        RadAniMap.Items.Clear();
                        lyr.Items.Add(RotaLine);
                        RadAniMap.Items.Add(lyr);
                        
                    }
                    
                }

                if (tanimStr == "BÖLGE")
                {
                    if (RotaCol.Count == 0)
                    {
                        lyr = new InformationLayer();
                        RotaLine.Points = new LocationCollection();

                    }
                    RotaCol.Add(e.Location);


                    if (RotaCol.Count > 1)
                    {
                        RotaLine.Points = RotaCol;
                        lyr.Items.Clear();
                        RadAniMap.Items.Clear();
                        lyr.Items.Add(RotaLine);
                        RadAniMap.Items.Add(lyr);

                    }

                }
            }
        }
コード例 #32
0
        protected InformationLayer CreateLayer()
        {
            var layer = new InformationLayer()
            {
                EnableHighlighting = false,
                EnableSelection    = false
            };

            if (!string.IsNullOrWhiteSpace(Name))
            {
                layer.Name = Name;
            }

            if (!string.IsNullOrWhiteSpace(ShapeTitlesPattern))
            {
                layer.ShapeTitlesPattern    = ShapeTitlesPattern;
                layer.ShapeTitlesVisibility = VisibilityMode.Visible;
            }

            if (ItemImageIndex.HasValue)
            {
                layer.ItemImageIndex = ItemImageIndex.Value;
            }

            var itemStyle = layer.ItemStyle;

            var fillColor = Utils.ColorFromString(FillColor);

            if (fillColor != Color.Empty)
            {
                itemStyle.Fill = fillColor;
            }

            var font = Utils.StringToFont(Font, out Color textColor);

            if (font != null)
            {
                itemStyle.Font = font;
            }
            if (textColor != Color.Empty)
            {
                itemStyle.TextColor = textColor;
            }

            var strokeColor = Utils.ColorFromString(StrokeColor);

            if (strokeColor != Color.Empty)
            {
                itemStyle.Stroke = strokeColor;
            }
            if (StrokeWidth.HasValue)
            {
                itemStyle.StrokeWidth = StrokeWidth.Value;
            }

            var textGlowColor = Utils.ColorFromString(TextGlowColor);

            if (textGlowColor != Color.Empty)
            {
                itemStyle.TextGlowColor = textGlowColor;
            }

            if (_RouteLayerContext != null)
            {
                _RouteLayerContext.MapContext = MapContext;
            }

            var provider = _RouteLayerContext?.CreateDataProvider(layer, ResultCount) ?? throw new Exception("Cannot create Route provider.");

            if (layer.DataProvider == null)
            {
                layer.DataProvider = provider;
            }

            return(layer);
        }
コード例 #33
0
        void AnimeTimer_Tick(object sender, EventArgs e)
        {
            if (!PaneAnime.IsHidden)
            for (int i = 0; i < Entities.GecmisYollar.HamYol.Count; i++)
            {
                if (Entities.GecmisYollar.HamYol[i].Points != null)
                {
                    stackAniDetay.Visibility = Visibility.Visible;
                    syc++;
                    if (syc >= Entities.GecmisYollar.HamYol[i].Points.Count)
                    {
                        /*
                        syc = 0;
                        btnStop.IsEnabled = false;
                        btnPlay.IsEnabled = true;
                        stackAniDetay.Visibility = Visibility.Collapsed;
                        AnimeTimer.Stop();
                         */
                    }
                    else
                    {
                        try
                        {
                            InformationLayer lyr = layerBul(Entities.GecmisYollar.AracData[i].Arac.ARC_SERINO.ToString());
                            if (lyr != null)
                            {
                                lyr.Items.Clear();
                                lyr.Items.Add(Entities.GecmisYollar.AracData[i]);
                                lyr.Items.Add(Entities.GecmisYollar.HamYol[i].Points[syc]);
                                RadAniMap.Center = Entities.GecmisYollar.HamYol[i].Points[syc];
                                hiz = int.Parse(Entities.GecmisYollar.DataList[i][syc].DT_H1Z);

                                if (hiz > mxhiz)
                                    mxhiz = hiz;

                                aTarih.Text = Entities.GecmisYollar.DataList[i][syc].DT_TAR1H.ToString();
                                aHiz.Text = Entities.GecmisYollar.DataList[i][syc].DT_H1Z.ToString() + " km/s";
                                aMaxHiz.Text = mxhiz.ToString() + " km/s";
                                aAdres.Text = Entities.GecmisYollar.DataList[i][syc].DT_ADRES;
                                aKontak.Text = Entities.GecmisYollar.DataList[i][syc].DT_KONTAK;
                                //aKmSayac.Text = (Entities.GecmisYollar.DataList[i][syc].DT_MESAFE-Entities.GecmisYollar.DataList[i][0].DT_MESAFE).ToString();

                                ikm = Entities.GecmisYollar.DataList[i].Count - 1;
                                km1 = Entities.GecmisYollar.DataList[i][0].DT_MESAFE;
                                km2 = Entities.GecmisYollar.DataList[i][syc].DT_MESAFE;
                                km3 = Entities.GecmisYollar.DataList[i][ikm].DT_MESAFE;
                                
                                //trh1 = Entities.GecmisYollar.DataList[i][0].DT_TAR1H;
                                //trh2 = Entities.GecmisYollar.DataList[i][syc].DT_TAR1H;
                                //trh3 = Entities.GecmisYollar.DataList[i][ikm].DT_TAR1H;

                                dKmTop.Text = (km3 - km1).ToString("#0.00") + " KM/H";
                                dKmSayac.Text = (km2 - km1).ToString("#0.00") + " KM/H";

                                //dSureSayac.Text = (trh2 - trh1).ToString();

                                aniSlider1.Minimum = 0;
                                aniSlider1.Maximum = Entities.GecmisYollar.HamYol[i].Points.Count - 1;
                                if (AnimeTimer.IsEnabled == true) // yoksa güm olur :)
                                    aniSlider1.Value = syc;


                                if (kontak != Entities.GecmisYollar.DataList[i][syc].DT_KONTAK)
                                {
                                    if (kontak == "Kapalı")
                                    {
                                        InformationLayer lt = new InformationLayer();

                                        if (kkl != null)
                                        {
                                            Entities.GecmisYollar.HamYol[i].Points[syc] = kkl;
                                            Entities.GecmisYollar.DataList[i][syc].DT_TAR1HK = kkt;
                                        }
                                        lt.Items.Add(Entities.GecmisYollar.HamYol[i].Points[syc]);
                                        lt.Items.Add(Entities.GecmisYollar.DataList[i][syc]);
                                        lt.ItemTemplate = layerTools.ItemTemplate;
                                        RadAniMap.Items.Add(lt);
                                    }
                                    else
                                    {
                                        InformationLayer lt = new InformationLayer();
                                        lt.Items.Add(Entities.GecmisYollar.HamYol[i].Points[syc]);
                                        lt.Items.Add(Entities.GecmisYollar.DataList[i][syc]);
                                        kkl = Entities.GecmisYollar.HamYol[i].Points[syc];
                                        kkt = Entities.GecmisYollar.DataList[i][syc].DT_TAR1H;
                                        lt.ItemTemplate = lyrKK.ItemTemplate;
                                        RadAniMap.Items.Add(lt);
                                    }

                                }
                                /*
                            else 
                            {
                                sycKP++;
                                if (sycKP == 5)
                                {
                                    InformationLayer lt = new InformationLayer();
                                    lt.Items.Add(Entities.GecmisYollar.HamYol[i].Points[syc]);
                                    lt.Items.Add(Entities.GecmisYollar.DataList[i][syc]);
                                    lt.ItemTemplate = lyrKP.ItemTemplate;
                                    RadAniMap.Items.Add(lt);
                                    sycKP = 0;
                                }
                            }
                            */

                                kontak = Entities.GecmisYollar.DataList[i][syc].DT_KONTAK;



                            }
                        }
                        catch
                        { }
                    }
                }
            }
        }
コード例 #34
0
ファイル: MainPage.xaml.cs プロジェクト: JoelWeber/xaml-sdk
 private void SetBestView(InformationLayer layer)
 {
     LocationRect bestView = layer.GetBestView(layer.Items.Cast<object>());
     RadMap1.SetView(bestView);
 }