示例#1
0
 private static function mergeWithDefaultValues($name, $value)
 {
     $default = array('map' => array('address' => null, 'longitude' => null, 'latitude' => null, 'zoom' => 13, 'width' => 500, 'height' => 500));
     if (array_key_exists($name, $default)) {
         $value = CoverageMap_Libs_Helper::arrayReplaceRecursive($default[$name], (array) $value);
     }
     return $value;
 }
示例#2
0
 public static function drawMap($params = array())
 {
     // Manually load JS
     $content = "<script src='https://maps.googleapis.com/maps/api/js?signed_in=true&libraries=places,drawing,geometry'></script>";
     $content .= "<script src='" . content_url() . "/plugins/coverage_map/Views/Js/Map.js'></script>";
     $content .= "<script src='" . content_url() . "/plugins/coverage_map/Views/Js/AddressAutocomplete.js'></script>";
     $content .= "<script src='" . content_url() . "/plugins/coverage_map/Views/Js/AddressChecker.js'></script>";
     // Get options
     $options = CoverageMap_Libs_Manage::getStoredOptions();
     // Set some options from params
     $options->map->height = !empty($params['height']) ? $params['height'] : $options->map->height;
     $options->map->width = !empty($params['width']) ? $params['width'] : $options->map->width;
     // Render template
     $content .= CoverageMap_Libs_Helper::render(dirname(__FILE__) . "/../Views/Map.php", $options);
     echo $content;
 }
示例#3
0
                            </th>
                            <td>
                                <input name="options[map][height]" type="text" value="<?php 
echo $map->height;
?>
" class="short-text"> pixels
                            </td>
                        </tr>
                    </tbody>
                </table>
                
                <!-- Map -->
                <a data-state="hidden" id="map-toggle" class="button" href="#" style="margin-bottom: 10px">Show Map</a>          
                <div id="map-wrapper" style="display: none; margin-bottom: 10px">
                    <?php 
echo CoverageMap_Libs_Helper::render(dirname(__FILE__) . "/Map.php", $vars);
?>
 
                </div>
            </div>
            
            
            
            <!-- Tab 'points'-->
            <div class="tab-content" data-tab="points" <?php 
echo $activeTab == "points" ? "" : "style='display:none'";
?>
>
                <br>
                <a href="#" class="page-title-action add-new-h2 new-point-toggle" data-state="hidden">Add point</a>