mysqldumper
-


Hinweise


Antwort
 
LinkBack Themen-Optionen Thema durchsuchen Thema bewerten
Alt 13.03.2007, 16:18   #1
TP-Senior
 
Benutzerbild von mat81
 
Registriert seit: Jun 2005
Ort: Köln
mat81 macht alles soweit korrekt
Question

GoogleMaps-Api findet einige Adressen nicht.


Hallo allerseits,

die eingebaute GoogleApi läuft eigentlich ganz gut. Doch manchmal werden keine Adressen gefunden. Gebe ich den String genauso aber auf der maps.google.de ein, dann wird die Adrese gefunden.

Die Funktion geocoder.getLatLng bekommt von mir einen Adress-String (z.B. "Zum Fischacker 5, 58898 Eslohe") und sollte die Koordinaten (var point) zurück geben. Dies klappt in einigen Fällen aber nicht.

Nun fehlt mir der Ansatz. Sucht Google normalerweise die nächstmögliche Koordinate? Wenn ja, wie starte ich diesen Aufruf? Oder muss ich den String bearbeiten?

Aber wie gesagt, oft klappts auch.

Hier mal die wichtigste Funktion aus meinem js:

Code:
function showAddress(inf) {
	var adr=inf['str']+', '+inf['plz']+' '+inf['ort'];
	//var adr=inf['adress_encoded'];
	var adr_show=inf['str']+', '+inf['plz']+' '+inf['ort'];
	if(inf['logo']!="leer"){
		var imglogo=new Image;
		/*imglogo.src="images/"+inf['logo'];*/
		imglogo.src=inf['logo'];
	}
	var info="";
	info+='<div id="inWin" class="infoWindow" style="width: '+inf['infowin_x']+'px; height: 100px">';
	info+="<div class='left' style='white-space:nowrap; width: 100px'><b>"+inf['company']+"</b><br />";
	if(inf['denotation']!="leer"){info+=inf['denotation']+"<br />";}
	info+=inf['str']+"<br />";
	info+=inf['plz']+" "+inf['ort']+"<br />";
	if(inf['tel']!="leer"){info+="Tel: "+inf['tel']+"<br />";}
	if(inf['fax']!="leer"){info+="Fax: "+inf['fax']+"<br />";}
	if(inf['email']!="leer"){
		m=inf['email'];
		mail="mailto:"+inf['email'];
		info+='<a href="'+mail+'">'+m+'</a><br />';
	}
	if(inf['website']!="leer"){
		u=inf['website'];
		url="http://"+u;
		info+='<a href="'+url+'" target="_blank">'+u+'</a>';
	}
	info+="</div>";
	if(inf['logo']!="leer"){
		i=inf['logo'];
		var img='<div class="right"><div style="height: 20px; width="'+inf['logo_x']+'px">&nbsp;</div><img name="logobild" src='+imglogo.src+' width="'+inf['logo_x']+'px" height="'+inf['logo_y']+'px" onerror="this.style.display=\'none\'" /></div>';
		info+=img;
	}
	info+='</div>';
	var anfahrt="<div>"+googleRoute(adr);+"</div>";
	var infoTabs = [	//tab width = 90 px			ä : &auml; : ä : E4 : 228 : ä(utf-8)
		new GInfoWindowTab(" Händler ", info),
		new GInfoWindowTab(" Anfahrt ", anfahrt)				
	];
	geocoder.getLatLng(
		adr,
		function(point) {
			if (!point) {
				var not=adr_show+" in GoogleMaps leider nicht gefunden";
				//document.getElementById("mapD").style.display="none";
				alert(not);
			} else {			
				map.setCenter(point, 12, G_HYBRID_MAP);
				var marker = new GMarker(point, icon);
					GEvent.addListener(marker, "click", function() {
    					marker.openInfoWindowTabsHtml(infoTabs);
					});
				map.addOverlay(marker);
				map.addControl(new GLargeMapControl());
				map.addControl(new GMapTypeControl());
				marker.openInfoWindowTabsHtml(infoTabs);
				if(inf['logo']!="leer"){
					var lang=inWinSize(imglogo, inf['lang']);
					document.getElementById('inWin').style.width=lang+"px";
				}
			}
		}
	);
}
__________________

The difference between theory and practice is
that in theory there is no
difference between theory and practice
but in practice there is

Geändert von mat81 (13.03.2007 um 18:26 Uhr).
mat81 ist offline   Mit Zitat antworten


Alt 14.03.2007, 11:42   #2
TP-Senior
 
Benutzerbild von mat81
 
Registriert seit: Jun 2005
Ort: Köln
mat81 macht alles soweit korrekt

Lösung


Nun hab ich eine Lösung gefunden - scheint gut zu funktionieren. Bisher gabs noch keine Fehler.

Und zwar hat das Plugin nur Probleme mit dem Ortsnamen gehabt, v.a. wenn der Stadtteil mit angegeben wurde. Deshalb hab ich den Suchstring von

Code:
var adr=inf['str']+', '+inf['plz']+' '+inf['ort'];
auf

Code:
var adr=inf['str']+', '+inf['plz']+', Deutschland';
geändert.

Für länderübergreifende Anwendungen gilt dann natürlich:

Code:
var adr=inf['str']+', '+inf['plz']+', '+inf['staat'];

Vielleicht konnte das auch anderen Helfen... ich bin froh, dass es jetzt Funktioniert.
__________________

The difference between theory and practice is
that in theory there is no
difference between theory and practice
but in practice there is
mat81 ist offline   Mit Zitat antworten
Antwort

  Aktuelles Thema
  TP Hilfe Forum > Web-Editoren & Coding > HTML Puristen > Javascript
GoogleMaps-Api findet einige Adressen nicht. GoogleMaps-Api findet einige Adressen nicht.
« Scrollbalken als Grafik | Suche Scrollbalken »

Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)
 
Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Thema bewerten
Thema bewerten:

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an
Gehe zu


Alle Zeitangaben in WEZ +2. Es ist jetzt 21:42 Uhr.

Powered by: vBulletin Version 3.7 (Deutsch)
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd. / Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.
Traum-Projekt.com | Suchen | Archiv | Impressum | Kontakt | | | Nach oben |



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67