adding example apps, fixing powerup issues
[feisty_meow.git] / production / example_apps / zippy_maps / src / Template / Locations / jump.ctp
1 <?php
2 /**
3  * @var \App\View\AppView $this
4  */
5 ?>
6 <nav class="large-3 medium-4 columns" id="actions-sidebar">
7         <ul class="side-nav">
8                 <li class="heading"><?= __('Actions') ?></li>
9                 <li><?= $this->Html->link(__('List Locations'), ['action' => 'index']) ?></li>
10         </ul>
11 </nav>
12 <div class="locations form large-9 medium-8 columns content">
13     <?= $this->Form->create('Jump') ?>
14     <fieldset>
15                 <legend><?= __('Jump to Location') ?></legend>
16         <?php
17                         if ($id === null) {
18                                 echo h ( 'Sorry, we did not find a location specified as starting point.' );                            
19                         } else {
20                                 // location id is good to go, so let's show the map.
21                                 
22                                 // list the options we want to override or add for the map.
23                                 $map_options = 
24                                 [
25                                         //off now for sure: 'autoCenter' => true, // automatically encompass markers.
26                                         'clustering' => true,  // cluster the markers.
27                                         'zoom' => 12,  // zoom in pretty far but not as a microscope.
28                                         'lat' => $fromLat,
29                                         'lng' => $fromLong,
30                                 ];
31                                 
32                                 // provide the element with all the info it needs to set up the map.
33                                 $element_options = 
34                                 [
35                                         'map_options' => $map_options,
36                                         'map_colors' => 'avmaps/js/sg2_map_colors.js',
37                                         'the_map' => $this->GoogleMap,
38                                         // no options to pass to ajax so far...
39                                         'ajax_options' => '{
40                                         }',
41                                         'default_options' => '{
42                                                 iconColor: "' . $this->MapDisplay->defaultIconColor() . '",
43                                                 json_provider: "/locations.json",
44                                         }',
45                                 ];
46                                 
47                                 echo $this->element('Avmaps.google_map', $element_options);                             
48                         }
49                 ?>
50     </fieldset>
51
52     <?= $this->Form->end() ?>
53 </div>