Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Some that has an guide on have to create an Visual WebPart using Google Maps for an list....

protected override void Render(HtmlTextWriter writer)
{
    string rScript = "";
    rScript += "<script src=\"http://maps.google.com/maps?file=api&v=2&key=" + 
               m_rGoogleKey + "\"\n type=\"text/javascript\"></script>\n";
    rScript += "<script type=\"text/javascript\">\n";
    rScript += "//<![CDATA[\n";
    rScript += "function Init()\n";
    rScript += "{\n";
    rScript += "var map = new GMap2(document.getElementById(\"map\"));\n";
    if (DisableDragging)
        rScript += "map.disableDragging();\n";
    rScript += "var latlng = new GLatLng(" + m_dLatitude + ", " + m_dLongitude + ");\n";
    rScript += "map.setCenter(latlng, " + m_nZoomLevel + ");\n";
    if (DisplayZoomControl)
        rScript += "map.addControl(new GLargeMapControl());\n";
    rScript += "map.addControl(new GMapTypeControl());\n";
    rScript += "var mkr = new GMarker(latlng);\n";
    if (DisplayIcon)
        rScript += "map.addOverlay(mkr);\n";
    rScript += "}\n";
    rScript += "//]]>\n";
    rScript += "</script>\n";
    rScript += " <div id=\"map\" style=\"width: " + GWidth + "px; height: " + 
               GHeight + "px\"></div>\n";
    writer.Write(rScript);
    if (!Page.ClientScript.IsStartupScriptRegistered("MapInit"))
        Page.ClientScript.RegisterStartupScript(typeof(string), "MapInit",
                  "Init()", true);
}
share|improve this question
1  
Hi Morski, Welcome to SharePoint StackExchange. Your question isn't very clear, so I was wondering if you could add more details by editing the question? I have taken the liberty of editing the question to reformat the code for you. Also please refer to the FAQ[1] for a guide on how to use this Q&A site. [1]: sharepoint.stackexchange.com/faq –  Hugh Wood Dec 4 '12 at 12:39
    
Hi my friend , my question is like this 0 down vote favorite Some that has an guide on have to create an Visual WebPart using Google Maps for an list.... –  Martin Dec 4 '12 at 12:40
    
Bye the way welcome by your self... –  Martin Dec 4 '12 at 12:48
add comment

1 Answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.