Kenny
17.11.2012, 12:49
Kopiere die Codestellen nicht einfach von Browserfenster zu Browserfenster! Speichere die bitte zwischen mittels Notepad++ oder einem anderen geeigneten Editor.
(17.11.2012, 19:45)Jockl schrieb: [ -> ]GoogleMaps bezogenen Einträge
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
var geocoder, map, map2;
function initialize() {
geocoder = new google.maps.Geocoder();
var geont = "{$GLOBALS['tplvars']['resrev_geo']}";
var myLatlng2 = new google.maps.LatLng{$GLOBALS['tplvars']['resrev_geo']};
if(geont == ""){
myLatlng2 = new google.maps.LatLng(0,0);
}
var myOptions2 = {
zoom: 4,
center: myLatlng2,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
map2 = new google.maps.Map(document.getElementById('map_geol'), myOptions2);
var marker2 = new google.maps.Marker({
position: myLatlng2,
map: map2
});
var myLatlng = new google.maps.LatLng{$GLOBALS['tplvars']['resrev_geo']};
var myOptions = {
zoom: 4,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
map = new google.maps.Map(document.getElementById('map_postbit'), myOptions);
var marker = new google.maps.Marker({
position: myLatlng,
map: map
});
}
function codeAddress() {
var address = document.getElementById('xthreads_resrev_location').value;
geocoder.geocode({'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var mylocation = results[0].geometry.location;
map2.setCenter(mylocation);
var marker3 = new google.maps.Marker({
map: map2,
position: mylocation
});
document.getElementsByName("xthreads_resrev_geo")[0].value = mylocation;
} else {
alert("Geocode was not successful for the following reason: " + status);
}
});
}
</script><