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


inject html text into GInfoWindow
Chuyển về thư viện mã lệnh
Autor: lenny76
Publicado: 26/07/2007
Leído: 9463 veces
Comentarios (0)
Valoracion: 6,884615


/**** Explicación / Description  ****/
I found a quite simple way to manage complex html code into GInfoWindow
to do this: create an Html file (map.htm)  without headers (html, body, ...) vs2005 even if with warnings will let you design and check it and also use css.
in the load event of the page with Gmap, insert the code below. careful to the name of the html file
you can even add strings dynamically to the html with the string builder. see {0} and {1} in the example

/**** Código de servidor / Server code  ****/
map.aspx

Dim objStreamReader As StreamReader
Dim ct As String
objStreamReader = File.OpenText(Server.MapPath("map.htm"))
ct = objStreamReader.ReadToEnd()
objStreamReader.Close()
ct = (ct.Replace(Chr(13), ""))

.......

window= New GInfoWindow(mymarkerlatlng, String.Format(ct, var1, var2), False, GListener.Event.mouseover)

GMap1.Add(finestra)



/**** Código HTML / HTML Code  ****/
map.htm:
<link href="miostile.css" rel="stylesheet" type="text/css" />
<div class="mappa" >
<img alt="{1}"src='foto/{1}.jpg' width='100' height='100' align='left' class='mappa_img'/>
<
div class="">
Luogo: {0}<br />
Data: xxxx<br />
</div>
</div>



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

none

Powered by Subgurim.NET and Comunactivo