Inheritance: Windows.UI.Xaml.Controls.Control, INotifyPropertyChanged
コード例 #1
0
ファイル: Pan.cs プロジェクト: SuperMap/iClient-for-Win8
 /// <summary>${ui_action_Pan_constructor_Map_D}</summary>
 /// <example>
 /// 	<code lang="CS">
 /// Pan panTo = new Pan(MyMap)
 /// </code>
 /// </example>
 /// <param name="map">${ui_action_Pan_constructor_Map_param_map}</param>
 /// <param name="cursor">${ui_action_MapAction_constructor_Map_param_cursor}</param>
 public Pan(Map map)
     : base(map, "Pan")
 {
     if (_devices == null)
     {
         _devices = new ObservableCollection<uint>();
         _devices.CollectionChanged += _devices_CollectionChanged;
     }
 }
コード例 #2
0
 public MeasureArea(Map map, ElementsLayer elementsLayer)
     : base(map)
 {
     Name = "MeasureArea";
     Map = map;
     Stroke = new SolidColorBrush(Colors.Red);
     Fill = new SolidColorBrush(Color.FromArgb(0x99, 255, 255, 255));
     StrokeThickness = 3;
     Opacity = 1;
     DrawLayer = elementsLayer;
 }
コード例 #3
0
        /// <summary>${controls_InfoWindow_constructor_None_D}</summary>
        public InfoWindow(Map map)
            : this()
        {
            if (map == null)
            { throw new ArgumentNullException("map", Resource.InfoWindow_MapParam); }

            this.Map = map;
            base.DefaultStyleKey = typeof(InfoWindow);
            Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            this.SizeChanged += new SizeChangedEventHandler(InfoWindow_SizeChanged);
            this.Map.LayoutUpdated += new EventHandler<object>(Map_LayoutUpdated);
        }
コード例 #4
0
 /// <summary>${ui_action_DrawFreeHandPolygon_constructor_Map_D}</summary>
 /// <example>
 /// 	<code lang="CS">
 /// DrawFreeLine draw = new DrawFreeLine(MyMap)
 /// </code>
 /// </example>
 /// <param name="map">${ui_action_DrawFreeHandPolygon_constructor_Map_param_map}</param>
 /// <param name="cursor">${ui_action_MapAction_constructor_Map_param_cursor}</param>
 public DrawFreeLine(Map map)
     : base(map, "DrawFreeLine")
 {
     if (map.Theme == null)
     {
         Stroke = new SolidColorBrush(Colors.Red);
         StrokeThickness = MagicNumber.ACTION_STYLE_DEFAULT_STROKETHICKNESS;
         Opacity = MagicNumber.ACTION_STYLE_DEFAULT_OPACITY;
     }
     else
     {
         this.Stroke = map.Theme.Stroke;
         this.StrokeThickness = map.Theme.StrokeThickness;
         this.Opacity = map.Theme.Opacity;
     }
 }
コード例 #5
0
 /// <summary>${ui_action_DrawRect_constructor_Map_D}</summary>
 /// <example>
 /// 	<code lang="CS">
 /// DrawRectangle draw = new DrawRectangle(MyMap)
 /// </code>
 /// </example>
 /// <param name="map">${ui_action_DrawRect_constructor_Map_param_map}</param>
 /// <param name="cursor">${ui_action_MapAction_constructor_Map_param_cursor}</param>
 public DrawRectangle(Map map)
     : base(map , "DrawRectangle")
 {
     startPt = Point2D.Empty;
     if (map.Theme == null)
     {
         Stroke = new SolidColorBrush(Colors.Green);
         StrokeThickness = MagicNumber.ACTION_STYLE_DEFAULT_STROKETHICKNESS;
         Fill = new SolidColorBrush(Colors.Black);
         Opacity = MagicNumber.ACTION_STYLE_DEFAULT_OPACITY;
     }
     else
     {
         this.Stroke = map.Theme.Stroke;
         this.StrokeThickness = map.Theme.StrokeThickness;
         this.Fill = map.Theme.Fill;
         this.Opacity = map.Theme.Opacity;
     }
 }
コード例 #6
0
 /// <summary>${ui_action_DrawPolygon_constructor_Map_D}</summary>
 /// <example>
 /// <code lang="CS">
 /// DrawPolygon draw = new DrawPolygon(MyMap);
 /// </code>
 /// </example>
 /// <param name="map">${ui_action_DrawPolygon_constructor_Map_param_map}</param>
 /// <param name="cursor">${ui_action_MapAction_constructor_Map_param_cursor}</param>
 public DrawPolygon(Map map)
     : base(map)
 {
     this.Name = "DrawPolygon";
     if (map.Theme == null)
     {
         Fill = new SolidColorBrush(Colors.Red);
         Stroke = new SolidColorBrush(Colors.Red);
         StrokeThickness = MagicNumber.ACTION_STYLE_DEFAULT_STROKETHICKNESS;
         Opacity = MagicNumber.ACTION_STYLE_DEFAULT_OPACITY;
     }
     else
     {
         this.Stroke = map.Theme.Stroke;
         this.StrokeThickness = map.Theme.StrokeThickness;
         this.Fill = map.Theme.Fill;
         this.Opacity = map.Theme.Opacity;
     }
 }
