<中央十字マークを別のレイヤーとして表示する>
(1) 次のコードをたとえば centercross.kml というファイル名で同じフォルダに保存します。
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="
http://www.opengis.net/kml/2.2">
<ScreenOverlay>
<name>Simple crosshairs</name>
<description>This screen overlay uses fractional positioning to put the
image in the exact center of the screen</description>
<Icon> <href>
http://developers.google.com/kml/documentation/images/crosshairs.png</href>
</Icon>
<overlayXY x="0.5" y="0.5" xunits="fraction" yunits="fraction"/>
<screenXY x="0.5" y="0.5" xunits="fraction" yunits="fraction"/>
<rotationXY x="0.5" y="0.5" xunits="fraction" yunits="fraction"/>
<size x="0" y="0" xunits="pixels" yunits="pixels"/>
</ScreenOverlay>
</kml>
上記は Google Earth のKMLチュートリアルのサンプル集にあったもので、
https://developers.google.com/kml/documentation/kml_tut?hl=jaセンターマークは白色なので、好きな色の好きなマークに変更して下さい。
また、<desucption 説明文>は日本語でわかりやすいものに変更して下さい。
(2) 次のコードを<head></head>本文に書き加える
var url1 = baseurl + 'centercross.kml';
var crsLayer = new google.maps.KmlLayer(url1, {
preserveViewport: true
});
document.getElementById('crs').onchange = function() {
crsLayer.setMap(this.checked ? map : null);
};
(3) 次のコードを<body></body>に書き加える
//デフォルトでは非表示にする
<div style="float:left;"><input id="crs" type="checkbox" />中心十字</div>