WebsiteBaker 2.13.8 is now available!
R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WBhttps://forum.websitebaker.org/index.php/topic,32355.0.html
if (!isset($zoom)) $zoom=14;if (!isset($width)) $width=500;if (!isset($height)) $height=500;$data = file_get_contents("http://maps.googleapis.com/maps/api/geocode/json?address=".urlencode($address)."&sensor=false");$obj = json_decode($data); if ($obj) { if (isset($obj->results[0]->geometry->location)) { $loc = $obj->results[0]->geometry->location; $array = array('latitude'=>$loc->lat, 'longitude'=>$loc->lng); $string_address = implode(',', $array); } else { throw new Exception('Lookup failed and/or address does not exist!'); } } else { throw new Exception('Lookup failed and/or address does not exist!'); }echo' <style> #map_canvas { margin: 0; padding: 0; height:'.$height .'; width:'.$width .' } </style> <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script> <script> function initialize() { var mapOptions = { zoom: '. $zoom .', center: new google.maps.LatLng(' . $string_address .'), mapTypeId: google.maps.MapTypeId.ROADMAP}; map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions); var marker = new google.maps.Marker({ position: new google.maps.LatLng(' . $string_address .') , map: map }); } google.maps.event.addDomListener(window, "load", initialize); </script>'; return '<div id="map_canvas"></div>';