Simple Map
HTML
<div id="map"></div>
<!-- Replace the value of the key parameter with your own API key. -->
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCkUOdZ5y7hMm0yrcCQoCvLwzdM6M8s5qk"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/geocodezip/geoxml3@master/polys/geoxml3.js"></script>
CSS
/* Always set the map height explicitly to define the size of the div
* element that contains the map. */
#map {
height: 100%;
}
/* Optional: Makes the sample page fill the window. */
html,
body {
height: 100%;
margin: 0;
padding: 0;
}
JavaScript
var map;
function initialize() {
map = new google.maps.Map(document.getElementById('map'), {
center: new google.maps.LatLng(37.566826, 126.9786567),
zoom: 11,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
var geoXml = new geoXML3.parser({
map: map,
suppressInfoWindows: true,
zoom: false,
});
geoXml.parseKmlString(kmlStr);
}
google.maps.event.addDomListener(window, "load", initialize);
var kmlStr = '<?xml version="1.0" encoding="utf-8" ?><kml xmlns="http://www.opengis.net/kml/2.2"><Document id="root_doc"><Schema name="gadm41_KOR_1" id="gadm41_KOR_1"><SimpleField name="GID_1" type="string"></SimpleField><SimpleField name="GID_0" type="string"></SimpleField><SimpleField name="COUNTRY" type="string"></SimpleField><SimpleField name="NAME_1" type="string"></SimpleField><SimpleField name="VARNAME_1" type="string"></SimpleField><SimpleField name="NL_NAME_1" type="string"></SimpleField><SimpleField name="TYPE_1" type="string"></SimpleField><SimpleField name="ENGTYPE_1" type="string"></SimpleField><SimpleField name="CC_1" type="string"></SimpleField><SimpleField name="HASC_1" type="string"></SimpleField><SimpleField name="ISO_1" type="string"></SimpleField></Schema><Folder><name>gadm41_KOR_1</name><Placemark><name>KOR.16_1</name><description>KOR</description><Style><LineStyle><color>ff0000ff</color></LineStyle><PolyStyle><fill>1</fill><color>ff000000</color></PolyStyle></Style><ExtendedData><SchemaData schemaUrl="#gadm41_KOR_1"><SimpleData name="GID_1">South Korea</SimpleData><SimpleData name="GID_0">Seoul</SimpleData><SimpleData name="COUNTRY">Keijo|Séoul|Seul|Seúl|Söul|Soul-</SimpleData><SimpleData name="NAME_1">서울특별시</SimpleData><SimpleData name="VARNAME_1">Teukbyeolsi</SimpleData><SimpleData name="NL_NAME_1">Capital Metropolitan City</SimpleData><SimpleData name="TYPE_1">NA</SimpleData><SimpleData name="ENGTYPE_1">KR.SO</SimpleData><SimpleData...