-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmaps_gen.php
More file actions
36 lines (30 loc) · 891 Bytes
/
maps_gen.php
File metadata and controls
36 lines (30 loc) · 891 Bytes
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
<?php
// Gerar url de carregamento do googlemaps
function monta() {
$cord = [
[-27.62183590736462, -48.67750872224158],
[-27.62420997875315, -48.68152344089844],
[-27.620317114157633, -48.68377890081801],
[-27.622259566975043, -48.669930376911815],
];
$aspa = "'";
$vg = ",";
$zoom = '18z'; // de 1 a 22
$carro = '!3e0';
$a_pe = '!3e2';
$bicicleta = '!3e1';
$onibus = '!3e3';
$terreno = '!3m1!4b1';
$satelite = '!3m1!1e3';
$visao = $terreno; //$satelite;
$meio_transporte = $carro;
$url = 'https://www.google.com/maps/dir/';
$ret = '';
foreach($cord as list($lat, $lng)) {
$ret .= $aspa.$lat.$vg.$lng.$aspa;
$ret .='/';
}
$ret .= "@0,0,$zoom/data=$visao!4m10!4m9!1m3!2m2!1d0!2d0!1m3!2m2!1d0!2d0$meio_transporte";
return $url . $ret;
}
echo monta();