Custom Google Maps

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

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

Open Support Ticket

Tagged: ,

  • Author
    Posts
  • #10170

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    it should be possible to dequeue the original map and enqueue a new copy of the js file from your child theme. However I have been only partially successfull in doing so.

    I’ll have to ask Vikas to have a llook for us.

    THx

    #10779

    Vikas
    Full Member
    Post count: 1128

    Hi,
    Here is better solution and will be included in next release, so u will not loose map custom style after upgrade.

    Plz download attached zip, extract it and upload map.js in
    your wordpress >

    wp-contentpluginsgeodirectorygeodirectory-functionsmap-functionsjs

    after uploading js in correct folder, plz put this snippet in ur theme’s functions.php file

    
    
    
    add_action('wp_footer'  , 'geodir_set_custom_map_style');
    function geodir_set_custom_map_style()
    {
    ?>
    <script>
    	
    	var geodir_custom_map_style =[
    					// Google Map Styles Starts Here
    					{
    					"stylers": [
    					  { "invert_lightness": true },
    					  { "saturation": -100 }
    					]
    					},
    					// Google Map Styles End Here
    					{
    						featureType: "poi.business",
    						elementType: "labels",
    						stylers: [
    							{ visibility: "off" },
    						]
    					}
    				]
    </script>
    <?php
    }
    

    NOTE: Take backup of ur map.js file first if u have made any style related changes there.

    Plz let me know how it goes.

    Thanks
    -Vikas

    #10782

    Guust
    Moderator
    Post count: 29970

    tested at http://goldroo.net
    all working beautifully !

    #12391

    Guust
    Moderator
    Post count: 29970

    Please see http://docs.wpgeodirectory.com/customised-maps/ for info about implementing this.

    #15625

    Patrick
    Lifetime Member
    Post count: 86

    This doesn’t work for me. I add the code as in example and I get an error:

    Parse error: syntax error, unexpected ‘}’ in /wp-content/themes/GDF_child/functions.php on line 4

    Line 4 has nothing to do with the error as that is a comment line and no code was added there. It didn’t like the } when the PHP opened back up.

    I ended up putting the script in another file and including it.

Viewing 5 posts - 16 through 20 (of 20 total)

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

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount