Usuario anónimo  |  Ingresar  |  Regístrate

inject html text into GInfoWindow
Volver a galería de código
Autor: lenny76
Publicado: 26/07/2007
Leído: 75479 veces
Comentarios (0)
Valoracion: 4,272727

/**** 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  ****/

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


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


/**** Código HTML / HTML Code  ****/
<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 />

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


Powered by Subgurim.NET