Friday, May 6, 2011

Google My Maps KML integration for your Website/Blog


This is a continuation of
Export My Maps Into KML File
in which we had learned how to export
Google My Maps into KML file .

    To integrate KML layer into our website we will be using
    Google Maps javascript v3 API's google.maps.KmlLayer()
     function . We pass the URL of the KML file as the parameter
     to this function .

// The Kml Overlay should be used as
var georssLayer=new google.maps.KmlLayer(url);
// Since KML is an overlay you should
// use the Google Map setmap property
// map is the Google Map Object

The complete code for Google Map KML Layer is as follows .
<!DOCTYPE html>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>Google Maps JavaScript API v3 Example: KmlLayer GeoRSS</title>
<script type="text/javascript" src="">>/script>
<script src="">>/script>
<script type="text/javascript">
$(document).ready(function() {
initialize() ;

function initialize() {
  var myLatlng = new google.maps.LatLng(49.496675,-102.65625);
  var myOptions = {
    zoom: 4,
    center: myLatlng,
    mapTypeId: google.maps.MapTypeId.ROADMAP

  var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

  var georssLayer = new google.maps.KmlLayer(',73.061829&spn=0.326906,0.672226&z=11&iwloc=0004a299a67007d319eb4&output=kml');

  <div id="map_canvas" style="width:500px;height:550px"></div>

Your Google Map Integrated into your Website should look like this .


Hi,Planning websites is pretty much like designing stage sets, it must look great, but under the surface for Web Design Cochin it has to work so that the search sites and web surfers can find your website.Thanks.............