Google Map (Automatischer Zoom)

hmmNaGut

Erfahrenes Mitglied
Hallo.. Leute brauche mal wieder eure Hilfe

Ich suche nach der Möglichkeit eines Automatischen Zooms.

Wenn der User in das Suchfeld Deutschland eingibt.. soll z.B. Zoom 1 sein
Wenn er eine genaue Adresse eingibt Zoom 10

Danke schon mal für eure Hilfe!!

Lg Patrick
 
Die Lösung habe ich schon gefunden.,

Hier bekommt ihr den Source Code

LG Patrick



PHP:
	  search:function(){
		  	
			var address = $('search-textfield').value;
			geocoder = new GClientGeocoder();
			geocoder.getLocations(
					address,
					function(response){
							if(response.Status.code == 200){
								place = response.Placemark[0];
								var point = new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]); 
								var viewport = new GLatLngBounds;
								viewport.extend(new GLatLng(place.ExtendedData.LatLonBox.south, place.ExtendedData.LatLonBox.west));
								viewport.extend(new GLatLng(place.ExtendedData.LatLonBox.north, place.ExtendedData.LatLonBox.east));
								this.map.setCenter(viewport.getCenter(), this.map.getBoundsZoomLevel(viewport));
								this.checkMarkers();
							}
							else if(response.Status.code == 602){
							    $('result-list').update("<h3>" + this.options['addressNotFound']+"</h3>");
							}
							
					}.bind(this)
			);
	  },
 
Zurück