Ignore:
Timestamp:
Jan 3, 2011, 7:39:14 PM (13 years ago)
Author:
cljosse
Message:

[edit_gmaps] upgrade to Google map apiV3


File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/edit_gmaps/admin/admin_edit.php

    r6445 r8456  
    11<?php
    22if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
     3
     4if (!defined('EDIT_RV_ROOT'))
     5define(  'EDIT_RV_ROOT',  PHPWG_PLUGINS_PATH.'edit_gmaps/admin/' );
     6
    37global $lang;
    48load_language('lang', dirname(__FILE__).'/../');
     
    3539
    3640$template->concat('TABSHEET_TITLE', ' '.l10n_dec('%d element', '%d elements', count($page['cat_elements_id'])).' - '.$page['title']);
     41
     42
     43$template->assign(
     44                                                array(                                         
     45                                                'EDIT_RV_ROOT' => EDIT_RV_ROOT)
     46                                                 );
    3747
    3848 
     
    99109            unset($collection);
    100110 }
     111
     112 
     113
    101114 if ($_POST['submit']==l10n('search_title' ))
    102115  { 
     116
    103117  $match  = $_POST['match'] ;
    104118
     
    203217{   
    204218    $lat =1000;
    205 
     219       
    206220if ($match<>"" && $match<>"/" )
    207221{   
    208222$match=str_replace(" ","+",$match);
    209 
    210223       $src="http://maps.google.com/maps/geo?q=".$match."&output=xml&sensor=true_or_false&key=".$conf['gmaps_api_key'];
    211224//json,kml,xml,csv
     
    216229                $lat=$location[1];
    217230                $lon=$location[0];
     231
    218232                                $template->assign(      array('lat' => $lat ,
    219233                                                                      'lon' => $lon ,));
     234                                $template->assign( 'coordinates',
     235                                                   array('LAT' => $lat,
     236                                                                                 'LON' => $lon,
     237                                                                                )
     238                                                                        );
    220239   }
    221240                                                                       
     
    225244                        if (array_search($id_0,$image)) {
    226245                         if ($lat==1000) {
    227                             $lat= ($image['lat'] <> '') ? $image['lat'] : '49.0'  ;
     246                            $lat= ($image['lat'] <> '') ? $image['lat'] : '100'  ;
    228247                                $lon= ($image['lon']  <> '') ? $image['lon'] : '3.0'  ;
    229                                 $template->assign(      array('lat' => $lat ,
    230                                                                       'lon' => $lon ,
    231                                                               )
    232                                 );
    233                         }
     248
     249                                $template->assign(      array('zoom' => 4,'lat' => $lat , 'lon' => $lon , )     );
     250                                $template->assign( 'coordinates',
     251                                                   array('LAT' => $lat,
     252                                                                                 'LON' => $lon,
     253                                                                                )
     254                                                                        );
     255
     256                                }
    234257                 
    235258                         $tpl_var = array_merge(
Note: See TracChangeset for help on using the changeset viewer.