1

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);
}
3
  • 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....
    – Batistuta
    Dec 4 '12 at 12:40
  • Bye the way welcome by your self...
    – Batistuta
    Dec 4 '12 at 12:48
1

Morski,

There are some web parts available Open Source, you can use them:
1- SharePoint 2010 Google Maps V3 WebPart
2- Display Google Maps in a Sharepoint Web Part using a Sharepoint List
3- SharePoint 2010 Google Maps Web Part for Sandbox and Farm Solutions
4- sharepoint-google-maps-webpart

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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