Pomóż nam przetłumaczyć lub ulepszyć tłumaczenie tej strony i zdobądź darmową licencję !
Użytkownik anonimowy  |  Zaloguj  |  Utwórz konto


inject html text into GInfoWindow
Powrót do galerii kodu
Autor: lenny76
Publicado: 2007-07-26
Leído: 9554 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