-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMapaController.php
More file actions
executable file
·79 lines (65 loc) · 2.19 KB
/
Copy pathMapaController.php
File metadata and controls
executable file
·79 lines (65 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
class MapaController extends Controller
{
public $coordenadas;
public function actionIndex($index)
{
Yii::app()->clientScript->registerScriptFile(
'https://maps.googleapis.com/maps/api/js?key=AIzaSyAm4Db2U-kRW0PjdAlvedYt2eEF8sEzfuU&sensor=false&libraries=places',
CClientScript::POS_END
);
Yii::app()->clientScript->registerScriptFile(
Yii::app()->baseUrl . '/js/gmap.js',
CClientScript::POS_END
);
Yii::app()->clientScript->registerScriptFile(
Yii::app()->baseUrl . '/js/markerclusterer.js',
CClientScript::POS_END
);
if($index)
{
Yii::app()->clientScript->registerScript(
"index",
"google.maps.event.addDomListener(window, 'load', initialize);
google.maps.event.addDomListener(document.getElementById('target'), 'change', Geolocalizar);",
CClientScript::POS_END
);
}
else
{
Yii::app()->clientScript->registerScript(
"detalle",
"google.maps.event.addDomListener(window, 'load', initialize2);
google.maps.event.addDomListener(document.getElementById('Eventos_Lugar'), 'keyup', Geolocalizar);
google.maps.event.addDomListener(document.getElementById('Eventos_Lugar'), 'blur', Geolocalizar);",
CClientScript::POS_END
);
}
$this->renderPartial('Index',array('index'=>$index));
}
/*public function actionGeolocalizar()
{
Yii::import('ext.EGMap.*');
$gMap = new EGMap();
// Create geocoded address
$geocoded_address = new EGMapGeocodedAddress($_POST['direccion']);
$geocoded_address->geocode($gMap->getGMapClient());
echo json_encode(array('latitud' => $geocoded_address->getLat(), 'longitud' => $geocoded_address->getLng()));
}*/
/*public function actionNuevoEvento()
{
Yii::app()->clientScript->registerScriptFile(
'https://maps.googleapis.com/maps/api/js?key=AIzaSyAm4Db2U-kRW0PjdAlvedYt2eEF8sEzfuU&sensor=false&libraries=places',
CClientScript::POS_END
);
Yii::app()->clientScript->registerScriptFile(
Yii::app()->baseUrl . '/js/gmap2.js',
CClientScript::POS_END
);
Yii::app()->clientScript->registerScriptFile(
Yii::app()->baseUrl . '/js/markerclusterer.js',
CClientScript::POS_END
);
$this->renderPartial('Index');
}*/
}