Customize Map Icon

This topic contains 7 replies, has 3 voices, and was last updated by  thebirdiemachine 8 years, 10 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #44954

    thebirdiemachine
    Expired Member
    Post count: 246

    Hello!

    I want to change the information displayed to the user when a map icon is clicked on. Right now it show (amongst other things) street address. I want to change it to city & state instead. How would I do that?

    I also want to change the background color from white to one of my subtle textures – would that be changing the CSS?

    Thanks
    Stacey

    #44958

    Simone
    Expired Member
    Post count: 3515

    Hi stacey, to add country and city, add the following in your functions.php inside your child theme’s folder

    
    
    add_filter('geodir_infowindow_meta_after','balloon_extra' );
    function balloon_extra() {
    global $post;
    
    echo $post->post_city;
    echo "<br>".$post->post_country;
    
    }

    to hide the street address and to change the background color, add the following to your style.css

    
    
    span.geodir_address {
    display:none;
    }
    
    .gm-style {
    background:yourcolor !important;
    }

    change yourcolor to your favorite color

    #44963

    thebirdiemachine
    Expired Member
    Post count: 246

    Thanks Simone I will give it a try and let you know!

    Cheers,
    Stacey

    #45069

    thebirdiemachine
    Expired Member
    Post count: 246

    Hi Simone,

    I tried what you sent but found two issues

    1. The code that I pasted in my functions file gives me City & Country. I am looking to get City & State. I did try to replace the word country with state but that did not work- I got only the city to display which I thought was funny.

    2. The CSS deleted the street address which is good. But I couldn’t get the background color to display in the bubble (I think .gm-style is for the big map). So I changed to the below:

    .gm-style-iw {
    background:yellow !important;
    }

    As you can see from the screenshot – attached – the entire bubble does not get colored and I can’t figure out what to do. Note the yellow color is just to show the problem – yes it is pretty ugly LOL.

    Can you make a suggestion to help me get the State to display and have the bubble fully filled with color?

    Thanks & Cheers,
    Stacey

    #45120

    Simone
    Expired Member
    Post count: 3515

    Hi,
    1- for state go for post_region

    2- the overall bubble is not declared within a class/ID in css, but only the container that’s why you have only the inner part with a different color.. I’ll double check asking Paolo when I have a chance and let you know

    #45141

    thebirdiemachine
    Expired Member
    Post count: 246

    Thanks Simone. The “region” changed worked perfectly!

    #45156

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    that div is out of our control, only if google maps would change it adding a class to it that would be possible.

    Thanks

    #45190

    thebirdiemachine
    Expired Member
    Post count: 246

    OK thanks for the info Paolo!

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

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

Open Support Ticket