コード例 #7
0
ファイル: Edit.cs プロジェクト: SuperMap/iClient-for-Win8
 /// <summary>${ui_action_Edit_constructor_D}</summary>
 /// <param name="map">${ui_action_Edit_constructor_param_map}</param>
 /// <param name="layer">${ui_action_Edit_constructor_param_layer}</param>
 public Edit(Map map , FeaturesLayer layer)
 {
     if (map != null && layer != null)
     {
         Name = "Edit";
         Map = map;
         editLayer = layer;
         editLayer.PointerPressed += editLayer_PointerPressed;
         editLayer.PointerReleased += editLayer_PointerReleased;
         if (map.Theme == null)
         {
             SetDefaultStyle();
         }
         else
         {
             HoverVertexStyle = map.Theme.HoverVertexStyle;
             SnapStyle = map.Theme.SnapStyle;
             HoverCenterStyle = map.Theme.HoverCenterStyle;
             hoverLineStyle = new PredefinedLineStyle() { Stroke = new SolidColorBrush(Colors.Transparent) , StrokeThickness = 10 };//Colors.Transparent
         }
     }
 }
コード例 #8
0
 public ZoomAnimation(Map map)
 {
     _map = map;
 }
コード例 #9
0
 public MeasureDistance(Map map, ElementsLayer elementsLayer)
     : base(map)
 {
     Name = "MeasureDistance";
     Map = map;
     Stroke = new SolidColorBrush(Colors.Red);
     StrokeThickness = 3;
     Opacity = 1;
     DrawLayer = elementsLayer;
 }
コード例 #10
0
        /// <summary>${controls_Magnifier_method_onApplyTemplate_D}</summary>
        protected override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            magnifierMap = GetTemplateChild("MagMap") as Map;
            if (magnifierMap == null)
            {
                throw new ArgumentNullException("MagMap");
            }
            //TiledCacheLayer需要
            magnifierMap.Layers.LayersInitialized += (s4 , e4) =>
            {
                ToSetMagnifierLevel();
                ToUpdateMagnifierMapCenterPosition();
            };
            if (Layer != null)
            {
                magnifierMap.Layers.Add(Layer);
            }
            magnifierMap.MinResolution = double.Epsilon;
            magnifierMap.MaxResolution = double.MaxValue;

            //使Map上的Resolutions和magMap的Resolutions保持一致;
            if (Map != null && Map.Resolutions != null)
            {
                magnifierMap.Resolutions = Map.Resolutions;
            }
            PointerPressed += (s , e) =>
            {
                isDragOn = true;
                beginPosition = e.GetCurrentPoint(null).Position;
                CapturePointer(e.Pointer);
            };
            PointerMoved += (s2 , e2) =>
            {
                if (this.isDragOn)
                {
                    currentPosition = e2.GetCurrentPoint(null).Position;
                    Convert.ToDouble(base.GetValue(Canvas.LeftProperty));
                    Convert.ToDouble(base.GetValue(Canvas.TopProperty));
                    MoveTo(currentPosition.X - beginPosition.X , currentPosition.Y - beginPosition.Y);
                    beginPosition = currentPosition;
                    ToUpdateMagnifierMapCenterPosition();
                }
            };
            PointerReleased += (s1 , e1) =>
            {
                if (this.isDragOn)
                {
                    ReleasePointerCaptures();
                    isDragOn = false;
                }
            };

            Opacity = 1.0;
            if (( Visibility == Visibility.Visible ) && ( Map != null ))
            {
                DispatchedHandler handler = new DispatchedHandler(delegate
                {
                    ToSetMagnifierLevel();
                    ToUpdateMagnifierMapCenterPosition();
                });
                Dispatcher.RunAsync(CoreDispatcherPriority.Normal, handler);
            }
        }
コード例 #11
0
ファイル: OvPan.cs プロジェクト: SuperMap/iClient-for-Win8
 public OvPan(Map map, Map mapBig)
     : base(map, "OvPan")
 {
     this.mapBig = mapBig;
 }
コード例 #12
0
 /// <summary>${ui_action_DrawPoint_constructor_Map_D}</summary>
 /// <example>
 /// <code>
 /// DrawPoint draw = new DrawPoint(MyMap);
 /// MyMap.Action=draw;
 /// draw.DrawCompleted += drawPoint_DrawCompleted;
 /// void drawPoint_DrawCompleted(object sender, DrawEventArgs e)
 /// {
 ///     //TODO
 /// }
 /// </code>
 /// </example>
 /// <param name="map">${ui_action_DrawPoint_constructor_Map_param_map}</param>
 /// <param name="cursor">${ui_action_MapAction_constructor_Map_param_cursor}</param>
 public DrawPoint(Map map)
     : base(map)
 {
     this.Name = "DrawPoint";
 }
