Exemple #1
0
        /// <summary>
        /// overrides OnPreRender in CompositeControl
        /// </summary>
        /// <param name="e"></param>
        protected override void OnPreRender(EventArgs e)
        {
            this.Style[HtmlTextWriterStyle.TextAlign] = "center";

            if (mapReference == null && MapReferenceId != null)
            {
                mapReference = this.FindSFMap();
            }

            if (mapReference != null)
            {
                string egisScriipt      = mapReference.ClientJSResouceName;
                ClientScriptManager csm = this.Page.ClientScript;
                csm.RegisterClientScriptResource(this.GetType(), egisScriipt);

                btnPanLeft.OnClientClick  = PanLeftClientJS;
                btnPanRight.OnClientClick = PanRightClientJS;
                btnPanUp.OnClientClick    = PanUpClientJS;
                btnPanDown.OnClientClick  = PanDownClientJS;
                btnZoomIn.OnClientClick   = ZoomInClientJS;
                btnZoomOut.OnClientClick  = ZoomOutClientJS;
            }
            else
            {
                System.Diagnostics.Debug.WriteLine("could not find " + MapReferenceId);
            }

            base.OnPreRender(e);
        }
Exemple #2
0
 /// <summary>
 /// Sets a reference to the SFMap Web Control that the MapPanControl will interact with
 /// </summary>
 /// <param name="map">the SFMap control</param>
 public void SetMap(ISFMap map)
 {
     mapReference = map;
     if (map != null)
     {
         this.MapReferenceId = map.ControlId;
     }
 }
        /// <summary>
        /// Sets a reference to the SFMap Web Control that the MapPanControl will interact with
        /// </summary>
        /// <param name="map">the SFMap control</param>
        public void SetMap(ISFMap map)
        {
            mapReference = map;
            if (map != null)
            {
                this.MapReferenceId = map.ControlId;
            }

        }
Exemple #4
0
        private ISFMap FindSFMap()
        {
            if (MapReferenceId == null)
            {
                return(null);
            }
            ISFMap map = this.Page.FindControl(MapReferenceId) as ISFMap;

            if (map == null && this.Page.Master != null)
            {
                //check masterpage
                map = FindControlRecursive(this.Page.Master, MapReferenceId) as ISFMap;
            }
            return(map);
        }
        /// <summary>
        /// overrides OnPreRender in CompositeControl
        /// </summary>
        /// <param name="e"></param>
        protected override void OnPreRender(EventArgs e)
        {
            
            this.Style[HtmlTextWriterStyle.TextAlign] = "center";
            
            if (mapReference == null && MapReferenceId!= null)
            {
                mapReference = this.FindSFMap();
            }

            if (mapReference != null)
            {
                string egisScriipt = mapReference.ClientJSResouceName;
                ClientScriptManager csm = this.Page.ClientScript;
                csm.RegisterClientScriptResource(this.GetType(), egisScriipt);

                btnPanLeft.OnClientClick = PanLeftClientJS;
                btnPanRight.OnClientClick = PanRightClientJS;
                btnPanUp.OnClientClick = PanUpClientJS;
                btnPanDown.OnClientClick = PanDownClientJS;
                btnZoomIn.OnClientClick = ZoomInClientJS;
                btnZoomOut.OnClientClick = ZoomOutClientJS;
            }
            else
            {
                System.Diagnostics.Debug.WriteLine("could not find " + MapReferenceId);
            }

            base.OnPreRender(e);
        }