Ci-dessous, les différences entre deux révisions de la page.
geo_data:check_adresses [21/01/2014 16:37] cyrille37 |
geo_data:check_adresses [21/08/2020 13:26] |
||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | ~~NOCACHE~~< | ||
- | class GeoCodage { | ||
- | | ||
- | | ||
- | | ||
- | if( self:: | ||
- | echo ' | ||
- | $data = array(); | ||
- | $data[' | ||
- | $data[' | ||
- | return $data ; | ||
- | } | ||
- | | ||
- | if( self:: | ||
- | echo ' | ||
- | $url = ' | ||
- | .urlencode($address) | ||
- | .'& | ||
- | if( $countrycodes != null ) | ||
- | $url .= '& | ||
- | $get = file_get_contents($url); | ||
- | if( self:: | ||
- | echo ' | ||
- | $results = json_decode($get); | ||
- | if( is_array($results) && count($results)> | ||
- | $data = array( | ||
- | ' | ||
- | ' | ||
- | ); | ||
- | } | ||
- | else { | ||
- | $data = array( | ||
- | ' | ||
- | ' | ||
- | ); | ||
- | } | ||
- | return $data; | ||
- | } | ||
- | | ||
- | if( self:: | ||
- | echo ' | ||
- | $url = ' | ||
- | $get = file_get_contents($url); | ||
- | if( self:: | ||
- | echo ' | ||
- | | ||
- | $data = array( | ||
- | ' | ||
- | ' | ||
- | ); | ||
- | return $data; | ||
- | } | ||
- | } | ||
- | |||
- | $dataPluginFile = DOKU_PLUGIN.' | ||
- | if(!file_exists($dataPluginFile)){ | ||
- | | ||
- | } | ||
- | require_once $dataPluginFile; | ||
- | $pdt = new syntax_plugin_data_table(); | ||
- | |||
- | $data = array( | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ); | ||
- | $dthlp = $pdt-> | ||
- | $column = $dthlp-> | ||
- | $column = $dthlp-> | ||
- | $column = $dthlp-> | ||
- | $column = $dthlp-> | ||
- | $column = $dthlp-> | ||
- | $column = $dthlp-> | ||
- | $column = $dthlp-> | ||
- | $column = $dthlp-> | ||
- | $column = $dthlp-> | ||
- | $column = $dthlp-> | ||
- | |||
- | $sql = $pdt-> | ||
- | $sqlite = $dthlp-> | ||
- | $res = $sqlite-> | ||
- | $rows = $sqlite-> | ||
- | $rowsCount = count($rows); | ||
- | |||
- | $geocodepage = ''; | ||
- | if( isset($_REQUEST[' | ||
- | { | ||
- | | ||
- | } | ||
- | echo '< | ||
- | |||
- | function getOsmUrl($lat, | ||
- | { | ||
- | | ||
- | } | ||
- | |||
- | foreach( $rows as $n => $row ){ | ||
- | | ||
- | $addr = $adr1.', | ||
- | |||
- | echo '< | ||
- | echo '< | ||
- | |||
- | if( $geocodepage == trim($pageid) ){ | ||
- | |||
- | // sans le code postal (pour Nominatim) | ||
- | $addr = $adr1 ; | ||
- | $addr.= strlen(trim($adr2))> | ||
- | $addr.= strlen(trim($adr3))> | ||
- | $addr.= $ville ; | ||
- | |||
- | // | ||
- | $geoCod = new GeoCodage(); | ||
- | $geodata = $geoCod-> | ||
- | $geo = $geodata[' | ||
- | if( $geo[' | ||
- | else if( $geo[' | ||
- | else $color=' | ||
- | //echo '< | ||
- | |||
- | echo '< | ||
- | |||
- | //if( $geo[' | ||
- | // $geo = $geodata[' | ||
- | // echo '< | ||
- | //} | ||
- | } | ||
- | echo '</ | ||
- | } | ||
- | |||
- | </ |