コード例 #13
0
 /// <summary>${ui_action_MapAction_constructor_Map_D}</summary>
 /// <param name="map">${ui_action_MapAction_constructor_Map_param_map}</param>
 /// <param name="name">${ui_action_MapAction_constructor_Map_param_name}</param>
 /// <param name="cursor">${ui_action_MapAction_constructor_Map_param_cursor}</param>
 public MapAction(Map map, string name)
 {
     Name = name;
     Map = map;
 }
コード例 #14
0
ファイル: ZoomOut.cs プロジェクト: SuperMap/iClient-for-Win8
 /// <summary>${ui_action_ZoomOut_constructor_Map_D}</summary>
 /// <example>
 /// 	<code lang="CS">
 /// ZoomOut zoomMap = new ZoomOut(MyMap)
 /// </code>
 /// </example>
 /// <param name="map">${ui_action_ZoomOut_constructor_Map_param_map}</param>
 /// <param name="cursor">${ui_action_MapAction_constructor_Map_param_cursor}</param>
 public ZoomOut(Map map)
     : base(map)
 { }
コード例 #15
0
 public PanAnimation(Map element)
 {
     this._map = element;
 }
コード例 #16
0
        /// <summary>${controls_OverviewMap_method_onApplyTemplate_D}</summary>
        protected override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            outerRect = GetTemplateChild("OuterRect") as Grid;
            outerRect.Width = base.Width;
            outerRect.Height = base.Height;

            arrowButton = GetTemplateChild("ArrowButton") as Button;
            if (arrowButton != null)
            {
                arrowButton.Click += new RoutedEventHandler(Button_Click);
            }
            arrowButtonCopy = GetTemplateChild("ArrowButtonCopy") as Button;
            arrowButtonCopy.Click += new RoutedEventHandler(Button_Click);
            ovMap = GetTemplateChild("OvMap") as Map;
            if (ovMap == null)
            {
                throw new ArgumentNullException("OvMap");
            }
            ovMap.MinResolution = double.Epsilon;
            ovMap.MaxResolution = double.MaxValue;

            if (Map != null)
            {
                ovMap.Action = new OvPan(ovMap, Map);

                //确保在Map上设置了Resolution将其传到ovMap上;
                //if (Map.Resolutions != null)
                //{
                //    ovMap.Resolutions = Map.Resolutions;
                //}
            }

            ovMap.Width = base.Width - 16;
            ovMap.Height = base.Height - 16;
            ovMap.ViewBoundsChanged += (s, e) => { UpdateOvRect(); };
            if (Layers != null && Layers.Count > 0)  //只要Layers有值就以Layers为准
            {
                ovMap.Layers.Clear();
                foreach (var item in Layers)
                {
                    ovMap.Layers.Add(item);
                }
            }
            else if (Layer != null)
            {
                ovMap.Layers.Add(Layer);
            }

            ovRect = GetTemplateChild("OvRect") as Grid;
            if (ovRect != null)
            {
                ovRect.PointerPressed += ovRect_PointerPressed;
            }
            UpdateOvRect();

            if (CollapsedInTheInitialization)
            {
                outerRect.Visibility = Visibility.Collapsed;
                arrowButtonCopy.Visibility = Visibility.Collapsed;
            }
            else
            {
                outerRect.Visibility = Visibility.Visible;
                arrowButton.Visibility = Visibility.Collapsed;
            }
        }
コード例 #17
0
        public DrawStar(Map map, CoreCursorType cursor)
        {

            Name = "DrawStar";
            Map = map;

            Stroke = new SolidColorBrush(Colors.Red);
            StrokeThickness = 2;
            Fill = new SolidColorBrush(Colors.Red);
            FillRule = FillRule.Nonzero;
            Opacity = 1;


        }
コード例 #18
0
 public DrawStar(Map map)
     : this(map,CoreCursorType.Hand)
 {
 }
コード例 #19
0
ファイル: ZoomIn.cs プロジェクト: SuperMap/iClient-for-Win8
 /// <summary>${ui_action_ZoomIn_constructor_Map_D}</summary>
 /// <example>
 /// 	<code lang="CS">
 /// ZoomIn zoomInMap = new ZoomIn(MyMap)
 /// </code>
 /// </example>
 /// <overloads>${ui_action_ZoomIn_constructor_overloads}</overloads>
 /// <param name="map">${ui_action_ZoomIn_constructor_Map_param_map}</param>
 /// <param name="cursor">${ui_action_MapAction_constructor_Map_param_cursor}</param>
 public ZoomIn(Map map)
     : base(map)
 {
 }