Die Einbindung dieser Karte:
Siehe davor Voraussetzung
1. In einer HTML Seite diesen Code eingeben:
<div id="map" style="width: 650px; height: 500px"></div>
<noscript>
<strong>JavaScript muss aktiviert sein um Google Maps zu nutzen.</strong> Es scheint jedoch, dass JavaScript entweder deaktiviert ist oder von Ihrem Browser nicht unterstützt wird. Um Google Maps anzuzeigen aktivieren Sie JavaScript in den Browser-Optionen und versuchen Sie es dann erneut.
</noscript>
<script type="text/javascript">
//<![CDATA[
if (GBrowserIsCompatible()) {
function MoreControl() {}
MoreControl.prototype = new GControl();
MoreControl.prototype.initialize = function(map) {
var container = document.createElement("div");
container.style.border = "2px solid black";
container.style.fontSize = "12px";
container.style.fontFamily = "Arial, sans-serif";
container.style.width="80px";
container.style.backgroundColor = "#ffffff";
container.style.textAlign = "center";
container.innerHTML = "Bilder & Artikel...";
map.getContainer().appendChild(container);
GEvent.addDomListener(container, "mouseover", function() {
map.addControl(layerControl);
});
return container;
}
MoreControl.prototype.getDefaultPosition = function() {
return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(210, 7));
}
function LayerControl(opts) {
this.opts = opts;
}
LayerControl.prototype = new GControl();
LayerControl.prototype.initialize = function(map) {
var container = document.createElement("div");
container.style.border = "2px solid black";
container.style.fontSize = "12px";
container.style.fontFamily = "Arial, sans-serif";
container.style.width="80px";
container.style.backgroundColor = "#ffffff";
container.innerHTML = '<center><b>Bilder & Artikel...<\/b><\/center>';
for (var i=0; i<this.opts.length; i++) {
if (layers[i].Visible) {
var c = 'checked';
} else {
var c = '';
}
container.innerHTML += '<input type="checkbox" onclick="toggleLayer('+i+')" ' +c+ ' /> '+this.opts[i]+'<br>';
}
map.getContainer().appendChild(container);
setTimeout("map.removeControl(layerControl)",5000);
return container;
}
LayerControl.prototype.getDefaultPosition = function() {
return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(210, 7));
}
function toggleLayer(i) {
if (layers[i].Visible) {
layers[i].hide();
} else {
if(layers[i].Added) {
layers[i].show();
} else {
map.addOverlay(layers[i]);
layers[i].Added = true;
}
}
layers[i].Visible = !layers[i].Visible;
}
var map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(50.9415187027125,6.958465576171875),13);
map.addControl(new GMapTypeControl());
map.addControl(new GLargeMapControl());
var layers = [];
layers[0] = new GLayer("org.wikipedia.en");
layers[0].Visible = false;
layers[0].Added = false;
layers[1] = new GLayer("org.wikipedia.de");
layers[1].Visible = false;
layers[1].Added = false;
layers[2] = new GLayer("com.panoramio.all");
layers[2].Visible = false;
layers[2].Added = false;
layers[3] = new GLayer("com.panoramio.popular");
map.addOverlay(layers[3]);
layers[3].Visible = true;
layers[3].Added = true;
var layerControl = new LayerControl(["Wiki", "Wiki DE", "Bilder", "Popular"]);
map.addControl(new MoreControl());
}
window.onunload = GUnload;
//]]>
</script>