Hãy giúp chúng tôi dịch trang web này cũng như cải tiến bản dịch tiếng Anh các trang của chúng tôi, Bạn sẽ nhận được phiên bản đơn giản có bản quyền.
Người dùng vô danh  |  Đăng nhập  |  Tạo tài khoản


Click and Center By Server
Chuyển về thư viện mã lệnh
Autor: subgurim
Publicado: 17/01/2007
Leído: 9044 veces
Comentarios (0)
Valoracion: 8,964667


/**** Explicación / Description  ****/
Castellano
Cuando haces clic en el mapa, se viaja a servidor y éste te devuelve las instrucciones para que el mapa se centre donde has hecho el clic.

Simplemente un ejemplo academic

English
When the map is clicked, there's a trip to the server and it returns the instructions to center the map where it was clicked.

A simple "academic" example.


/**** Código de servidor / Server code  ****/
using System;

using Subgurim.Controles;

public partial class Galeria_codigo_Ejemplos_ClickAndCenterServer : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }


    protected string GMap1_Click(object s, GAjaxServerEventArgs e)
    {
        return string.Format("{0}.panTo({1})", e.who, e.point.ToString("new"));
    }
}


/**** Código HTML / HTML Code  ****/
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ClickAndCenterServer.aspx.cs" Inherits="Galeria_codigo_Ejemplos_ClickAndCenterServer" %>

<%@ Register Assembly="GMaps" Namespace="Subgurim.Controles" TagPrefix="cc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Click And Center By Server</title>
   
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <cc1:GMap ID="GMap1" runat="server" enableServerEvents="true" Width="600px" Height="400px"
         OnClick="GMap1_Click" />
    </div>
    </form>
</body>
</html>


/**** Código Javascript / Javascript Code  ****/

.aspx
        return string.Format("{0}.panTo({1})", e.who, e.point.ToString("new"));

Powered by Subgurim.NET and Comunactivo