Open NRose opened 10 years ago
var map; var geocoder = null; geocoder = new google.maps.Geocoder();
function initialize() { var mapOptions = { zoom: 11, center: new google.maps.LatLng(breitengrad, längegrad), mapTypeControl: false, zoomControl: true, zoomControlOptions: { style: google.maps.ZoomControlStyle.LARGE }, streetViewControl: false, scrollwheel: false, mapTypeId: google.maps.MapTypeId.ROADMAP };
map = new google.maps.Map(document.getElementById('map'), mapOptions);
}
function doSearch() {
address = document.getElementById("search_input").value;
geocoder.geocode( { 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
map.setCenter(results[0].geometry.location);
map.setZoom(13);
}
else{
var request = new XMLHttpRequest();
request.open('GET', 'http://localhost:3000/get/json);
request.onload = function(){
doResolutionSearch(JSON.parse(this.responseText), address);
};
request.send();
}
});
}
Route zeichnen auf der Map: https://developers.google.com/maps/documentation/javascript/overlays?hl=de#Polylines mit entfernung berechnen: http://www.freemaptools.com/how-far-is-it-between.htm
Ist das hier hilfreich? http://www.dreamdealer.nl/tutorials/getting_directions_with_google_maps.html
https://developers.google.com/maps/documentation/geocoding/?hl=de