adding example apps, fixing powerup issues
[feisty_meow.git] / production / example_apps / zippy_maps / src / Template / Locations / radius.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('RadiusFinder') ?>
14     <fieldset>
15                 <legend><?= __('Find Locations Within Radius') ?></legend>
16         <?php
17                         if ($id === null) {
18                                 echo h ( 'Sorry, we did not find a location specified as starting point.' );                            
19                         } else {
20                                 echo $this->Form->control ( 'from-address', [ 
21                                                 'type' => 'textarea',
22                                                 'rows' => 1,
23                                                 'default' => $fromAddress,
24                                                 'disabled' => 'disabled' 
25                                 ] );
26                                 
27                                 echo $this->Form->control ( 'radius (in miles)' , ['default' => $radius]);
28                                                                 
29                                 // list options we want to override or add for the map.
30                                 $map_options = [
31                                         'autoCenter' => true, // automatically encompass markers.
32                                         'clustering' => true,  // cluster the markers.
33                                 ];
34                                 
35                                 // provide the element with all the info it needs to set up the map.
36                                 $element_options =
37                                 [
38                                         'map_options' => $map_options,
39                                         'map_colors' => 'avmaps/js/sg2_map_colors.js',
40                                         'the_map' => $this->GoogleMap,
41                                         // no options to pass to ajax so far...
42                                         'ajax_options' => '{
43                                         }',
44                                         // not passing json provider, since we are doing a special radius thing here.  so no updates.
45                                         'default_options' => '{
46                                                 iconColor: "' . $this->MapDisplay->defaultIconColor() . '",
47                                         }',
48                                 ];
49                                                                 
50                                 echo $this->element('Avmaps.google_map', $element_options);
51                         }
52                 ?>
53     </fieldset>
54     <?= $this->Form->button(__('Calculate')) ?>
55     <?= $this->Form->end() ?>
56 </div>