예제 #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);
        }
예제 #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;
     }
 }
예제 #3
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;
            }

        }
예제 #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);
        }
예제 #5
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);
        }