Your address will show here +12 34 56 78

Home Forums WP ESTATE – Real Estate WordPress Theme FORUM No Single Agent Map options Reply To: No Single Agent Map options

#75491

Steven McSorley

This is the metabox.php function which is called into the Single Agent admin

function estate_page_map_box_agent($post) {
    global $post;
    $page_lat           = get_post_meta($post->ID, 'page_custom_lat', true);
    $page_long          = get_post_meta($post->ID, 'page_custom_long', true);
    $page_custom_image  = get_post_meta($post->ID, 'page_custom_image', true);
    $page_custom_zoom  = get_post_meta($post->ID, 'page_custom_zoom', true);
    
    if ($page_custom_zoom==''){
        $page_custom_zoom=15;
    }
    
    print '
   
    <p class="meta-options">
        <label for="page_custom_image">'.__('Replace Map with this image','wpestate').'</label><br />
        <input id="page_custom_image" type="text" size="36" name="page_custom_image" value="'.$page_custom_image.'" />
	<input id="page_custom_image_button" type="button"   size="40" class="upload_button button" value="'.__('Upload Image','wpestate').'" />
     </p>
     
     <p class="meta-options">
       <label for="page_custom_zoom">'.__('Zoom Level for map (1-20)','wpestate').'</label><br />
       <select name="page_custom_zoom" id="page_custom_zoom">';
      
      for ($i=1;$i<21;$i++){
           print '<option value="'.$i.'"';
           if($page_custom_zoom==$i){
               print ' selected="selected" ';
           }
           print '>'.$i.'</option>';
       }
        
     print'
       </select>
     <p>
    ';

As you can see there is an option for the Map or image, and zoom level, but no option to put in Lat and long.

However I have done this.

function estate_page_map_box_agent($post) {
    global $post;
    $page_lat           = get_post_meta($post->ID, 'page_custom_lat', true);
    $page_long          = get_post_meta($post->ID, 'page_custom_long', true);
    $page_custom_image  = get_post_meta($post->ID, 'page_custom_image', true);
    $page_custom_zoom  = get_post_meta($post->ID, 'page_custom_zoom', true);
    
    if ($page_custom_zoom==''){
        $page_custom_zoom=15;
    }
    
    print '
   
    <p class="meta-options">
        <label for="page_custom_image">'.__('Replace Map with this image','wpestate').'</label><br />
        <input id="page_custom_image" type="text" size="36" name="page_custom_image" value="'.$page_custom_image.'" />
	<input id="page_custom_image_button" type="button"   size="40" class="upload_button button" value="'.__('Upload Image','wpestate').'" />
     </p>
     
     <p class="meta-options">
       <label for="page_custom_zoom">'.__('Zoom Level for map (1-20)','wpestate').'</label><br />
       <select name="page_custom_zoom" id="page_custom_zoom">';
      
      for ($i=1;$i<21;$i++){
           print '<option value="'.$i.'"';
           if($page_custom_zoom==$i){
               print ' selected="selected" ';
           }
           print '>'.$i.'</option>';
       }
        
     print'
       </select>
     <p>
    ';
    print '
    <!-- ADDED META OPTIONS FOR LAT AND LONG -->
    <p class="meta-options">
    '.__('  Leave these blank in order to get the general map settings.','wpestate').'
    </p>
    <p class="meta-options">  
        <label for="page_custom_lat">'.__('Map - Center point  Latitudine: ','wpestate').'</label><br />
        <input type="text" id="page_custom_lat" name="page_custom_lat" size="40" value="'.$page_lat.'">
    </p>
    <p class="meta-options">  
        <label for="page_custom_long">'.__('Map - Center point  Longitudine: ','wpestate').'</label><br />
        <input type="text" id="page_custom_long" name="page_custom_long" size="40" value="'.$page_long.'">
    </p>
    '; 
     
    
}

So we now have an option to put lat and long on single Agent, however the pin for agent dosnt show up.

Will I need to add an option to catch this somewhere or and an option for Agent Pin in the Pin management ?

Hope that makes it a bit clearer

Thanks