Skip to main content

KML Overlay

Supported Object Types

  • Markers
  • Polylines
  • Polygons

Overlaying KML on map

KML Properties

Required Parameter

  • Map
  • url: URL of the KML file.

Optional Parameter

  • fitbounds: Fits in the map layer automatically to a bound on which geoJson has made. By default it is false.
    {
fitbounds: true
}
  • fitboundOptions: This shows the options aailable on the fitBound property.
    {
fitboundOptions: {padding: 120,duration:1000}
}
  • cType: It is for geojson data geometry
    • 0: for lat,lng combination (Default)
    • 1: for lng,lat conbination
    {
cType: 1
}

KmlLayer Method

Mappls.KmlLayer()

    var url="https://www.mapmyindia.com/api/advanced-maps/doc/sample/mmi.kml"; 
new mappls.KmlLayer({
map:map_object,
url:url,
cType:1,
preserveViewport:true
});

Remove KML Overlay

    mappls.remove({map:map_object,layer:KmlLayer_object});