
Descargarlo directamente desde el Sitio de CodeProject
Introduction
This article presents a Google map WebPart.
This article presents a Google map WebPart.
Using the code
The rendering on the Google map control is performed in the WebPart Render event. The Google map control is initialized using the ClientScriptManager object.
Collapse
Copy Code
protected override void Render(HtmlTextWriter writer)
{
string rScript = "";
rScript += "m_rGoogleKey + "\"\n type=\"text/javascript\">\n";
rScript += "\n";
rScript += " GHeight + "px\">
\n";{
string rScript = "";
rScript += "m_rGoogleKey + "\"\n type=\"text/javascript\">\n";
rScript += "\n";
rScript += " GHeight + "px\">
writer.Write(rScript);
if (!Page.ClientScript.IsStartupScriptRegistered("MapInit"))
Page.ClientScript.RegisterStartupScript(typeof(string), "MapInit",
"Init()", true);
}
In order to be able to modify the Google map properties, I created an EditorPart class, allowing the user to change the Google API key or the dimensions of the WebPart.
Collapse
No hay comentarios:
Publicar un comentario