Answer the question
In order to leave comments, you need to log in
How to install google maps via api on the site?
Can't install google maps. Here is the callback function
var marker;
function shopMap() {
var shop = $('#shops-info__map').attr('data-geo').split(',');
var map = new google.maps.Map(document.getElementById('shops-info__map'), {
center: new google.maps.LatLng(shop[0], shop[1]),
//scrollwheel: false,
disableDefaultUI: false,
mapTypeControl: false,
streetViewControl: false,
zoom: 15,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
var customMapType = new google.maps.StyledMapType([{"stylers": [{"saturation": -100}]}, {
"featureType": "poi",
"stylers": [{"visibility": "off"}]
}],
{name: 'Custom Stysle'});
var customMapTypeId = 'custom_style';
map.mapTypes.set(customMapTypeId, customMapType);
map.setMapTypeId(customMapTypeId);
var marker_image = '/static/images/bml_map.svg';
var marker = new google.maps.Marker({
position: new google.maps.LatLng(shop[0], shop[1]),
map: map,
icon: marker_image
});
var text = $('#shops-info__map').attr('data-text');
var infowindow = new google.maps.InfoWindow({
content: text
});
marker.addListener('click', function () {
infowindow.open(map, marker);
});
}
script(src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDy9eQx5kMEARWLXqslJFeGxvIP-GrEG34&callback=shopMap")
Answer the question
In order to leave comments, you need to log in
Api is paid when a certain number of requests per month
is reached, if you increase the limit, then money will begin to be debited.
But when you receive an api key, you will have to pay (like $ 1), which will be returned to you within 1 day, this is done to check the card whether it exists on In fact,
at least that's how I understood the documentation on the Google page
(I can't help with the code)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question