1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
require_once __DIR__ . "/vendor/autoload.php"; |
4
|
|
|
|
5
|
|
|
use Cornford\Googlmapper\Mapper; |
6
|
|
|
use Illuminate\Container\Container; |
7
|
|
|
use Illuminate\Events\Dispatcher; |
8
|
|
|
use Illuminate\Filesystem\Filesystem; |
9
|
|
|
use Illuminate\View\Compilers\BladeCompiler; |
10
|
|
|
use Illuminate\View\Engines\CompilerEngine; |
11
|
|
|
use Illuminate\View\Factory; |
12
|
|
|
use Illuminate\View\Engines\EngineResolver; |
13
|
|
|
use Illuminate\View\FileViewFinder; |
14
|
|
|
|
15
|
|
|
/** |
16
|
|
|
* Env function. |
17
|
|
|
* |
18
|
|
|
* @param string $key |
19
|
|
|
* @param string $value |
20
|
|
|
* |
21
|
|
|
* @return string |
22
|
|
|
*/ |
23
|
|
|
function env($key, $value) |
|
|
|
|
24
|
|
|
{ |
25
|
|
|
return $value; |
26
|
|
|
} |
27
|
|
|
|
28
|
|
|
$fileViewFinder = new FileViewFinder(new Filesystem, [__DIR__ . '/src/views']); |
29
|
|
|
$fileViewFinder->addNamespace('googlmapper', [__DIR__ . '/src/views']); |
30
|
|
|
|
31
|
|
|
$engineResolver = new EngineResolver(); |
32
|
|
|
$engineResolver->register( |
33
|
|
|
'blade', |
34
|
|
|
function () { |
35
|
|
|
return new CompilerEngine(new BladeCompiler(new Filesystem(), sys_get_temp_dir())); |
36
|
|
|
} |
37
|
|
|
); |
38
|
|
|
|
39
|
|
|
$viewFactory = new Factory($engineResolver, $fileViewFinder, new Dispatcher(new Container)); |
40
|
|
|
|
41
|
|
|
$config = include_once __DIR__ . '/src/config/config.php'; |
42
|
|
|
|
43
|
|
|
$mapper = new Mapper($viewFactory, $config); |
44
|
|
|
|
45
|
|
|
// Location |
46
|
|
|
$mapper->location('Sheffield')->streetview(1, 1, ['ui' => false]); |
47
|
|
|
|
48
|
|
|
// Map |
49
|
|
|
$mapper->map(53.3, -1.4, ['zoom' => 10, 'markers' => ['title' => 'My Location', 'animation' => 'DROP']]); |
50
|
|
|
|
51
|
|
|
// Information window |
52
|
|
|
$mapper->informationWindow(53.4, -1.5, 'Content'); |
53
|
|
|
|
54
|
|
|
// Render |
55
|
|
|
print $mapper->render(); |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.