in

SharePoint Blogs

The Best Place for SharePoint-related Blogs

Bobby Habib SharePoint & MOSS Blogging Space

Bobby Habib - My findings on SharePoint / MOSS, Web Part Developments, etc. Information I think will help the SharePoint Community. All posts are provided "AS IS" with no warranties, and confers no rights. Whats the bloody Point!

December 2007 - Posts

  • Create a Google Map Web Part for Free

    So you are looking at creating a google map web part for your MOSS web site and for FREE and done in minutes.

     

    Well this can be achieved in minutes and you could surprise yourself! There is no special development required to achieve this, just a little bit of HTML, a link out to the web from your MOSS server as the google map api will need to communicate to the google map server and a google API key which you can request from here. The google API key, is a key that will be mailed to you from google, once you have submitted the google api key form, you will need to agree to Google Standard Terms and Conditions and provide the URL of your MOSS site.  

    PreReq

    1. MOSS Server

    2. Goggle API Key

    How Too

    1. Open a Moss site where you would like to place your Goggle Map web part.

    2. Place a Content Editor Web Part in the Page of the site.

    3. Edit the content Editor Web Part and in the proerties of this web part open the source editor. Do not use the Rich Text Editor.

    4. Copy and paste the folloing code in the sorce editor:

    <script src="http://maps.google.com/maps?file=api&v=1&key=ADD_YOUR_GOGGLE_API_KEY_HERE" mce_src="http://maps.google.com/maps?file=api&v=1&key=ADD_YOUR_GOGGLE_API_KEY_HERE" type="text/javascript">

    </script>

    <div id="map" style="width: 400px;height:300px"></div>

    <script type="text/javascript">

    var map = new GMap(document.getElementById("map")); map.centerAndZoom(new GPoint(-0.160265, 51.51443), 3);

    </script>

    5. Apply and OK.

    6. And Voila!

    There is a good site that will get you the latitude and longitude coordinates of your desired location, that will be used when communicating to the google map server:

    http://geo.localsearchmaps.com/?street=45+Oxford+Street&city=London&country=UK

    Notice in the above URL you send the Building Number & the street, city, country and the site will return a text page of the latitude and longitude co-ordinates that you can use, for your desired location.

    If you want to add scaling and repositioning to your web part then add the following into your code, after the var map = ...... Line:

    map.addControl(new GLargeMapControl());

    This web part can be achieved in a matter of a few minutes and can save you some money, I have seen companies charging $400.00 for this. Surprise

    You can also add mapping markers and Location descriptions into your web part very easily. I will write another post showing this. Stick out tongue 

     

     


Need SharePoint Training? Attend a SharePoint Bootcamp!

Posts (c) their respective authors. Everything else (c) 2007 SharePoint Experts