Display KML on Google Maps


Display KML on Google Maps

Kml File Example

KML is a file format used to display geographic data in an Earth browser such as Google Earth, Google Maps, and Google Maps for android. 
If you have a Kml file content and you need to view kml file in Google Map. This Google Map API v3 example demonstrates how to plot KML file in google map. Find the javascript code snippet below :-
// Function to plot a kml on google map
function OpenWimaxCovarageplot() {
            if (map) {               
                WimaxLayer = null;
                WimaxLayer = new google.maps.KmlLayer(''); 

                if (WimaxLayer) {
view kml file in google maps,how to open kml files in google earth,view kml in google maps,google earth kmz,view kmz files,kml or kmz
view kmz file in google maps
// Function to remove opened kml from Google Map
 function RemoveWimaxCovarageplot() {
            if (WimaxLayer) {
                WimaxLayer = null;

Note: Your .KML file should be located on public IP
Display KML on Google Maps Reviewed by Ravi Kumar on 11:54 AM Rating: 5


  1. Nice article Ravi. Could you please give some description of KML file to make this article more descriptive.

  2. yeah sure! KML is a file format(extension) used to display geographic data on google maps and google earth.

    KML uses a tag-based structure with nested elements and attributes and is based on the XML standard.

    For example download the kml file from the below url and open it in notepad or google earth.


    I hope you will find this information helpful for more please visit https://developers.google.com/kml/documentation/kml_tut

    1. Hi Ravi,

      Could you please help me to load .kml file on google map through virtual directory of Development server, i created an virtual directory from where i can download the file if i put URL on IE, but when i putting same url into google.map.KmlLayer('my virtual directory') the map is not displayed. Could you please guide me. Where i get stuck.

      Awaiting for your quick response

    2. Hello Pankaj,

      you should upload your kml file on public IP/URL otherwise it will not display on google map.


All Rights Reserved by Etechpulse © 2012 - 2017

Contact Form


Email *

Message *

Powered by Blogger.