Okay
  Public Ticket #1630375
Newave - Multiple Map Pins
Closed

Comments

  • CILUK started the conversation

    Hello! Great theme guys and have only one question regarding adding multiple pins to the map. Our customer would like to show two (office) locations, with possibly more in the future. No problem adding one, but please could you direct me to how we can add another..?

    Many thanks!

  •  1,974
    Support replied

    Hi!

    First of all what's the theme version you are running? So I can direct you inside the code. Also the site url, if possible.

    Thank you.

    Clapat Support

    https://www.clapat.com/

    Review Envato Item Support Policy

  •   CILUK replied privately
  •   Support replied privately
  •   CILUK replied privately
  •  1,974
    Support replied

    You can try opening inline_scripts.php and you will basically have to duplicate these lines:

    jQuery('#map_canvas').gmap('addMarker', {'position': latitude+','+longitude, 'bounds': true, icon : new google.maps.MarkerImage("<?php if( trim($global_theme_options["gmap_marker_icon"]) == "" ) echo get_template_directory_uri() . '/images/marker.png'; else echo $global_theme_options["gmap_marker_icon"]; ?>") }).click(function() {
                                jQuery('#map_canvas').gmap('openInfoWindow', {'content': contentString}, this);
                            });

    and replace latitude , longitude and contentString variables.


    Thank you.

    Clapat Support

    https://www.clapat.com/

    Review Envato Item Support Policy

  •   CILUK replied privately
  •   CILUK replied privately
  •  1,974
    Support replied

    No, you don't just duplicate the lines - you change the variables as well.

    latitude , longitude are the parameters you enter in theme options, are the lat and long of the address

    You will probably have to enter hardcoded values for the second address.

    content string what you show to show in the pop up (html).

    You need to have a bit of coding knowledge

    We can change the code for a fee, but you may find it expensive.

    Thank you.

    Clapat Support

    https://www.clapat.com/

    Review Envato Item Support Policy

  •   CILUK replied privately
  •   CILUK replied privately
  •   Support replied privately
  •   CILUK replied privately
  •   Support replied privately
  •   CILUK replied privately
  •   Support replied privately
  •   CILUK replied privately
  •  1,974
    Support replied

    Hello,

    It's about the map zoom, you can set it in theme options -> map options

    Thank you.

    Clapat Support

    https://www.clapat.com/

    Review Envato Item Support Policy

  •   CILUK replied privately
  •   Support replied privately
  •   CILUK replied privately
  •   Support replied privately
  •   CILUK replied privately
  •   Support replied privately
  •   CILUK replied privately
  •   Support replied privately
  •   CILUK replied privately
  •   Support replied privately
  •   CILUK replied privately
  •   Support replied privately
  •   CILUK replied privately
  •   Support replied privately
  •   CILUK replied privately
  •   CILUK replied privately
  •   Support replied privately
  •   CILUK replied privately
  •   Support replied privately
  •  2
    John replied

    Hi there!


    Google Maps stopped working on website:

    Sorry! Something went wrong. This page didn't load Google Maps correctly. See the JavaScript console for technical details.

    URL is - http://justcornwall.co.uk/

    Please advise..?

    Thanks!

  •  1,974
    Support replied

    Hello,

    Looks like your map key has expired, this is the error message I get in the browser console:

    Google Maps JavaScript API error: ExpiredKeyMapError
    https://developers.google.com/maps/documentation/javascript/error-messages#expired-key-map-error


    Thank you.

    Clapat Support

    https://www.clapat.com/

    Review Envato Item Support Policy

  •  2
    John replied

    Thanks so much for your prompt reply!

    Got the API updated and now loads a generic map, but won't show the actual location address..?

    Please see attatched.

    Thoughts..?

    John

  •  1,974
    Support replied

    Hi, 

    you need to enable Geocoding Service API as suggested by the error message:

    Geocoding Service: This API project is not authorized to use this API.  For more information on authentication and Google Maps JavaScript API services please see: https://developers.google.com/maps/documentation/javascript/get-api-key

    Thank you.

    Clapat Support

    https://www.clapat.com/

    Review Envato Item Support Policy

  •  2
    John replied

    All sorted. Thank you once again for your excellent support.

    One other thing, is there a way to set a different map height for desktop and mobile?

    Regards,

    John


  •  1,974
    Support replied

    Hi, you can use 

    #map_canvas {

        height: 350px;
    }

    in multiple media queries for example

    @media screen and (max-width: 769px) {


        #map_canvas {

              height: 200px; 

         }


    }


    Thank you.

    Clapat Support

    https://www.clapat.com/

    Review Envato Item Support Policy

  •  2
    John replied

    Hi,

    URI: http://justcornwall.co.uk/

    We would like to center the map pin vertically (see attached), and on another project (using the same theme) I think you advised on adding the following code:

                            jQuery('#map_canvas').gmap('option', 'zoom', <?php if( $global_theme_options['map_zoom_level'] ) echo $global_theme_options['map_zoom_level']; else echo '8'; ?>);
                            var gmap = jQuery('#map_canvas').gmap('get', 'map');
                            gmap.setCenter( {lat:47.0, lng:17.0} );

    Is this still correct and which file do we add this?

    Thanks,

    John


  •  1,974
    Support replied

    Hi John,

    if you can open in the future a new tikcet, appreciate.

    If you are using the latest version of newave in /js/scripts.js you see on line 1247 that the map will attempt to center on the address specified in theme options:

    https://prnt.sc/26d3uhs

    Thank you.

    Clapat Support

    https://www.clapat.com/

    Review Envato Item Support Policy