X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=production%2Fexample_apps%2Fzippy_maps%2Fsrc%2FTemplate%2FLocations%2Fradius.ctp;fp=production%2Fexample_apps%2Fzippy_maps%2Fsrc%2FTemplate%2FLocations%2Fradius.ctp;h=11b483e47a963ac1dbb41f02f197c635f8502ccf;hb=34d1cb2e8687b826357db1d3821bf9e05cf6f13d;hp=0000000000000000000000000000000000000000;hpb=21f30bb859e6c15393e23ac0e5ef417b82f628a5;p=feisty_meow.git diff --git a/production/example_apps/zippy_maps/src/Template/Locations/radius.ctp b/production/example_apps/zippy_maps/src/Template/Locations/radius.ctp new file mode 100644 index 00000000..11b483e4 --- /dev/null +++ b/production/example_apps/zippy_maps/src/Template/Locations/radius.ctp @@ -0,0 +1,56 @@ + + +
+ Form->create('RadiusFinder') ?> +
+ + Form->control ( 'from-address', [ + 'type' => 'textarea', + 'rows' => 1, + 'default' => $fromAddress, + 'disabled' => 'disabled' + ] ); + + echo $this->Form->control ( 'radius (in miles)' , ['default' => $radius]); + + // list options we want to override or add for the map. + $map_options = [ + 'autoCenter' => true, // automatically encompass markers. + 'clustering' => true, // cluster the markers. + ]; + + // provide the element with all the info it needs to set up the map. + $element_options = + [ + 'map_options' => $map_options, + 'map_colors' => 'avmaps/js/sg2_map_colors.js', + 'the_map' => $this->GoogleMap, + // no options to pass to ajax so far... + 'ajax_options' => '{ + }', + // not passing json provider, since we are doing a special radius thing here. so no updates. + 'default_options' => '{ + iconColor: "' . $this->MapDisplay->defaultIconColor() . '", + }', + ]; + + echo $this->element('Avmaps.google_map', $element_options); + } + ?> +
+ Form->button(__('Calculate')) ?> + Form->end() ?> +