/// <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; } }
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; }
/// <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); }
/// <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; } }
/// <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; } }
/// <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; } }
/// <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 } } }
public ZoomAnimation(Map map) { _map = map; }
public MeasureDistance(Map map, ElementsLayer elementsLayer) : base(map) { Name = "MeasureDistance"; Map = map; Stroke = new SolidColorBrush(Colors.Red); StrokeThickness = 3; Opacity = 1; DrawLayer = elementsLayer; }
/// <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); } }
public OvPan(Map map, Map mapBig) : base(map, "OvPan") { this.mapBig = mapBig; }
/// <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"; }
/// <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; }
/// <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) { }
public PanAnimation(Map element) { this._map = element; }
/// <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; } }
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; }
public DrawStar(Map map) : this(map,CoreCursorType.Hand) { }
/// <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) { }