Пример #1
0
        void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            timer.Duration = new TimeSpan(0, 0, 0, 0,500);
            Dtimer.Duration = new TimeSpan(0, 0, 0, 20);
            Ltimer.Duration = new TimeSpan(0, 0, 0, 55);
            //Ltimer.Begin();
            ml.Name = "routing";
            realml.Name = "realroads";
            this.ctlMap.Mode = new MercatorMode();
            wms = new WMSTileSourse();
            mtl.CacheMode = null;
            mtl.TileSources.Add(wms);
            var fiverealwms = new fiveleveroadsTileSourse();
            var fourRealWms = new fourleveroadsTileSourse();
            var threerealwms = new threeleveroadsTileSourse();
            var twoRealWms = new twoleveroadsTileSourse();

            realwms.laynum = 0;
            mtl.TileSources.Add(realwms);
            //mtl.TileSources.Add(fiverealwms);
            //mtl.TileSources.Add(fourRealWms);
            //mtl.TileSources.Add(threerealwms);
            //mtl.TileSources.Add(twoRealWms);

            ctlMap.Children.Add(mtl);
            ctlMap.Center = new Location(31.64, 120.31);
            ctlMap.ZoomLevel = 10;

            var styles = new Dictionary<string, StyleSpecification>
                             {
                                 {
                                     "defaultstyle", new StyleSpecification
                                                         {
                                                             ID = "style1",
                                                             LineColour = "FF1B0AA5",
                                                             LineWidth = 2,
                                                             PolyFillColour = "88677E1E",
                                                             ShowFill = true,
                                                             ShowLine = true,
                                                             IconURL = "http://soulsolutions.com.au/Images/pin.png",
                                                             IconScale = 1,
                                                             //IconOffsetX = 70, //35.41666666666667,
                                                             //IconOffsetY = -90 //-45.83333333333333
                                                         }
                                     }
                             };

            layer = new EnhancedMapLayer(ctlMap)
                        {
                            Styles = styles,
                            LayerDefinition = new LayerDefinition
                                                  {
                                                      CurrentVersion = DateTime.Now,
                                                      IsEditable = false,
                                                      LabelOn = true,
                                                      LayerAlias = "Sample Layer",
                                                      LayerID = "1",
                                                      LayerStyleName = "style3",
                                                      LayerTimeout = -1,
                                                      LayerType = 1,
                                                      MaxDisplayLevel = 100,
                                                      MBR = new byte[0],
                                                      MinDisplayLevel = 1,
                                                      PermissionToEdit = false,
                                                      Selected = true,
                                                      Tags = "Test Group",
                                                      ZIndex = 30,
                                                      Temporal = true,
                                                      IconURI = "http://soulsolutions.com.au/Images/pin.png",
                                                      ObjectAttributes =
                                                          new Dictionary<int, LayerObjectAttributeDefinition>()
                                                  },
                            EnableBalloon = false,
                            EnableClustering = true,
                            ID = "routing",
                        };
            ctlMap.Children.Add(layer);
            ctlMap.Children.Add(ml);
            //ctlMap.Children.Add(realml);
            ctlMap.Children.Add(carml);
            //Getrealtimeroad("11", "3");
            InitCar();
        }
Пример #2
0
        void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            timer.Duration  = new TimeSpan(0, 0, 0, 0, 500);
            Dtimer.Duration = new TimeSpan(0, 0, 0, 20);
            Ltimer.Duration = new TimeSpan(0, 0, 0, 55);
            //Ltimer.Begin();
            ml.Name          = "routing";
            realml.Name      = "realroads";
            this.ctlMap.Mode = new MercatorMode();
            wms           = new WMSTileSourse();
            mtl.CacheMode = null;
            mtl.TileSources.Add(wms);
            var fiverealwms  = new fiveleveroadsTileSourse();
            var fourRealWms  = new fourleveroadsTileSourse();
            var threerealwms = new threeleveroadsTileSourse();
            var twoRealWms   = new twoleveroadsTileSourse();



            realwms.laynum = 0;
            mtl.TileSources.Add(realwms);
            //mtl.TileSources.Add(fiverealwms);
            //mtl.TileSources.Add(fourRealWms);
            //mtl.TileSources.Add(threerealwms);
            //mtl.TileSources.Add(twoRealWms);


            ctlMap.Children.Add(mtl);
            ctlMap.Center    = new Location(31.64, 120.31);
            ctlMap.ZoomLevel = 10;

            var styles = new Dictionary <string, StyleSpecification>
            {
                {
                    "defaultstyle", new StyleSpecification
                    {
                        ID             = "style1",
                        LineColour     = "FF1B0AA5",
                        LineWidth      = 2,
                        PolyFillColour = "88677E1E",
                        ShowFill       = true,
                        ShowLine       = true,
                        IconURL        = "http://soulsolutions.com.au/Images/pin.png",
                        IconScale      = 1,
                        //IconOffsetX = 70, //35.41666666666667,
                        //IconOffsetY = -90 //-45.83333333333333
                    }
                }
            };

            layer = new EnhancedMapLayer(ctlMap)
            {
                Styles          = styles,
                LayerDefinition = new LayerDefinition
                {
                    CurrentVersion   = DateTime.Now,
                    IsEditable       = false,
                    LabelOn          = true,
                    LayerAlias       = "Sample Layer",
                    LayerID          = "1",
                    LayerStyleName   = "style3",
                    LayerTimeout     = -1,
                    LayerType        = 1,
                    MaxDisplayLevel  = 100,
                    MBR              = new byte[0],
                    MinDisplayLevel  = 1,
                    PermissionToEdit = false,
                    Selected         = true,
                    Tags             = "Test Group",
                    ZIndex           = 30,
                    Temporal         = true,
                    IconURI          = "http://soulsolutions.com.au/Images/pin.png",
                    ObjectAttributes =
                        new Dictionary <int, LayerObjectAttributeDefinition>()
                },
                EnableBalloon    = false,
                EnableClustering = true,
                ID = "routing",
            };
            ctlMap.Children.Add(layer);
            ctlMap.Children.Add(ml);
            //ctlMap.Children.Add(realml);
            ctlMap.Children.Add(carml);
            //Getrealtimeroad("11", "3");
            InitCar();
        }