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..?
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:
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:
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!
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
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
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
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
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!
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
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
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
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
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
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'; ?>);
Is this still correct and which file do we add this?var gmap = jQuery('#map_canvas').gmap('get', 'map');
gmap.setCenter( {lat:47.0, lng:17.0} );
Thanks,
John
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