public IWidgetSet CreateWidgetSet(IMapWidget mapWidget)
 {
     return(new WidgetSetType()
     {
         Widget = new System.ComponentModel.BindingList <WidgetType>(),
         Container = new System.ComponentModel.BindingList <ContainerType>(),
         MapWidget = (MapWidgetType)mapWidget
     });
 }
Esempio n. 2
0
        public MapCtrl(IApplicationDefinition appDef, IMapGroup group, IEditorService edService, IMapWidget widget)
            : this()
        {
            _appDef = appDef;
            _widget = widget;
            _group  = group;
            _edSvc  = edService;
            _edSvc.RegisterCustomNotifier(this);
            _models            = new BindingList <MapModel>();
            lstMaps.DataSource = _models;
            UpdateMapList();
            txtMapId.Text = group.id;

            LoadMapOptions();
        }
        private void lstMaps_SelectedIndexChanged(object sender, EventArgs e)
        {
            btnRemoveMap.Enabled = false;
            var grp = this.SelectedGroup;

            if (grp != null)
            {
                propertiesPanel.Controls.Clear();
                IMapWidget widget = null;

                var mapWidget = _flexLayout.GetFirstWidgetSet().MapWidget;
                //We're editing the one used by the map widget
                if (grp.id == mapWidget.MapId)
                {
                    widget = mapWidget;
                }

                var mapCtrl = new MapCtrl(_flexLayout, grp, _edsvc, widget);
                mapCtrl.Dock = DockStyle.Fill;
                propertiesPanel.Controls.Add(mapCtrl);
                btnRemoveMap.Enabled = true;
            }
        }
 private void SetupMapWidget(IMapWidget mapWidget)
 {
     _mapWidget           = mapWidget;
     _initMapXml          = _mapWidget.ToXml();
     txtMapWidgetXml.Text = _initMapXml;
 }
Esempio n. 5
0
 public IWidgetSet CreateWidgetSet(IMapWidget mapWidget)
 {
     return new WidgetSetType()
     {
         Widget = new System.ComponentModel.BindingList<WidgetType>(),
         Container = new System.ComponentModel.BindingList<ContainerType>(),
         MapWidget = (MapWidgetType)mapWidget
     };
 }
Esempio n. 6
0
 private void SetupMapWidget(IMapWidget mapWidget)
 {
     _mapWidget = mapWidget;
     _initMapXml = _mapWidget.ToXml();
     txtMapWidgetXml.Text = _initMapXml;
 }
Esempio n. 7
0
        public MapCtrl(IApplicationDefinition appDef, IMapGroup group, IEditorService edService, IMapWidget widget)
            : this()
        {
            _edsvc = edService;
            _edsvc.RegisterCustomNotifier(this);
            _appDef = appDef;
            _group = group;
            _widget = widget;

            foreach (var map in group.Map)
            {
                if (map.Type.Equals("MapGuide")) //NOXLATE
                {
                    _map = map;
                }
                else
                {
                    var cmsOpts = map.CmsMapOptions;
                    if (cmsOpts != null)
                    {
                        switch (cmsOpts.Type)
                        {
                            case G_HYBRID_MAP:
                                chkGoogHybrid.Checked = true;
                                break;
                            case G_NORMAL_MAP:
                                chkGoogStreets.Checked = true;
                                break;
                            case G_SATELLITE_MAP:
                                chkGoogSatellite.Checked = true;
                                break;
                            case G_PHYSICAL_MAP:
                                chkGoogTerrain.Checked = true;
                                break;
                            case BING_AERIAL:
                                chkBingSatellite.Checked = true;
                                break;
                            case BING_HYBRID:
                                chkBingHybrid.Checked = true;
                                break;
                            case BING_ROAD:
                                chkBingStreets.Checked = true;
                                break;
                            case YAHOO_MAP_HYB:
                                chkYahooHybrid.Checked = true;
                                break;
                            case YAHOO_MAP_REG:
                                chkYahooStreets.Checked = true;
                                break;
                            case YAHOO_MAP_SAT:
                                chkYahooSatellite.Checked = true;
                                break;
                        }
                    }
                }
            }

            string googUrl = _appDef.GetValue("GoogleScript"); //NOXLATE
            string yahooUrl = _appDef.GetValue("YahooScript"); //NOXLATE

            if (!string.IsNullOrEmpty(yahooUrl))
            {
                txtYahooApiKey.Text = yahooUrl.Substring(YAHOO_URL.Length);
            }
            EvaluateCmsStates();

            _initialView = _group.InitialView;
            _cmsMaps = new Dictionary<string, CmsMap>();
            chkOverride.Checked = (_initialView != null);

            InitCmsMaps(group);
            Debug.Assert(_cmsMaps.Count == 13);

            if (_initialView == null)
                _initialView = group.CreateInitialView(0.0, 0.0, 0.0);

            txtViewX.Text = _initialView.CenterX.ToString(CultureInfo.InvariantCulture);
            txtViewY.Text = _initialView.CenterY.ToString(CultureInfo.InvariantCulture);
            txtViewScale.Text = _initialView.Scale.ToString(CultureInfo.InvariantCulture);

            txtViewX.TextChanged += (s, e) =>
            {
                double d;
                if (double.TryParse(txtViewX.Text, out d))
                {
                    _initialView.CenterX = d;
                    OnResourceChanged();
                }
            };
            txtViewY.TextChanged += (s, e) =>
            {
                double d;
                if (double.TryParse(txtViewY.Text, out d))
                {
                    _initialView.CenterY = d;
                    OnResourceChanged();
                }
            };
            txtViewScale.TextChanged += (s, e) =>
            {
                double d;
                if (double.TryParse(txtViewScale.Text, out d))
                {
                    _initialView.Scale = d;
                    OnResourceChanged();
                }
            };

            TextBoxBinder.BindText(txtMapId, group, "id"); //NOXLATE

            txtMapDefinition.Text = _map.GetMapDefinition();
            txtMapDefinition.TextChanged += (s, e) =>
            {
                _map.SetMapDefinition(txtMapDefinition.Text);
                OnResourceChanged();
            };

            CheckBoxBinder.BindChecked(chkSingleTiled, _map, "SingleTile"); //NOXLATE

            var selOverlay = _map.GetValue("SelectionAsOverlay"); //NOXLATE
            var selColor = _map.GetValue("SelectionColor"); //NOXLATE

            if (!string.IsNullOrEmpty(selColor))
                cmbSelectionColor.CurrentColor = Utility.ParseHTMLColorRGBA(selColor.Substring(2)); //Strip the "0x" part

            if (!string.IsNullOrEmpty(selOverlay))
            {
                bool b = true;
                if (bool.TryParse(selOverlay, out b))
                    chkSelectionAsOverlay.Checked = b;
            }

            cmbSelectionColor.SelectedIndexChanged += (s, e) =>
            {
                _map.SetValue("SelectionColor", "0x" + Utility.SerializeHTMLColorRGBA(cmbSelectionColor.CurrentColor, true)); //NOXLATE
                OnResourceChanged();
            };
            chkSelectionAsOverlay.CheckedChanged += (s, e) =>
            {
                _map.SetValue("SelectionAsOverlay", chkSelectionAsOverlay.Checked.ToString().ToLower()); //NOXLATE
                OnResourceChanged();
            };

            _noEvents = false;
        }