Skip to main content
San Diego Microsoft Consulting Solutions

John's Microsoft Solutions Notepad

Go Search
Advanced Microsoft Network Solutions  

Serving San Diego and Southern California customers that demand the very best  



Contact a Microsoft Solution Specialist  
Home
Enterprise Microsoft Solutions
Small Business Services
Microsoft Solutions Blog
About Gilham Consulting
Contact Us
  
 Home > John's Microsoft Solutions Notepad > Media > Google_Maps_Sharepoint_2007_Webpart_Code 

Web Part Page Title Bar image
Google Maps Sharepoint 2007 and WSS Webpart

 Google Maps WebPart

 Download Google Maps Web Part

 

Download the free Google Maps Sharepoint Web Part Template

You will need to replace some variables when editing the Web Part Source Code:

  • Replace API Key (Get One Here)
    • <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=YOUR_VERY_LONG_API_KEY_HERE" type="text/javascript">
  • Replace with Lattitude Longitude:
    • map.setCenter(new GLatLng(33.077734,-117.14035),12)
    • var point = new GLatLng(33.077734,-117.14035);
  • Optional - Change Height and Width:
    • <div id="map" style="width: 500px; height:500px"></div>

Modified from orignal author:
http://www.sharepointblogs.com/bobbyhabib/archive/2007/12/05/create-a-google-map-web-part-for-free.aspx

 

 Or Paste Source Code in Content Editor Web Part

<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=YOUR_VERY_LONG_API_KEY_HERE" type="text/javascript">
</script>
<script type="text/javascript">
function load() {
function createMarker(point,html) {
 var marker = new GMarker(point);
   GEvent.addListener(marker, "click", function() {
     marker.openInfoWindowHtml(html);
     });
   return marker;
 }
var map = new GMap2(document.getElementById("map"));
     map.addControl(new GSmallMapControl());
     map.setCenter(new GLatLng(33.077734,-117.14035),12);
var point = new GLatLng(33.077734,-117.14035);
 var marker = createMarker(point,'Home')
     map.addOverlay(marker);
 }
</script>
<div id="map" style="width: 500px; height:500px"></div>
<script type="text/javascript">
 window.onload = load;
</script>


Contact Us  |  877.445.4267  |  San Diego, CA

Copyright 2007 Gilham Consulting - All rights reserved