diff --git a/event.php b/event.php index 45ea8ec..d3a698a 100755 --- a/event.php +++ b/event.php @@ -34,10 +34,10 @@ $dtend = strtotime($event['event_dtend']); '.$event["event_localisation"].''; - $url = 'https://maps.googleapis.com/maps/api/geocode/json?address='.urlencode($event["event_localisation"]).'&key=AIzaSyB8Cd8NP8VOa0wIlvvYGEMZMzCKwROiHxU'; + $url = 'https://nominatim.openstreetmap.org/search?format=json&q='.urlencode($event["event_localisation"]); $obj = json_decode(file_get_contents($url), true); - $lat = $obj["results"][0]["geometry"]["location"]["lat"]; - $lng = $obj["results"][0]["geometry"]["location"]["lng"]; + $lat = $obj[0]["lat"]; + $lng = $obj[0]["lon"]; $urlFrame = 'http://www.openstreetmap.org/export/embed.html?bbox='.$lng.','.$lat.','.$lng.','.$lat.'&layer=mapnik&floor'; echo '