Changeset 247 for trunk/client/inc


Ignore:
Timestamp:
Jan 30, 2016, 11:38:54 PM (9 years ago)
Author:
luc
Message:

Aggiornato Google Maps e sistemato in amministrazione la scelta del tema.
Solo per l'upgrade temete conto del file di aggirnamento del databalse presente nella dir sql con il nome aggiornamento-2.0_2016-01-30.sql.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/client/inc/javascript.php

    r210 r247  
    4949
    5050
     51
     52
     53
     54
     55
    5156function googlemaps(){
    5257global $dbi,$prefix,$id_comune,$googlemaps,$op,$gkey,$lang;
     
    5762    $sql = mysql_query("select indirizzo from ".$prefix."_ele_sede where id_sede='$id_sede'", $dbi);
    5863    list($indirizzo)=mysql_fetch_row($sql);
    59     $address="$indirizzo  $comune";
     64    $address=rawurlencode("$indirizzo,$comune,58047");
     65
     66        $resultGeoCode=file_get_contents('http://maps.google.com/maps/api/geocode/json?address='.$address.'&sensor=false');
     67
     68        $output= json_decode($resultGeoCode);
     69       
     70        if($output->status == 'OK'){
     71                $latitude       = $output->results[0]->geometry->location->lat; //Returns Latitude
     72                $longitude      = $output->results[0]->geometry->location->lng; // Returns Longitude
     73                $location       = $output->results[0]->formatted_address;
     74        }
     75
     76
     77        $coords['lat'] = $latitude;
     78        $coords['long'] = $longitude;
     79
     80
     81
     82
     83
     84/*
     85
     86
     87
    6088       
    6189        $url = sprintf('http://maps.google.com/maps?output=js&q=%s',rawurlencode($address));
     
    75103        }
    76104
     105*/
     106
     107
     108
     109
     110
     111
     112
    77113echo '
    78114<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true&language=it"></script>
    79115   <script type="text/javascript">
    80       function initialize() {
     116      function maps() {
    81117         var latlng = new google.maps.LatLng('.$coords['lat'].','.$coords['long'].'); // centro della mappa
    82118         var myLatlng = new google.maps.LatLng('.$coords['lat'].','.$coords['long'].'); // segnapunto
     
    99135   </script>
    100136';
     137
    101138}
    102139?>
Note: See TracChangeset for help on using the changeset viewer.