Your address will show here +12 34 56 78

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

This topic contains 1 reply, has 1 voice, and was last updated by  Steven McSorley 3 years ago.

  • Author
    Posts
  • #75093

    Steven McSorley

    Hi, Cant seem to find the Lat and Long for setting the map pin to display agent on map on single agent, I cant see the call in agent.php, it only displays option to either use map or image and zoom select,
    Also i don’t see the option for the pin, in Pin management

    i added part of the map function from metaboxes php to the agent function (function estate_agent( $post )), which gives me the option to insert lat and long, the map goes to the area where these are but no map pin.

    Although in map example its there : http://wpestatetheme.org/agents/sophie-douglas/

    Could you direct me in the right direction please.

    thankyou in advance

  • #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

You must be logged in to reply to this topic.