How do I change properties of map in GD Detail tab?

This topic contains 12 replies, has 3 voices, and was last updated by  Vikas 9 years, 10 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #8620

    purpleedge
    Expired Member
    Post count: 539

    Can someone remind me where to change the properties of the map in the Detail page Map tab? I can’t seem to find it now?

    #8621

    purpleedge
    Expired Member
    Post count: 539

    I want to change the height and turn off scrollwheel.

    #8622

    Guust
    Moderator
    Post count: 29970

    Widget in sidebar of detail page

    #8623

    purpleedge
    Expired Member
    Post count: 539

    Thanks Guust, does that change the height of the map on the listing Detail Map Tab?

    I’ve made some changes to the sidebar and don’t have the GD map there.

    #8624

    Guust
    Moderator
    Post count: 29970

    Not the map tab.
    The tab map can be adjusted by the submitter, ie the zoom and type of map.
    To adjust the height of the map in the tab, i think you have to do some coding work…
    Let’s ask vikas.

    #8840

    purpleedge
    Expired Member
    Post count: 539

    Hi Vikas, do you have any thoughts on this? How can I make the map on the detail tab a bit taller, and how can I turn off mouse-zoom?

    #8852

    Vikas
    Full Member
    Post count: 1128

    Plz write this in ur theme’s functions.php file

    
    
    
    add_filter('geodir_map_options_detail_page_map_canvas' , 'geodir_edit_map_options_detail_page_map_canvas');
    function geodir_edit_map_options_detail_page_map_canvas($map_option)
    {
    	//print_r($map_option) ;
    	$map_option['width'] = '330px' // change it as per ur wish;
    	$map_option['height'] = '200px'; // change it as per ur wish;
    	$map_option['scrollwheel'] = 0;
    	return $map_option ;
    }
    
    #8853

    Vikas
    Full Member
    Post count: 1128

    sorry use this one please

    
    
    
    add_filter('geodir_map_options_detail_page_map_canvas' , 'geodir_edit_map_options_detail_page_map_canvas');
    function geodir_edit_map_options_detail_page_map_canvas($map_option)
    {
    	//print_r($map_option) ;
    	$map_option['width'] = '330px' ;// change it as per ur wish;
    	$map_option['height'] = '200px'; // change it as per ur wish;
    	$map_option['scrollwheel'] = 0;
    	return $map_option ;
    }
    
    #8912

    purpleedge
    Expired Member
    Post count: 539

    Thanks Vikas, perfect!

    #8924

    purpleedge
    Expired Member
    Post count: 539

    Vikas, can you please explain how this works, and how the add_filter function knows which map to apply this to?

    I can’t find the $tag ‘geodir_map_options_detail_page_map_canvas’ anywhere?

    #8938

    Vikas
    Full Member
    Post count: 1128

    geodir_map_options_detail_page_map_canvas in this ‘detail_page_map_canvas’ is map canvas name, so lets say u have a map with canvas name ‘my_map_canvas’ then filter name will be ‘geodir_map_options_my_map_canvas’.

    Please advise ?

    #8942

    purpleedge
    Expired Member
    Post count: 539

    Thanks, I don’t really understand.

    I didn’t know you could do that, I looked at the WP codex and thought that the add_filter($tag had to be an existing tag declared with apply_filter($tag

    So you’ve created a $tag

    geodir_map_options_ . detail_page_map_canvas

    and WP knows what it refers to? Powerful stuff.

    Do you have another example of how this can be done?

    #8943

    Vikas
    Full Member
    Post count: 1128

    Yes, tag name can be dynamic. Its very powerful.

Viewing 13 posts - 1 through 13 (of 13 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket