Sven Mintel
Mitglied
Könntest du bitte mal das komplette HTML-Dokument posten?
Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
var map = new GMap2(document.getElementById("map"));
var address = document.getElementById('addressInput').value;
var geocoder = new GClientGeocoder();
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
// Create our "tiny" marker icon
var icon = new GIcon();
icon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";
icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
icon.iconSize = new GSize(12, 20);
icon.shadowSize = new GSize(22, 20);
icon.iconAnchor = new GPoint(6, 20);
icon.infoWindowAnchor = new GPoint(5, 1);
// Our info window content
var infoTabs = [
new GInfoWindowTab("Tab1", "This is tab #1 content"),
new GInfoWindowTab("Tab2", "This is tab #2 content"),
new GInfoWindowTab("Tab3", "This is tab #3 content")
];
geocoder.getLatLng(address, function(latlng) {
if (!latlng) {
alert(address + ' not found');
} else {
GEvent.addListener(map, "moveend", function() {
//var center = map.getCenter();
//document.getElementById("message").innerHTML = "<div style=\"font-family: Verdana,Arial; font-size:12px;\">Kartenmitte (Breite, Länge in °): "+center.toString()+"</div>";
});
map.setCenter(latlng, 15);
var marker = new GMarker(latlng, {draggable: true});
GEvent.addListener(marker, "dragstart", function() {
map.closeInfoWindow();
});
GEvent.addListener(marker, "dragend", function() {
});
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowTabsHtml(infoTabs);
});
//map.addOverlay(new GMarker(latlng, icon));
map.addOverlay(marker);
marker.openInfoWindowTabsHtml(infoTabs);
}});
// Create our "tiny" marker icon
var icon = new GIcon();
icon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";
icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
icon.iconSize = new GSize(12, 20);
icon.shadowSize = new GSize(22, 20);
icon.iconAnchor = new GPoint(6, 20);
icon.infoWindowAnchor = new GPoint(5, 1);
var marker = new GMarker(latlng, {draggable: true,icon:icon});
function showicons(point, name, address, type) {
var marker = new GMarker(point, myicons);
//var marker = new GMarker(point);
var html = "<b>" + name + "</b> <br/>" + address;
GEvent.addListener(marker, 'click', function() {
marker.openInfoWindowHtml(html);
});
return marker;
}