Moving marker and expand map boundary

Sep 30, 2008 at 3:46 AM
Edited Sep 30, 2008 at 3:48 AM
I am trying to get the map to expand when a marker has reached the edge of the map... Example moving marker below.
Any help would be greatful. Thanks.

    protected void Timer1_Tick(object sender, EventArgs e)
    {
        double lat, lng;
        int x;
        x = 3;

        GoogleMarker marker = new GoogleMarker();
        marker.AutoPan = true;

        if (Session["__Lat"] != null)
            if (double.TryParse(Convert.ToString(Session["__Lat"]), out lat))
                marker.Latitude = lat + x;
        if (Session["__Lng"] != null)
            if (double.TryParse(Convert.ToString(Session["__Lng"]), out lng))
                marker.Longitude = lng + x;

       
        GoogleMap1.Markers.Add(marker);

        Session["__Lat"] = marker.Latitude.ToString();
        Session["__Lng"] = marker.Longitude.ToString();

    }

    protected void Page_Load(object sender, EventArgs e)
    {
            GoogleMarker marker = new GoogleMarker();
            marker.Latitude = 42.7;
            marker.Longitude = 23.3;
            marker.AutoPan = true;
            GoogleMap1.Markers.Add(marker);

        if (!IsPostBack)
        {
            Session["__View"] = ((int)GoogleMap1.DefaultMapView).ToString();
            Session["__Lat"] = GoogleMap1.Latitude.ToString();
            Session["__Lng"] = GoogleMap1.Longitude.ToString();
            Session["__Zoom"] = GoogleMap1.Zoom.ToString();
        }
    }