public GoogleMapEditor(umbraco.interfaces.IData Data, MapState Configuration)
 {
     _data = Data;
     if (Configuration != null)
     {
         value = Configuration;
     }
     else
     {
         value = new MapState()
         {
             Width = Constants.DEFAULT_WIDTH,
             Height = Constants.DEFAULT_HEIGHT,
             Zoom = Constants.DEFAULT_ZOOM,
             Language = Constants.DEFAULT_LANGUAGE,
             DrawingTools = Constants.DEFAULT_DRAWINGTOOLS,
             SingleLocation = false,
             SearchBox = true,
             RichtextEditor = false,
             ZoomControl = true,
             PanControl = true,
             StreetViewControl = true,
             ScaleControl = true,
             Center = new Center
             {
                 Latitude = Constants.DEFAULT_LAT,
                 Longitude = Constants.DEFAULT_LNG
             }
         };
     }
 }
        public void Save()
        {
            _datatype.DBType = (umbraco.cms.businesslogic.datatype.DBTypes)Enum.Parse(typeof(umbraco.cms.businesslogic.datatype.DBTypes), DBTypes.Ntext.ToString(), true);

            int zoom = Constants.DEFAULT_ZOOM;
            int width = Constants.DEFAULT_WIDTH;
            int height = Constants.DEFAULT_HEIGHT;
            double lat = Constants.DEFAULT_LAT;
            double lng = Constants.DEFAULT_LNG;

            int.TryParse(this._txtHeight.Text, out height);
            int.TryParse(this._txtWidth.Text, out width);
            int.TryParse(this._txtZoom.Text, out zoom);
            double.TryParse(this._txtCenterLatitude.Text, out lat);
            double.TryParse(this._txtCenterLongitude.Text, out lng);

            List<string> drawingTools = new List<string>();

            foreach (ListItem item in this._cblDrawingTools.Items)
            {
                if (item.Selected)
                {
                    drawingTools.Add(item.Value);
                }
            }

            MapState data = new MapState()
            {
                Language = this._ddlLanguages.SelectedValue,
                Height = height,
                Width = width,
                Zoom = zoom,
                SearchBox = this._cbSearchBox.Checked,
                RichtextEditor = this._cbRichText.Checked,
                DrawingTools = drawingTools.ToArray<string>(),
                SingleLocation = this._cbSingleLocation.Checked,
                ZoomControl = this._cbZoomControl.Checked,
                PanControl = this._cbPanControl.Checked,
                StreetViewControl = this._cbStreetViewControl.Checked,
                ScaleControl = this._cbScaleControl.Checked,
                Center = new Center() { Latitude = lat, Longitude = lng }
            };

            SqlHelper.ExecuteNonQuery("delete from cmsDataTypePreValues where datatypenodeid = @dtdefid",
                    SqlHelper.CreateParameter("@dtdefid", _datatype.DataTypeDefinitionId));
            SqlHelper.ExecuteNonQuery("insert into cmsDataTypePreValues (datatypenodeid,[value],sortorder,alias) values (@dtdefid,@value,0,'')",
                    SqlHelper.CreateParameter("@dtdefid", _datatype.DataTypeDefinitionId),
                    SqlHelper.CreateParameter("@value", data.ToJSON()));
        }