31-12-16, 08:16 PM
اود السؤال عن معنى هذا الكود وماهي الادوات المستخدمه
كود :
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class Samples_MapClickEvent : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//Add event handler for PushpinMoved event
GoogleMapForASPNet1.MapClicked += new GoogleMapForASPNet.MapClickedHandler(OnMapClicked);
if (!IsPostBack)
{
//You must specify Google Map API Key for this component. You can obtain this key from http://code.google.com/apis/maps/signup.html
//For samples to run properly, set GoogleAPIKey in Web.Config file.
GoogleMapForASPNet1.GoogleMapObject.APIKey = ConfigurationManager.AppSettings["API_Key"];
//Specify width and height for map. You can specify either in pixels or in percentage relative to it's container.
GoogleMapForASPNet1.GoogleMapObject.Width = "1000px"; // You can also specify percentage(e.g. 80%) here
GoogleMapForASPNet1.GoogleMapObject.Height = "500px";
//Specify initial Zoom level.
GoogleMapForASPNet1.GoogleMapObject.ZoomLevel = 14;
//Specify Center Point for map. Map will be centered on this point.
GoogleMapForASPNet1.GoogleMapObject.CenterPoint = new GooglePoint("1", 26.396893, 50.195927);
}
}
//Add event handler for Map Click event
void OnMapClicked(double dLat, double dLng)
{
//Print clicked map positions
lblPushpin1.Text = "(" + dLat.ToString() + "," + dLng.ToString() + ")";
//Generate new id for google point
string sID = "Point1";
GooglePoint GP1 = new GooglePoint(sID, dLat, dLng);
GoogleMapForASPNet1.GoogleMapObject.Points.Add(GP1);
Session["x"] = dLat.ToString();
Session["y"] = dLng.ToString();
Response.Redirect("SignUpStore.aspx");
}