Esempio n. 1
0
 function all_geocoded_posts_map($args = array(), $content = '')
 {
     $_yes = array('yes', 'true', 'on');
     $args = is_array($args) ? $args : array();
     $map = $this->_model->get_map_defaults();
     $map['defaults'] = $this->_model->get_map_defaults();
     $map['id'] = 'geocoded_posts-' . md5(microtime());
     $map['show_map'] = 1;
     $map['markers'] = $this->_data->get_all_geolocated_posts_as_markers(6);
     foreach ($args as $key => $arg) {
         if (in_array($arg, $_yes)) {
             $args[$key] = 1;
         }
     }
     $args['nearby_posts'] = false;
     // ... or the world explodes
     if (!empty($args['show_markers']) && empty($args['nearby_posts_in_list'])) {
         $args['nearby_posts_in_list'] = true;
         // Auto-set if not explicitly requested otherwise
     }
     $codec = new AgmMarkerReplacer();
     return $codec->create_tag($map, $args);
 }
 /**
  * Creates a map from a list of markers.
  */
 private function _create_map($markers, $id = false, $overrides = array())
 {
     if (!$markers) {
         return false;
     }
     $id = $id ? $id : md5(time() . rand());
     $map = $this->_model->get_map_defaults();
     $map['defaults'] = $this->_model->get_map_defaults();
     $map['id'] = $id;
     $map['show_map'] = 1;
     $map['show_markers'] = 0;
     $map['markers'] = $markers;
     $codec = new AgmMarkerReplacer();
     return $codec->create_tag($map, $overrides);
 }
 /**
  * Get venue map tag.
  * @param string $venue Venue
  * @param array $args Optional map overrides
  * @return string Map tag
  */
 private function _venue_to_map($venue, $args = array())
 {
     $venue = $venue ? $venue : $this->get_venue();
     if (!class_exists('AgmMarkerReplacer')) {
         return $venue;
     }
     if (!$this->has_venue_map($venue)) {
         return $venue;
     }
     $codec = new AgmMarkerReplacer();
     if (empty($args)) {
         $args = apply_filters('eab-maps-map_defaults', array());
         $args = apply_filters('agm_google_maps-autogen_map-shortcode_attributes', $args);
     }
     return $codec->create_tag($this->_get_venue_map($venue), $args);
 }
 private function _get_group_map_tag($group_id, $overrides = array())
 {
     $map = $this->_get_group_map($group_id);
     if (!$map) {
         return false;
     }
     $codec = new AgmMarkerReplacer();
     return $codec->create_tag($map, $overrides);
 }